Extended message box - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2) +--- Thread: Extended message box (/showthread.php?tid=1465) Pages:
1
2
|
Extended message box - mnrvovrfc - 02-11-2023 How difficult would it be to create a "deluxe" edition of the Message Box which supports a large amount of text? What I mean is, an "OK" button, and a text field with scrollbars that could hold reasonably a larger amount of text than an ordinary Message Box. Take for instance the dialog seen in many Windows installers, to display the License Agreement, and usually has two buttons: "I agree" or "I decline". Just offer the one button to get out of the dialog. It would be a good alternative to the "SCREEN 0" to show more stuff that could fit on that screen. The problem could be how large to make the window and the scrollable text holder. Code: (Select All) /------------------------------------------------\ I have taken the idea from the Purebasic Code Archive, which used WinAPI, and created a version of it with Autohotkey. It should be doable with TinyFileDialog library. Of course, this is something that should be supported on all platforms. I have also created a scrollable window that works with the mouse but some of you would find it clunky. RE: Extended message box - SpriggsySpriggs - 02-13-2023 (02-11-2023, 08:41 PM)mnrvovrfc Wrote: How difficult would it be to create a "deluxe" edition of the Message Box which supports a large amount of text? What I mean is, an "OK" button, and a text field with scrollbars that could hold reasonably a larger amount of text than an ordinary Message Box. Take for instance the dialog seen in many Windows installers, to display the License Agreement, and usually has two buttons: "I agree" or "I decline". Just offer the one button to get out of the dialog. Can you show some screenshots of the version you made? That might give us an idea of what functions we should be calling. RE: Extended message box - bplus - 02-13-2023 Who in this wide world wants to scroll horizontally when they are reading? It's why word wrap was invented. RE: Extended message box - mnrvovrfc - 02-13-2023 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. Code: (Select All) Procedure MessageWindow(Titel.s, Text.s) 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. RE: Extended message box - mnrvovrfc - 02-13-2023 I'm not going to install Purebasic only to do a screenshot, in fact never again. Sorry. I was unable to find the "utility" which uses "vorbiscomment" program from the OGG Vorbis tools, with the "Tinydialog" library for Freebasic, I think it was written by stylin? Welp, I created something that could work on any platform, but it's not quite the same as I requested on this topic. Code: (Select All) OPTION _EXPLICIT Change the text filename to the one you want on the line with "OPEN" statement. For a string variable delimited by newline characters, call "readtextwindow". If it's a string array, call "readtextwindow2". If you want control over the screen colors and the screen dimensions, use the ordinary subprogram call. Note this is SCREEN 0, not graphics screen. Also I believe in the second version of this, which now I can't find in my backups, had mouse support. This presented one, however, supports the arrow keys. I still want one which looks like standard dialogs out of an operating system desktop. RE: Extended message box - SpriggsySpriggs - 02-13-2023 Well, could you at least post a screenshot of the results you got with the code you just posted? RE: Extended message box - vince - 02-14-2023 (02-13-2023, 07:21 PM)mnrvovrfc Wrote: I'm not going to install Purebasic only to do a screenshot, in fact never again. Sorry. maybe smallbasic or Justbasic are worth a shot? RE: Extended message box - aurel - 02-14-2023 I have PureBasic ..but i don't see a point why i do that looks to me like discovery of hot water.. message box in winApi is derived from Dialog class and as such have some great points and limitations u can simply use Toolwindow -> class and make custom message box RE: Extended message box - mnrvovrfc - 02-14-2023 (02-14-2023, 10:03 AM)aurel Wrote: I have PureBasic ..but i don't see a point why i do that Thank you mate! But I wrote a version somewhere (then that should have been with Autohotkey) where the "OK" button was on the left-hand side of the dialog, leaving the text box as high inside the window as possible. That is better because most people expect word-wrap going from left to right. Maybe it's the same eg. for those that write in Arabic but right to left... RE: Extended message box - mnrvovrfc - 08-19-2023 Well this requires Yad. It could probably be done with Zenity but that's about it for Linux. Windows could well do this as I've already demonstrated although poorly. I still want this. |