public override void OnMouseDown(DrawManager parent, MouseButtonEventArgs button) { if (scrollbar_rect.matrix.TestCollision(new Vertex2(UserMouse.GetX(), UserMouse.GetY()))) { anchor = new Vertex2(UserMouse.GetX(), UserMouse.GetY() - (scrollbar_rect.y - outline_rect.y)); isGrabbed = true; } }
public TimeTracker(UserBoxCintrolOfTimeSpeed userBox) { keyBoard = new UserKeyBoard(); mouse = new UserMouse(); mouse.MouseMoved += Mouse_MouseMoved; keyBoard.KeyBoardPressed += KeyBoard_KeyBoardPressed; SystemEvents.SessionSwitch += SystemEvents_SessionSwitch; SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; recordToFile = new RecordToFile("testRecord.txt"); record = recordToFile.CurentRecord; userBoxControl = userBox; StartSaveTimer(); DisplayTimer(); }
public override void Draw(DrawManager parent) { if (isGrabbed) { float dy = UserMouse.GetY() - (float)anchor.y; if (dy < 0) { dy = 0; } if (dy > maxScroll) { dy = maxScroll; } scrollbar_rect.y = outline_rect.y + dy; scrollValue = (int)Math.Floor(dy * pixelScale); Console.WriteLine("Setting sv to: " + scrollValue); } bg_rect.Draw(parent); outline_rect.Draw(parent); scrollbar_rect.Draw(parent); }
public override void Draw(DrawManager parent) { base.Draw(parent); highlight_box.Draw(parent); if (highlight_box.matrix.TestCollision(new Vertex2(UserMouse.GetX(), UserMouse.GetY()))) { highlight_box.color.a += 4; if (highlight_box.color.a > 80) { highlight_box.color.a = 80; } } else { highlight_box.color.a -= 4; if (highlight_box.color.a < 20) { highlight_box.color.a = 20; } } title_text.Draw(parent); }
public override void Draw(DrawManager parent) { cursorSprite.x = UserMouse.GetX(); cursorSprite.y = UserMouse.GetY(); cursorSprite.Draw(parent); }