Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13567


Ignore:
Timestamp:
01/25/16 17:58:07 (9 years ago)
Author:
mkommend
Message:

#2567: Implemented saving and restoring the window position, size and state of the optimizer.

Location:
trunk/sources/HeuristicLab.Optimizer/3.3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLab.Optimizer-3.3.csproj

    r13228 r13567  
    224224  </ItemGroup>
    225225  <ItemGroup>
    226     <None Include="app.config" />
     226    <None Include="app.config">
     227      <SubType>Designer</SubType>
     228    </None>
    227229    <EmbeddedResource Include="Documents\FirstSteps.rtf" />
    228230    <None Include="HeuristicLab.snk" />
  • trunk/sources/HeuristicLab.Optimizer/3.3/Plugin.cs.frame

    r13321 r13567  
    6060      }
    6161
    62       if (mainForm != null) {
     62      if (mainForm != null) {     
     63        mainForm.Location = Settings.Default.MainFormLocation;
     64        mainForm.Size = Settings.Default.MainFormSize;
     65        mainForm.Load += (sender, eventArgs) => {
     66          mainForm.WindowState = Settings.Default.MainFormWindowState;
     67        };
     68
     69        mainForm.FormClosing += (sender, eventArgs) => {
     70          Settings.Default.MainFormWindowState = mainForm.WindowState;
     71          if (mainForm.WindowState != FormWindowState.Normal) {
     72            Settings.Default.MainFormLocation = mainForm.RestoreBounds.Location;
     73            Settings.Default.MainFormSize = mainForm.RestoreBounds.Size;
     74          } else if (mainForm.WindowState == FormWindowState.Normal) {
     75            Settings.Default.MainFormLocation = mainForm.Location;
     76            Settings.Default.MainFormSize = mainForm.Size;
     77          }
     78        };
     79
     80
    6381        ClientInformation.InitializeAsync();
    6482        UserInformation.InitializeAsync();
  • trunk/sources/HeuristicLab.Optimizer/3.3/Properties/Settings.Designer.cs

    r11623 r13567  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:4.0.30319.34014
     4//     Runtime Version:4.0.30319.34209
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
     
    107107            }
    108108        }
     109       
     110        [global::System.Configuration.UserScopedSettingAttribute()]
     111        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     112        [global::System.Configuration.DefaultSettingValueAttribute("0, 0")]
     113        public global::System.Drawing.Point MainFormLocation {
     114            get {
     115                return ((global::System.Drawing.Point)(this["MainFormLocation"]));
     116            }
     117            set {
     118                this["MainFormLocation"] = value;
     119            }
     120        }
     121       
     122        [global::System.Configuration.UserScopedSettingAttribute()]
     123        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     124        [global::System.Configuration.DefaultSettingValueAttribute("0, 0")]
     125        public global::System.Drawing.Size MainFormSize {
     126            get {
     127                return ((global::System.Drawing.Size)(this["MainFormSize"]));
     128            }
     129            set {
     130                this["MainFormSize"] = value;
     131            }
     132        }
     133       
     134        [global::System.Configuration.UserScopedSettingAttribute()]
     135        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     136        [global::System.Configuration.DefaultSettingValueAttribute("Normal")]
     137        public global::System.Windows.Forms.FormWindowState MainFormWindowState {
     138            get {
     139                return ((global::System.Windows.Forms.FormWindowState)(this["MainFormWindowState"]));
     140            }
     141            set {
     142                this["MainFormWindowState"] = value;
     143            }
     144        }
    109145    }
    110146}
  • trunk/sources/HeuristicLab.Optimizer/3.3/Properties/Settings.settings

    r6827 r13567  
    2424      <Value Profile="(Default)">DockingMainForm</Value>
    2525    </Setting>
     26    <Setting Name="MainFormLocation" Type="System.Drawing.Point" Scope="User">
     27      <Value Profile="(Default)">0, 0</Value>
     28    </Setting>
     29    <Setting Name="MainFormSize" Type="System.Drawing.Size" Scope="User">
     30      <Value Profile="(Default)">0, 0</Value>
     31    </Setting>
     32    <Setting Name="MainFormWindowState" Type="System.Windows.Forms.FormWindowState" Scope="User">
     33      <Value Profile="(Default)">Normal</Value>
     34    </Setting>
    2635  </Settings>
    2736</SettingsFile>
  • trunk/sources/HeuristicLab.Optimizer/3.3/app.config

    r11623 r13567  
    2929                <value>DockingMainForm</value>
    3030            </setting>
     31            <setting name="MainFormLocation" serializeAs="String">
     32                <value>0, 0</value>
     33            </setting>
     34            <setting name="MainFormSize" serializeAs="String">
     35                <value>0, 0</value>
     36            </setting>
     37            <setting name="MainFormWindowState" serializeAs="String">
     38                <value>Normal</value>
     39            </setting>
    3140        </HeuristicLab.Optimizer.Properties.Settings>
    3241    </userSettings>
Note: See TracChangeset for help on using the changeset viewer.