예제 #1
0
        public void LoginClick(object o, Controls.EventArgs e)
        {
            bool success = false;

            //Set remember me config
            if (chkRememberMe.Checked)
            {
                RememberPass(txtUser.Text, txtPass.Text);
            }
            else
            {
                Configuration config = ConfigurationManager.OpenExeConfiguration(System.Reflection.Assembly.GetExecutingAssembly().Location);
                config.AppSettings.Settings["User"].Value = string.Empty;
                config.AppSettings.Settings["Pass"].Value = string.Empty;
                config.Save(ConfigurationSaveMode.Modified);
            }
            //Login
            Manager.Cursor = Manager.Skin.Cursors["Busy"].Resource;
            Login(txtUser.Text, txtPass.Text, grpLogin, out success);
            Manager.Cursor = Manager.Skin.Cursors["Default"].Resource;
            //Close if authenticated
            // if (success)
            //  {
            Close();
            Manager.Remove(MainWindow.InfoBanner);
            // }
        }
예제 #2
0
        ////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////
        void btnApply_Click(object sender, Controls.EventArgs e)
        {
            Manager.Graphics.IsFullScreen = chkResFull.Checked;

            int w = 1024;
            int h = 768;

            if (rdbRes1024.Checked)
            {
                w = 1024;
                h = 768;
            }
            else if (rdbRes1280.Checked)
            {
                w = 1280;
                h = 1024;
            }
            else if (rdbRes1680.Checked)
            {
                w = 1680;
                h = 1050;
            }

            Manager.Graphics.PreferredBackBufferWidth  = w;
            Manager.Graphics.PreferredBackBufferHeight = h;

            Manager.Graphics.ApplyChanges();
        }
        private void Selection_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            selectedEntityIndex = (int)btn.Tag;
            SelectEntity();
        }
        private void CategoryBtn_Click(object sender, EventArgs e)
        {
            Button btn      = (Button)sender;
            string category = (string)btn.Tag;

            DisplayCategory(category);
        }
예제 #5
0
        private void MenuChoose(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            //If back, destroy state
            if (sender == m_MenuButtons[0])
            {
                m_Active = false;
            }

            //If save the king
            if (sender == m_MenuButtons[1])
            {
                //Create parameter
                Object[] Parameters = new object[2];
                for (int i = 0; i < 3; i++)
                {
                    if (m_HeroButtons[i].m_Highlight)
                    {
                        Parameters[0] = (Player)i;
                    }
                }
                Parameters[1] = GameData.LoadGameData(m_FileListBox.Items[m_FileListBox.ItemIndex] as string);

                //Go to play state
                Global.StateManager.GoTo(StateID.Game, Parameters, true);
            }
        }
예제 #6
0
        void btnSet_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            //Set Game's content pack data
            foreach (ContentPack pack in IO.ContentPacks)
            {
                if (pack.Name == (List.Items[List.ItemIndex] as ContentPackListControl).Pack.Name)
                {
                    Game.ContentPackData = pack;
                    Game.ContentPackName = pack.Name;
                }
            }

            //Save in config
            Configuration config = ConfigurationManager.OpenExeConfiguration(System.Reflection.Assembly.GetExecutingAssembly().Location);

            config.AppSettings.Settings["ContentPack"].Value = Game.ContentPackName;
            config.Save(ConfigurationSaveMode.Modified);

            //Prompt User
            MessageBox m = new MessageBox(Manager, MessageBoxType.YesNo, "Your content pack has been set. Please restart the game to apply changes!\nRestart now?", "Apply Changes");

            m.Init();
            m.Closed += m_Closed;
            m.ShowModal();
            Manager.Add(m);
            Description.Text = "Customize the graphics of Zarknorth with content packs! [color:Gold]Restart to apply pack![/color]\nCurrent Pack: " + Game.ContentPackName;
            //Close window
            Close();
        }
 void attributeButton_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (guiGameAttribute != null)
     {
         guiGameAttribute.Visible = !guiGameAttribute.Visible;
     }
 }
