Tabbed workspace views provides an alternate style to the normal multiple document interface (MDI) view Framework. When used, a workspace tab appears as part of the command bar. As views are activated a new tab is created for the view. The view itself will appear as a tabbed workspace view. This is very similar to how the Studio shows files when using tabbed workspaces. As the application is resized the view will resize to accommodate the available client area space. The view will expand to use the extra space but will be limited in size by setting the view’s piMaxSize property (otherwise views get way too big and stretched). A view can be centered on the client area space. A view can be dragged and split either horizontally or vertically. If a view’s area gets too small horizontal and vertical scrollbars will appear as needed.
To use scrolling views you must:
Set pbTabbedWorkspaces to True in your cCJCommandBarSystem object.
Views will normally be centered. To disable this, set the cCJCommandBarSystem object’s pbCenterTabbedViews to False.
At this point there is basic functionality. To get proper scrolling tabbed workspace views you need to change your views.
For each view, you must add a scrolling container (cDbScrollingContainer / cScrollingContainer) and a scrolling client (cDbScrollingClientArea / cScrollingClientArea) object. These should be placed in your view so they contain all of your visual objects.
Set piMaxSize to represent the largest size you want your view to be. Once this size is exceeded, horizontally or vertically, the controls will now longer get bigger (anchoring is disabled). The minimum size of a view (the size before scroll bars are applied) is determined by the Size property.
Object oSalesPersonView is a dbView
Set Label to "Sales Person Entry View"
Set Size to 51 245
Set piMaxSize to 51 245
Object SalesP_DD is a Salesp_DataDictionary
End_Object
Set Main_DD to SalesP_DD
Set Server to SalesP_DD
Object oScrollingContainer1 is a cDbScrollingContainer
Object oScrollingClientArea1 is a cDbScrollingClientArea
Object oSalesP_ID is a dbForm
Entry_Item SalesP.ID
Set Label to "Sales Person ID:"
Set Size to 13 46
Set Location to 4 70
Set Label_Col_Offset to 2
Set Label_Justification_Mode to jMode_Right
End_Object
Object oSalesP_Name is a dbForm
Entry_Item SalesP.Name
Set Label to "Sales Person Name:"
Set Size to 13 156
Set Location to 20 70
Set Label_Col_Offset to 2
Set Label_Justification_Mode to jMode_Right
End_Object
End_Object
End_Object
End_Object
The tabbed workspace interface uses our standard scrolling container logic, which requires two new objects. When we created scrolling containers we attempted a design that would be more "automatic" (property based via sub-classing) but determined there was not an effective way to accomplish that. We even considered creating a new C class that contains the Windows object (and Windows needs these extra objects) but that would have created a whole level of confusion about which Windows Handle is associated with a particular DataFlex object. We felt it was best to just make this explicit.