Ejemplo n.º 1
0
        private void CreateUI()
        {
            _ObjectField = new CacheObjectField(this)
            {
                Row = 2, Column = 1
            };

            _MainPanel = new ChangeCheck()
            {
                Row = 1, Column = 0
            };
            _MainPanel.RowDefinitions.Add(ButtonRowHeight, GridUnitType.Pixel);           // _BtnAdd
            _MainPanel.RowDefinitions.Add(1, GridUnitType.Star);                          // _ItemsList
            _MainPanel.RowDefinitions.Add(_ObjectField.LayoutHeight, GridUnitType.Pixel); // _ObjectField

            _BtnAdd = new Skill.Framework.UI.Button()
            {
                Row = 0, Column = 0, Margin = new Thickness(2)
            };
            _BtnAdd.Content.text = "Add";
            _BtnAdd.Click       += new System.EventHandler(_BtnAdd_Click);

            _ItemsList = new ListBox()
            {
                Row = 1, Column = 0, Margin = new Thickness(2)
            };
            _ItemsList.BackgroundVisible = true;
            _ItemsList.DisableFocusable();

            _MainPanel.Controls.Add(new Box()
            {
                Row = 2, Column = 1
            });
            _MainPanel.Controls.Add(_BtnAdd);
            _MainPanel.Controls.Add(_ItemsList);
            _MainPanel.Controls.Add(_ObjectField);


            _PnlControls = new StackPanel()
            {
                Row = 0, Column = 0
            };
            _BtnInitializeOnAwake = new UI.ToggleButton()
            {
                Height = 18
            };
            _BtnInitializeOnAwake.Label.text    = "Initialize On Awake";
            _BtnInitializeOnAwake.Label.tooltip = "create all cached objects on awake";
            _BtnInitializeOnAwake.IsChecked     = _Data.InitializeOnAwake;

            _BtnMakeAsChild = new UI.ToggleButton()
            {
                Height = 18
            };
            _BtnMakeAsChild.Label.text    = "Make as Child";
            _BtnMakeAsChild.Label.tooltip = "create all cached objects as childs of group";
            _BtnMakeAsChild.IsChecked     = _Data.MakeAsChild;

            _FlCleanInterval = new FloatField()
            {
                Height = 18
            };
            _FlCleanInterval.Label.text    = "Clean Interval";
            _FlCleanInterval.Label.tooltip = "Clean Interval of this group";
            _FlCleanInterval.Value         = _Data.CleanInterval;

            _PnlControls.Controls.Add(_BtnInitializeOnAwake);
            _PnlControls.Controls.Add(_BtnMakeAsChild);
            _PnlControls.Controls.Add(_FlCleanInterval);

            _Frame = new Frame("MainFrame");

            _Frame.Grid.RowDefinitions.Add(56, GridUnitType.Pixel); // _PnlControls
            _Frame.Grid.RowDefinitions.Add(1, GridUnitType.Star);   // _MainPanel

            _Frame.Grid.Controls.Add(_PnlControls);
            _Frame.Grid.Controls.Add(_MainPanel);

            _MainPanel.Changed          += new EventHandler(_ChangeCheck_Changed);
            _ItemsList.SelectionChanged += _ItemsPanel_SelectionChanged;

            _BtnInitializeOnAwake.Changed += Properties_Changed;
            _BtnMakeAsChild.Changed       += Properties_Changed;
            _FlCleanInterval.ValueChanged += Properties_Changed;
        }
Ejemplo n.º 2
0
        private void CreateUI()
        {
            _ObjectField = new ImplantObjectField(this)
            {
                Row = 4, Column = 1
            };

            _MainPanel = new ChangeCheck();

            _MainPanel.RowDefinitions.Add(26, GridUnitType.Pixel);                        // property lable
            _MainPanel.RowDefinitions.Add(124, GridUnitType.Pixel);                       // properties
            _MainPanel.RowDefinitions.Add(ButtonRowHeight, GridUnitType.Pixel);           // button add
            _MainPanel.RowDefinitions.Add(1, GridUnitType.Star);                          // object list
            _MainPanel.RowDefinitions.Add(_ObjectField.LayoutHeight, GridUnitType.Pixel); // object filed


            _LblDefaultProperties = new DropShadowLabel()
            {
                Row = 0, Column = 0, Margin = new Thickness(0, 0, 0, 6)
            }; _LblDefaultProperties.Text = "Default properties";

            ImplantAsset asset = target as ImplantAsset;

            if (asset.DefaultObject == null)
            {
                asset.DefaultObject = CreateNew();
            }
            asset.DefaultObject.OverrideProperties = true;
            _PropertiesField = new ImplantObjectPropertiesField()
            {
                Row = 1, Column = 0, Object = asset.DefaultObject
            };

            _ItemsList = new ListBox()
            {
                Row = 3, Column = 0, Margin = new Thickness(0, 2)
            };
            _ItemsList.BackgroundVisible = true;
            _ItemsList.DisableFocusable();

            _BtnAdd = new Skill.Framework.UI.Button()
            {
                Row = 2, Column = 0, Margin = new Thickness(2)
            };
            _BtnAdd.Content.text = "Add";
            _BtnAdd.Click       += new System.EventHandler(_BtnAdd_Click);

            _MainPanel.Controls.Add(new Box()
            {
                Row = 4, Column = 0
            });
            _MainPanel.Controls.Add(new Box()
            {
                Row = 0, Column = 0, RowSpan = 2
            });

            _MainPanel.Controls.Add(_LblDefaultProperties);
            _MainPanel.Controls.Add(_PropertiesField);
            _MainPanel.Controls.Add(_BtnAdd);
            _MainPanel.Controls.Add(_ItemsList);
            _MainPanel.Controls.Add(_ObjectField);



            _Frame = new Frame("MainFrame");
            _Frame.Grid.Controls.Add(_MainPanel);

            _MainPanel.Changed          += new EventHandler(_ChangeCheck_Changed);
            _ItemsList.SelectionChanged += _ItemsList_SelectionChanged;
        }