예제 #8
0
        void Delete_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            if (MapList.Items.Count == 0)
            {
                return;
            }
            MapListItem item = (MapList.Items[MapList.ItemIndex] as MapListItem);

            MapList.Enabled = false;
            MessageBox confirmDelete = new MessageBox(Manager, MessageBoxType.YesNo, "Are you sure you would like to delete " + item.MapName.Text + " ?\nIt will be lost forever.", "Confirm Deletion");

            confirmDelete.Init();
            confirmDelete.buttons[0].Text  = "Delete";
            confirmDelete.buttons[1].Text  = "Cancel";
            confirmDelete.buttons[0].Color = Color.Red;
            confirmDelete.Closed          += new WindowClosedEventHandler(delegate(object s, WindowClosedEventArgs ev)
            {
                if ((s as Dialog).ModalResult == ModalResult.Yes)
                {
                    IO.DeleteMap(item.MapName.Text);
                    MapList.Items.Remove(item);
                    if (MapList.Items.Count > 0)
                    {
                        MapList.ItemIndex = 0;
                        (MapList.Items[MapList.ItemIndex] as MapListItem).sb.Color = Color.LightGreen;
                    }
                }
                MapList.Enabled = true;
            });
            confirmDelete.ShowModal();
            Manager.Add(confirmDelete);
        }
예제 #9
0
 void MapList_ItemIndexChanged(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     List();
     if (MapList.Items.Count > 0)
     {
         foreach (MapListItem C in MapList.Items)
         {
             C.sb.Color = Color.White;
         }
         (MapList.Items[MapList.ItemIndex] as MapListItem).sb.Color = Color.LightGreen;
         MapListItem item = (MapList.Items[MapList.ItemIndex] as MapListItem);
         try
         {
             string[] Data = IO.GetLevelData(item.MapName.Text);
             Map.Text         = item.MapName.Text;
             Author.Text      = "By: " + Data[0];
             Description.Text = "Description: " + Data[1];
             Version.Text     = "Game Version: " + Data[2];
             LastSaved.Text   = "Last Played: " + Data[3];
             Size.Text        = "Size: " + Data[5] + "x" + Data[6];
             Seed.Text        = "Seed: " + Data[4];
         }
         catch (Exception ex)
         {
             System.Diagnostics.Debug.WriteLine("Exception: " + ex.ToString());
         }
     }
 }
예제 #10
0
 void btnBack_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     createButton.Enabled = false;
     startButton.Enabled  = false;
     game.hideMessageDialog();
     state = GameState.character_backtologin;
 }
예제 #11
0
        void item_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            int equipIdx = Convert.ToInt32(((ImageBox)sender).Name);

            if (guiGameInventory != null)
            {
                if (guiGameInventory.getSelectedItemIndex() < 0)
                {
                    if (selectedItemIndex >= 0)
                    {
                        if (selectedItemIndex == equipIdx)
                        {
                            ((ImageBox)sender).Image = selectedItemTexture;
                            selectedItemTexture      = null;
                            selectedItemIndex        = -1;
                        }
                    }
                    else
                    {
                        selectedItemTexture      = ((ImageBox)sender).Image;
                        ((ImageBox)sender).Image = nullTexture;
                        selectedItemIndex        = equipIdx;
                    }
                }
                else
                {
                    // Use selected item
                    if (network.isConnected())
                    {
                        network.Send("INVENTORYUSE:" + guiGameInventory.getSelectedItemIndex() + ";");
                        guiGameInventory.clearSelectedItem();
                    }
                }
            }
        }
예제 #12
0
        void button_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            Button b = (Button)sender;

            ///use it ....
            okClicked = true;
        }
예제 #13
0
        ////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////
        protected virtual void OnHotTrackChanged(TomShane.Neoforce.Controls.EventArgs e)
        {
            if (HotTrackChanged != null)
            {
                HotTrackChanged.Invoke(this, e);
            }
        }
 void upBtn_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (sender.Equals(this.strBtn) || sender.Equals(this.dexBtn) || sender.Equals(this.intBtn))
     {
         if (sender.Equals(this.strBtn))
         {
             // Send to server that player up str
             // Send chat message
             if (network.isConnected())
             {
                 network.Send("ADDSTR:1;");
             }
         }
         if (sender.Equals(this.dexBtn))
         {
             // Send to server that player up dex
             // Send chat message
             if (network.isConnected())
             {
                 network.Send("ADDDEX:1;");
             }
         }
         if (sender.Equals(this.intBtn))
         {
             // Send to server that player up int
             // Send chat message
             if (network.isConnected())
             {
                 network.Send("ADDINT:1;");
             }
         }
     }
 }
예제 #15
0
        ////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////
        protected virtual void OnItemIndexChanged(TomShane.Neoforce.Controls.EventArgs e)
        {
            if (ItemIndexChanged != null)
            {
                ItemIndexChanged.Invoke(this, e);
            }
        }
예제 #16
0
        /// <summary>
        /// The all important crafting button click
        /// </summary>
        void btnCraft_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            Item item = (itemSelector.Items[itemSelector.ItemIndex] as ItemListControl).Item;

            //Get recipie
            Recipe r = null;

            foreach (KeyValuePair <Item, Recipe> kv in CraftingRecipies.Recipies)
            {
                if (kv.Key.ID == item.ID)
                {
                    r = kv.Value;
                }
            }


            if (curStation == StationType.Crafting)
            {
                foreach (Slot s in r.Ingredients)
                {
                    Slot.RemoveAmount(new Slot(s.Item, s.Stack * (int)(spnCraft.Value / r.AmountToMake)), Game.level.Players[0].Inventory);
                }
                sltOutput.ItemSlots[0] = new Slot(item, r.AmountToMake * (int)(spnCraft.Value / r.AmountToMake));

                btnCraft.Text = "Take Item";
            }
            else if (curStation == StationType.Smelting)
            {
                Smelting              = true;
                btnCraft.Text         = "Smelting...";
                grpPnlRecipie.Enabled = false;
            }
            btnCraft.Enabled = false;
        }
예제 #17
0
 public void itemSelector_ItemIndexChanged(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (itemSelector.Items.Count() > 0 && itemSelector.ItemIndex >= 0)
     {
         Item   item = (itemSelector.Items[itemSelector.ItemIndex] as ItemListControl).Item;
         Recipe r    = null;
         foreach (KeyValuePair <Item, Recipe> kv in CraftingRecipies.Recipies)
         {
             if (kv.Key.ID == item.ID)
             {
                 r             = kv.Value;
                 CurrentRecipe = kv;
             }
         }
         spnCraft.Text  = r.AmountToMake.ToString();
         spnCraft.Value = r.AmountToMake;
         spnCraft_TextChanged(spnCraft, new TomShane.Neoforce.Controls.EventArgs());
         if (r.Station == Item.CraftingTable)
         {
             SetupCraftingControls(Manager);
         }
         else if (r.Station.SubType == BlockSubType.Furnace)
         {
             SetupFurnaceControls(Manager);
         }
         if (BlocksNearby.Contains(r.Station))
         {
             Show(r.Station, false);
         }
         UpdateItemPanel(sender);
     }
 }
예제 #18
0
 void txtSearch_FocusGained(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if ((sender as TextBox).Text == "Search...")
     {
         (sender as TextBox).Text = string.Empty;
     }
 }
예제 #19
0
        void txtSearch_TextChanged(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            string Text = (sender as TextBox).Text;

            FilterString = Text.Trim();
            UpdateItemList(sender);
        }
예제 #20
0
        void sltInput_MoveItems(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            //Giveitem
            Item item = (itemSelector.Items[itemSelector.ItemIndex] as ItemListControl).Item;

            //Get recipie
            Recipe r = null;

            foreach (KeyValuePair <Item, Recipe> kv in CraftingRecipies.Recipies)
            {
                if (kv.Key.ID == item.ID)
                {
                    r = kv.Value;
                }
            }
            if (!Smelting && sltInput != null && (btnCraft.Text != "Refuel" && !sltInput.ItemSlots[0].Equals(Slot.Empty)))
            {
                btnCraft.Enabled = CanCraft(r);
            }
            if (btnCraft.Text == "Refuel" && sltInput.ItemSlots[0].Item.ID != Item.Blank.ID)
            {
                btnCraft.Text      = "Smelt";
                btnCraft.TextColor = Color.White;
                btnCraft.Enabled   = true;
            }
            if (sltInput.ItemSlots[0].Item == Item.Blank && Smelting)
            {
                StopSmelting();
            }
        }
예제 #21
0
        ////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////
        protected virtual void OnHideSelectionChanged(TomShane.Neoforce.Controls.EventArgs e)
        {
            if (HideSelectionChanged != null)
            {
                HideSelectionChanged.Invoke(this, e);
            }
        }
 void equipmentButton_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (guiGameEquipment != null)
     {
         guiGameEquipment.Visible = !guiGameEquipment.Visible;
     }
 }
 void skillButton_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (guiGameSkill != null)
     {
         guiGameSkill.Visible = !guiGameSkill.Visible;
     }
 }
예제 #24
0
 void Input_TextChanged(object sender, Controls.EventArgs e)
 {
     Save.Enabled = true;
     if (Input.Text.Length > MaxNameLength)
     {
         Input.Text = Input.Text.Substring(0, Math.Min(Input.Text.Length, MaxNameLength));
     }
     foreach (Galaxy galaxy in Game.UniverseViewer.Systems)
     {
         foreach (SolarSystem solarsystem in galaxy.Children)
         {
             foreach (PlanetaryObject planet in solarsystem.Children)
             {
                 if (planet.Name == Input.Text)
                 {
                     Save.Enabled = false;
                 }
             }
         }
     }
     if (!Cyral.Extensions.StringExtensions.IsFileNameSafe(Input.Text))
     {
         Save.Enabled = false;
     }
 }
