当前位置: 首页>>代码示例>>C#>>正文


C# TomShane类代码示例

本文整理汇总了C#中TomShane的典型用法代码示例。如果您正苦于以下问题:C# TomShane类的具体用法?C# TomShane怎么用?C# TomShane使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TomShane类属于命名空间,在下文中一共展示了TomShane类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EraseToolBehavior

        public void EraseToolBehavior(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            CurrentToolSystem toolSys = (CurrentToolSystem)(world.SystemManager.GetSystem<CurrentToolSystem>()[0]);
            toolSys.SetCurrentTool(CustomControls.Tool.ERASE_TOOL);

            HighligthButton(eraserTool);
        }
开发者ID:Hoodad,项目名称:Editor_TLCB,代码行数:7,代码来源:ToolbarSystem.cs

示例2: SaveBtn_Click

 /// <summary>
 /// When the saved button is clicked
 /// </summary>
 void SaveBtn_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (Edit)
     {
         //TODO: Add validation and error handling
         string[] address = AddressTxt.Text.Split(':');
         string IP;
         int port = 0;
         IP = address[0];
         if (address.Length > 1)
             port = int.Parse(address[1]);
         ServerList.EditServer(Index, new ServerSaveData(NameTxt.Text, IP, port));
     }
     else
     {
         //TODO: Add validation and error handling
         string[] address = AddressTxt.Text.Split(':');
         string IP;
         int port = 0;
         IP = address[0];
         if (address.Length > 1)
             port = int.Parse(address[1]);
         ServerList.AddServer(new ServerSaveData(NameTxt.Text, IP, port));
     }
     Close();
 }
开发者ID:Express50,项目名称:Bricklayer,代码行数:29,代码来源:AddServerDialog.cs

示例3: DrawControl

        protected override void DrawControl(TomShane.Neoforce.Controls.Renderer renderer, Microsoft.Xna.Framework.Rectangle rect, Microsoft.Xna.Framework.GameTime gameTime)
        {
            Color color = Color.White;
            color.A = imageOpacity;

            base.DrawControl(renderer, rect, gameTime);
            renderer.Draw(image, rect, color);
        }
开发者ID:Hoodad,项目名称:Editor_TLCB,代码行数:8,代码来源:ImageBasedButton.cs

示例4: canvasWindow_MouseClick

 private void canvasWindow_MouseClick(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     TomShane.Neoforce.Controls.MouseEventArgs ev = (TomShane.Neoforce.Controls.MouseEventArgs)(e);
     if (ev.Button == MouseButton.Right)
     {
         RadialMenuSystem radial = (RadialMenuSystem)world.SystemManager.GetSystem<RadialMenuSystem>()[0];
         radial.toggleRadialMenu();
     }
 }
开发者ID:Hoodad,项目名称:Editor_TLCB,代码行数:9,代码来源:CanvasControlSystem.cs

示例5: ExportMapBehavior

 public void ExportMapBehavior(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     Button btn = (Button)sender;
     btn.Focused = false;
     System.Windows.Forms.SaveFileDialog exportMapDialog = new System.Windows.Forms.SaveFileDialog();
     exportMapDialog.InitialDirectory = Convert.ToString(Environment.SpecialFolder.CommonProgramFilesX86);
     exportMapDialog.Filter = "Map files (*.datmap)|*.datmap";
     exportMapDialog.FilterIndex = 1;
     exportMapDialog.Title = "Export your map";
     exportMapDialog.FileOk += new System.ComponentModel.CancelEventHandler(SuccessfullyExportedMap);
     exportMapDialog.ShowDialog();
 }
开发者ID:Hoodad,项目名称:Editor_TLCB,代码行数:12,代码来源:ToolbarSystem.cs

