public bool ShowIcon {
get {
-#if NET_2_0
if (!Form.ShowIcon)
return false;
-#endif
if (!HasBorders)
return false;
if (IsMinimized)
protected virtual void Activate ()
{
- form.Refresh ();
+ form.Invalidate (true);
+ form.Update ();
}
public virtual bool IsActive {
protected virtual void HandleWindowMove (Message m)
{
- Point move = MouseMove (m);
+ Point move = MouseMove (Cursor.Position);
UpdateVP (virtual_position.X + move.X, virtual_position.Y + move.Y,
virtual_position.Width, virtual_position.Height);
private void HandleSizing (Message m)
{
Rectangle pos = virtual_position;
- Size minimum_size = SystemInformation.MinWindowTrackSize;
- int mw = minimum_size.Width;
- int mh = minimum_size.Height;
+ int mw;
+ int mh;
+ if (IsToolWindow) {
+ int border_width = BorderWidth;
+ mw = 2 * (border_width + Theme.ManagedWindowSpacingAfterLastTitleButton) + ThemeEngine.Current.ManagedWindowButtonSize (this).Width;
+ mh = 2 * border_width + TitleBarHeight;
+ } else {
+ Size minimum_size = SystemInformation.MinWindowTrackSize;
+ mw = minimum_size.Width;
+ mh = minimum_size.Height;
+ }
int x = Cursor.Position.X;
int y = Cursor.Position.Y;
{
}
- protected Point MouseMove (Message m)
+ protected Point MouseMove (Point pos)
{
- Point cp = Cursor.Position;
- return new Point (cp.X - start.X, cp.Y - start.Y);
+ return new Point (pos.X - start.X, pos.Y - start.Y);
}
protected virtual void DrawVirtualPosition (Rectangle virtual_position)
foreach (TitleButton button in this) {
if (button == null)
continue;
-
+
+ if (button.State == ButtonState.Inactive)
+ continue;
+
if (button == over_button) {
if (any_pushed_buttons) {
any_change |= button.State != ButtonState.Pushed;
ToolTipHide (false);
foreach (TitleButton button in this) {
- if (button != null) {
+ if (button != null && button.State != ButtonState.Inactive) {
button.State = ButtonState.Normal;
}
}
TitleButton clicked_button = FindButton (x, y);
- if (clicked_button != null) {
+ if (clicked_button != null && clicked_button.State != ButtonState.Inactive) {
clicked_button.State = ButtonState.Pushed;
}
}
}
TitleButton clicked_button = FindButton (x, y);
- if (clicked_button != null) {
+ if (clicked_button != null && clicked_button.State != ButtonState.Inactive) {
clicked_button.OnClick ();
}
foreach (TitleButton button in this) {
- if (button == null)
+ if (button == null || button.State == ButtonState.Inactive)
continue;
button.State = ButtonState.Normal;
if (clicked_button == CloseButton && !form.closing)
XplatUI.InvalidateNC (form.Handle);
+
+ ToolTipHide (true);
}
internal void MouseLeave (int x, int y)
}
foreach (TitleButton button in this) {
- if (button == null)
+ if (button == null || button.State == ButtonState.Inactive)
continue;
button.State = ButtonState.Normal;