예제 #25
0
        void btnView_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            TaskAchievementLog AchievementLog = new TaskAchievementLog(Game.level.game.Manager);

            AchievementLog.Init();
            Game.level.game.Manager.Add(AchievementLog);
        }
예제 #26
0
 /// <summary>
 /// Acts as an event handler for the "Cancel" button.  This method is called when the user
 /// clicks on the button.
 /// </summary>
 /// <param name="obj">Access to the object clicked. Unused.</param>
 /// <param name="e">Event arguments. Unused.</param>
 void Cancel_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     MessageBox.Show(ServiceManager.Game.Manager,
                     MessageBox.MessageBoxType.YES_NO,
                     "Are you sure you want to cancel and lose all changes?",
                     "Cancel").Closed += new TomShane.Neoforce.Controls.WindowClosedEventHandler(Window_Closed);
 }
예제 #27
0
        /// <summary>
        /// Event handler for when the user selects a different turret
        /// </summary>
        void TurretSelectionChanged(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            Weapon selectedWeapon = weapons[form.TurretIndex];

            form.TurretPower = Utils.ConvertPowerToProgressBar(
                selectedWeapon.Projectile.AverageDamage);
            form.TurretRange = Utils.ConvertRangeToProgressBar(selectedWeapon.Projectile.Range);
            form.TurretRate  = Utils.ConvertRateToProgressBar(
                selectedWeapon.Cooldown);

            Scene scene = ServiceManager.Game.Renderer.ActiveScene;

            scene.Delete(selectedTurretRenderID);

            selectedTurretRenderID = ServiceManager.Game.Renderer.ActiveScene.Add(
                ServiceManager.Resources.GetModel("weapons\\" + selectedWeapon.Model),
                Vector3.Zero, 0);
            float oldRotation = selectedTurret.ZRotation;

            selectedTurret = scene.Access3D(selectedTurretRenderID);
            selectedTurret.Attach(selectedTank, "Mount");
            selectedTurret.ZRotation = oldRotation;

            ApplySkin();
        }
예제 #28
0
        void btnApply_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            Game.ParticleQuality = ParticleCmb.ItemIndex;
            Game.Skin            = SkinCmb.ItemIndex;
            if (Game.Skin == 0 && Manager.Skin.Name != "Red")
            {
                Manager.SetSkin("Red");
            }
            if (Game.Skin == 1 && Manager.Skin.Name != "Blue")
            {
                Manager.SetSkin("Blue");
            }
            if (Game.Skin == 2 && Manager.Skin.Name != "Green")
            {
                Manager.SetSkin("Green");
            }
            //Let the game know of the changes
            Game.LightingQuality = LightingQualityCmb.ItemIndex;
            Game.TileEdges       = TilesidesChk.Checked;
            Game.DropShadows     = DropShadowsChk.Checked;
            Game.Antialiasing    = AntialiasingChk.Checked;
            Game.Fullscreen      = FullscreenChk.Checked;
            Game.LightingRefresh = LightingRefreshCmb.ItemIndex;
            Game.Autosave        = AutosaveChk.Checked;

            //Recompute lighting if level is open
            if (Game.level != null && Game.level.ready)
            {
                Game.level.ComputeLighting = true;
            }

            (Manager.Game as Game).ApplyResolution();

            try
            {
                //Set the config file
                Configuration config = ConfigurationManager.OpenExeConfiguration(System.Reflection.Assembly.GetExecutingAssembly().Location);
                config.AppSettings.Settings["ParticleQuality"].Value = Game.ParticleQuality.ToString();
                config.AppSettings.Settings["Fullscreen"].Value      = Game.Fullscreen.ToString();
                config.AppSettings.Settings["Antialiasing"].Value    = Game.Antialiasing.ToString();
                config.AppSettings.Settings["TileEdges"].Value       = Game.TileEdges.ToString();
                config.AppSettings.Settings["Autosave"].Value        = Game.Autosave.ToString();
                config.AppSettings.Settings["DropShadows"].Value     = Game.DropShadows.ToString();
                config.AppSettings.Settings["LightingQuality"].Value = Game.LightingQuality.ToString();
                config.AppSettings.Settings["LightingRefresh"].Value = Game.LightingRefresh.ToString();
                config.AppSettings.Settings["Skin"].Value            = Game.Skin.ToString();
                config.AppSettings.Settings["ContentPack"].Value     = Game.ContentPackName;

                //Save controls
                for (int i = 0; i < Game.Controls.Count(); i++)
                {
                    config.AppSettings.Settings[Game.Controls.ElementAt(i).Key].Value = Game.Controls.ElementAt(i).Value.ToString().RemoveWhitespace();
                }
                config.Save(ConfigurationSaveMode.Modified);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);
            }
        }
 void inventoryButton_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (guiGameInventory != null)
     {
         guiGameInventory.Visible = !guiGameInventory.Visible;
     }
 }
 void systemButton_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (guiGameMenu != null)
     {
         guiGameMenu.Visible = !guiGameMenu.Visible;
     }
 }
