mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Removed some unused code, and fixed a Editor-reuse issue. (No focus, and resize issues)
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2106 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
336518f5f9
commit
f7782299cd
7 changed files with 105 additions and 96 deletions
|
@ -108,6 +108,9 @@ namespace Greenshot {
|
|||
hideToolstripItems();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove the current surface
|
||||
/// </summary>
|
||||
private void RemoveSurface() {
|
||||
if (surface != null) {
|
||||
panel1.Controls.Remove(surface as Control);
|
||||
|
@ -116,6 +119,10 @@ namespace Greenshot {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Change the surface
|
||||
/// </summary>
|
||||
/// <param name="newSurface"></param>
|
||||
private void SetSurface(ISurface newSurface) {
|
||||
if (this.Surface != null && this.Surface.Modified) {
|
||||
throw new ApplicationException("Surface modified");
|
||||
|
@ -123,6 +130,8 @@ namespace Greenshot {
|
|||
|
||||
RemoveSurface();
|
||||
|
||||
panel1.Height = 10;
|
||||
panel1.Width = 10;
|
||||
this.surface = newSurface as Surface;
|
||||
panel1.Controls.Add(surface as Surface);
|
||||
Image backgroundForTransparency = GreenshotPlugin.Core.GreenshotResources.getImage("Checkerboard.Image");
|
||||
|
@ -135,7 +144,6 @@ namespace Greenshot {
|
|||
surface.SurfaceSizeChanged += new SurfaceSizeChangeEventHandler(SurfaceSizeChanged);
|
||||
surface.SurfaceMessage += new SurfaceMessageEventHandler(SurfaceMessageReceived);
|
||||
surface.FieldAggregator.FieldChanged += new FieldChangedEventHandler(FieldAggregatorFieldChanged);
|
||||
|
||||
SurfaceSizeChanged(this.Surface);
|
||||
|
||||
bindFieldControls();
|
||||
|
@ -144,6 +152,7 @@ namespace Greenshot {
|
|||
if (surface != null && surface.CaptureDetails != null && surface.CaptureDetails.Title != null) {
|
||||
this.Text = surface.CaptureDetails.Title + " - " + Language.GetString(LangKey.editor_title);
|
||||
}
|
||||
WindowDetails.ToForeground(this.Handle);
|
||||
}
|
||||
|
||||
private void updateUI() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue