Exemple #1
0
        public static CCheckBox CreateCheckBox(string name, int x, int y, Transform parent, int width = 0, int height = 0)
        {
            GameObject obj = UnityEngine.Object.Instantiate(FuncUtil.GetUIAssetByPath(CHECKBOX_PATH)) as GameObject;

            if (obj == null)
            {
                return(null);
            }
            obj.transform.parent        = parent;
            obj.transform.localScale    = Vector3.one;
            obj.transform.localPosition = new Vector3(x, y, 0);
            CCheckBox asset = obj.GetComponent <CCheckBox>();

            asset.Selected = false;
            if (width > 0)
            {
                asset.Label.width = width;
            }
            if (height > 0)
            {
                asset.Label.height = height;
            }
            asset.Text = name;
            return(asset);
        }
Exemple #2
0
        static public CCheckBox BuildCCheckBox(Control parent)
        {
            while (model.allControls.Exists(l => l.cd.Name == "CCheckBox" + CCheckBox.count))
            {
                CCheckBox.count++;
            }
            CCheckBox c = new CCheckBox();

            parent.Controls.Add(c);

            c.CheckStateChanged += CoupledControlsManager.CheckBoxCoupled;
            c.CheckStateChanged += VisibilityRelationManager.CheckBoxVisibility;
            c.CheckStateChanged += ReadRelationManager.ReadRelationUpdate;

            SetCommonHandlers(c);
            SetChangesHandler(c);

            Model.getInstance().allControls.Add(c);
            c.SetControlDescription();

            c.cd.RealText = c.cd.Text;

            model.logCreator.Append("+ Added: " + c.cd.Name);

            return(c);
        }
Exemple #3
0
        public CRedirectPage()
            : base((int)EPages.P_REDIRECT, "Redirections")
        {
            _checkCFU      = new CCheckBox("Unconditional");
            _checkCFU.PosY = 5;
            add(_checkCFU);

            _editCFUNumber      = new CEditField("Number>", "", true);
            _editCFUNumber.PosY = 6;
            add(_editCFUNumber);

            _checkCFNR      = new CCheckBox("On No Reply");
            _checkCFNR.PosY = 7;
            add(_checkCFNR);

            _editCFNRNumber      = new CEditField("Number>", "");
            _editCFNRNumber.PosY = 8;
            add(_editCFNRNumber);


            _checkCFB      = new CCheckBox("On Busy");
            _checkCFB.PosY = 9;
            add(_checkCFB);

            _editCFBNumber      = new CEditField("Number>", "");
            _editCFBNumber.PosY = 10;
            add(_editCFBNumber);

            this.Ok += new VoidDelegate(CRedirectPage_Ok);
        }
Exemple #4
0
        public CRingModePage()
            : base((int)EPages.P_RINGMODE, "Ringer Mode")
        {
            _radio = new CRadioButtonGroup();

            _silentCb          = new CCheckBox("Silent");
            _silentCb.PosY     = 5;
            _silentCb.LinkKey  = _silentCb.PosY;
            _silentCb.Softkey += new BoolIntDelegate(_silentCb_Softkey);
            _radio.add(_silentCb);

            _melodyCb          = new CCheckBox("Melody");
            _melodyCb.PosY     = 7;
            _melodyCb.LinkKey  = _melodyCb.PosY;
            _melodyCb.Softkey += new BoolIntDelegate(_melodyCb_Softkey);
            _radio.add(_melodyCb);

            _beepCb          = new CCheckBox("Beep");
            _beepCb.PosY     = 9;
            _beepCb.LinkKey  = _beepCb.PosY;
            _beepCb.Softkey += new BoolIntDelegate(_beepCb_Softkey);
            _radio.add(_beepCb);

            add(_radio);
        }
Exemple #5
0
        private void Init_Textbox_et_label(int xpos, int ypos)
        {
            int lxpos = 6;
            int lypos = 3;


            this.Chb_Rouecodeuse = new CCheckBox("Chb_Rouecodeuse", lxpos, ypos, false, "Utiliser roue codeuse pour temps mort");
            ypos           += 21;
            this.Tb_tpsmort = new TTextBox("Tb_tpsmort", xpos, ypos, "100", 0, 2555, 5);
            this.L_tpsmort  = new LLabel("L_Pulse_t_1", lxpos, ypos + lypos, "Temps mort par pas de 5ns :                  ns");
            ypos           += 21;
            this.L_Nbbras   = new LLabel("L_Nbbras", lxpos, ypos + lypos, "Nombre de bras actifs :");
            this.Tb_Nbbras  = new TTextBox("Tb_Nbbras", xpos, ypos, "2", 0, 4, 1)
            {
                Enabled = false
            };
        }