예제 #31
0
파일: Button.cs 프로젝트: GodLesZ/svn-dump
 ////////////////////////////////////////////////////////////////////////////
 
 ////////////////////////////////////////////////////////////////////////////
 private void OnGlyphChanged(EventArgs e)
 {
   if (GlyphChanged != null) GlyphChanged.Invoke(this, e);
 }
예제 #32
0
파일: Window.cs 프로젝트: GodLesZ/svn-dump
    ////////////////////////////////////////////////////////////////////////////
    
    ////////////////////////////////////////////////////////////////////////////  
    protected override void OnDoubleClick(EventArgs e)
    {
    x�
��blob 1024�PNG


IHDR�w=�+tEXtCreation TimeMi 31 Mrz 2004 15:42:07 +0100�#ntIME���@P	pHYs
�
예제 #33
0
 ////////////////////////////////////////////////////////////////////////////          
 ////////////////////////////////////////////////////////////////////////////          
 protected virtual void OnStyleChanged(EventArgs e)
 {
     if (StyleChanged != null) StyleChanged.Invoke(this, e);
 }
예제 #34
0
파일: Window.cs 프로젝트: Rfvgyhn/Neoforce
        /// <summary>
        /// Handler for when the window completes a move event.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnMoveEnd(EventArgs e)
        {
            base.OnMoveEnd(e);

            // Reset to original alpha value.
            try
            {
                Alpha = oldAlpha;
            }
            catch
            {
            }
        }
예제 #35
0
    ////////////////////////////////////////////////////////////////////////////  

    ////////////////////////////////////////////////////////////////////////////  
    protected internal override void OnSkinChanged(EventArgs e)
    {
      base.OnSkinChanged(e);
      if (sbVert != null && sbHorz != null)
      {
        sbVert.Visible = false;
        sbHorz.Visible = false;
        CalcScrolling();
      }  
    }
예제 #36
0
파일: Button.cs 프로젝트: GodLesZ/svn-dump
    //////////////////////////////////////////////////////////////////////////// 

    //////////////////////////////////////////////////////////////////////////// 
    protected override void OnClick(EventArgs e)
    {
      MouseEventArgs ex = (e is MouseEventArgs) ? (MouseEventArgs)e : new MouseEventArgs();      
      
      if (ex.Button == MouseButton.Left || ex.Button == MouseButton.None)
      {
        pushed = !pushed;
      }  
      
      base.OnClick(e);           
      
      if ((ex.Button == MouseButton.Left || ex.Button == MouseButton.None) && Root != null)
      {
        if (Root is Window)
        {
          Window wnd = (Window)Root;
          if (ModalResult != ModalResult.None)
          {            
            wnd.Close(ModalResult);
          }
        }        
      }
    }
예제 #37
0
        void cbListPicker_ItemIndexChanged(object sender, EventArgs e)
        {
            ComboBox cmb = (ComboBox)sender;
            if (cmb.ItemIndex < 0) return;
            string item = cmb.Items.ElementAt(cmb.ItemIndex).ToString();
            if (item.Equals("Other Objects"))
            {
                foreach (object o in lstMain.Items.ToList())
                {
                    lstMain.Items.Remove(o);
                }
                lstMain.Items.Add(OrbIt.game);
                lstMain.Items.Add(room);
                lstMain.Items.Add(room.masterGroup);
            }
            else if (!item.Equals(""))
            {
                foreach (object o in lstMain.Items.ToList())
                {
                    lstMain.Items.Remove(o);
                }

                Group find = room.masterGroup.FindGroup(item);
                if (find == null) return;
                lstMain.Items.AddRange(find.fullSet);
                SyncTitleNumber(find);

                SetDefaultNodeAsEdit();

            }
            lstMain.ScrollTo(0);
        }
예제 #38
0
 void btnSaveNode_Click(object sender, EventArgs e)
 {
     if (inspectorArea.editNode == null)
         PopUp.Toast("You haven't selected a Node.");
     else
         PopUp.Text("Pick a preset name", "Name preset", delegate(bool c, object input)
         {
                             if (c) Assets.saveNode(inspectorArea.editNode, (string)input);
             return true;
         });
 }
예제 #39
0
    ////////////////////////////////////////////////////////////////////////////   

    ////////////////////////////////////////////////////////////////////////////   
    protected override void OnClick(EventArgs e)
    {
      MouseEventArgs ex = e as MouseEventArgs;      
      ex.Position = new Point(ex.Position.X + sbHorz.Value, ex.Position.Y + sbVert.Value);
      
      base.OnClick(e);
    }
예제 #40
0
		////////////////////////////////////////////////////////////////////////////     

		////////////////////////////////////////////////////////////////////////////     
		protected override void OnClick(EventArgs e)
		{
			MouseEventArgs ex = (e is MouseEventArgs) ? (MouseEventArgs)e : new MouseEventArgs();

			if (ex.Button == MouseButton.Left || ex.Button == MouseButton.None)
			{
				if (mode == RadioButtonMode.Auto)
				{
					if (Parent != null)
					{
						ControlsList lst = Parent.Controls as ControlsList;
						for (int i = 0; i < lst.Count; i++)
						{
							if (lst[i] is RadioButton)
							{
								(lst[i] as RadioButton).Checked = false;
							}
						}
					}
					else if (Parent == null && Manager != null)
					{
						ControlsList lst = Manager.Controls as ControlsList;

						for (int i = 0; i < lst.Count; i++)
						{
							if (lst[i] is RadioButton)
							{
								(lst[i] as RadioButton).Checked = false;
							}
						}
					}
				}
			}
			base.OnClick(e);
		}
예제 #41
0
    ////////////////////////////////////////////////////////////////////////////                               

    ////////////////////////////////////////////////////////////////////////////
    void btnClose_Click(object sender, EventArgs e)
    {      
      Close(ModalResult = ModalResult.Cancel);
    }
예제 #42
0
    ////////////////////////////////////////////////////////////////////////////

    ////////////////////////////////////////////////////////////////////////////
    protected override void OnMoveEnd(EventArgs e)
    {
      base.OnMoveEnd(e);
      try
      {
        Alpha = oldAlpha;
      }
      catch
      {
      }
    }
예제 #43
0
 ////////////////////////////////////////////////////////////////////////////   
 
 ////////////////////////////////////////////////////////////////////////////                  
 void ScrollBarValueChanged(object sender, EventArgs e)
 {
   CalcScrolling();     
 }
예제 #44
0
파일: Window.cs 프로젝트: Rfvgyhn/Neoforce
        /// <summary>
        /// Handler for when the window starts a move event.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnMoveBegin(EventArgs e)
        {
            base.OnMoveBegin(e);

            // Swap the current alpha values.
            try
            {
                oldAlpha = Alpha;
                Alpha = dragAlpha;
            }
            catch
            {
            }
        }
예제 #45
0
        void btnDeleteGroup_Click(object sender, EventArgs e)
        {
            string item = cbListPicker.Items.ElementAt(cbListPicker.ItemIndex).ToString();
            if (item.Equals("Other Objects") || item.Equals("master") || item.Equals("Link Groups") || item.Equals("Normal Groups"))
            {
                return;
            }
            else if (!item.Equals(""))
            {
                Group g = GetActiveGroup();
                if (g == null) return;
                if (g.Name.Equals("[G0]")) return;

                foreach (object o in lstMain.Items.ToList())
                {
                    lstMain.Items.Remove(o);
                }

                if (g.fullSet.Contains(room.targetNode)) room.targetNode = null;
                if (g.fullSet.Contains(inspectorArea.editNode) && inspectorArea.editNode != g.defaultNode)
                {
                    inspectorArea.InsBox.Items.Clear();
                    inspectorArea.rootitem = null;
                    inspectorArea.editNode = null;
                }
                g.DeleteGroup();

                cbListPicker.Items.Remove(g.Name);

                cbListPicker.ItemIndex = 2;

                //UpdateGroupComboBoxes();
                SyncTitleNumber();

            }
            lstMain.ScrollTo(0);
        }
예제 #46
0
 void lstMain_Click(object sender, EventArgs e)
 {
     MouseEventArgs me = (MouseEventArgs)e;
     if (me.Button != MouseButton.Right) return;
     ListBox listbox = (ListBox)sender;
     listbox.ContextMenu.Items.ToList().ForEach(o => listbox.ContextMenu.Items.Remove(o));
     //foreach (MenuItem m in listbox.ContextMenu.Items.ToList())
     //{
     //    listbox.ContextMenu.Items.Remove(m);
     //}
     Color c = listbox.ContextMenu.Color;
     listbox.ContextMenu.Color = new Color(0f, 0f, 0f, 0f);
     if (listbox.ItemIndex >= 0 && listbox.Items.ElementAt(listbox.ItemIndex) is Node)
     {
         listbox.ContextMenu.Color = new Color(1f, 1f, 1f, 1.0f);
         listbox.ContextMenu.Items.Add(ConvertIntoList);
         listbox.ContextMenu.Items.Add(PromoteToDefault);
     }
 }
예제 #47
0
 void cbListPicker_Click(object sender, EventArgs e)
 {
     int t = cbListPicker.ItemIndex;
     cbListPicker.ItemIndex = 0;
     cbListPicker.ItemIndex = t;
 }
예제 #48
0
    ////////////////////////////////////////////////////////////////////////////     

    ////////////////////////////////////////////////////////////////////////////     
    protected override void OnClick(EventArgs e)    
    {
      MouseEventArgs ex = (e is MouseEventArgs) ? (MouseEventArgs)e : new MouseEventArgs();      
      
      if (ex.Button == MouseButton.Left || ex.Button == MouseButton.None)      
      {        
        Checked = !Checked;
      }  
      base.OnClick(e);
    }
예제 #49
0
        void ConvertIntoList_Click(object sender, EventArgs e)
        {
            Node n = (Node)lstMain.Items.ElementAt(lstMain.ItemIndex);
            if (n == room.targetNode)
            {
                room.targetNode = null;
            }

            Node newdefault = n.CreateClone(n.room);
            //Node.cloneNode(n, newdefault);
            newdefault.body.velocity = new Vector2(0, 0);
            Group g = new Group(room, newdefault, room.masterGroup.childGroups["General Groups"]);
            newdefault.name = g.Name;
            //room.masterGroup.childGroups["General Groups"].AddGroup(g.Name, g);
            //room.masterGroup.UpdateComboBox();
            UpdateGroupComboBoxes();

            Group active = GetActiveGroup();
            if (active == null) return;
            //active.fullSet.Remove(n);
            active.DeleteEntity(n);

            //g.fullSet.Add(n);

            int index = cbListPicker.Items.IndexOf(newdefault.name);
            cbListPicker.ItemIndex = index;
            //cmbListPicker.Refresh();
            //cmbListPicker.ItemIndex = 0;
        }
예제 #50
0
 ////////////////////////////////////////////////////////////////////////////     
 
 ////////////////////////////////////////////////////////////////////////////     
 protected virtual void OnCheckedChanged(EventArgs e)
 {
   if (CheckedChanged != null) CheckedChanged.Invoke(this, e);
 }
예제 #51
0
 void PromoteToDefault_Click(object sender, EventArgs e)
 {
     Node n = (Node)lstMain.Items.ElementAt(lstMain.ItemIndex);
     Node newdefault = n.CreateClone(n.room);
     Group g = GetActiveGroup();
     if (g == null) return;
     g.defaultNode = newdefault;
     g.fullSet.Remove(n);
     SetDefaultNodeAsEdit();
 }
 public void OnEvent(Control control, DetailedItem item, EventArgs e)
 {
     if (item == null || control == null || item.obj == null) return;
     if (!(item.obj is InspectorInfo)) return;
     InspectorInfo ins = (InspectorInfo)item.obj;
     if (e is KeyEventArgs && control.GetType() == typeof(TextBox))
     {
         KeyEventArgs ke = (KeyEventArgs)e;
         if (ke.Key != Microsoft.Xna.Framework.Input.Keys.Enter) return;
         TextBox textbox = (TextBox)control;
         object san = ins.TrySanitize(textbox.Text);
         if (san != null)
         {
             ins.SetValue(san);
             //Console.WriteLine(ins.parentItem.obj.GetType() + " >> " + ins + " >> " + san.GetType() + " >> " + san);
             if (GroupSync)
             {
                 ins.ApplyToAllNodes(activeGroup);
             }
         }
         marginalize(textbox);
     }
     else if (control is ComboBox)
     {
         ins.SetValue(control.Text);
         if (GroupSync)
         {
             ins.ApplyToAllNodes(activeGroup);
         }
     }
     else if (control is Button)
     {
         if (control.Name.Equals("bool_button_enabled"))
         {
             ins.SetValue(GetButtonBool((Button)control));
             if (GroupSync)
             {
                 ins.ApplyToAllNodes(activeGroup);
             }
         }
         else if (control.Name.Equals("toggle_button_enabled"))
         {
             ins.SetValue(GetButtonBool((Button)control));
             if (GroupSync)
             {
                 ins.ApplyToAllNodes(activeGroup);
             }
         }
         else if (control.Name.Equals("component_button_enabled"))
         {
             Component component = (Component)ins.obj;
             component.active = GetButtonBool((Button)control);
             if (this is ComponentView)
             {
                 ComponentView cv = (ComponentView)this;
                 if (cv.lblCurrentComp.Text.Equals(component.GetType().ToString().LastWord('.')))
                     cv.lblCurrentComp.TextColor = control.TextColor;
             }
             //ins.SetValue(checkbox.Checked);
             if (GroupSync)
             {
                 foreach (Node n in activeGroup.fullSet)
                 {
                     if (n.HasComp(component.GetType()))
                         n.comps[component.GetType()].active = component.active;
                 }
             }
         }
         else if (control.Name.Equals("component_button_remove"))
         {
             if (ins.obj is Component)
             {
                 Component component = (Component)ins.obj;
                 if (this is ComponentView && (this as ComponentView).viewType == ViewType.Link)
                 {
                     ComponentView cv = (ComponentView)this;
                     cv.rootLink.components.Remove(component.GetType());
                 }
                 else
                 {
                     component.parent.RemoveComponent(component.GetType());
                     if (GroupSync)
                     {
                         foreach (Node n in activeGroup.fullSet)
                         {
                             n.RemoveComponent(component.GetType());
                         }
                     }
                 }
             }
             if (this is ComponentView) (this as ComponentView).RefreshComponents();
         }
         else if (control.Name.Equals("method_button_invoke"))
         {
             if (ins.methodInfo != null)
             {
                 ins.methodInfo.Invoke(ins.parentobj, null);
                 if (GroupSync)
                 {
                     ins.ApplyToAllNodes(activeGroup);
                 }
             }
         }
     }
 }
 void btn_Click(object sender, EventArgs e)
 {
     MouseEventArgs ex = (e is MouseEventArgs) ? (MouseEventArgs)e : new MouseEventArgs();
       txt.Items.Add((sender == btn ? "Button" : "List") + ": Click " + ex.Button.ToString());
       txt.ItemIndex = txt.Items.Count - 1;
 }
예제 #54
0
 /// <summary>
 /// Handles when the control's image is changed.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnImageChanged(EventArgs e)
 {
     if (ImageChanged != null) ImageChanged.Invoke(this, e);
 }
예제 #55
0
 ////////////////////////////////////////////////////////////////////////////
 
 ////////////////////////////////////////////////////////////////////////////
 void btnClose_SkinChanged(object sender, EventArgs e)
 {
   btnClose.Skin = new SkinControl(Manager.Skin.Controls[skButton]);
 }
예제 #56
0
        private void InitChoose(object sender, EventArgs e)
        {
            //Cancel Button
            if (sender == m_Buttons[0]) m_Active = false;

            //Go to editor
            if (sender == m_Buttons[1])
            {
                //Prepare parameter
                object[] Parameters;

                //Create parameter
                Parameters = new object[2];
                Parameters[0] = m_ComboBoxs[0].Items[HeightIndex];
                Parameters[1] = m_ComboBoxs[1].Items[WidthIndex];

                //Go to story
                Global.StateManager.GoTo(StateID.Editor, Parameters);

                //Make state inactive
                m_Active = false;
            }
        }
예제 #57
0
    //////////////////////////////////////////////////////////////////////////// 

    ////////////////////////////////////////////////////////////////////////////
    protected override void OnMoveBegin(EventArgs e)
    {
      base.OnMoveBegin(e);
     
      try
      {     
        oldAlpha = Alpha;   
        Alpha = dragAlpha;
      }
      catch
      {
      }
    }
예제 #58
0
 ////////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////////          
 protected virtual void OnBorderChanged(EventArgs e)
 {
     if (BorderChanged != null) BorderChanged.Invoke(this, e);
 }
예제 #59
0
 ////////////////////////////////////////////////////////////////////////////
 
 ////////////////////////////////////////////////////////////////////////////  
 protected override void OnDoubleClick(EventArgs e)
 {
   base.OnDoubleClick(e);
               
   MouseEventArgs ex = (e is MouseEventArgs) ? (MouseEventArgs) e : new MouseEventArgs();
   
   if (IconVisible && ex.Button == MouseButton.Left)
   {
     Rectangle r = GetIconRect();
     r.Offset(AbsoluteLeft, AbsoluteTop);
     if (r.Contains(ex.Position))
     {
       Close();
     }
   }  
 }
예제 #60
0
 ////////////////////////////////////////////////////////////////////////////          
 ////////////////////////////////////////////////////////////////////////////        
 protected virtual void OnValueChanged(EventArgs e)
 {
     if (ValueChanged != null) ValueChanged.Invoke(this, e);
 }