Skip to content

Commit ace4751

Browse files
committed
Add settings property to start window maximized
1 parent e6a492c commit ace4751

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

Bender.bmx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Global g_GraphicsOutput:GraphicsOutput = Null
2626

2727
Repeat
2828
g_SettingsManager = New SettingsManager()
29-
g_UserInterface = New UserInterface()
29+
g_UserInterface = New UserInterface(g_DefaultMaximizeWindow)
3030
g_FileIO = New FileIO()
3131
g_GraphicsOutput = New GraphicsOutput(g_UserInterface.GetMaxWorkspaceWidth())
3232
EnablePolledInput()

Types/SettingsManager.bmx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Import "Utility.bmx"
22

33
'//// SETTINGS MANAGER //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
44

5+
Global g_DefaultMaximizeWindow:Int = False
56
Global g_DefaultBackgroundRed:Int = 50
67
Global g_DefaultBackgroundGreen:Int = 170
78
Global g_DefaultBackgroundBlue:Int = 255
@@ -42,6 +43,8 @@ Type SettingsManager
4243
propAndValue[1] = propAndValue[1].Trim()
4344

4445
Select propAndValue[0]
46+
Case "StartMaximizedWindow"
47+
g_DefaultMaximizeWindow = Utility.Clamp(propAndValue[1].ToInt(), False, True)
4548
Case "BackgroundRed"
4649
g_DefaultBackgroundRed = Utility.Clamp(propAndValue[1].ToInt(), 0, 255)
4750
Case "BackgroundGreen"
@@ -76,6 +79,7 @@ Type SettingsManager
7679
Method WriteSettingsFile(propertyValues:String[])
7780
Local outputString:TStringBuilder = New TStringBuilder("// User Settings~n~n")
7881

82+
outputString.Append("StartMaximizedWindow = " + g_DefaultMaximizeWindow + "~n")
7983
outputString.Append("BackgroundRed = " + propertyValues[0] + "~n")
8084
outputString.Append("BackgroundGreen = " + propertyValues[1] + "~n")
8185
outputString.Append("BackgroundBlue = " + propertyValues[2] + "~n")

Types/UserInterface.bmx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,12 @@ Type UserInterface
7878

7979
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
8080

81-
Method New()
81+
Method New(startMaximized:Int)
8282
InitializeUserInterface()
8383
InitializeCanvasGraphics()
84+
If startMaximized Then
85+
MaximizeWindow(m_MainWindow)
86+
EndIf
8487
EndMethod
8588

8689
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)