Added some new icons to the context menu.

Fixed form size/position when applying a new window region (ensures the form is always on screen).
Fixed rounding error when ending resize operation in AspectRatioForm.
This commit is contained in:
Lorenz Cuno Klopfenstein 2010-07-31 01:19:45 +02:00
parent 7f50cd0874
commit 759be7cb3d
13 changed files with 138 additions and 70 deletions

View file

@ -127,7 +127,7 @@ namespace OnTopReplica {
//Ensure that the ClientSize of the form is always respected
//(not ensured by the WM_SIZING message alone because of rounding errors and the chrome space)
if (KeepAspectRatio) {
var newHeight = (int)((ClientSize.Width - ExtraPadding.Horizontal) / AspectRatio + ExtraPadding.Vertical);
var newHeight = (int)Math.Round(((ClientSize.Width - ExtraPadding.Horizontal) / AspectRatio) + ExtraPadding.Vertical);
ClientSize = new Size(ClientSize.Width, newHeight);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

View file

@ -44,7 +44,6 @@
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
this.fullOpacityToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.resizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuResize = new System.Windows.Forms.ContextMenuStrip(this.components);
this.doubleToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
@ -69,6 +68,7 @@
this.italianoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuContextClose = new System.Windows.Forms.ToolStripMenuItem();
this.fullOpacityToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.danskToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuFullscreenContext = new System.Windows.Forms.ContextMenuStrip(this.components);
this.enableClickthroughToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -115,7 +115,6 @@
this.menuWindows.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.noneToolStripMenuItem});
this.menuWindows.Name = "menuWindows";
this.menuWindows.OwnerItem = this.menuContextWindows;
this.menuWindows.Size = new System.Drawing.Size(118, 26);
this.menuWindows.Opening += new System.ComponentModel.CancelEventHandler(this.Menu_Windows_opening);
//
@ -130,13 +129,13 @@
this.fullSelectWindowToolStripMenuItem.DropDown = this.menuWindows;
this.fullSelectWindowToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.list;
this.fullSelectWindowToolStripMenuItem.Name = "fullSelectWindowToolStripMenuItem";
this.fullSelectWindowToolStripMenuItem.Size = new System.Drawing.Size(186, 22);
this.fullSelectWindowToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
this.fullSelectWindowToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuWindows;
this.fullSelectWindowToolStripMenuItem.ToolTipText = global::OnTopReplica.Strings.MenuWindowsTT;
//
// switchToWindowToolStripMenuItem
//
this.switchToWindowToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.window_switch;
this.switchToWindowToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.xiao_arrow;
this.switchToWindowToolStripMenuItem.Name = "switchToWindowToolStripMenuItem";
this.switchToWindowToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
this.switchToWindowToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuSwitch;
@ -166,6 +165,7 @@
//
// clickForwardingToolStripMenuItem
//
this.clickForwardingToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.clickforwarding;
this.clickForwardingToolStripMenuItem.Name = "clickForwardingToolStripMenuItem";
this.clickForwardingToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.clickForwardingToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuClickForwarding;
@ -174,6 +174,7 @@
//
// clickThroughToolStripMenuItem
//
this.clickThroughToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.window_opacity;
this.clickThroughToolStripMenuItem.Name = "clickThroughToolStripMenuItem";
this.clickThroughToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.clickThroughToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuClickThrough;
@ -182,6 +183,7 @@
//
// groupSwitchModeToolStripMenuItem
//
this.groupSwitchModeToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.groupmode;
this.groupSwitchModeToolStripMenuItem.Name = "groupSwitchModeToolStripMenuItem";
this.groupSwitchModeToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.groupSwitchModeToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuGroupSwitch;
@ -204,7 +206,6 @@
this.toolStripMenuItem3,
this.toolStripMenuItem4});
this.menuOpacity.Name = "menuOpacity";
this.menuOpacity.OwnerItem = this.menuContextOpacity;
this.menuOpacity.ShowCheckMargin = true;
this.menuOpacity.ShowImageMargin = false;
this.menuOpacity.Size = new System.Drawing.Size(154, 92);
@ -248,14 +249,6 @@
this.toolStripMenuItem4.ToolTipText = global::OnTopReplica.Strings.MenuOp25TT;
this.toolStripMenuItem4.Click += new System.EventHandler(this.Menu_Opacity_click);
//
// fullOpacityToolStripMenuItem
//
this.fullOpacityToolStripMenuItem.DropDown = this.menuOpacity;
this.fullOpacityToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.window_opacity;
this.fullOpacityToolStripMenuItem.Name = "fullOpacityToolStripMenuItem";
this.fullOpacityToolStripMenuItem.Size = new System.Drawing.Size(186, 22);
this.fullOpacityToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuOpacity;
//
// resizeToolStripMenuItem
//
this.resizeToolStripMenuItem.DropDown = this.menuResize;
@ -313,6 +306,7 @@
//
// fullscreenToolStripMenuItem1
//
this.fullscreenToolStripMenuItem1.Image = global::OnTopReplica.Properties.Resources.fullscreen;
this.fullscreenToolStripMenuItem1.Name = "fullscreenToolStripMenuItem1";
this.fullscreenToolStripMenuItem1.Size = new System.Drawing.Size(164, 22);
this.fullscreenToolStripMenuItem1.Text = global::OnTopReplica.Strings.MenuFitFullscreen;
@ -442,6 +436,7 @@
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.xiao_help;
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
this.aboutToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuAbout;
@ -456,6 +451,14 @@
this.menuContextClose.Text = global::OnTopReplica.Strings.MenuClose;
this.menuContextClose.Click += new System.EventHandler(this.Menu_Close_click);
//
// fullOpacityToolStripMenuItem
//
this.fullOpacityToolStripMenuItem.DropDown = this.menuOpacity;
this.fullOpacityToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.window_opacity;
this.fullOpacityToolStripMenuItem.Name = "fullOpacityToolStripMenuItem";
this.fullOpacityToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
this.fullOpacityToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuOpacity;
//
// danskToolStripMenuItem
//
this.danskToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.flag_danish;
@ -473,12 +476,13 @@
this.enableClickthroughToolStripMenuItem,
this.fullExitToolStripMenuItem});
this.menuFullscreenContext.Name = "menuFullscreenContext";
this.menuFullscreenContext.Size = new System.Drawing.Size(187, 114);
this.menuFullscreenContext.Size = new System.Drawing.Size(190, 92);
//
// enableClickthroughToolStripMenuItem
//
this.enableClickthroughToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.clickforwarding;
this.enableClickthroughToolStripMenuItem.Name = "enableClickthroughToolStripMenuItem";
this.enableClickthroughToolStripMenuItem.Size = new System.Drawing.Size(186, 22);
this.enableClickthroughToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
this.enableClickthroughToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuClickThrough;
this.enableClickthroughToolStripMenuItem.ToolTipText = global::OnTopReplica.Strings.MenuClickThroughTT;
this.enableClickthroughToolStripMenuItem.Click += new System.EventHandler(this.Menu_ClickThrough_click);
@ -487,7 +491,7 @@
//
this.fullExitToolStripMenuItem.Image = global::OnTopReplica.Properties.Resources.close_new;
this.fullExitToolStripMenuItem.Name = "fullExitToolStripMenuItem";
this.fullExitToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.fullExitToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
this.fullExitToolStripMenuItem.Text = global::OnTopReplica.Strings.MenuQuitFullscreen;
this.fullExitToolStripMenuItem.Click += new System.EventHandler(this.Menu_Fullscreen_ExitFullscreen_click);
//

