Rapid-Q Documentation by William Yu (c)1999 | Appendix A: QTABCONTROL

# QTABCONTROL Component

  QTabControl is a tab set that has the appearance of notebook dividers, except it is not made up of several pages.
  QTabControl Properties

  Field | Type | R/W | Default

  Align | INTEGER | RW | alNone
  ButtonStyle | INTEGER | RW | False
  ClientHeight | INTEGER | RW |
  ClientWidth | INTEGER | RW |
  Color | INTEGER | RW |
  Cursor | INTEGER | RW | crDefault
  Enabled | INTEGER | RW | True
  FlatButtons | INTEGER | RW | False
  FlatSeperators | INTEGER | RW | False
  FocusButtons | INTEGER | RW | False
  Font | QFONT | W |
  Height | INTEGER | RW |
  Hint | STRING | RW |
  HotTrack | INTEGER | RW | False
  Left | INTEGER | RW | 0
  MultiLine | INTEGER | RW | False
  Parent | QFORM/QPANEL/QTABCONTROL | W |
  PopupMenu | QPOPUPMENU | W |
  ScrollOpposite | INTEGER | RW | False
  ShowHint | INTEGER | RW | False
  Tab | ARRAY of STRING | RW |
  TabHeight | INTEGER | RW |
  TabInactiveColor | INTEGER | RW |
  TabInactiveFont | QFONT | W |
  TabIndex | INTEGER | RW |
  TabOrder | INTEGER | RW |
  TabPosition | INTEGER | RW |
  TabWidth | INTEGER | RW |
  Tag | INTEGER | RW |
  Top | INTEGER | RW | 0
  Width | INTEGER | RW |
  VerticalTabs | INTEGER | RW | False
  Visible | INTEGER | RW | True

  QTabControl Methods

  Method | Type | Description | Params

  AddTabs | SUBI | Add tabs to control | STRING, Infinite
  DelTabs | SUBI | Delete tabs from control | INTEGER, Infinite
  InsertTab | SUB (Index%, String$) | Inserts Tab at Index% | 2

  QTabControl Events

  Event | Type | Occurs when... | Params

  OnChange | VOID | Tabs change | 0

  QTabControl Examples

      '' Tab Control Example for Rapid-Q by William Yu
      '' When you hide a container (like QFORM, QTABCONTROL, and QPANEL), all the
      '' components within it are also hidden.

      $INCLUDE "RAPIDQ.INC"

      DECLARE SUB TabChange

      CREATE MainForm AS QForm
        Center
        Height = 300
        Width = 350
        Caption = "Tab Control demo"
        CREATE Tab AS QTabControl
          AddTabs "Tab 1","Tab 2","Tab 3","Tab 4"
          Width = MainForm.ClientWidth
          Height = MainForm.ClientHeight
          OnChange = TabChange
          HotTrack = True
          CREATE Panel0 AS QPanel
            Top = 40
            Left = 5
            Width = Tab.ClientWidth - 10
            Height = Tab.ClientHeight - 50
            Caption = "Panel 1"
            BevelInner = bvLowered
            CREATE Button1 AS QButton
              Caption = "Hello world!"
            END CREATE
          END CREATE
          CREATE Panel1 AS QPanel
            Top = 40
            Left = 5
            Width = Tab.ClientWidth - 10
            Height = Tab.ClientHeight - 50
            Caption = "Panel 2"
            BevelInner = bvLowered
            Visible = False
          END CREATE
          CREATE Panel2 AS QPanel
            Top = 40
            Left = 5
            Width = Tab.ClientWidth - 10
            Height = Tab.ClientHeight - 50
            Caption = "Panel 3"
            BevelInner = bvLowered
            Visible = False
          END CREATE
          CREATE Panel3 AS QPanel
            Top = 40
            Left = 5
            Width = Tab.ClientWidth - 10
            Height = Tab.ClientHeight - 50
            Caption = "Panel 4"
            BevelInner = bvLowered
            Visible = False
          END CREATE
        END CREATE
      END CREATE

      SUB TabChange
        SELECT CASE Tab.TabIndex
          CASE 0
            Panel0.Visible = True
            Panel1.Visible = False
            Panel2.Visible = False
            Panel3.Visible = False
          CASE 1
            Panel1.Visible = True
            Panel0.Visible = False
            Panel2.Visible = False
            Panel3.Visible = False
          CASE 2
            Panel2.Visible = True
            Panel1.Visible = False
            Panel0.Visible = False
            Panel3.Visible = False
          CASE 3
            Panel3.Visible = True
            Panel1.Visible = False
            Panel2.Visible = False
            Panel0.Visible = False
        END SELECT
      END SUB

      MainForm.ShowModal

  Prev Component | Contents | Next Component