Ultimate Suite for PowerBuilder contains 3 window objects that you can use to create a Single Page Application.
Single Page Applications are applications that display all or most functionality within a single window (or page).
This window gives you the most basic functionality. You can have toolbar items in the windows caption and a status bar at the bottom.
With pre-built navigation, all you need to do is call a single function for each user object you want to display to the user. When a navigation item is selected on the left, the window will display the corresponding user object. Toolbar items can be added to the window caption for expanded functionality.
//Instance Variables u_cst_dashboard iuo_dashboard u_cst_employee iuo_employee u_cst_sales_order iuo_order u_cst_tilemenu iuo_tilemenu u_cst_about iuo_about u_cst_credits iuo_credits //Open event of window of_SetWindowIcon("icons\PBUS logo 24x24.png" ) of_SetCopyright("Copyright © 2020 Werysoft Inc." ) of_AddPanel("Dashboard", "icons\dashboard.png" , iuo_dashboard) of_AddPanel("Tile Menu", "icons\tilemenu.png" , iuo_tilemenu) of_AddPanel("Employee", "icons\open_employee 32x32.png" , iuo_employee) of_AddPanel("Orders", "icons\order 32x32.png" , iuo_order) of_AddPanel("About", "icons\about 16x16.png", iuo_about) of_SelectPanel("Dashboard") of_SetTheme("WINDOWS10_BLUE") of_AddToolbarItem("Save","icons\save white.png" ) of_AddToolbarItem("Print","icons\print white.png" ) of_AddToolbarItem("Print Preview","icons\print preview white.png" ) of_AddToolbarSeparator() of_AddToolbarItem("New Employee","icons\add_employee white.png" ) of_AddToolbarItem("Remove Employee","icons\remove_employee white.png" ) of_AddToolbarSeparator() of_AddToolbarItem("New Order","icons\add_order white.png" ) of_AddToolbarItem("Remove Order","icons\remove_order white.png" )
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.
//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 you want to display your window as Maximized when the window opens, you'll need to add the following to the top of your windows Open event:
THIS.WindowState = Maximized!