Class XbpTabPage() Foundation

Class function of the XbpTabPage class.

Superclass
Description

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
:new()
Creates an instance of the XbpTabPage class.
Configuration

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.

:caption
The caption of the XbpTabPage object.
:clipChildren
Determines whether Xbase Parts in the child list are clipped during graphic output.
:drawMode
Specifies the drawing mode of the tab page object.
:minimized
Determines whether the XbpTabPage is minimized after it is created (the page is not visible).
:postOffset
Determines the distance between the end of the tab and the end of the page as a percentage of the page width.
:preOffset
Determines the distance between the start of the tab and the start of the page as a percentage of the page width.
:tabHeight
Determines the height of the tab.
:type
Determines the position of the tab.
:useVisualStyle
Determines whether the XbpTabPage uses a Visual Style for display.
Life cycle
:create()
Requests system resources for the XbpTabPage object.
:configure()
Reconfigures the XbpTabPage object after :create() has been executed.
:destroy()
Releases the system resources of the XbpTabPage object.
Methods
:maximize()
Maximizes the page of the XbpTabPage object (displays the page in the foreground with its dialog elements visible).
:minimize()
Minimizes the page of the XbpTabPage object (only the tab is displayed).
Events
:draw
Informs the application that an owner-drawn tab page object needs to be redrawn.
:keyboard
Keyboard input received.
:tabActivate
The tab of the XbpTabPage object has been activated.
Examples
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 "Gra.ch" 
#include "Xbp.ch" 
#include "Appevent.ch" 

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

   SetColor("N/W") 
   CLS 

   // 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:create() 
   oTab1:TabActivate := {|| QOut( oTab1:caption ) } 

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

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

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

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

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

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

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.