1. Olan Knight
  2. PowerBuilder
  3. Friday, 28 February 2020 22:46 PM UTC

I would dearly love to see the good old MESSAGEBOX function extended to allow user to specify their own values for BUTTON and ICON. This is the standard prototype for MessageBox:

                 Message (title, text, icon, button, default)

I see this working with a new standard enumerated icon of "custom!", which means a following parameter must be the string name of the bitmap to be used as the icon.

                  Message (title, text, CUSTOM!, "ROCKETSHIP.BMP!", button, default)


I see the same thing for the BUTTON parameter. Either the user passes a standard enumerated button or a new enumerated value of "custom!", and a following comma-separated string indicates the button text to be used and the number of options presented.

                  Message (title, text, icon, "CUSTOM!", "RECALCULATE, SAVE, RESTORE, COMMIT", default)

   The number of comma separated string values is the number of button options to present.
   The order in which the options are listed in the string parameter are their associated numeric values: 1, 2, 3...


Thanks.

Olan

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Saturday, 29 February 2020 17:26 PM UTC
  2. PowerBuilder
  3. # 1

Hi Olan;

  Feel free to adopt my STD framework's Message box window and approach. It's resizable, can control it's minimum and/or  maximum size, supports menus, multilingual, centres on App's location (including Web Browser based PowerServer apps), works with PB2019's Theme feature, allows logging, supports select & copy, zoomable and PB's print window feature.

Much better than the O/S' IMHO. ;-)

Regards... Chris

 

Comment
  1. Chris Pollach @Appeon
  2. Monday, 2 March 2020 17:00 PM UTC
Hi René ;

Yes, I use a standard "Response" type Window class.

Interesting, I never tested the POSTed events / functions around this - but, never had any issues with that happening in the over three decades that I have been using my MB Class framework window. Including within PowerServer since 2008.

Regards ... Chris
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 4 March 2020 16:57 PM UTC
Hi René ... Yes, I saw that posting before. Personally because my framework and Apps quite often use multi-threading, I WANT the Posted Events to keep working in the background while the GUI layer (main thread) has a response window open. So to me - this a great design and not a bug. Just my $0.02
  1. Helpful
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Saturday, 29 February 2020 09:56 AM UTC
  2. PowerBuilder
  3. # 2

I like this enhancement - along with the timeout option. It follows the Open/Closed Principle for the PowerScript language and existing runtime functionality. (Open for extensions; closed for modifications)

  • Simply adds additional valid parameter combinations for the MessageBox function. Could even be a new, differently named system function supporting new parameter sets with new defaults.
  • Neither changes to language semantics, compiler behavior, nor existing system functions

You have my vote. /M

Comment
  1. Olan Knight
  2. Saturday, 29 February 2020 21:38 PM UTC
Thanks,Michael! :)
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Saturday, 29 February 2020 03:24 AM UTC
  2. PowerBuilder
  3. # 3

I have an example that uses the MessageBox API function. It also includes the undocumented variant MessageBoxTimeout.

https://www.topwizprogramming.com/freecode_messagebox.html

To specify a non-standard icon, you'll need to use the MessageBoxIndirect function:

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messageboxindirectw

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.