View file

@ -152,7 +152,7 @@ namespace OnTopReplica {
protected override void OnMouseClick(MouseEventArgs e) {
base.OnMouseClick(e);
//Same story as above...
//Same story as above (OnMouseDoubleClick)
if (e.Button == System.Windows.Forms.MouseButtons.Right) {
OpenContextMenu();
}
@ -393,6 +393,30 @@ namespace OnTopReplica {
_thumbnailPanel.ConstrainToRegion = false;
SetAspectRatio(_thumbnailPanel.ThumbnailOriginalSize, true);
}
FixPositionAndSize();
}
}
const int FixMargin = 10;
/// <summary>
/// Fixes the form's position and size, ensuring it is fully displayed in the current screen.
/// </summary>
private void FixPositionAndSize() {
var screen = Screen.FromControl(this);
if (Width > screen.WorkingArea.Width) {
Width = screen.WorkingArea.Width - FixMargin;
}
if (Height > screen.WorkingArea.Height) {
Height = screen.WorkingArea.Height - FixMargin;
}
if (Location.X + Width > screen.WorkingArea.Right) {
Location = new Point(screen.WorkingArea.Right - Width - FixMargin, Location.Y);
}
if (Location.Y + Height > screen.WorkingArea.Bottom) {
Location = new Point(Location.X, screen.WorkingArea.Bottom - Height - FixMargin);
}
}

View file

@ -10,10 +10,6 @@ namespace OnTopReplica {
EventHandler RequestClosingHandler;
const int SidePanelMargin = 1;
const int ScreenBorderMargin = 10;
bool _sidePanelDidMoveForm = false;
Point _sidePanelPreviousFormLocation;
/// <summary>
/// Opens a new side panel.
@ -63,17 +59,7 @@ namespace OnTopReplica {
);
//Move window if needed
var screenCurr = Screen.FromControl(this);
int pRight = Location.X + Width + ScreenBorderMargin;
if (pRight >= screenCurr.Bounds.Width) {
_sidePanelPreviousFormLocation = Location;
_sidePanelDidMoveForm = true;
Location = new Point(screenCurr.WorkingArea.Width - Width - ScreenBorderMargin, Location.Y);
}
else {
_sidePanelDidMoveForm = false;
}
FixPositionAndSize();
//Hook event listener
if (RequestClosingHandler == null)
@ -105,12 +91,6 @@ namespace OnTopReplica {
);
ExtraPadding = new Padding(0);
_thumbnailPanel.Size = ClientSize;
//Move window back if needed
if (_sidePanelDidMoveForm) {
Location = _sidePanelPreviousFormLocation;
_sidePanelDidMoveForm = false;
}
}
void SidePanel_RequestClosing(object sender, EventArgs e) {

View file

@ -299,6 +299,11 @@
<None Include="Assets\reduce.png" />
</ItemGroup>
<ItemGroup>
<None Include="Assets\fullscreen.png" />
<None Include="Assets\clickforwarding.png" />
<None Include="Assets\groupmode.png" />
<Content Include="Assets\xiao_arrow.png" />
<None Include="Assets\xiao_help.png" />
<None Include="Assets\window_opacity_new.png" />
<None Include="Assets\xiao_wrench.png" />
<None Include="Assets\xiao_delete.png" />

View file

@ -67,6 +67,13 @@ namespace OnTopReplica.Properties {
}
}
internal static System.Drawing.Bitmap clickforwarding {
get {
object obj = ResourceManager.GetObject("clickforwarding", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap close_new {
get {
object obj = ResourceManager.GetObject("close_new", resourceCulture);
@ -109,6 +116,20 @@ namespace OnTopReplica.Properties {
}
}
internal static System.Drawing.Bitmap fullscreen {
get {
object obj = ResourceManager.GetObject("fullscreen", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap groupmode {
get {
object obj = ResourceManager.GetObject("groupmode", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap icon {
get {
object obj = ResourceManager.GetObject("icon", resourceCulture);
@ -235,6 +256,13 @@ namespace OnTopReplica.Properties {
}
}
internal static System.Drawing.Bitmap xiao_arrow {
get {
object obj = ResourceManager.GetObject("xiao_arrow", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap xiao_component {
get {
object obj = ResourceManager.GetObject("xiao_component", resourceCulture);
@ -256,6 +284,13 @@ namespace OnTopReplica.Properties {
}
}
internal static System.Drawing.Bitmap xiao_help {
get {
object obj = ResourceManager.GetObject("xiao_help", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap xiao_ok {
get {
object obj = ResourceManager.GetObject("xiao_ok", resourceCulture);

View file

@ -121,11 +121,14 @@
<data name="flag_ita" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\flag_ita.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="xiao_add" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\xiao_add.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="close_new" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\x-oblique.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pos_topright" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\pos_topright.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="xiao_component" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\component.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="refresh" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\25.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -133,9 +136,18 @@
<data name="window_multiple16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\window_multiple16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="xiao_delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\xiao_delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="regions" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\regions_new.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pos_null" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\pos_null.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="window_opacity" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\window_opacity_new.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="thumbs_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\thumbs_up.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -145,6 +157,18 @@
<data name="pos_bottomleft" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\pos_bottomleft.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pos_topright" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\pos_topright.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="clickforwarding" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\clickforwarding.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\newicon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="xiao_help" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\xiao_help.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="back" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\back.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -163,6 +187,9 @@
<data name="window_switch" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\window_switch.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="desktop" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\desktop.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="flag_danish" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\flag_danish.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -172,44 +199,32 @@
<data name="xiao_ok" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\xiao_ok.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="xiao_component" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\component.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="xiao_wrench" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\xiao_wrench.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="list" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\list.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icon_new" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\icon-new.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="fullscreen" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\fullscreen.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="xiao_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\xiao_down.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="xiao_arrow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\xiao_arrow.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="window_border16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\window_border16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="flag_usa" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\flag_usa.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="xiao_add" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\xiao_add.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="xiao_delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\xiao_delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="xiao_wrench" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\xiao_wrench.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\newicon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="window_opacity" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\window_opacity_new.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="desktop" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\desktop.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="regions" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\regions_new.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="list" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\list.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="icon_new" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\icon-new.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="groupmode" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Assets\groupmode.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -15,8 +15,12 @@ namespace OnTopReplica.SidePanels {
comboRegions.Items.Add(o);
}
}
_regionDrawnHandler = new ThumbnailPanel.RegionDrawnHandler(ThumbnailPanel_RegionDrawn);
}
ThumbnailPanel.RegionDrawnHandler _regionDrawnHandler;
public override void OnFirstShown(MainForm form) {
base.OnFirstShown(form);
@ -25,13 +29,14 @@ namespace OnTopReplica.SidePanels {
SetRegion(form.SelectedThumbnailRegion.Value);
form.ThumbnailPanel.DrawMouseRegions = true;
form.ThumbnailPanel.RegionDrawn += new ThumbnailPanel.RegionDrawnHandler(ThumbnailPanel_RegionDrawn);
form.ThumbnailPanel.RegionDrawn += _regionDrawnHandler;
}
public override void OnClosing(MainForm form) {
base.OnClosing(form);
form.ThumbnailPanel.DrawMouseRegions = false;
form.ThumbnailPanel.RegionDrawn -= _regionDrawnHandler;
}
void ThumbnailPanel_RegionDrawn(object sender, Rectangle region) {