示例6: ShowSimpleInputDialog

        /// <summary>
        /// Shows the simple input dialog.
        /// </summary>
        public void ShowSimpleInputDialog(Manager manager, string caption, string text, string initialValue,
            TomShane.Neoforce.Controls.EventHandler okBtnEventHandler)
        {
            window = new Window(manager);
            window.Init();
            window.Width = 450;
            window.Height = 150;
            window.Text = caption;
            window.Closing += OnSimpleInputDialogClosing;
            window.Visible = true;

            Label label = new Label(manager);
            label.Init();
            label.Text = text;
            label.Width = 400;
            label.Height = 20;
            label.Left = 5;
            label.Top = 5;
            label.Parent = window;

            TextBox textBox = new TextBox(manager);
            textBox.Init();
            textBox.Width = 400;
            textBox.Height = 20;
            textBox.Left = 5;
            textBox.Top = 40;
            textBox.Text = initialValue;
            textBox.Parent = window;

            Button btnSimpleInputDialogOk = new Button(manager);
            btnSimpleInputDialogOk.Init();
            btnSimpleInputDialogOk.Text = "Ok";
            btnSimpleInputDialogOk.Width = 100;
            btnSimpleInputDialogOk.Height = 30;
            btnSimpleInputDialogOk.Left = 5;
            btnSimpleInputDialogOk.Top = 75;
            btnSimpleInputDialogOk.Click += okBtnEventHandler;
            btnSimpleInputDialogOk.Click += OnClickBtnSimpleInputDialogOk;
            btnSimpleInputDialogOk.Tag = textBox; // Textbox as Tag, to access the value
            btnSimpleInputDialogOk.Parent = window;

            Button btnSimpleInputDialogCancel = new Button(manager);
            btnSimpleInputDialogCancel.Init();
            btnSimpleInputDialogCancel.Text = "Cancel";
            btnSimpleInputDialogCancel.Width = 100;
            btnSimpleInputDialogCancel.Height = 30;
            btnSimpleInputDialogCancel.Left = 110;
            btnSimpleInputDialogCancel.Top = 75;
            btnSimpleInputDialogCancel.Click += OnClickBtnSimpleInputDialogCancel;
            btnSimpleInputDialogCancel.Parent = window;

            manager.Add(window);
        }
开发者ID:mrommel,项目名称:MiRo.SimHexWorld,代码行数:56,代码来源:SimpleInputDialog.cs

示例7: DrawControl

        protected override void DrawControl(TomShane.Neoforce.Controls.Renderer renderer, 
            Microsoft.Xna.Framework.Rectangle rect,
            Microsoft.Xna.Framework.GameTime gameTime)
        {
            //renderer.Draw(tilemapImage, rect, Color.White);
            //renderer.Draw(tileSelectorImage, selectorRect, Color.White);
            /*Vector2 offset = new Vector2(-m_windowParent.ScrollBarValue.Horizontal,
                -m_windowParent.ScrollBarValue.Vertical);*/

            m_undoTree.draw(renderer.SpriteBatch,
                new Vector2(Parent.AbsoluteLeft, Parent.AbsoluteTop));

            // resizing
            /*
            Width = Math.Max(OriginWidth,(int)tck);
            Height = Math.Max(OriginHeight, (int)(tck*0.1f));
            //m_windowParent.Width = (int)tck;
            m_windowParent.MovableArea = new Rectangle(0,0,(int)tck,(int)(tck*0.1f));
             * */
        }
开发者ID:Hoodad,项目名称:Editor_TLCB,代码行数:20,代码来源:UndoTreeContainer.cs

示例8: okButton_Click

 void okButton_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     Close();
 }
开发者ID:mrommel,项目名称:MiRo.SimHexWorld,代码行数:4,代码来源:UnitInfoDialog.cs

