02-13-2023, 06:18 PM
(This post was last modified: 02-13-2023, 06:29 PM by mnrvovrfc.
Edit Reason: Provided code in Purebasic
)
Horizontal scroll is only a possibility, not a requirement.
The example code I have is in Purebasic, do you still want to see it?
I just remembered I also have a "Tinyscreendialog" which is not the implementation used by QB64PE, but was a Freebasic "library" by someone else. It was by one of the early contributors of the QB64 Wiki. Allowed to build simple dialogs much like Autohotkey. With that I was able to build an extended message box which had a text field that could scroll vertically, and otherwise "OK" button.
As I've said, it was derrived from Purebasic Code Archive. The size of the dialog is hardcoded because it was meant to be a demonstration of using "any" amount of text as the message. Of course it could be made larger, until the limits of the screen, up to the programmer. It uses pipe "|" character to delimit a newline, so there was no need to inject a CHR$(13). It might have to be adjusted, however, to send the right newline combination depending on operating system.
EDIT #2: AH screenshots! Will have to go back to Windows LOL and dig even deeper into my backups for an EXE file created with that programming system. Or the only program I wrote with Freebasic which only gives tag information to an OGG Vorbis file.
The example code I have is in Purebasic, do you still want to see it?
I just remembered I also have a "Tinyscreendialog" which is not the implementation used by QB64PE, but was a Freebasic "library" by someone else. It was by one of the early contributors of the QB64 Wiki. Allowed to build simple dialogs much like Autohotkey. With that I was able to build an extended message box which had a text field that could scroll vertically, and otherwise "OK" button.
Code: (Select All)
Procedure MessageWindow(Titel.s, Text.s)
xwidth = 320
xheight = 160
ewindow = OpenWindow(#PB_Any, 0, 0, xwidth, xheight, Titel, #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If ewindow
pip = 0
Repeat
pip = FindString(Text, "|", pip + 1)
If pip
If Mid(Text, pip + 1, 1) = "0"
ch = Val(Mid(Text, pip + 2, 3))
If ch = 124: ch = 1: EndIf
If ch
Text = Left(Text, pip - 1) + Chr(ch) + Mid(Text, pip + 5)
EndIf
EndIf
EndIf
Until pip = 0
Text = ReplaceString(Text, "|", Chr(13) + Chr(10))
Text = ReplaceString(Text, #SOH$, "|")
ewindowcontent = StringGadget(#PB_Any, 0, 0, xwidth, xheight - 32, Text, #PB_String_ReadOnly | #ES_MULTILINE | #PB_String_BorderLess | #WS_VSCROLL | #WS_HSCROLL)
okbut = ButtonGadget(#PB_Any, xwidth / 2 - 60, xheight - 28, 120, 28, "OK")
Repeat
ev = WaitWindowEvent()
If (ev = #PB_Event_Gadget) And (EventGadget() = okbut)
Break
EndIf
Until ev = #PB_Event_CloseWindow
CloseWindow(ewindow)
EndIf
EndProcedure
As I've said, it was derrived from Purebasic Code Archive. The size of the dialog is hardcoded because it was meant to be a demonstration of using "any" amount of text as the message. Of course it could be made larger, until the limits of the screen, up to the programmer. It uses pipe "|" character to delimit a newline, so there was no need to inject a CHR$(13). It might have to be adjusted, however, to send the right newline combination depending on operating system.
EDIT #2: AH screenshots! Will have to go back to Windows LOL and dig even deeper into my backups for an EXE file created with that programming system. Or the only program I wrote with Freebasic which only gives tag information to an OGG Vorbis file.