Ejemplo n.º 1
0
        public void CreateControls()
        {
            if (!ResManager.Instance.Data.Properties.ContainsKey(Text))
            {
                m_pContainingWindow = new Window(new Rectangle(ResManager.Instance.DefaultWindowLocation.X, ResManager.Instance.DefaultWindowLocation.Y, 200, 200), this);
                Text = m_pContainingWindow.Id;
            }
            else
            {
                WindowProperty resource = ResManager.Instance.Data.Properties[Text];
                m_pContainingWindow = new Window(resource, this);
                foreach (ControlProperty ResourceControl in resource.m_aControls.Values)
                {
                    switch (ResourceControl.m_szType)
                    {
                        case "WTYPE_BUTTON":
                            {
                                if(ResourceControl.m_style.HasFlag(WindowStyle.WBS_RADIO))
                                    AddControlFromResource(new Rose.Controls.Radiobox(ResourceControl));
                                else if(ResourceControl.m_style.HasFlag(WindowStyle.WBS_CHECK))
                                    AddControlFromResource(new Rose.Controls.Checkbox(ResourceControl));
                                else
                                    AddControlFromResource(new Rose.Controls.Button(ResourceControl));
                            }
                            break;

                        case "WTYPE_TEXT":
                        case "WTYPE_STATIC":
                            {
                                //if (ResourceControl.m_szTitle == "")
                                    //AddControlFromResource(new Rose.Controls.Static(ResourceControl));
                                //else
                                AddControlFromResource(new Rose.Controls.Label(ResourceControl));
                            }
                            break;

                        case "WTYPE_EDITCTRL":
                            {
                                AddControlFromResource(new Rose.Controls.Edit(ResourceControl));
                            }
                            break;

                        case "WTYPE_CUSTOM":
                            {
                                AddControlFromResource(new Rose.Controls.Custom(ResourceControl));
                            }
                            break;

                        case "WTYPE_COMBOBOX":
                            {
                                AddControlFromResource(new Rose.Controls.Combo(ResourceControl));
                            }
                            break;

                        case "WTYPE_LISTBOX":
                            {
                                AddControlFromResource(new Rose.Controls.ListBox(ResourceControl));
                            }
                            break;

                        case "WTYPE_TABCTRL":
                            {
                                AddControlFromResource(new Rose.Controls.TabbedMdi(ResourceControl));
                            }
                            break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Basic Initializer.
 /// </summary>
 public Control()
 {
     m_visibility = VISIBLITY_TYPE.Visible;
     m_bEnabled = true;
     m_bDraggable = true;
     m_bResizable = true;
     m_bDragging = false;
     m_rectBounds = new Rectangle();
     m_parent = null;
     m_szTooltip = "";
     m_szDefaultID = "WIDC_CONTROL";
     m_bShowCaption = false;
     m_bOffset = true;
     m_bPasting = false;
 }