コード例 #1
0
 public frmListaObiecte(List <T> pListaElemente,
                        string pTitluEcran,
                        CDefinitiiComune.EnumTipSelectie pModSelectie,
                        List <T> pListaElementeEvidentiate,
                        List <T> pListaElementeBifate,
                        Control pControlLegatura,
                        bool pDeschideLaPozitiaMouseului,
                        int pWidthEcran,
                        bool pSelectiaInStanga,
                        bool pAfiseazaHeaderDGV,
                        bool pAfiseazaDoarToString) : this(pListaElemente, pTitluEcran, pModSelectie, pListaElementeEvidentiate, pListaElementeBifate, pControlLegatura, pDeschideLaPozitiaMouseului, pWidthEcran, pSelectiaInStanga, pAfiseazaHeaderDGV, pAfiseazaDoarToString, false, true)
 {
 }
コード例 #2
0
        public frmListaObiecte(List <T> pListaElemente,
                               string pTitluEcran,
                               CDefinitiiComune.EnumTipSelectie pModSelectie,
                               List <T> pListaElementeEvidentiate,
                               List <T> pListaElementeBifate,
                               Control pControlLegatura,
                               bool pDeschideLaPozitiaMouseului,
                               int pWidthEcran,
                               bool pSelectiaInStanga,
                               bool pAfiseazaHeaderDGV,
                               bool pAfiseazaDoarToString,
                               bool pPermiteSelectiaGoala,
                               bool pPermiteMultiSelectDGV)
        {
            this.InitializeComponent();

            this.dgvListaObiecte.SePermiteMultiBifa(pPermiteMultiSelectDGV);

            this.txtCautare.RandulUrmator   += txtCautare_RandulUrmator;
            this.txtCautare.RandulPrecedent += txtCautare_RandulPrecedent;

            this.lListaElemente            = pListaElemente;
            this.lModSelectie              = pModSelectie;
            this.Text                      = pTitluEcran;
            this.lListaElementeEvidentiate = pListaElementeEvidentiate;
            this.lListaElementeBifate      = pListaElementeBifate;
            this.lSelectiaInStanga         = pSelectiaInStanga;
            this.lAfiseazaHeaderDGV        = pAfiseazaHeaderDGV;
            this.lPermiteSelectiaGoala     = pPermiteSelectiaGoala;

            this.DeschideLaPozitiaMouseului  = pDeschideLaPozitiaMouseului;
            this.PermiteDeplasareaEcranului  = true;
            this.PermiteMaximizareaEcranului = true;

            this.lAfiseazaDoarToString = pAfiseazaDoarToString;

            //Setam marimea ecranului in functie de marimea listei
            //consideram 25 = inaltimea unui rand si 20 inaltimea header-ului
            int InaltimeEcran = this.txtCautare.Height + Convert.ToInt32(6 * CDefinitiiComune._FactorMultiplicareDPI_X) + this.lblTitluEcran.Height + this.btnValidare.Height + this.lListaElemente.Count * 24 + ((this.lAfiseazaHeaderDGV) ? 20 : 0);

            InaltimeEcran = Math.Max(150 * (int)CDefinitiiComune._FactorMultiplicareDPI_Y, InaltimeEcran);

            if (pWidthEcran > 0)
            {
                this.Width = Convert.ToInt32(pWidthEcran * CDefinitiiComune._FactorMultiplicareDPI_X);
            }

            Screen ecranCurent = Screen.FromControl(this); //this is the Form class

            if (ecranCurent == null)
            {
                ecranCurent = Screen.PrimaryScreen;
            }

            //Arata ciudat daca depasim jumatate din inaltimea ecranului
            if (InaltimeEcran > ecranCurent.WorkingArea.Height / 2 - 20)
            {
                InaltimeEcran = ecranCurent.WorkingArea.Height / 2 - 20;
                this.Height   = InaltimeEcran;
                //this.StartPosition = FormStartPosition.CenterScreen;
            }
            else
            {
                this.Height = InaltimeEcran;

                //if (!this.DeschideLaPozitiaMouseului)
                //{
                //    this.TipDeschidere = CEnumerariComune.EnumTipDeschidere.CentrulEcranului;
                //    this.StartPosition = FormStartPosition.CenterScreen;
                //}
                //else
                //    DeschidereMouseStangaJosCuDeplasare();
            }

            if (!this.DeschideLaPozitiaMouseului)
            {
                this.TipDeschidere = CEnumerariComune.EnumTipDeschidere.CentrulEcranului;
                this.StartPosition = FormStartPosition.CenterScreen;
            }
            else
            {
                DeschidereMouseStangaJosCuDeplasare();
            }

            this.MinimumSize = this.Size;
        }
コード例 #3
0
 public frmListaObiecte(List <T> pListaElemente,
                        string pTitluEcran,
                        CDefinitiiComune.EnumTipSelectie pModSelectie)
     : this(pListaElemente, pTitluEcran, pModSelectie, null, null, null, false, -1, true, true, true)
 {
 }
コード例 #4
0
        public static T Afiseaza <T>(Form pEcranParinte, List <T> pListaObiecte, string pTitluEcran, CDefinitiiComune.EnumTipSelectie pTipSelectie)
        {
            using (frmListaObiecte <T> EcranPrincipal = new frmListaObiecte <T>(pListaObiecte, pTitluEcran, pTipSelectie))
            {
                if (CCL.UI.IHMUtile.DeschideEcran(pEcranParinte, EcranPrincipal))
                {
                    return(EcranPrincipal.lListaElementeSelectionate[0]);
                }
            }

            return(default(T));
        }