@@ -308,6 +308,13 @@ FUNCTION ide2 (ignore)
308
308
menuDesc$(m, i - 1) = "Sets string returned by COMMAND$ function"
309
309
menu$(m, i) = "-": i = i + 1
310
310
311
+ LoggingEnableMenu = i
312
+ menu$(m, i) = "Display #Logging Output": i = i + 1
313
+ menuDesc$(m, i - 1) = "Turns on logging output and displays it in a console window"
314
+ IF LoggingEnabled THEN
315
+ menu$(RunMenuID, LoggingEnableMenu) = CHR$(7) + menu$(RunMenuID, LoggingEnableMenu)
316
+ END IF
317
+
311
318
RunMenuSaveExeWithSource = i
312
319
menu$(m, i) = "Output EXE to Source #Folder": i = i + 1
313
320
menuDesc$(m, i - 1) = "Toggles compiling program to QB64-PE's folder or to source folder"
@@ -320,6 +327,10 @@ FUNCTION ide2 (ignore)
320
327
IF GenerateLicenseFile THEN
321
328
menu$(RunMenuID, GenerateLicenseEnableMenu) = CHR$(7) + menu$(RunMenuID, GenerateLicenseEnableMenu)
322
329
END IF
330
+ IF os$ = "LNX" AND MacOSX = 0 THEN
331
+ menu$(m, i) = "Change #Terminal": i = i + 1
332
+ menuDesc$(m, i - 1) = "Configure the terminal used for $CONSOLE and logging output"
333
+ END IF
323
334
menu$(m, i) = "-": i = i + 1
324
335
325
336
IF os$ = "LNX" THEN
@@ -5177,6 +5188,21 @@ FUNCTION ide2 (ignore)
5177
5188
5178
5189
5179
5190
5191
+ IF MID$(menu$(m, s), 1) = "Display #Logging Output" OR MID$(menu$(m, s), 2) = "Display #Logging Output" THEN
5192
+ PCOPY 2, 0
5193
+ LoggingEnabled = NOT LoggingEnabled
5194
+ WriteConfigSetting generalSettingsSection$, "LoggingEnabled", BoolToTFString$(LoggingEnabled)
5195
+
5196
+ IF LoggingEnabled THEN
5197
+ menu$(RunMenuID, LoggingEnableMenu) = CHR$(7) + "Display #Logging Output"
5198
+ ELSE
5199
+ menu$(RunMenuID, LoggingEnableMenu) = "Display #Logging Output"
5200
+ END IF
5201
+
5202
+ PCOPY 3, 0: SCREEN , , 3, 0
5203
+ GOTO ideloop
5204
+ END IF
5205
+
5180
5206
IF RIGHT$(menu$(m, s), 28) = "Output EXE to Source #Folder" THEN
5181
5207
PCOPY 2, 0
5182
5208
SaveExeWithSource = NOT SaveExeWithSource
@@ -5207,6 +5233,17 @@ FUNCTION ide2 (ignore)
5207
5233
GOTO ideloop
5208
5234
END IF
5209
5235
5236
+ IF menu$(m, s) = "Change #Terminal" THEN
5237
+ PCOPY 2, 0
5238
+
5239
+ ideTerminalBox
5240
+
5241
+ 'retval is ignored
5242
+ PCOPY 3, 0: SCREEN , , 3, 0
5243
+ GOTO ideloop
5244
+ END IF
5245
+
5246
+
5210
5247
IF RIGHT$(menu$(m, s), 29) = "#Output Watch List to Console" THEN
5211
5248
PCOPY 2, 0
5212
5249
WatchListToConsole = NOT WatchListToConsole
@@ -15785,6 +15822,150 @@ FUNCTION ideCompilerSettingsBox
15785
15822
LOOP
15786
15823
END FUNCTION
15787
15824
15825
+ SUB ideTerminalBox
15826
+
15827
+ '-------- generic dialog box header --------
15828
+ PCOPY 0, 2
15829
+ PCOPY 0, 1
15830
+ SCREEN , , 1, 0
15831
+ focus = 1
15832
+ DIM p AS idedbptype
15833
+ DIM o(1 TO 100) AS idedbotype
15834
+ DIM sep AS STRING * 1
15835
+ sep = CHR$(0)
15836
+ '-------- end of generic dialog box header --------
15837
+
15838
+ '-------- init --------
15839
+
15840
+ i = 0
15841
+
15842
+ idepar p, 60, 7, "Default Terminal"
15843
+
15844
+ i = i + 1
15845
+ PrevFocus = 1
15846
+ o(i).typ = 1
15847
+ o(i).y = 2
15848
+ o(i).nam = idenewtxt("Terminal Command")
15849
+ o(i).txt = idenewtxt(DefaultTerminal)
15850
+ o(i).sx1 = 0
15851
+ o(i).v1 = LEN(DefaultTerminal)
15852
+
15853
+ i = i + 1
15854
+ o(i).typ = 3
15855
+ o(i).y = 7
15856
+ o(i).txt = idenewtxt("#OK" + sep + "#Cancel")
15857
+ o(i).dft = 1
15858
+ '-------- end of init --------
15859
+
15860
+ '-------- generic init --------
15861
+ FOR i = 1 TO 100: o(i).par = p: NEXT 'set parent info of objects
15862
+ '-------- end of generic init --------
15863
+
15864
+ DO 'main loop
15865
+
15866
+
15867
+ '-------- generic display dialog box & objects --------
15868
+ idedrawpar p
15869
+ f = 1: cx = 0: cy = 0
15870
+ FOR i = 1 TO 100
15871
+ IF o(i).typ THEN
15872
+
15873
+ 'prepare object
15874
+ o(i).foc = focus - f 'focus offset
15875
+ o(i).cx = 0: o(i).cy = 0
15876
+ idedrawobj o(i), f 'display object
15877
+ IF o(i).cx THEN cx = o(i).cx: cy = o(i).cy
15878
+ END IF
15879
+ NEXT i
15880
+ lastfocus = f - 1
15881
+ '-------- end of generic display dialog box & objects --------
15882
+
15883
+ '-------- custom display changes --------
15884
+ LOCATE p.y + 4, p.x + 2
15885
+ PRINT CHR$(34) + "$$" + CHR$(34) + " is replaced with the executable";
15886
+ LOCATE p.y + 5, p.x + 2
15887
+ PRINT CHR$(34) + "$@" + CHR$(34) + " is replaced with the COMMAND$ string";
15888
+ '-------- end of custom display changes --------
15889
+
15890
+ 'update visual page and cursor position
15891
+ PCOPY 1, 0
15892
+ IF cx THEN SCREEN , , 0, 0: LOCATE cy, cx, 1: SCREEN , , 1, 0
15893
+
15894
+ '-------- read input --------
15895
+ change = 0
15896
+ DO
15897
+ GetInput
15898
+ IF mWHEEL THEN change = 1
15899
+ IF KB THEN change = 1
15900
+ IF mCLICK THEN mousedown = 1: change = 1
15901
+ IF mRELEASE THEN mouseup = 1: change = 1
15902
+ IF mB THEN change = 1
15903
+ alt = KALT: IF alt <> oldalt THEN change = 1
15904
+ oldalt = alt
15905
+ _LIMIT 100
15906
+ LOOP UNTIL change
15907
+ IF alt AND NOT KCTRL THEN idehl = 1 ELSE idehl = 0
15908
+ 'convert "alt+letter" scancode to letter's ASCII character
15909
+ altletter$ = ""
15910
+ IF alt AND NOT KCTRL THEN
15911
+ IF LEN(K$) = 1 THEN
15912
+ k = ASC(UCASE$(K$))
15913
+ IF k >= 65 AND k <= 90 THEN altletter$ = CHR$(k)
15914
+ END IF
15915
+ END IF
15916
+ SCREEN , , 0, 0: LOCATE , , 0: SCREEN , , 1, 0
15917
+ '-------- end of read input --------
15918
+
15919
+ '-------- generic input response --------
15920
+ info = 0
15921
+ IF K$ = "" THEN K$ = CHR$(255)
15922
+ IF KSHIFT = 0 AND K$ = CHR$(9) THEN focus = focus + 1
15923
+ IF (KSHIFT AND K$ = CHR$(9)) OR (INSTR(_OS$, "MAC") AND K$ = CHR$(25)) THEN focus = focus - 1: K$ = ""
15924
+ IF focus < 1 THEN focus = lastfocus
15925
+ IF focus > lastfocus THEN focus = 1
15926
+ f = 1
15927
+ FOR i = 1 TO 100
15928
+ t = o(i).typ
15929
+ IF t THEN
15930
+ focusoffset = focus - f
15931
+ ideobjupdate o(i), focus, f, focusoffset, K$, altletter$, mB, mousedown, mouseup, mX, mY, info, mWHEEL
15932
+ END IF
15933
+ NEXT
15934
+ '-------- end of generic input response --------
15935
+
15936
+ 'specific post controls
15937
+ IF focus <> PrevFocus THEN
15938
+ 'Always start with TextBox values selected upon getting focus
15939
+ PrevFocus = focus
15940
+ IF focus = 1 THEN
15941
+ o(focus).v1 = LEN(idetxt(o(focus).txt))
15942
+ IF o(focus).v1 > 0 THEN o(focus).issel = -1
15943
+ o(focus).sx1 = 0
15944
+ END IF
15945
+ END IF
15946
+
15947
+ IF K$ = CHR$(27) OR (focus = 3 AND info <> 0) THEN
15948
+ ClearMouse
15949
+ EXIT SUB
15950
+ END IF
15951
+
15952
+ IF K$ = CHR$(13) OR (focus = 2 AND info <> 0) THEN
15953
+ DefaultTerminal = idetxt(o(1).txt)
15954
+
15955
+ WriteConfigSetting generalSettingsSection$, "DefaultTerminal", DefaultTerminal
15956
+
15957
+ ClearMouse
15958
+ _KEYCLEAR
15959
+ EXIT SUB
15960
+ END IF
15961
+ 'end of custom controls
15962
+
15963
+ mousedown = 0
15964
+ mouseup = 0
15965
+ LOOP
15966
+
15967
+ END SUB
15968
+
15788
15969
FUNCTION idemessagebox (titlestr$, messagestr$, buttons$)
15789
15970
15790
15971
'-------- generic dialog box header --------
0 commit comments