示例9: lstMain_ItemIndexChanged

        void lstMain_ItemIndexChanged(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            ListBox listbox = (ListBox)sender;
            //remove panelControl elements (from groupPanel at the bottom)
            if (inspectorArea.propertyEditPanel.panelControls.Keys.Count > 0)
            {
                inspectorArea.propertyEditPanel.DisableControls();
            }

            if (listbox.ItemIndex >= 0 && listbox.Items.ElementAt(listbox.ItemIndex) is Node)
            {
                SetTargetNode((Node)listbox.Items.ElementAt(listbox.ItemIndex));
            }
            else if (listbox.ItemIndex >= 0)
            {
                //ResetInspectorBox(inspectorArea.InsBox, listbox.Items.ElementAt(listbox.ItemIndex));
                inspectorArea.ResetInspectorBox(listbox.Items.ElementAt(listbox.ItemIndex));
            }
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:19,代码来源:Sidebar.cs

示例10: consolePressed

 void consolePressed(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (sender is Button || (sender is TextBox && (((KeyEventArgs)e).Key == Keys.Enter)))
         ProcessConsoleCommand(consoletextbox.Text);
 }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:5,代码来源:Sidebar.cs

示例11: cbPresets_ItemIndexChanged

 void cbPresets_ItemIndexChanged(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     ComboBox combobox = (ComboBox)sender;
     if (combobox.ItemIndex != lstPresets.ItemIndex)
     {
         lstPresets.ItemIndex = combobox.ItemIndex;
     }
 }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:8,代码来源:Sidebar.cs

示例12: btnDefaultNode_Click

 void btnDefaultNode_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     SetDefaultNodeAsEdit();
 }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:4,代码来源:Sidebar.cs

示例13: btnAddComponent_Click

 void btnAddComponent_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (inspectorArea.editNode == null)
         PopUp.Toast("You haven't selected a Node.");
     else
     {
         new AddComponentWindow(this, tbcMain, inspectorArea.editNode, null, false);
         //ObservableCollection<dynamic> nodecomplist = new ObservableCollection<dynamic>((Enum.GetValues(typeof(comp)).Cast<dynamic>().Where(c => !inspectorArea.editNode.HasComp(c))));
         //List<dynamic> missingcomps = new List<dynamic>(Enum.GetValues(typeof(comp)).Cast<dynamic>().Where(c => inspectorArea.editNode.HasComp(c)));
         //
         //PopUp.opt[] options = new PopUp.opt[]{
         //    new PopUp.opt(PopUp.OptType.info, "Add component to: " + inspectorArea.editNode.name),
         //    new PopUp.opt(PopUp.OptType.dropDown, nodecomplist),
         //    new PopUp.opt(PopUp.OptType.checkBox, "Add to all",
         //        delegate(object s, TomShane.Neoforce.Controls.EventArgs a){
         //            if ((s as CheckBox).Checked) nodecomplist.AddRange(missingcomps);
         //            else nodecomplist.RemoveRange(missingcomps);})};
         //
         //PopUp.makePopup(ui, options, "Add Component", delegate(bool a, object[] o)
         //{
         //    if (a) return addComponent(o);
         //    else return false;
         //});
     }
 }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:25,代码来源:Sidebar.cs

示例14: InsBox_ItemIndexChanged

        void InsBox_ItemIndexChanged(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            ListBox InsBox = (ListBox)sender;

            if (InsBox.ItemIndex < 0 || InsBox.Items.Count == 0) return;
            InspectorInfo item = (InspectorInfo)InsBox.Items.ElementAt(InsBox.ItemIndex);

            //UpdateGroupPanel(item, groupPanel);
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:9,代码来源:InspectorArea.cs

示例15: InsBox_DoubleClick

        void InsBox_DoubleClick(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            //InspectorBox InsBox = (InspectorBox)sender;
            MouseEventArgs mouseArgs = (MouseEventArgs)e;
            if (mouseArgs.Button == MouseButton.Left)
            {
                if (InsBox.ItemIndex < 0 || InsBox.Items.Count == 0 || InsBox.ItemIndex >= InsBox.Items.Count) return;
                InspectorInfo item = (InspectorInfo)InsBox.Items.ElementAt(InsBox.ItemIndex);
                item.DoubleClickItem(this);
                InspectorInfo temp = ActiveInspectorParent;
                string lbltext = "/" + temp.Name();
                while (temp.parentItem != null)
                {
                    temp = temp.parentItem;
                    lbltext = lbltext.Insert(0, "/" + temp.Name());
                }
                if (!OverrideString.Item1)
                {
                    lblInspectorAddress.Text = lbltext;
                }
                //Type t = item.obj.GetType();

                //if (activeInspectorItem != item)
                //    propertyEditPanel.UpdatePanel(item);

            }
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:27,代码来源:InspectorArea.cs


注:本文中的TomShane类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。