Skip to content

Commit

Permalink
* options for auto-size
Browse files Browse the repository at this point in the history
   behavior of window
  • Loading branch information
festo-i40 committed Aug 29, 2024
1 parent 6a93d57 commit 2ca1bd6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
14 changes: 11 additions & 3 deletions src/AasxPackageExplorer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2939,12 +2939,20 @@ private void Window_Closing(object sender, CancelEventArgs e)

private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
{
if (this.ActualWidth > 800)
if (this.ActualWidth > 1)
{
if (MainSpaceGrid != null && MainSpaceGrid.ColumnDefinitions.Count >= 3)
{
MainSpaceGrid.ColumnDefinitions[0].Width = new GridLength(this.ActualWidth / 5);
MainSpaceGrid.ColumnDefinitions[4].Width = new GridLength(this.ActualWidth / 2.5);
var w0 = 0.2;
if (Options.Curr.PercentageLeftColumn >= 0 && Options.Curr.PercentageLeftColumn <= 100.0)
w0 = Options.Curr.PercentageLeftColumn / 100.0;

var w4 = 0.4;
if (Options.Curr.PercentageRightColumn >= 0 && Options.Curr.PercentageRightColumn <= 100.0)
w4 = Options.Curr.PercentageRightColumn / 100.0;

MainSpaceGrid.ColumnDefinitions[0].Width = new GridLength(this.ActualWidth * w0);
MainSpaceGrid.ColumnDefinitions[4].Width = new GridLength(this.ActualWidth * w4);
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/AasxPackageExplorer/debug.MIHO.script
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
Tool("editkey");
Select("Submodel", "First");
Select("Submodel", "Next");
Select("SME", "First");
Tool("aas-elem-copy");
Tool("aas-elem-paste-below");
Sleep(1000);
x = Select("This");
WriteLine("##RESULT#1##", x.IdShort);
Tool("aas-elem-delete");
// Select("SME", "First");
// Tool("aas-elem-copy");
// Tool("aas-elem-paste-below");
// Sleep(1000);
// x = Select("This");
// WriteLine("##RESULT#1##", x.IdShort);
// Tool("aas-elem-delete");
// Tool("sammaspectimport", "File", "C:\\HOMI\\Develop\\Aasx\\repo\\samm-test\\Aspect_Example_SML_MLP.ttl");
// Tool("exportpredefineconcepts", "File", "C:\HOMI\Develop\Aasx\repo\aid\new.txt");
// Tool("submodelinstancefromsmtconcepts");
Expand Down
2 changes: 2 additions & 0 deletions src/AasxPackageExplorer/options-debug.MIHO.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
"ContentHome": "https://github.com/admin-shell/io/blob/master/README.md",
"UseFlyovers": true,
"SplashTime": 0,
"PercentageLeftColumn": 12,
"PercentageRightColumn": 60,
"InternalBrowser": false,
"EclassTwoPass": true,
"BackupDir": ".\\backup",
Expand Down
10 changes: 10 additions & 0 deletions src/AasxPackageLogic/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,16 @@ public class OptionsInformation
Cmd = "-splash", Arg = "<milli-secs>")]
public int SplashTime = -1;

[OptionDescription(Description = "Fraction of main window with dedicated to left column of screen " +
"when resizing window.",
Cmd = "-percentage-left-col", Arg = "Percent 0-100.0")]
public double PercentageLeftColumn = 20.0;

[OptionDescription(Description = "Fraction of main window with dedicated to right column of screen " +
"(content section) when resizing window.",
Cmd = "-percentage-right-col", Arg = "Percent 0-100.0")]
public double PercentageRightColumn = 40.0;

[OptionDescription(Description = "If true, use always internal browser",
Cmd = "-intbrowse")]
public bool InternalBrowser = false;
Expand Down

0 comments on commit 2ca1bd6

Please sign in to comment.