Example #1
0
            public FiltreComp(ModelDoc2 mdl, Groupe g, CtrlSelectionBox SelectionBox, Parametre Prefixe)
            {
                _Mdl          = mdl;
                _SelectionBox = SelectionBox;

                G = g;

                _Select_CompBase = G.AjouterSelectionBox("", "Selectionnez le composant");
                _Select_CompBase.SelectionMultipleMemeEntite = true;
                _Select_CompBase.SelectionDansMultipleBox    = true;
                _Select_CompBase.UneSeuleEntite = true;
                _Select_CompBase.FiltreSelection(swSelectType_e.swSelCOMPONENTS, swSelectType_e.swSelFACES);
                _Select_CompBase.OnSelectionChanged += delegate(Object sender, int nb) { AfficherInfos(); };
                _Select_CompBase.OnSubmitSelection  += SelectionnerPiece;
                _Select_CompBase.Hauteur             = 2;

                _TextBox_NomComp = G.AjouterTexteBox("");
                _TextBox_NomComp.LectureSeule    = true;
                _TextBox_NomComp.NotifieSurFocus = true;

                o1 = G.AjouterOption("Filtrer propriete");
                o2 = G.AjouterOption("Filtrer config");

                o1.OnCheck += delegate(Object sender) { _TextBox_Prefixe.Visible = true; _TextListBox_Configs.Visible = false; };
                o2.OnCheck += delegate(Object sender) { _TextBox_Prefixe.Visible = false; _TextListBox_Configs.Visible = true; };

                _TextBox_Prefixe = G.AjouterTexteBox(Prefixe, true);

                _TextListBox_Configs = G.AjouterTextListBox("Liste des configurations");
                _TextListBox_Configs.TouteHauteur      = true;
                _TextListBox_Configs.Height            = 50;
                _TextListBox_Configs.SelectionMultiple = true;

                _Button = G.AjouterBouton("Filtrer");
                _Button.OnButtonPress += delegate(Object sender)
                {
                    if (o1.IsChecked)
                    {
                        RechercherComp(_SelectionBox, _TextBox_Prefixe.Text);
                    }
                    else
                    {
                        SelectionnerComposants();
                    }
                };
            }