コード例 #1
0
ファイル: ControlToolbox.cs プロジェクト: esdrubal/guieditor
        public ControlToolbox(Gwen.Control.Base parent)
            : base(parent)
        {
            Width = 150;
            Margin = new Gwen.Margin( 5, 5, 5, 5 );
            SetText( "Controls" );

            var pTileLayout = new Gwen.Control.Layout.Tile( this );
            pTileLayout.SetTileSize(22, 22);

            foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
                foreach (var controlType in assembly.GetTypes().Where<Type>(type => type.IsSubclassOf(typeof(Gwen.Control.Base))))
                {

                    if (controlType == typeof(DesignerBase)) continue;

                    var pButton = new Gwen.Control.Button(pTileLayout);
                    pButton.SetSize( 20, 20 );
                    pButton.SetToolTipText(controlType.Name);
                    //pButton.SetImage("img/controls/" + controlType.Name + ".png");
                    pButton.ShouldDrawBackground = true;

                    //
                    // Make drag and droppable. Pass the ControlFactory as the userdata
                    //
                    pButton.DragAndDrop_SetPackage(true, "ControlSpawn", controlType);//,pControlFactory );
                }
        }
コード例 #2
0
ファイル: ControlToolbox.cs プロジェクト: esdrubal/guieditor
        public ControlToolbox(Gwen.Control.Base parent)
            : base(parent)
        {
            Width  = 150;
            Margin = new Gwen.Margin(5, 5, 5, 5);
            SetText("Controls");

            var pTileLayout = new Gwen.Control.Layout.Tile(this);

            pTileLayout.SetTileSize(22, 22);

            foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                foreach (var controlType in assembly.GetTypes().Where <Type>(type => type.IsSubclassOf(typeof(Gwen.Control.Base))))
                {
                    if (controlType == typeof(DesignerBase))
                    {
                        continue;
                    }

                    var pButton = new Gwen.Control.Button(pTileLayout);
                    pButton.SetSize(20, 20);
                    pButton.SetToolTipText(controlType.Name);
                    //pButton.SetImage("img/controls/" + controlType.Name + ".png");
                    pButton.ShouldDrawBackground = true;

                    //
                    // Make drag and droppable. Pass the ControlFactory as the userdata
                    //
                    pButton.DragAndDrop_SetPackage(true, "ControlSpawn", controlType);//,pControlFactory );
                }
            }
        }
コード例 #3
0
 private void LoadPowders()
 {
     _bottomMenuBox.DeleteAllChildren();
     Gwen.Control.Button _sandButton = new Gwen.Control.Button(_bottomMenuBox);
     _sandButton.Font.Size = 12;
     _sandButton.SetSize(80, 28);
     _sandButton.SetText("Sand");
     _sandButton.SetToolTipText("Sand");
     _sandButton.SetPosition(2, 7);
     _sandButton.Name     = "SandElement";
     _sandButton.Clicked += OnButtonClick;
 }
コード例 #4
0
        private void LoadElementCatagories()
        {
            Gwen.Control.Button _powdersButton = new Gwen.Control.Button(_sideMenuBox);
            _powdersButton.Font      = _powdersButton.Font.Copy();
            _powdersButton.Font.Size = 8;
            _powdersButton.SetSize(80, 20);
            _powdersButton.SetToolTipText("Powders");
            _powdersButton.SetText("Powders");
            _powdersButton.SetPosition(0, 0);
            _powdersButton.Name     = "PowdersMenu";
            _powdersButton.Clicked += OnButtonClick;

            Gwen.Control.Button _liquidsButton = new Gwen.Control.Button(_sideMenuBox);

            _liquidsButton.Font      = _liquidsButton.Font.Copy();
            _liquidsButton.Font.Size = 8;
            _liquidsButton.SetSize(80, 20);
            _liquidsButton.SetToolTipText("Liquids");
            _liquidsButton.SetText("Liquids");
            _liquidsButton.SetPosition(0, 22);
            _liquidsButton.Name     = "LiquidsMenu";
            _liquidsButton.Clicked += OnButtonClick;
        }