Class XbpTabPage() Foundation

Class function of the XbpTabPage class.


The XbpTabPage class provides objects that manage tabbed dialogs (index tabs). These are dialog elements that look like index cards:

:preOffSet <---|| TAB ||------------> :postOffset 
           |----|     |-------------| 
           |                        | 
           |      PAGE              | 
           |                        | 
           |                        | 

Any dialog element can be placed within a tab page. The tab is used to activate the page of the XbpTabPage object which brings the page to the foreground. All dialog elements available within the page then become visible. The position and width of the tab are defined by the instance variables :preOffset and :postOffset. Numeric values specifying the offset for the left and right edge of the tab (as a percent of the total width) must be assigned to the instance variables before the :create() method is called.

Two or more XbpTabPage objects are generally displayed at the same position in the window with different positions for each of their tabs. This allows all the tabs to be visible while only one page is active. When a tab is clicked, the corresponding page is brought to the foreground making its dialog elements available. This process is accomplished using the methods :maximize() and :minimize().

Class methods
Creates an instance of the XbpTabPage class.

The instance variables in this group configure system resources. If changes are made to the default values, they must be made before the :create() method is executed or :configure() must be called to activate the changes.

The caption of the XbpTabPage object.
Determines whether Xbase Parts in the child list are clipped during graphic output.
Specifies the drawing mode of the tab page object.
Determines whether the XbpTabPage is minimized after it is created (the page is not visible).
Determines the distance between the end of the tab and the end of the page as a percentage of the page width.
Determines the distance between the start of the tab and the start of the page as a percentage of the page width.
Determines the height of the tab.
Determines the position of the tab.
Determines whether the XbpTabPage uses a Visual Style for display.
Life cycle
Requests system resources for the XbpTabPage object.
Reconfigures the XbpTabPage object after :create() has been executed.
Releases the system resources of the XbpTabPage object.
Maximizes the page of the XbpTabPage object (displays the page in the foreground with its dialog elements visible).
Minimizes the page of the XbpTabPage object (only the tab is displayed).
Informs the application that an owner-drawn tab page object needs to be redrawn.
Keyboard input received.
The tab of the XbpTabPage object has been activated.
XbpTabPage() Example

// This example demonstrates the basic steps for 
// programming XbpTabPage objects. Three XbpTabPage 
// objects are created. Each contains an XbpStatic 
// object. A title is displayed in the tab referring 
// to the functionality that is planned for later 
// implementation in the tab page. 

#include "" 
#include "" 
#include "" 

   LOCAL nEvent, mp1, mp2, oXbp 
   LOCAL oTab1, oTab2, oTab3, oDlg 


   // Dialog with desktop as parent 
   oDlg:= XbpDialog():new( AppDesktop() ) 
   oDlg:create( ,, {100,100}, {640,400} ) 

   // First tab page is maximized 
   oTab1 := XbpTabPage():new( oDlg:drawingArea,, {10,10}, {580,320} ) 
   oTab1:minimized   := .F. 
   oTab1:caption     := "Customer" 
   oTab1:TabActivate := {|| QOut( oTab1:caption ) } 

   oXbp:=XbpStatic():new( oTab1,, {20,50}, {540,220} ) 
   oXbp:type         := XBPSTATIC_TYPE_GROUPBOX 
   oXbp:caption      := "Get customer data" 

   // Second tab page is minimized 
   oTab2 := XbpTabPage():new( oDlg:drawingArea,, {10,10}, {580,320} ) 
   oTab2:caption     := "Order" 
   oTab2:preOffset   := 20 
   oTab2:postOffset  := 60 
   oTab2:TabActivate := {|| QOut( oTab2:caption ) } 

   oXbp:=XbpStatic():new( oTab2,, {20,50}, {540,220} ) 
   oXbp:type         := XBPSTATIC_TYPE_GROUPBOX 
   oXbp:caption      := "Get order" 

   // Third tab page is minimized 
   oTab3 := XbpTabPage():new( oDlg:drawingArea,, {10,10}, {580,320} ) 
   oTab3:caption     := "Invoice" 
   oTab3:preOffset   := 40 
   oTab3:postOffset  := 40 
   oTab3:TabActivate := {|| QOut( oTab3:caption ) } 

   oXbp:=XbpStatic():new( oTab3,, {20,50}, {540,220} ) 
   oXbp:type         := XBPSTATIC_TYPE_GROUPBOX 
   oXbp:caption      := "Get invoices" 

   // Event loop 
   nEvent := 0 
   DO WHILE nEvent <> xbeP_Close 
      nEvent := AppEvent( @mp1, @mp2, @oXbp ) 
      oXbp:handleEvent( nEvent, mp1, mp2 ) 

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.