Added save and restore window size functionality

Branch_1.5.0
Nathan Crawford 2010-07-09 13:49:29 +00:00
rodzic 953b6ebce8
commit 01d6b67e82
2 zmienionych plików z 32 dodań i 1 usunięć

Wyświetl plik

@ -33,7 +33,7 @@ namespace embroideryReader
{
private NJCrawford.IniFile settings;
// obsolete, but leaving here for historical purposes
// update location is obsolete, but leaving here for historical purposes
private const String SETTING_UPDATE_LOCATION = "update location";
private const String SECTION_BACKGROUND_COLOR = "background color";
@ -50,6 +50,9 @@ namespace embroideryReader
private const String SETTING_LAST_OPEN_FILE_FOLDER = "last open file folder";
private const String SETTING_LAST_SAVE_IMAGE_LOCATION = "last save image location";
private const String SETTING_WINDOW_WIDTH = "window width";
private const String SETTING_WINDOW_HEIGHT = "window height";
private const String VALUE_YES = "yes";
private const String VALUE_NO = "no";
@ -279,5 +282,29 @@ namespace embroideryReader
settings.setValue(SETTING_LAST_SAVE_IMAGE_LOCATION, value);
}
}
public int windowWidth
{
get
{
return settings.getValue(SETTING_WINDOW_WIDTH);
}
set
{
settings.setValue(SETTING_WINDOW_WIDTH, value);
}
}
public int windowHeight
{
get
{
return settings.getValue(SETTING_WINDOW_HEIGHT);
}
set
{
settings.setValue(SETTING_WINDOW_HEIGHT, value);
}
}
}
}

Wyświetl plik

@ -55,6 +55,8 @@ namespace embroideryReader
private void checkSettings()
{
this.BackColor = settings.backgroundColor;
this.Width = settings.windowWidth;
this.Height = settings.windowHeight;
}
private void Form1_Load(object sender, EventArgs e)
@ -242,6 +244,8 @@ namespace embroideryReader
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
settings.windowWidth = this.Width;
settings.windowHeight = this.Height;
settings.save();
}