kopia lustrzana https://github.com/njcrawford/EmbroideryReader
Added save and restore window size functionality
rodzic
953b6ebce8
commit
01d6b67e82
|
@ -33,7 +33,7 @@ namespace embroideryReader
|
||||||
{
|
{
|
||||||
private NJCrawford.IniFile settings;
|
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 SETTING_UPDATE_LOCATION = "update location";
|
||||||
|
|
||||||
private const String SECTION_BACKGROUND_COLOR = "background color";
|
private const String SECTION_BACKGROUND_COLOR = "background color";
|
||||||
|
@ -51,6 +51,9 @@ namespace embroideryReader
|
||||||
|
|
||||||
private const String SETTING_LAST_SAVE_IMAGE_LOCATION = "last save image location";
|
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_YES = "yes";
|
||||||
private const String VALUE_NO = "no";
|
private const String VALUE_NO = "no";
|
||||||
|
|
||||||
|
@ -279,5 +282,29 @@ namespace embroideryReader
|
||||||
settings.setValue(SETTING_LAST_SAVE_IMAGE_LOCATION, value);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,8 @@ namespace embroideryReader
|
||||||
private void checkSettings()
|
private void checkSettings()
|
||||||
{
|
{
|
||||||
this.BackColor = settings.backgroundColor;
|
this.BackColor = settings.backgroundColor;
|
||||||
|
this.Width = settings.windowWidth;
|
||||||
|
this.Height = settings.windowHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Form1_Load(object sender, EventArgs e)
|
private void Form1_Load(object sender, EventArgs e)
|
||||||
|
@ -242,6 +244,8 @@ namespace embroideryReader
|
||||||
|
|
||||||
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
|
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
{
|
{
|
||||||
|
settings.windowWidth = this.Width;
|
||||||
|
settings.windowHeight = this.Height;
|
||||||
settings.save();
|
settings.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue