Esempio n. 1
0
        protected override void initAfterSettings()
        {
            base.initAfterSettings();


            cBtnMenu.Click += cBtnMenu_Click;

            // RegisterForContextMenu(cTree);
            RegisterForContextMenu(cPanelMenu);



            {
                this.settings.enumarate("cTree");

                var listMenuItems = new List <string>();
                if (this.settings.isEnumerValid())
                {
                    var structMenu_ = this.settings.forkEnumer();
                    structMenu_.enumarate();


                    while (structMenu_.moveNext())
                    {
                        var id = structMenu_.getNameEnumer();

                        listMenuItems.Add(id);
                    }
                }
                cPanelMenu.RemoveAllViews();

                foreach (var id in listMenuItems)
                {
                    if (this.settings.enumarate(id))
                    {
                        var itemCmd  = this.settings.getStringAttrEnumer("Cmd");
                        var itemText = this.settings.getStringAttrEnumer("Text");
                        itemText = environment.translate(itemText);

                        var       v      = this.LayoutInflater.Inflate(Resource.Layout.MobMenuItem, cPanelMenu, false);
                        MobButton mobBtn = v.FindViewById <MobButton>(Resource.Id.cBtnDo);



                        var btn = mobBtn; // new MobButton(this);
                        btn.Text = (itemText);

                        if (itemCmd != null && itemCmd != "")
                        {
                            btn.activity = environment.toActivity(itemCmd, null);
                        }

                        cPanelMenu.AddView(btn);
                    }
                }
            }
        }
 private void InitializeComponent()
 {
     this.numBox = new MobGE.MobControl.MobNumEdit();
     this.button = new MobGE.MobControl.MobButton();
     this.SuspendLayout();
     //
     // numBox
     //
     this.numBox.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.numBox.DSColumn   = "";
     this.numBox.DSProperty = "Value";
     this.numBox.DSSubTable = "";
     this.numBox.DSTable    = "";
     this.numBox.Increment  = 0;
     this.numBox.Location   = new System.Drawing.Point(0, 0);
     this.numBox.Maximum    = 0;
     this.numBox.MaxLength  = 0;
     this.numBox.Minimum    = 0;
     this.numBox.Name       = "numBox";
     this.numBox.Size       = new System.Drawing.Size(133, 21);
     this.numBox.TabIndex   = 3;
     this.numBox.Value      = 0;
     //
     // button
     //
     this.button.Dock     = System.Windows.Forms.DockStyle.Right;
     this.button.Location = new System.Drawing.Point(133, 0);
     this.button.Name     = "button";
     this.button.Size     = new System.Drawing.Size(25, 49);
     this.button.TabIndex = 2;
     this.button.Text     = "...";
     this.button.Click   += new System.EventHandler(this.button_Click);
     //
     // MobNumEditButton
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Dpi;
     this.Controls.Add(this.numBox);
     this.Controls.Add(this.button);
     this.Name    = "MobNumEditButton";
     this.Size    = new System.Drawing.Size(158, 49);
     this.Resize += new System.EventHandler(this.MobTextBoxButton_Resize);
     this.ResumeLayout(false);
 }