Skip to content

Commit b84aab6

Browse files
committed
FLTK: fix startup size in run mode
1 parent 61ff5ce commit b84aab6

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

src/platform/fltk/Profile.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515

1616
const char *configFile = "config.txt";
1717
const char *pathKey = "path";
18-
const char *indentLevelKey = "_indentLevel";
18+
const char *indentLevelKey = "indentLevel";
1919
const char *fontNameKey = "fontName";
20-
const char *fontSizeKey = "_fontSize";
20+
const char *fontSizeKey = "fontSize";
2121
const char *windowPosKey = "windowPos";
2222
const char *activeTabKey = "activeTab";
23-
const char *createBackupsKey = "_createBackups";
24-
const char *lineNumbersKey = "_lineNumbers";
25-
const char *appPositionKey = "_appPosition";
23+
const char *createBackupsKey = "createBackups";
24+
const char *lineNumbersKey = "lineNumbers";
25+
const char *appPositionKey = "appPosition";
2626

2727
// in BasicEditor.cxx
2828
extern TextDisplay::StyleTableEntry styletable[];

src/platform/fltk/dev_fltk.cxx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,12 @@ int osd_devinit() {
8383
int w = opt_pref_width + delta_x;
8484
int h = opt_pref_height + delta_y;
8585
wnd->_outputGroup->resize(w, h);
86-
wnd->_out->resize(w, h);
86+
wnd->_out->setStartSize(w, h);
8787
}
8888
// show the output-group in case it's the full-screen container. a possible
8989
// bug with fltk on x11 prevents resize after the window has been shown
9090
if (wnd->isInteractive() && !wnd->logPrint()) {
91-
int w = wnd->_out->w();
92-
int h = wnd->_out->h();
9391
wnd->_outputGroup->show();
94-
wnd->_out->resize(w, h);
9592
}
9693

9794
dev_fgcolor = -DEFAULT_FOREGROUND;

src/platform/fltk/display.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ DisplayWidget::DisplayWidget(int x, int y, int w, int h, int defsize) :
218218
_ansiWidget(NULL),
219219
_screen(NULL),
220220
_resized(false),
221-
_defsize(defsize) {
221+
_defsize(defsize),
222+
_startW(-1),
223+
_startH(-1) {
222224
drawColorRaw = DEFAULT_BACKGROUND;
223225
drawColor = maSetColor(drawColorRaw);
224226
widget = this;
@@ -231,6 +233,9 @@ DisplayWidget::~DisplayWidget() {
231233

232234
void DisplayWidget::createScreen() {
233235
if (!_screen) {
236+
if (_startW != -1 && _startH != -1) {
237+
resize(_startW, _startH);
238+
}
234239
_screen = new Canvas(_defsize);
235240
_screen->create(w(), h());
236241
_screen->_isScreen = true;

src/platform/fltk/display.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class DisplayWidget : public fltk::Widget, IButtonListener {
6060
int getY();
6161
void setPixel(int x, int y, int c);
6262
void setXY(int x, int y);
63+
void setStartSize(int w, int h) { _startW=w; _startH=h; }
6364
int textWidth(const char *s);
6465
int textHeight(void);
6566
void setFontSize(float i);
@@ -83,6 +84,7 @@ class DisplayWidget : public fltk::Widget, IButtonListener {
8384
Canvas *_screen;
8485
bool _resized;
8586
int _defsize;
87+
int _startW, _startH;
8688
};
8789

8890
#endif

src/platform/fltk/sbasic.nsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@
3838
;--------------------------------
3939
;Installer Sections
4040

41+
RequestExecutionLevel admin
42+
4143
; Optional section (can be disabled by the user)
4244
Section "Start Menu Shortcut"
45+
SetShellVarContext all
4346
CreateDirectory "$SMPROGRAMS\SmallBASIC 0.11.5"
4447
SetOutPath $INSTDIR
4548
CreateShortCut "$SMPROGRAMS\SmallBASIC 0.11.5\SmallBASIC.lnk" "$INSTDIR\sbasici.exe"
@@ -103,6 +106,7 @@ SectionEnd
103106
;Uninstaller Section
104107

105108
Section "Uninstall"
109+
SetShellVarContext all
106110
; Remove registry keys
107111
DeleteRegKey /ifempty HKCU "Software\SmallBASIC\FLTK_0.11.5"
108112

0 commit comments

Comments
 (0)