mirror of
https://github.com/fadden/6502bench.git
synced 2024-10-10 04:23:44 +00:00
Make project properties window resizable
Useful for the project symbols tab. The size is retained for the current session, but resets when the program exits.
This commit is contained in:
parent
b7d771a3b2
commit
1e7a6620e0
@ -23,7 +23,7 @@ limitations under the License.
|
|||||||
xmlns:local="clr-namespace:SourceGen.WpfGui"
|
xmlns:local="clr-namespace:SourceGen.WpfGui"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Edit Project Properties"
|
Title="Edit Project Properties"
|
||||||
Width="640" Height="400" ResizeMode="NoResize"
|
Width="640" Height="400" MinWidth="640" MinHeight="400" ResizeMode="CanResizeWithGrip"
|
||||||
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
|
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
|
||||||
Loaded="Window_Loaded" Closing="Window_Closing">
|
Loaded="Window_Loaded" Closing="Window_Closing">
|
||||||
|
|
||||||
|
@ -40,6 +40,9 @@ namespace SourceGen.WpfGui {
|
|||||||
public partial class EditProjectProperties : Window, INotifyPropertyChanged {
|
public partial class EditProjectProperties : Window, INotifyPropertyChanged {
|
||||||
private const string NO_WIDTH_STR = "-";
|
private const string NO_WIDTH_STR = "-";
|
||||||
|
|
||||||
|
private static double sWindowWidth = -1;
|
||||||
|
private static double sWindowHeight = -1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// New set. Updated when Apply or OK is hit. This will be null if no changes have
|
/// New set. Updated when Apply or OK is hit. This will be null if no changes have
|
||||||
/// been applied.
|
/// been applied.
|
||||||
@ -65,10 +68,7 @@ namespace SourceGen.WpfGui {
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsDirty {
|
public bool IsDirty {
|
||||||
get { return mIsDirty; }
|
get { return mIsDirty; }
|
||||||
set {
|
set { mIsDirty = value; OnPropertyChanged(); }
|
||||||
mIsDirty = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private bool mIsDirty;
|
private bool mIsDirty;
|
||||||
|
|
||||||
@ -161,6 +161,17 @@ namespace SourceGen.WpfGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e) {
|
private void Window_Loaded(object sender, RoutedEventArgs e) {
|
||||||
|
// Configure window size. Initially we set it to MinWidth/MinHeight. On subsequent
|
||||||
|
// visits we set it to the size it was the last time.
|
||||||
|
if (sWindowWidth < 0) {
|
||||||
|
sWindowWidth = Width = MinWidth;
|
||||||
|
sWindowHeight = Height = MinHeight;
|
||||||
|
} else {
|
||||||
|
Width = sWindowWidth;
|
||||||
|
Height = sWindowHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Configure controls and clear IsDirty.
|
||||||
Loaded_General();
|
Loaded_General();
|
||||||
|
|
||||||
LoadProjectSymbols();
|
LoadProjectSymbols();
|
||||||
@ -200,6 +211,9 @@ namespace SourceGen.WpfGui {
|
|||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sWindowWidth = Width;
|
||||||
|
sWindowHeight = Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ApplyButton_Click(object sender, RoutedEventArgs e) {
|
private void ApplyButton_Click(object sender, RoutedEventArgs e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user