Exemple #6
0
        public CCallOptionsPage()
            : base(ECallPages.P_CALLOPTIONS, "Options...")
        {
            clearHistory(false);

            forgetPage(false);

            // remove all CTelephony controls.
            removeAll();

            _mute          = new CCheckBox("Mute");
            _mute.PosY     = 5;
            _mute.Softkey += new BoolIntDelegate(_mute_Softkey);
            this.add(_mute);

            CLink volume = new CLink("Volume", (int)ECallPages.P_SETVOLUME);

            volume.PosY  = 6;
            volume.Align = EAlignment.justify_right;
            this.add(volume);

            _linkDtmf      = new CLink("DTMF mode", (int)ECallPages.P_DTMFOPTIONS);
            _linkDtmf.PosY = 7;
            this.add(_linkDtmf);

            CLink calls = new CLink("Calls", (int)EPages.P_CALLLOG);

            calls.PosY  = 8;
            calls.Align = EAlignment.justify_right;
            this.add(calls);

            CLink phonebook = new CLink("Phonebook", (int)EPages.P_PHONEBOOK);

            phonebook.PosY = 9;
            this.add(phonebook);

            CLink menu = new CLink("Menu", (int)EPages.P_MENU);

            menu.PosY  = 10;
            menu.Align = EAlignment.justify_right;
            this.add(menu);
        }
Exemple #7
0
        public CServicesPage()
            : base((int)EPages.P_SERVICES, "Services")
        {
            CLink linkRedirect = new CLink("Redirect", (int)EPages.P_REDIRECT);

            linkRedirect.PosY = 7;
            add(linkRedirect);

            CCheckBox chbDND = new CCheckBox("Do Not Disturb", 0);

            chbDND.PosY         = 8;
            chbDND.Align        = EAlignment.justify_right;
            chbDND.OnChecked   += new VoidDelegate(chbDND_OnChecked);
            chbDND.OnUnchecked += new VoidDelegate(chbDND_OnUnchecked);
            add(chbDND);

            CCheckBox linkAA = new CCheckBox("Auto Answer", 0);

            linkAA.PosY = 9;
            add(linkAA);
        }
Exemple #8
0
        public override void onEntry()
        {
            int cnt = 0;

            _radio.removeAll();

            for (int i = 0; i < CAccounts.getInstance().getSize(); i++)
            {
                bool      ischecked = (i == CAccounts.getInstance().DefAccountIndex) ? true : false;
                CCheckBox item      = new CCheckBox(CAccounts.getInstance()[i].Name, -1, ischecked);
                if (item.Caption.Length == 0)
                {
                    item.Caption = "--- empty ---";
                }
                else
                {
                    if (CAccounts.getInstance()[i].RegState == 200)
                    {
                        item.Caption += " (Reg)";
                    }
                    else
                    {
                        item.Caption += " (Not reg)";
                    }
                }
                item.subItems[0] = i.ToString();
                //item.Softkey += new BoolIntDelegate(item_Softkey);
                _radio.add(item);
                if (ischecked)
                {
                    cnt++;
                }
            }

            mText = "Accounts (" + cnt + ")";

            base.onEntry();
        }
Exemple #9
0
        /// <summary>
        /// Initialise les textbox et les label
        /// </summary>
        /// <param name="xpos">position en x</param>
        /// <param name="ypos">position en y</param>
        private void Init_Textbox_et_label(int xpos, int ypos)
        {
            int lxpos    = 10;
            int lypos    = 3;
            int Tb_xpos2 = xpos + 42;

            this.L_valtri             = new LLabel("L_valtri", lxpos, ypos + lypos, "Valeur initiale du triangle");
            ypos                     += 21;
            this.L_l0bits             = new LLabel("L_l0bits", xpos, ypos + lypos, "10Bits");
            this.L_enpour             = new LLabel("L_enpour", Tb_xpos2, ypos + lypos, "En %");
            ypos                     += 21;
            this.L_départ             = new LLabel("L_départ", lxpos, ypos + lypos, "Départ");
            this.Tb_val_tri_init      = new TTextBox("Tb_tri", xpos, ypos, "512", 0, 1023, 1);
            this.Tb_val_tri_init_Pour = new TTextBox("Tb_tri_pour", Tb_xpos2, ypos, "50", 0, 100, 0.1);
            ypos                     += 21;
            this.L_limite             = new LLabel("L_limite", xpos, ypos + lypos, "Limite");
            ypos                     += 21;
            this.L_max_bras           = new LLabel("L_max_bras", lxpos, ypos + lypos, "Max :");
            this.Tb_multinivmax       = new TTextBox("Tb_multinivmax", xpos, ypos, "1023", 0, 1023, 1);
            this.Tb_multinivmax_Pour  = new TTextBox("Tb_multinivmax_Pour", Tb_xpos2, ypos, "100", 0, 100, 0.1);
            ypos                     += 21;
            this.L_min_bras           = new LLabel("L_min_bras", lxpos, ypos + lypos, "Min :");
            this.Tb_multinivmin       = new TTextBox("Tb_multinivmin", xpos, ypos, "0", 0, 1023, 1);
            this.Tb_multinivmin_Pour  = new TTextBox("Tb_multinivmin_Pour", Tb_xpos2, ypos, "0", 0, 100, 0.1);
            ypos                     += 21;
            this.Chb_inv_bras         = new CCheckBox("Chb_inv_bras", lxpos, ypos, false, "inversion bras haut-bas", false);
            ypos                     += 21;
            this.Cmb_sens_tri         = new CComboBox("cmb_tri", lxpos, ypos, 116, new List <string>()
            {
                "Monté", "Descente"
            }, 0);
            ypos += 21;
            this.Cmb_cons_Bras = new CComboBox("Cmb_cons_Bras", lxpos, ypos, 116, new List <string>()
            {
                "Consigne 1", "Consigne 2"
            }, 0, false);
        }
Exemple #10
0
        public CCallOptionsPage()
            : base(ECallPages.P_CALLOPTIONS, "Options...")
        {
            clearHistory(false);

              forgetPage(false);

              // remove all CTelephony controls.
              removeAll();

              _mute = new CCheckBox("Mute");
              _mute.PosY = 5;
              _mute.Softkey += new BoolIntDelegate(_mute_Softkey);
              this.add(_mute);

              CLink volume = new CLink("Volume", (int)ECallPages.P_SETVOLUME);
              volume.PosY = 6;
              volume.Align = EAlignment.justify_right;
              this.add(volume);

              _linkDtmf = new CLink("DTMF mode", (int)ECallPages.P_DTMFOPTIONS);
              _linkDtmf.PosY = 7;
              this.add(_linkDtmf);

              CLink calls = new CLink("Calls", (int)EPages.P_CALLLOG);
              calls.PosY = 8;
              calls.Align = EAlignment.justify_right;
              this.add(calls);

              CLink phonebook = new CLink("Phonebook", (int)EPages.P_PHONEBOOK);
              phonebook.PosY = 9;
              this.add(phonebook);

              CLink menu = new CLink("Menu", (int)EPages.P_MENU);
              menu.PosY = 10;
              menu.Align = EAlignment.justify_right;
              this.add(menu);
        }
Exemple #11
0
        private void CreatePreviewControls(Section s, XElement i)
        {
            if (s == null)
            {
                return;
            }
            if (i == null)
            {
                return;
            }

            switch (i.Attribute("type").Value)
            {
            case "CLabel":
                CLabel lbl = ControlFactory.BuildCLabel(s.Tab);
                lbl.cd.Name = i.Element("Name").Value;
                break;

            case "CComboBox":
                CComboBox cb = ControlFactory.BuildCComboBox(s.Tab);
                cb.cd.Name = i.Element("Name").Value;
                break;

            case "CButton":
                CButton b = ControlFactory.BuildCButton(s.Tab);
                b.cd.Name = i.Element("Name").Value;
                break;

            case "CGroupBox":
                CGroupBox gb = ControlFactory.BuildCGroupBox(s.Tab);
                gb.cd.Name = i.Element("Name").Value;
                break;

            case "CPanel":
                CPanel pl = ControlFactory.BuildCPanel(s.Tab);
                pl.cd.Name = i.Element("Name").Value;
                break;

            case "CBitmap":
                CBitmap bm = ControlFactory.BuildCBitmap(s.Tab);
                bm.cd.Name = i.Element("Name").Value;
                break;

            case "CTextBox":
                CTextBox tb = ControlFactory.BuildCTextBox(s.Tab);
                tb.cd.Name = i.Element("Name").Value;
                break;

            case "CCheckBox":
                CCheckBox ccb = ControlFactory.BuildCCheckBox(s.Tab);
                ccb.cd.Name = i.Element("Name").Value;
                break;

            case "CTabControl":
                CTabControl ctc = ControlFactory.BuildCTabControl(s.Tab);
                ctc.cd.Name = i.Element("Name").Value;
                break;

            case "CTabPage":
                //Tab pages require its parent TabControl to be created first.
                break;
            }
        }
Exemple #12
0
        public CServicesPage()
            : base((int)EPages.P_SERVICES, "Services")
        {
            CLink linkRedirect = new CLink("Redirect", (int)EPages.P_REDIRECT);
              linkRedirect.PosY = 7;
              add(linkRedirect);

              CCheckBox chbDND = new CCheckBox("Do Not Disturb", 0);
              chbDND.PosY = 8;
              chbDND.Align = EAlignment.justify_right;
              chbDND.OnChecked += new VoidDelegate(chbDND_OnChecked);
              chbDND.OnUnchecked += new VoidDelegate(chbDND_OnUnchecked);
              add(chbDND);

              CCheckBox linkAA = new CCheckBox("Auto Answer", 0);
              linkAA.PosY = 9;
              add(linkAA);
        }
Exemple #13
0
        public override void onEntry()
        {
            int cnt = 0;

              _radio.removeAll();

              for (int i=0; i<CAccounts.getInstance().getSize(); i++)
              {
            bool ischecked = (i == CAccounts.getInstance().DefAccountIndex) ? true : false;
            CCheckBox item = new CCheckBox(CAccounts.getInstance()[i].Name, -1, ischecked);
            if (item.Caption.Length == 0)
            {
              item.Caption = "--- empty ---";
            }
            else
            {
              if (CAccounts.getInstance()[i].RegState == 200)
            item.Caption += " (Reg)";
              else
            item.Caption += " (Not reg)";
            }
            item.subItems[0] = i.ToString();
            //item.Softkey += new BoolIntDelegate(item_Softkey);
            _radio.add(item);
             if (ischecked) cnt++;
              }

              mText = "Accounts (" + cnt + ")";

              base.onEntry();
        }
Exemple #14
0
        public CRingModePage()
            : base((int)EPages.P_RINGMODE,"Ringer Mode")
        {
            _radio = new CRadioButtonGroup();

              _silentCb = new CCheckBox("Silent");
              _silentCb.PosY = 5;
              _silentCb.LinkKey = _silentCb.PosY;
              _silentCb.Softkey += new BoolIntDelegate(_silentCb_Softkey);
              _radio.add(_silentCb);

              _melodyCb = new CCheckBox("Melody");
              _melodyCb.PosY = 7;
              _melodyCb.LinkKey = _melodyCb.PosY;
              _melodyCb.Softkey += new BoolIntDelegate(_melodyCb_Softkey);
              _radio.add(_melodyCb);

              _beepCb = new CCheckBox("Beep");
              _beepCb.PosY = 9;
              _beepCb.LinkKey = _beepCb.PosY;
              _beepCb.Softkey += new BoolIntDelegate(_beepCb_Softkey);
              _radio.add(_beepCb);

              add(_radio);
        }
Exemple #15
0
        public CRedirectPage()
            : base((int)EPages.P_REDIRECT, "Redirections")
        {
            _checkCFU = new CCheckBox("Unconditional");
              _checkCFU.PosY = 5;
              add(_checkCFU);

              _editCFUNumber = new CEditField("Number>", "", true);
              _editCFUNumber.PosY = 6;
              add(_editCFUNumber);

              _checkCFNR = new CCheckBox("On No Reply");
              _checkCFNR.PosY = 7;
              add(_checkCFNR);

              _editCFNRNumber = new CEditField("Number>", "");
              _editCFNRNumber.PosY = 8;
              add(_editCFNRNumber);

              _checkCFB = new CCheckBox("On Busy");
              _checkCFB.PosY = 9;
              add(_checkCFB);

              _editCFBNumber = new CEditField("Number>", "");
              _editCFBNumber.PosY = 10;
              add(_editCFBNumber);

              this.Ok += new VoidDelegate(CRedirectPage_Ok);
        }