Author Topic: Spawning child windows and/or message boxes  (Read 21661 times)

0 Members and 1 Guest are viewing this topic.

Offline ErichK

  • Newbie
  • Posts: 2
    • View Profile
    • Check out my software on my blog
Spawning child windows and/or message boxes
« on: November 12, 2018, 02:26:03 pm »
Hi everyone,

Been a while since I've been here, but it looks like QB64 has been moving right along, and I love what I see so far with InForm.  I've been playing with it for the past couple of hours.

For starters I do have a question though, and forgive me if I've overlooked this, but is there any way to spawn child windows from within an InForm app (either modal or non-modal) or do things like quick messageboxes?

Thanks for your help.

FellippeHeitor

  • Guest
Re: Spawning child windows and/or message boxes
« Reply #1 on: November 12, 2018, 02:57:28 pm »
Hello, ErichK and welcome to our forum.

Thanks for your interest in InForm!

There is currently no way to have multiple windows simultaneously with QB64, and that limitation extends to InForm as well.

About message boxes, there is this:

FUNCTION MessageBox& (Message$, Title$, Setup AS LONG)

Not specifying Title$ will have the message box inherit the main form's title/caption.

Setup is a combination (button + icon) of:
Buttons, which can be MsgBox_OkOnly, MsgBox_OkCancel, MsgBox_AbortRetryIgnore, MsgBox_YesNoCancel, MsgBox_YesNo, MsgBox_RetryCancel, MsgBox_CancelTryagainContinue, MsgBox_CancelTryagainContinue.

Icons, which can be MsgBox_Critical, MsgBox_Question, MsgBox_Exclamation, MsgBox_Information

The possible return values are: MsgBox_Ok, MsgBox_Cancel, MsgBox_Abort, MsgBox_Retry, MsgBox_Ignore, MsgBox_Yes, MsgBox_No, MsgBox_Tryagain, MsgBox_Continue.

All combinations of the above work as expected in Windows. For macOS and Linux, you only get OkOnly and YesNo for buttons.

Sample usage:

Code: QB64: [Select]
  1.                 Answer = MessageBox("Do you love QB64?", "", MsgBox_YesNo + MsgBox_Question)
  2.                 IF Answer = MsgBox_No THEN
  3.                     Caption(Label1) = "I'll give you some more time to fall in love."
  4.                 ELSE
  5.                     Caption(Label1) = "We do too!"
  6.                 END IF
  7.  
« Last Edit: November 12, 2018, 03:18:02 pm by FellippeHeitor »

Offline ErichK

  • Newbie
  • Posts: 2
    • View Profile
    • Check out my software on my blog
Re: Spawning child windows and/or message boxes
« Reply #2 on: November 12, 2018, 05:21:04 pm »
Ah, okay, I see.  Well at any rate, thanks for your breakdown of the MessageBox function, I must have not seen it when I looked at the Wiki.  :-)