Tab
Previous topic  First topic  Next topic





Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE TAB cName | (cVarName) | &(cExpression) 
      [ ; OF cWindow ]
Parent.Name
  
A reference to the Parent Window
      [ ROW nRow ]
0
  
Row position on container window in pixels coordinates
      [ COL nCol ]
0
  
Col position on container window in pixels coordinates
      [ WIDTH nWidth ]
?
  
The desired width size of the Control in pixels
      [ HEIGHT nHeight ]
?
  
The desired height size of the Control in pixels
      [ ROWBOTTOM nRow ]
n/a
  
Bottom Row position on container window in pixels coordinates. This property adjust the HEIGHT property according the ROW property.
      [ COLRIGHT nCol ]
n/a
  
Right Col position on container window in pixels coordinates. This property adjust the WIDTH property according the COL property.
      [ CAPTION nPage , "cText" ]
NIL
  
Caption for page nPage
      [ PICTURE nPage , "cPictureName" ]
NIL
  
Picture for page nPage
      [ ENABLED .T. | .F. ]
.T.
  Enable or Disable control
      [ VALUE nValue ]
1
  
Page focused at started
      [ FONTNAME "cFontName" ]
Parent.Fontname
  
Font family for control text
      [ FONTSIZE nPoints ]
Parent.FontSize
  
Font size for control text
      [ FONTBOLD .T. | .F. ]
.F.
  
Set Bold attribute to control text
      [ FONTITALIC .T. | .F. ]
.F.
  
Set Italic attribute to control text
      [ FONTUNDERLINE .T. | .F. ]
.F.
  
Set Underline attribute to control text
      [ FONTSTRIKEOUT .T. | .F. ]
.F.
  
Set Strikeout attribute to control text
      [ FONTCOLOR {aFontColor} | aVarFontColor ]
OS.FontColor
  
