Navigation: Ultimate Suite for PowerBuilder Help > Single Page Application Windows > Tabbed Caption >

Usage

Send comments on this topic.

 

The tabbed caption window behaves very similar to most modern web browsers. Each opened window is displayed as a tab in the windows caption. You can display a button to allow users to open new tabs, if your application needs this functionality. This window is best used for single purpose pages (like a web browser). Although you are able to open any type of user object or window object in each tab.

To use this window, inherit from w_pbus_spa_tab . This window doesn't support the PB menu but you can specify one so you can still use menu shortcuts.

Although it's not necessary, typically with this type of window you'll want to open a tab for your user when the window opens. Similar to how web browsers preload a tab to help get you started. Likewise, you may want to close the window if the user closes the last opened tab:

Sample Code:

//Open event of window
w_sql lw_sql
of_OpenTab(lw_sql, "New Query", "SQL!")

//AddTabButtonClicked event
//Open a new tab similar to how we automatically opened one in the open event
w_sql lw_sql
of_OpenTab(lw_sql, "New Query", "SQL!")

//TabClosed event
//If there are no more tabs opened, we can close the whole window.
IF of_GetTabCount() = 0 THEN
 POST Close(THIS)
END IF

Note: The PowerBuilder Menu object is currently not supported in this release. A menu alternative may be added in the future.

Known Issue: If your window's WindowState property is initially set to Maximized! and the window doesn't maximize when opened, you'll need to add the following to the top of your windows Open event:

 THIS.WindowState = Maximized!


Copyright © 2021 Werysoft Inc.