Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow splash screen to move. Removal of some unused code. (OIL) #3260

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion XenAdmin/Controls/FlickerFreeListBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected override void WndProc(ref Message msg)
si.cbSize = (uint)Marshal.SizeOf(si);
Win32.GetScrollInfo(msg.HWnd, 0, ref si);

if ((msg.WParam.ToInt32() & 0xFF) == Win32.SB_THUMBTRACK)
if ((msg.WParam.ToInt32() & 0xFF) == (int)Win32.ScrollBarCommands.SB_THUMBTRACK)
{
// If the user is in the middle of dragging the scrollbar, we're interested in
// the 'track' position
Expand Down
39 changes: 0 additions & 39 deletions XenAdmin/Controls/SnapshotTreeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ protected override void OnLayout(LayoutEventArgs levent)
{
//This is needed to maximize and minimize properly, there is some issue in the ListView Control
Win32.POINT pt = new Win32.POINT();
IntPtr hResult = SendMessage(Handle, LVM_GETORIGIN, IntPtr.Zero, ref pt);

origin = pt;
root.InvalidateAll();
Expand Down Expand Up @@ -328,13 +327,9 @@ private void PositionSnapshots(SnapshotIcon icon, int x, int y)
// Debugger.Break();
}
}
public const int LVM_GETORIGIN = 0x1000 + 41;

private Win32.POINT origin = new Win32.POINT();

[DllImport("user32.dll")]
internal static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, ref Win32.POINT pt);

#endregion

#region Drawing
Expand Down Expand Up @@ -379,9 +374,6 @@ protected override void WndProc(ref Message m)
}
}




private const int WS_HSCROLL = 0x100000;
private const int WS_VSCROLL = 0x200000;
private const int GWL_STYLE = (-16);
Expand All @@ -406,7 +398,6 @@ internal static bool IsHorizontalScrollBarVisible(Control ctrl)
return (GetWindowLong(ctrl.Handle, GWL_STYLE) & WS_HSCROLL) != 0;
}


private void SnapshotTreeView_DrawItem(object sender, DrawListViewItemEventArgs e)
{

Expand All @@ -432,34 +423,6 @@ private void SnapshotTreeView_DrawItem(object sender, DrawListViewItemEventArgs

}

public void DrawRoundRect(Graphics g, Brush b, float x, float y, float width, float height, float radius)
{

GraphicsPath gp = new GraphicsPath();

gp.AddLine(x + radius, y, x + width - (radius * 2), y); // Line

gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90); // Corner

gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2)); // Line

gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, radius * 2, 0, 90); // Corner
gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height); // Line

gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90); // Corner

gp.AddLine(x, y + height - (radius * 2), x, y + radius); // Line

gp.AddArc(x, y, radius * 2, radius * 2, 180, 90); // Corner

gp.CloseFigure();



g.FillPath(b, gp);

}

private void DrawDate(DrawListViewItemEventArgs e, SnapshotIcon icon, bool background)
{

Expand Down Expand Up @@ -534,8 +497,6 @@ private void PaintLine(Graphics g, SnapshotIcon icon, SnapshotIcon child, bool h
}
}



#endregion

private string _spinningMessage = "";
Expand Down
12 changes: 7 additions & 5 deletions XenAdmin/Controls/TreeViews/FlickerFreeTreeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ protected override void OnAfterExpand(VirtualTreeViewEventArgs e)

protected override void WndProc(ref Message m)
{
//Prevent Redraw background on paint
if (m.Msg == Win32.WM_ERASEBKGND)
{
m.Result = IntPtr.Zero;
Expand Down Expand Up @@ -322,16 +323,17 @@ public bool TryToSelectNewNode(Predicate<object> tagMatch, bool selectNode, bool
{
if (selectNode)
SelectedNode = node;

if (expandNode)
node.Expand();
node.Expand();

if (ensureNodeVisible)
node.EnsureVisible();
node.EnsureVisible();

return true;
}
}

return false;
}

Expand Down
2 changes: 2 additions & 0 deletions XenAdmin/SplashScreen.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions XenAdmin/SplashScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using System.Drawing;
using System.Windows.Forms;
using XenAdmin.Core;
using XenCenterLib;

namespace XenAdmin
{
Expand Down Expand Up @@ -67,5 +68,24 @@ private void timer1_Tick(object sender, EventArgs e)
timer1.Stop();
ShowMainWindowRequested?.Invoke();
}

private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
SendToForm(e.Button);
}

private void labelCopyright_MouseDown(object sender, MouseEventArgs e)
{
SendToForm(e.Button);
}

private void SendToForm(MouseButtons mouseButton)
{
if (mouseButton == MouseButtons.Left)
{
Win32.ReleaseCapture();
Win32.SendMessage(Handle, Win32.WM_NCLBUTTONDOWN, Win32.HT_CAPTION, 0);
}
}
}
}
Loading
Loading