Set foreground color (text color)
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
      [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
      [ MULTILINE .T. | .F. ]
.F.
  ?
      [ FLAT .T. | .F. ]
.F.
  Set Flat attibute for control. The control don't will have 3D aspect.
      [ BUTTONS .T. | .F. ]
.F.
  ?
      [ HOTTRACK .T. | .F. ]
.F.
  ?
      [ VERTICAL .T. | .F. ]
.F.
  ?
      [ BOTTOM .T. | .F. ]
.F.
  ?
      [ PAGECOUNT ]   
Only for mg_Get() function. It returns the total amount of pages in control
      [ NOTABSTOP .T. | .F. ]
.F.
  
This property force that TAB key doesn't stop in this control
      [ HASFOCUS ]   
Only for mg_Get() function. This property returns .T. if control has the application focus
      [ PARENT cParentName ]
NIL
  
Parent window for this widget
      [ PARENTTYPE n/a ]   
Only for mg_get() function, this property returns the PARENT control type or "" if the parent was not set.
      [ CURSOR ]
Qt_ArrowCursor
  
Change the cursor pointer shape for the control. Go to to learn more about it.
      [ ONCHANGE cOnChange | {BOnChange} ]
NIL
  
An action to be performed when control is clicking
      [ ONGOTFOCUS cOnGotFocus | {BOnGotFocus} ]
NIL
  An action to be performed when control is focused
      [ ONLOSTFOCUS cOnLostFocus | {BOnLostFocus} ]
NIL
  An action to be performed when control is lost focused
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide control (like methods SHOW and HIDE)
      [ CONTEXTMENUSUPRESSED .T. | .F. ]
.F.
  
Disable the display of the Context Menu of control.
      [ CREATE PAGE cName ]   
Text to display in Page Tab
            [ PICTURE "cPictureName" ]
NIL
  
Picture name for display into caption page
            [ POSITION ]   
Only for mg_Get. This property return the numeric position of page in the TAB control
            [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
            [ FONTCOLOR {aFontColor} | aVarFontColor ]
OS.FontColor
  
Set foreground color (text color)
            [ FONTNAME "cFontName" ]
Parent.Fontname
  
Font family for control text
            [ FONTSIZE nPoints ]
Parent.FontSize
  
Font size for control text
            [ FONTBOLD .T. | .F. ]
.F.
  
Set Bold attribute to control text
            [ FONTITALIC .T. | .F. ]
.F.
  
Set Italic attribute to control text
            [ FONTUNDERLINE .T. | .F. ]
.F.
  
Set Underline attribute to control text
            [ FONTSTRIKEOUT .T. | .F. ]
.F.
  
Set Strikeout attribute to control text
            [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
            [ CURSOR ]
Qt_ArrowCursor
  
Change the cursor pointer shape for the control. Go to to learn more about it.
            [ ENABLED .T. | .F. ]
.T.
  
Enable or Disable the page of control
            [ CREATE CONTEXT MENU [ cName ] ]   
CONTEXT MENU for control
                  [ ......... ]   
You can see properties for this menu in CONTEXT MENU topic
            [ END MENU ]   
 
            [ .....Controls here !!! ]   
 
            [ CREATE TAB ]   
 
                  [ CREATE PAGE ]   
 
                  [ .....Controls here !!! ]   
 
                  [ END PAGE ]   
?
                   .........    
 
                  [ CREATE PAGE ]   
 
                  [ .....Controls here !!! ]   
 
                  [ END PAGE ]   
?
                   .........    
 
            [ END TAB ]   
 
            [ .....Controls here !!! ]   
 
      [ END PAGE ]   
?
       .........    
 
       .........    
 
      [ CREATE PAGE ]   
 
      [ .....Controls here !!! ]   
 
      [ END PAGE ]   
 
       .........    
 
      [ CREATE PAGE ]   
 
      [ .....Controls here !!! ]   
 
      [ END PAGE ]   
 
      [ CREATE CONTEXT MENU [ cName ] ]   
CONTEXT MENU for control
            [ ......... ]   
You can see properties for this menu in CONTEXT MENU topic
      [ END MENU ]   
 
END TAB 

Jump to Context Menu topic



Methods for Tab


Methods
Status
Default
Planned
Started
Ready
Comments
    HIDE
n/a
  This method HIDE the control
    SHOW
n/a
  This method SHOW the control
    UNSETCURSOR
n/a
  
Reset the cursor pointer shape for the control to default (Qt_ArrowCursor). Go to to learn more about it.
    RELEASE
n/a
  
This method is used to destroy the control.
    SETFOCUS
n/a
  
This method put the program focus into control
    GETCHILDREN
n/a
  
This method return an array containing a list of controls that have this control as parent
    GETCONTROLS
n/a
  
This method return an array containing a list of controls that have this control as parent, except those that are not shown on screen (e.g. TIMER or CONTEXTMENU)
    ADDPAGE [ cCaption ]
n/a
  
This method add a PAGE to the TAB control in the last position
    INSERTPAGE nPos [ , cCaption ]
n/a
  
This method insert a PAGE to the TAB control in the nPos position
    DELETEPAGE nPos
n/a
  
This method delete the nPos PAGE from the TAB control
    DELETEPAGEALL
n/a
  
This method delete all PAGEs from the TAB control
    GETPAGENAME nPos
n/a
  
This method return the name of the PAGE in the nPos position in the TAB. Page name is generated automatically in creation time and is a random name.
    ADDCONTROL cControlName , nPage [ , nRow ] [ , nCol ]
n/a
  
This method ADD a previously created control to the nPage PAGE in the TAB, optionally, you can specify the row and col position into the page. By default, row and col are zero
    ONCHANGE
n/a
  
Execute ONCHANGE block coded in CREATE or seted by mg_Set
    ONGOTFOCUS
n/a
  Execute ONGOTFOCUS block coded in CREATE or seted by mg_Set
    ONLOSTFOCUS
n/a
  Execute ONLOSTFOCUS block coded in CREATE or seted by mg_Set



Methods for Tab Page


Methods
Status
Default
Planned
Started
Ready
Comments
    GETCHILDREN
n/a
  
This method return an array containing a list of controls that have this control as parent
    GETCONTROLS
n/a
  
This method return an array containing a list of controls that have this control as parent, except those that are not shown on screen (e.g. TIMER or CONTEXTMENU)
    UNSETCURSOR
n/a
  
Reset the cursor pointer shape for the control to default (Qt_ArrowCursor). Go to to learn more about it.




Example:

File: d_tab.prg


#include "marinas-gui.ch"

Function Main

   SET APPLSTYLE TO "MarinasLooks"

   CREATE WINDOW d_window
      ROW 0
      COL 0
      WIDTH 820 ; HEIGHT 480
      CAPTION "Marinas-GUI Demo Tab Control"
      ICON "../resource/d_test.ico"
      MAIN .T.

      d_tab_def()

   END WINDOW

   mg_Do( "d_window" , "center" )

   mg_Do( "d_window" , "activate" )

Return Nil

Function RefreshTitle()
Return mg_Set( "d_window" , "caption" , "Marinas-GUI Tab Number " + alltrim( str( mg_Get( "d_window" , "Tab_1" , "value" ) ) ) )


File: d_tab_def.prg

#include "marinas-gui.ch"

Function d_tab_def()

      CREATE TAB Tab1A
         ROW 15
         COL 100
         WIDTH 620
         HEIGHT 460
         VALUE 1
         FONTSIZE 9
         FONTITALIC .T.
         TOOLTIP "Tab Tooltip"

         CREATE CONTEXT MENU

            CREATE ITEM "Item 1 from Tab"
               ONCLICK { || mg_MsgInfo( "Item 1 from Tab" ) }
               PICTURE "../resource/d_test.png"
            END ITEM

            CREATE ITEM "Item 2 from Tab"
               ONCLICK { || mg_MsgInfo( "Item 2 from Tab" ) }
               PICTURE "../resource/d_test.png"
            END ITEM

         END MENU

         CREATE PAGE "Tab1A Page1"

            CREATE LABEL Tab1A_Page1_Label1
                   ROW    70
                   COL    40
                   WIDTH  120
                   HEIGHT 24
                   VALUE "Tab1A_Page1_Label1"
            END LABEL

            CREATE BUTTON Tab1A_Page1_Button1
                  ROW    130
                  COL    40
                  AUTOSIZE .T.
                  CAPTION "Tab1A_Page1_Button1"
                  ONCLICK mg_MsgInfo( "Click from Tab1A_Page1_Button1" )

                  CREATE CONTEXT MENU

                     CREATE ITEM "Item 1 from Button in Page"
                        ONCLICK { || mg_MsgInfo( "Item 1 from Button in Page" ) }
                        PICTURE "../resource/d_test.png"
                     END ITEM

                     CREATE ITEM "Item 2 from Button in Page"
                        ONCLICK { || mg_MsgInfo( "Item 2 from Button in Page" ) }
                        PICTURE "../resource/d_test.png"
                     END ITEM

                  END MENU

            END BUTTON

            CREATE CONTEXT MENU

               CREATE ITEM "Item 1 from Page"
                  ONCLICK { || mg_MsgInfo( "Item 1 from Page" ) }
                  PICTURE "../resource/d_test.png"
               END ITEM

               CREATE ITEM "Item 2 from Page"
                  ONCLICK { || mg_MsgInfo( "Item 2 from Page" ) }
                  PICTURE "../resource/d_test.png"
               END ITEM

            END MENU

         END PAGE

         CREATE PAGE "Tab1A Page2"
            PICTURE '../resource/d_test.png'

            CREATE LABEL Tab1A_Page2_Label1
                   ROW    90
                   COL    110
                   WIDTH  120
                   HEIGHT 24
                   VALUE "Tab1A_Page2_Label1"
            END LABEL

            CREATE BUTTON Tab1A_Page2_Button1
                   ROW    150
                   COL    110
                   WIDTH  140
                   HEIGHT 25
                   CAPTION "Tab1A_Page2_Button1"
                   ONCLICK mg_MsgInfo( "Click from Tab1A_Page2_Button1" )
            END BUTTON

         END PAGE

         CREATE PAGE "Tab1A Page3"

            CREATE LABEL Tab1A_Page3_Label1
                   ROW    190
                   COL    200
                   WIDTH  120
                   HEIGHT 24
                   VALUE "Tab1A_Page3_Label1"
            END LABEL

            CREATE BUTTON Tab1A_Page3_Button1
                   ROW    235
                   COL    200
                   WIDTH  140
                   HEIGHT 27
                   CAPTION "Tab1A_Page2_Button1"
                   ONCLICK mg_MsgInfo( "Click from Tab1A_Page2_Button1" )
            END BUTTON

         END PAGE

         CREATE PAGE "Tab1A Page4"
            PICTURE '../resource/d_test.png'

            CREATE LABEL Tab1A_Page4_Label1
                   ROW    190
                   COL    10
                   WIDTH  120
                   HEIGHT 24
                   VALUE "Tab1A_Page1_Label1"
            END LABEL

            CREATE BUTTON Tab1A_Page4_Button1
                   ROW    230
                   COL    10
                   WIDTH  140
                   HEIGHT 25
                   CAPTION "Tab1A_Page4_Button1"
                   ONCLICK mg_MsgInfo( "Click from Tab1A_Page4_Button1" )
            END BUTTON

         END PAGE

         CREATE PAGE "Tab1A Page5 MultiTab"

            CREATE TAB Tab2A
               ROW 15
               COL 10
               WIDTH 600
               HEIGHT 410
               VALUE 3
               FONTNAME "mg_monospace"
               FONTSIZE 12
               TOOLTIP "Tab2 Tooltip"

               CREATE PAGE "Tab2A Page1"

                  CREATE LABEL Tab2A_Page1_Label1
                         ROW    100
                         COL    10
                         WIDTH  200
                         HEIGHT 24
                         VALUE "Label Tab2 Page 1"
                  END LABEL

                  CREATE BUTTON Tab2A_Page1_Button1
                         ROW    140
                         COL    10
                         AUTOSIZE .T.
                         CAPTION "Tab2A_Page1_Button1"
                         ONCLICK mg_MsgInfo( "Click from Tab2A_Page1_Button1" )
                  END BUTTON

               END PAGE

               CREATE PAGE "Tab2A Page2"
                  PICTURE '../resource/d_test.png'

                  CREATE TAB Tab3A
                     ROW 15
                     COL 10
                     WIDTH 290
                     HEIGHT 355
                     VALUE 3
                     BACKCOLOR {0,0,255}
                     FONTSIZE 10
                     TOOLTIP "Tab3 Tooltip"

                     CREATE PAGE "Tab3A Page1"

                        CREATE LABEL Tab3A_Page1_Label1
                               ROW    100
                               COL    10
                               WIDTH  200
                               HEIGHT 24
                               VALUE "Tab3A_Page1_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON Tab3A_Page1_Button1
                               ROW    140
                               COL    10
                               AUTOSIZE .T.
                               CAPTION "Tab3A_Page1_Button1"
                               ONCLICK mg_MsgInfo( "Click from Tab3A_Page1_Button1" )
                        END BUTTON

                     END PAGE

                     CREATE PAGE "Tab3A Page2"
                        PICTURE '../resource/d_test.png'

                        CREATE LABEL Tab3A_Page2_Label1
                               ROW    100
                               COL    100
                               AUTOSIZE .T.
                               VALUE "Tab3A_Page2_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON Tab3A_Page2_Button1
                               ROW    140
                               COL    60
                               WIDTH  200
                               HEIGHT 25
                               CAPTION "Tab3A_Page2_Button1"
                               ONCLICK mg_MsgInfo( "Click from Tab3A_Page2_Button1" )
                        END BUTTON

                     END PAGE

                     CREATE PAGE "Tab3A Page3"
                        PICTURE '../resource/d_test.png'

                        CREATE LABEL Tab3A_Page3_Label1
                               ROW    80
                               COL    110
                               AUTOSIZE .T.
                               VALUE "Tab3A_Page3_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON Tab3A_Page3_Button1
                               ROW    120
                               COL    70
                               WIDTH  200
                               HEIGHT 25
                               CAPTION "Tab3A_Page3_Button1"
                               ONCLICK mg_MsgInfo( "Click from Tab3A_Page3_Button1" )
                        END BUTTON

                     END PAGE

                     CREATE PAGE "Tab3A Page4"
                        PICTURE '../resource/d_test.png'

                        CREATE LABEL Tab3A_Page4_Label1
                               ROW    70
                               COL    120
                               AUTOSIZE .T.
                               VALUE "Tab3A_Page4_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON Tab3A_Page4_Button1
                               ROW    110
                               COL    30
                               WIDTH  200
                               HEIGHT 25
                               CAPTION "Tab3A_Page4_Button1"
                               ONCLICK mg_MsgInfo( "Click from Tab3A_Page4_Button1" )
                        END BUTTON

                     END PAGE

                  END TAB

                  CREATE TAB Tab3B
                     ROW 15
                     COL 310
                     WIDTH 280
                     HEIGHT 355
                     VALUE 3
                     BACKCOLOR {255,0,0}
                     FONTSIZE 10
                     TOOLTIP "Tab3B Tooltip"

                     CREATE PAGE "Tab3B Page1"

                        CREATE LABEL Tab3B_Page1_Label1
                               ROW    100
                               COL    10
                               WIDTH  200
                               HEIGHT 24
                               VALUE "Tab1B_Page1_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON Tab3B_Page1_Button1
                               ROW    140
                               COL    10
                               AUTOSIZE .T.
                               CAPTION "Tab3B_Page1_Button1"
                               ONCLICK mg_MsgInfo( "Click from Tab3B_Page1_Button1" )
                        END BUTTON

                     END PAGE

                     CREATE PAGE "Tab3B Page2"
                        PICTURE '../resource/d_test.png'

                        CREATE LABEL Tab3B_Page2_Label1
                               ROW    100
                               COL    100
                               AUTOSIZE .T.
                               VALUE "Tab3B_Page2_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON Tab3B_Page2_Button1
                               ROW    140
                               COL    80
                               WIDTH  180
                               HEIGHT 25
                               CAPTION "Tab3B_Page2_Button1"
                               ONCLICK mg_MsgInfo( "Click from Tab3B_Page2_Button1" )
                        END BUTTON

                     END PAGE

                     CREATE PAGE "Tab3B Page3"
                        PICTURE '../resource/d_test.png'

                        CREATE LABEL Tab3B_Page3_Label1
                               ROW    80
                               COL    110
                               AUTOSIZE .T.
                               VALUE "Tab3B_Page3_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON Tab3B_Page3_Button1
                               ROW    120
                               COL    60
                               WIDTH  180
                               HEIGHT 25
                               CAPTION "Tab3B_Page3_Button1"
                               ONCLICK mg_MsgInfo( "Click from Tab3B_Page3_Button1" )
                        END BUTTON

                     END PAGE

                     CREATE PAGE "Tab3B Page4"
                        PICTURE '../resource/d_test.png'

                        CREATE LABEL Tab3B_Page4_Label1
                               ROW    70
                               COL    120
                               AUTOSIZE .T.
                               VALUE "Tab3B_Page4_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON Tab3B_Page4_Button1
                               ROW    110
                               COL    20
                               WIDTH  200
                               HEIGHT 25
                               CAPTION "Tab3B_Page4_Button1"
                               ONCLICK mg_MsgInfo( "Click from Tab3B_Page4_Button1" )
                        END BUTTON

                     END PAGE

                  END TAB

               END PAGE

            END TAB

         END PAGE

      END TAB

      mg_Set( "d_window" , "Tab2A" , "value" , 2 )

      mg_Set( "d_window" , "Tab3A" , "value" , 3 )

Return .T.



Marinas-GUI Version 03.06 and
Marinas-IDE Version 05.06 and
LEX Files Version 02.06


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
last update: March 09
2017
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




A Harbour/QT framework to make multiplatform programs

(©) Copyright 2009-2017 by Fernando Santolin (aka CarozoDeQuilmes)
CarozoDeQuilmes@gmail.com

2009-2017 Beta tester and full English translator: Bruno Luciani
Bruno.Luciani@gmail.com

2014-2015 Final English corrector: David Worboys
DavidWorboys@hotmail.com

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Jump to Donation Topic


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

www.marinas-gui.org


www.marinas-gui.org  

Previous topic  First topic  Next topic