Esempio n. 1
0
		protected override void OnMousePress(MouseEventArgs e) {
			base.OnMouseDown(e);

			if (e.Button == EMouseButton.Left) {
				int pos = e.Position.X;

				if (pos < btnSlider.Left) {
					Value -= pageSize;
				} else if (pos >= btnSlider.Left + btnSlider.Width) {
					Value += pageSize;
				}
			}
		}
Esempio n. 2
0
		protected override void OnMouseMove(MouseEventArgs e) {
			base.OnMouseMove(e);
			if (tabPages.Count > 1) {
				int index = hoveredIndex;
				Point p = new Point(e.State.X - Root.AbsoluteLeft, e.State.Y - Root.AbsoluteTop);
				for (int i = 0; i < tabPages.Count; i++) {
					Rectangle r = tabPages[i].HeaderRect;
					if (p.X >= r.Left && p.X <= r.Right && p.Y >= r.Top && p.Y <= r.Bottom && tabPages[i].Enabled) {
						index = i;
						break;
					} else {
						index = -1;
					}
				}
				if (index != hoveredIndex) {
					hoveredIndex = index;
					Invalidate();
				}
			}
		}
Esempio n. 3
0
		protected override void OnMouseDown(MouseEventArgs e) {
			base.OnMouseDown(e);

			if (tabPages.Count > 1) {
				Point p = new Point(e.State.X - Root.AbsoluteLeft, e.State.Y - Root.AbsoluteTop);
				for (int i = 0; i < tabPages.Count; i++) {
					Rectangle r = tabPages[i].HeaderRect;
					if (p.X >= r.Left && p.X <= r.Right && p.Y >= r.Top && p.Y <= r.Bottom) {
						SelectedIndex = i;
						break;
					}
				}
			}
		}
Esempio n. 4
0
		protected override void OnMouseDown(MouseEventArgs e) {
			base.OnMouseDown(e);

			btnSlider.Passive = true;

			if (e.Button == EMouseButton.Left) {
				if (orientation == EOrientation.Horizontal) {
					int pos = e.Position.X;

					if (pos < btnSlider.Left) {
						Value -= pageSize;
						if (Value < 0)
							Value = 0;
					} else if (pos >= btnSlider.Left + btnSlider.Width) {
						Value += pageSize;
						if (Value > range - pageSize)
							Value = range - pageSize;
					}
				} else {
					int pos = e.Position.Y;

					if (pos < btnSlider.Top) {
						Value -= pageSize;
						if (Value < 0)
							Value = 0;
					} else if (pos >= btnSlider.Top + btnSlider.Height) {
						Value += pageSize;
						if (Value > range - pageSize)
							Value = range - pageSize;
					}
				}
			}
		}
Esempio n. 5
0
		protected override void OnMouseUp(MouseEventArgs e) {
			btnSlider.Passive = false;
			base.OnMouseUp(e);
		}
Esempio n. 6
0
		void ArrowPress(object sender, MouseEventArgs e) {
			if (e.Button == EMouseButton.Left) {
				if (sender == btnMinus) {
					Value -= StepSize;
					if (Value < 0)
						Value = 0;
				} else if (sender == btnPlus) {
					Value += StepSize;
					if (Value > range - pageSize)
						Value = range - pageSize - 1;
				}
			}
		}