Presentable help window invoked from the console

Everything else that doesn't fall into one of the other PB categories.
Oso
Enthusiast
Enthusiast
Posts: 595
Joined: Wed Jul 20, 2022 10:09 am

Presentable help window invoked from the console

Post by Oso »

Good to see some familiar names here, after an absence from the forum for a while.

I’ve been working entirely on server-side development, consequently I have limited GUI expertise. The requirement is that I have an OpenConsole() administrative application but ideally I need to provide a pop-up window invoked by a command, showing a reasonable extent of help text. It must be something better than a requester box. I'd prefer not to display the help as console text.

Before I explain what I’ve tried, is there a known method that works well? TIA.
Bitblazer
Enthusiast
Enthusiast
Posts: 762
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Presentable help window invoked from the console

Post by Bitblazer »

What about a PDF viewer for DOS like MUPDF ? Or fbhelp.
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: Presentable help window invoked from the console

Post by Kuron »

OT, but welcome back. :mrgreen:
Best wishes to the PB community. Thank you for the memories. ♥️
Oso
Enthusiast
Enthusiast
Posts: 595
Joined: Wed Jul 20, 2022 10:09 am

Re: Presentable help window invoked from the console

Post by Oso »

Kuron wrote: Fri Sep 15, 2023 4:45 am OT, but welcome back. :mrgreen:
Thanks Kuron 😀
Oso
Enthusiast
Enthusiast
Posts: 595
Joined: Wed Jul 20, 2022 10:09 am

Re: Presentable help window invoked from the console

Post by Oso »

Bitblazer wrote: Fri Sep 15, 2023 3:07 am What about a PDF viewer for DOS like MUPDF ? Or fbhelp.
Thanks for the ideas Bitblazer. I'd prefer to develop the code for the help, to keep this self-contained. I tried this :

Code: Select all

helpwin.i = OpenWindow(#PB_Any, 50, 30, 1200, 600, "User's Help", #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
Is there a gadget available that offers scrollable text within it, such as with a vertical scrollbar?
User avatar
idle
Always Here
Always Here
Posts: 5899
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Presentable help window invoked from the console

Post by idle »

Hi Oso,

Maybe just open a window with an editor gadget and set it to read only and word wrap.
Oso
Enthusiast
Enthusiast
Posts: 595
Joined: Wed Jul 20, 2022 10:09 am

Re: Presentable help window invoked from the console

Post by Oso »

idle wrote: Fri Sep 15, 2023 7:55 am Hi Oso, Maybe just open a window with an editor gadget and set it to read only and word wrap.
Hi Idle, thanks for this and hope you're okay. This works beautifully well, including the scrolling, simple but effective. Hopefully I've got this right :

Code: Select all

helpwin.i = OpenWindow(#PB_Any, 200, 300, 500, 200, "User Help Guide", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
helpdsp.i = EditorGadget(#PB_Any, 0, 0, 500, 200, #PB_Editor_ReadOnly | #PB_Editor_WordWrap)
    
AddGadgetItem(helpdsp.i, -1, "User's Guide")
AddGadgetItem(helpdsp.i, -1, "")
AddGadgetItem(helpdsp.i, -1, "The keyboard shortcut keys Ctrl + C (Copy), Ctrl + X (Cut) and Ctrl + V (Paste) can be used for editing. The 'Insert' key determines whether text is inserted or overwritten. The Delete key deletes characters to the right of the cursor.  Holding down the Shift key and using the arrow keys, selects text.")
AddGadgetItem(helpdsp.i, -1, "")
AddGadgetItem(helpdsp.i, -1, "To exit from the console session, press F10.")
    
Repeat
  ; Delay(50) * Removed
Until WaitWindowEvent() = #PB_Event_CloseWindow
CloseWindow(helpwin.i)
Image
Last edited by Oso on Fri Sep 15, 2023 1:42 pm, edited 1 time in total.
User avatar
idle
Always Here
Always Here
Posts: 5899
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Presentable help window invoked from the console

Post by idle »

Yes that good but you don't need to delay its waiting
Oso
Enthusiast
Enthusiast
Posts: 595
Joined: Wed Jul 20, 2022 10:09 am

Re: Presentable help window invoked from the console

Post by Oso »

idle wrote: Fri Sep 15, 2023 10:14 am Yes that good but you don't need to delay its waiting
That's interesting, you're right, it works fine without. EDIT: I'd omitted CloseWindow() in one of my tests — it didn't like that and I assumed at first it needed a delay.
Post Reply