Skip to content

Commit

Permalink
remember last used window size for pixel window
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbradsmith committed Oct 13, 2024
1 parent ad3d483 commit 4d60f3c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
21 changes: 21 additions & 0 deletions BinxelviewForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,22 @@ string parseOption(string optline, string base_path, bool ini_file)
split_view = (v != 0);
return "";
}
if (opt == "SPLITVIEWW")
{
int v;
if (!int.TryParse(val,out v)) return "Could not parse integer for splitvieww: "+val;
if (v <= 0) return "Splitvieww value must be positive: "+val;
split_view_form.Width = v;
return "";
}
if (opt == "SPLITVIEWH")
{
int v;
if (!int.TryParse(val,out v)) return "Could not parse integer for splitviewh: "+val;
if (v <= 0) return "Splitviewh value must be positive: "+val;
split_view_form.Height = v;
return "";
}
if (opt == "HORIZONTAL")
{
int v;
Expand Down Expand Up @@ -579,6 +595,11 @@ string saveIni(string path)
sw.WriteLine(string.Format("hexpos={0}",decimal_position ? 0 : 1));
sw.WriteLine(string.Format("snapscroll={0}",snap_scroll ? 1 : 0));
sw.WriteLine(string.Format("splitview={0}",split_view ? 1 : 0));
if (split_view) // save split_view window size if active
{
sw.WriteLine(string.Format("splitvieww={0}",split_view_form.Width));
sw.WriteLine(string.Format("splitviewh={0}",split_view_form.Height));
}
sw.WriteLine(string.Format("horizontal={0}",horizontal_layout ? 1 : 0));
sw.WriteLine(string.Format("twiddle={0}",twiddle));
sw.WriteLine("# end");
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ For an INI file, paths can be either absolute or relative to the INI file's dire
-splitview=1
Set the "Pixel Window" option to create a separate viewing window (1 on, 0 off).

-splitvieww=640
-splitviewh=480
Set the Pixel Window's width and height.

-horizontal=1
Set the layout option (1 horizontal, 0 vertical).

Expand Down

0 comments on commit 4d60f3c

Please sign in to comment.