Navigation: Ultimate Suite for PowerBuilder Help > PowerModal >

Implementation

Send comments on this topic.

 

Implementation:

The easiest way to use PowerModal is to create a global variable for your application:

n_cst_powermodal gnv_modal

The PowerModal object is autoinstantiated, so you can start using it immediately:

w_openemployee lw_mywindow
gnv_modal.OpenModal(lw_mywindow)

 By default, PowerModal uses the top most window in your application for the message overlay. You can explicitly set the parent window by calling the of_Register method:

gnv_modal.of_Register(w_frame)

If you prefer not to declare a global variable, you can use PowerModal locally:

n_cst_powermodal lnv_modal
w_openemployee lw_mywindow
lnv_modal.OpenModal(lw_mywindow)

PowerModal will display your modal window using the properties you set on it (Title, Min-Max Buttons, Center, Border, Palette Window, etc.). Adjust these properties as necessary. For example, if you don't want your user to move your modal window around the screen, turn the Titlebar off.

 

Note:

For best results, use a window with a Popup! window type. You can use Response! windows but some features will be limited.

 

Closing with a return value:

If you're using a Popup! window, you will call the PowerModal CloseModal function with your return value. In order for this to work, you need a reference to the PowerModal object that opened the window. In this case, it's best to create a global reference as seen above.

If you're using a Response! window, you will need to call the build in CloseWithReturn PowerBuilder function to close the window. Response windows are thread blocking windows so PowerModal won't be able to process return value (i.e. CloseModal can't be called from a Response window).

 


Copyright © 2021 Werysoft Inc.