void Checkbox_OnClick(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { if (base.PointInBounds(e.Position)) { this.Checked = !this.Checked; } }
public virtual void Mouse_Down(SdlDotNet.Input.MouseButtonEventArgs e) { if (mWindowed && mCloseable && this.PointInBounds(e.Position, new Rectangle(mCloseButtonBounds.Location.X + this.Location.X, mCloseButtonBounds.Y + this.Location.Y, mCloseButtonSurf.Size.Width, mCloseButtonSurf.Size.Height))) { this.CloseWindow(); } else if (mWindowed && mMaximizable && this.PointInBounds(e.Position, new Rectangle(mMaximizeButtonBounds.Location.X + this.Location.X, mMaximizeButtonBounds.Y + this.Location.Y, mMaximizeButtonBounds.Size.Width, mMaximizeButtonBounds.Size.Height))) { if (mWindowState == WindowManager.WindowState.Normal) { SetMaximizedState(); } else if (mWindowState == WindowManager.WindowState.Maximized) { SetNormalState(); this.Location = mPrevFullBounds.Location; this.Size = mPrevControlBounds.Size; } } else if (mWindowed && mMinimizable && this.PointInBounds(e.Position, new Rectangle(mMinimizeButtonBounds.Location.X + this.Location.X, mMinimizeButtonBounds.Y + this.Location.Y, mMinimizeButtonBounds.Size.Width, mMinimizeButtonBounds.Size.Height))) { SetMinimizedState(); } else if (mWindowed && this.PointInBounds(e.Position, new Rectangle(this.Location, mTitleBarBounds.Size))) { if (mWindowState != WindowManager.WindowState.Maximized) { this.mDrag = true; this.mDragStart = new Point(e.Position.X - this.Location.X, e.Position.Y - this.Location.Y); } } }
void lblUseCharacter_OnClick(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { bool charSelected = false; if (btnChar1.Focused) { WindowSwitcher.GetWindow(WindowSwitcher.Window.Game, true); Tcp.TcpResponder.SendUseChar(1); charSelected = true; } else if (btnChar2.Focused) { WindowSwitcher.GetWindow(WindowSwitcher.Window.Game, true); Tcp.TcpResponder.SendUseChar(2); charSelected = true; } else if (btnChar3.Focused) { WindowSwitcher.GetWindow(WindowSwitcher.Window.Game, true); Tcp.TcpResponder.SendUseChar(3); charSelected = true; } if (charSelected) { WindowManager.RemoveWindow(this); WindowManager.AddWindow(WindowSwitcher.Window.Loading); Windows.WindowSwitcher.LoadingWindow.UpdateLoadText("Logging in..."); } }
void Events_MouseButtonDown(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { if (e.ButtonPressed) { shoot = true; } }
static void onMouseButton(object sender, SdlDotNet.Input.MouseButtonEventArgs args) { if (start == false) { start = true; ballx = xpos + 34; bally = 350; } }
void Textbox_OnClick(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { //Point clickedPoint = base.ControlPointFromScreenPoint(e.Position); //mCursorLocX = (clickedPoint.X / mLetterSize.Width); //mCursorLocY = (clickedPoint.Y / mLetterSize.Height) - 1; //if (GetCharNumFromCursorLoc() > mChars.Count) { // mCursorLocX = (mChars.Count) % mMaxX; // mCursorLocY = (mChars.Count) / mMaxX; //} }
void Control_OnClick(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { if (FocusOnClick) { if (this.Focused == false) { this.Focused = true; } } }
void Events_MouseButtonDown(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { if (this.PointInBounds(e.Position)) { if (OnClick != null) { OnClick(this, e); } } }
void btnDebug_OnClick(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { //if (SdlDotNet.Widgets.WindowManager.IsWindowOpen(WindowSwitcher.GetWindow(WindowSwitcher.Window.Debug)) == false) { // WindowManager.AddWindow(WindowSwitcher.Window.Debug); // WindowSwitcher.DebugWindow.OnWindowClosed += new EventHandler(DebugWindow_OnWindowClosed); // btnDebug.Text = "Close Debug Window"; //} else { // WindowSwitcher.DebugWindow.OnWindowClosed -= new EventHandler(DebugWindow_OnWindowClosed); // WindowManager.RemoveWindow(WindowSwitcher.Window.Debug); // btnDebug.Text = "Show Debug Window"; //} }
/// <summary> /// Handles the MouseButtonUp event of the Events control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="SdlDotNet.Input.MouseButtonEventArgs"/> instance containing the event data.</param> public void Events_MouseButtonUp(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { int realX = e.X / Game.Scale - 2; int realY = e.Y / Game.Scale - 2; MouseClickEventArgument eventArgument = new MouseClickEventArgument(); eventArgument.X = realX; eventArgument.Y = realY; eventArgument.Bubble = true; eventArgument.MouseButton = e.Button; // Find a suitable control to accept the event Game.GuiManager.GetFace(Game.GameScreenManager.CurrentGameScreen.FaceId).Bubble(BubbleFace, eventArgument); }
private void Events_MouseButtonDown(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { if (GameState == (int)State.homeScreen) { for (int i = 0; i < rectMenuItemsList.Count; i++) { if (temp.IntersectsWith(rectMenuItemsList[i])) { m_menuItemsList[i].ReplaceColor(Color.Yellow, Color.Red); } else { m_menuItemsList[i].ReplaceColor(Color.Red, Color.White); } } } }
public static void Mouse_Up(SdlDotNet.Input.MouseButtonEventArgs e) { if (mOpenWindows.Count > 0) { //GetTopMostWindow().Mouse_Up(e); for (int i = mOpenWindows.Count - 1; i >= 0; i--) { if (mOpenWindows[i].WindowState != WindowState.Minimized && PointInBounds(e.Position, mOpenWindows[i].FullBounds)) { mOpenWindows[i].Mouse_Up(e); //if (mOpenWindows[mOpenWindows.Count - 1].AlwaysOnTop == false && i != mOpenWindows.Count - 1) { // SwitchWindows(i, mOpenWindows.Count - 1); //} break; } } } }
void btnUp_OnClick(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { if (!inverted) { if (Value > 0) { Value -= step; //if (OnChangeValue != null) // OnChangeValue(Value, null); } } else { if (Value < max) { Value += step; //if (OnChangeValue != null) // OnChangeValue(Value, null); } } }
void TaskBarButton_OnClick(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { if (mWindow.WindowState == Client.Logic.Windows.WindowManager.WindowState.Minimized) { mWindow.WindowState = Client.Logic.Windows.WindowManager.WindowState.Normal; Windows.WindowManager.BringWindowToFront(mWindow); } else if (mWindow.WindowState == Client.Logic.Windows.WindowManager.WindowState.Normal) { if (Windows.WindowManager.IsWindowTopMost(mWindow)) { mWindow.WindowState = Client.Logic.Windows.WindowManager.WindowState.Minimized; } else { mWindow.BringToFront(); } } else if (mWindow.WindowState == Client.Logic.Windows.WindowManager.WindowState.Maximized) { mWindow.BringToFront(); } }
private void Events_MouseButtonUp(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { switch (GameState) { case (int)State.homeScreen: // check voor het aanklikken van knoppen op homescreen for (int i = 0; i < rectMenuItemsList.Count; i++) { if (temp.IntersectsWith(rectMenuItemsList[i])) { switch (i) { case 0: // start GameState = (int)State.buildLevel; done = false; break; case 1: // exit GameState = (int)State.quit; break; } } } break; case (int)State.gameOver: // bij game over klik je om terug naar het hoofdscherm te gaan GameState = (int)State.homeScreen; done = false; break; case (int)State.finish: GameState = (int)State.homeScreen; background = new Surface(@"Assets\Sprites\background_1.jpg"); activeLevel = level1; done = false; break; } }
public static void SdlDotNet_Core_Events_MouseButtonDown(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { SdlDotNet.Widgets.WindowManager.HandleMouseButtonDown(e); }
// this procedure is called when a mouse button is pressed or released static void onMouseButton(object sender, SdlDotNet.Input.MouseButtonEventArgs args) { }
public virtual void Mouse_Up(SdlDotNet.Input.MouseButtonEventArgs e) { this.mDrag = false; }
void Scrollbar_OnClick(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { }
void Events_MouseButtonUp(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { shoot = false; }
void lblLoginScreen_OnClick(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { WindowManager.RemoveWindow(this); WindowManager.AddWindow(WindowSwitcher.Window.Login); }