Referência de Objetos ou componentes

Application
ClipBoard
Printer
QBitMap
QButton
QCanvas
QCheckBox
QComboBox
QComPort
QCoolBtn
QDirTree
QEdit
QFileListBox
QFileStream
QFont
QFontDialog
QForm
QGauge
QGlassFrame
QGroupBox
QHeader
QImage
QImageList
QLabel
QListBox
QListView
QMainMenu
QMemoryStream
QMenuItem
QMySQL
QNotifyIconData
QOpenDialog
QOleObject
QOleContainer
QOutLine
QOvalBtn
QPanel
QPopMenu
QRadioButton
QRect
QRegistry
QRichEdit
QSaveDialog
QScrollBar
QScrolBox
QSocket
QSplitter
QStatusBar
QStringGrid
QStringList
QTabControl
QTimer
QTrackBar
QTreeView
Componente QHeader (Cabeçalho)

QHeader é um grupo de colunas de cabeçalho que o usuário pode redimensionar diretamente na tela

Tipo interno de QHeader

TYPE SectionsType              'ie. Header.Sections(0).Caption
     Alignment AS INTEGER  
'Padrão taLeftJustify
     AllowClick AS INTEGER  ' True (verdadeiro)
     Caption AS STRING
     MaxWidth AS INTEGER  
'Padrão 10000
     MinWidth AS INTEGER    'Padrão 0
     Style AS INTEGER          'Padrão hsText
     Width AS INTEGER         'Padrão 50
  END TYPE
Demais componentes    - Click Barra lateral esquerdac
Informações adicionais - Click propriedades  em azul
Propriedades de QHeadert
   Campo    Tipo    R/W+    Padrão
 Align
 INTEGER    RW  alNone
 ClientHeight
 INTEGER    RW  
 ClientWidth
 INTEGER    RW  
 CopyMode
 INTEGER    RW  cmBlackness
 Cursor
 INTEGER    RW  crDefault
 Enabled
 INTEGER    RW  True (verdadeiro)
 Font
 QFONT    W  
 Handle
 INTEGER    RW  
 Height
 INTEGER    RW  
 Hint
 STRING    RW  
 HotTrack
 INTEGER    RW  False (falso)
 Left
 INTEGER    RW  0
 Parent
 QFORM/QPANEL/QTABCONTROL    W  
 Pixel
 2D ARRAY of INTEGER    RW  
 PopupMenu
 QPOPUPMENU    W  
 Sections
 ARRAY de SectionsType    RW  
 SectionsCount
 INTEGER    R  
 ShowHint
 INTEGER    RW  False (falso)
 Tag
 INTEGER    RW  
 Top
 INTEGER    RW  0
 Width
 INTEGER    RW  
 Visible
 INTEGER    RW  True (verdadeiro)
+ R = Propriedade de leitura   W = Propriedade de escrita             #W = Windows  X = Linux  G = Solaris


Métodos de QHeader
   Método    Tipo    Descrição  Parâmetros
AddSections
SUBI Adicionar novas seções ao Header    STRING,
    Infinite
Clear
SUB Apaga todas as seções    0
Circle
SUB (x1%, y1%, x2%, y2%, c%, fill%) Desenha e preenche o circulo.    6
CopyRect
SUB (D, Image, S) D e S são QRECTs. Image pode ser um QImage, QCanvas, ou QBitmap.    3
Draw
SUB (x%, y%, BMP) Desenha e preenche um retângulo.    3
FillRect
SUB (x1%, y1%, x2%, y2%, c%) D e S são QRECTs. Image pode ser um QImage, QCanvas, ou QBitmap.    3
Line
SUB (x1%, y1%, x2%, y2%, c%) Desenha uma linha.    5
Paint
SUB (x%, y%, c%, borderc%) Preenche uma Região.    4
Pset
SUB (x%, y%, c%) Plota um pixel.    3
Rectangle
SUB (x1%, y1%, x2%, y2%, c%) Desenha um retângulo.    5
Repaint
SUB Força repintar o header.    0
RoundRect
SUB (x1%, y1%, x2%, y2%, x3%, y3%, c%) Desenha e prenche um rectângulo arredondado.    7
StretchDraw
SUB (Rect AS QRECT, BMP) Desenha um BMP e ajusta-o dentro do Rect.    2
TextHeight
FUNCTION (Text$) AS WORD Retorna a altura em pixels, do Text$ string.    1
TextWidth
SUB (Rect AS QRECT, BMP) Retorna a largura em pixels, do Text$ string.    1
TextRect
SUB (Rect AS QRECT, x%, y%, S$, fc%, bc%) Escreve texto, e coloca dentro da região Rect.    6
TextOut
SUB (x%, y%, S$, fc%, bc%) Escreve texto na imagem.    5
#W = Windows  X = Linux  G = Solaris


Eventos de QHeader
   Efento    Tipo    Ocorre quando...  Parâmetros
OnDrawSection
SUB (Index%, Pressed%, Rect AS QRECT) Uma seção do header precisa ser repintada. A propriedade Style em Header section deve ser hsOwnerDraw.    3
OnMouseDown
SUB (Button%, X%, Y%, Shift%) Botão doMouse pressionado.    4
OnMouseMove
SUB (X%, Y%, Shift%) O Mouse foi movido.    3
OnMouseUp
SUB (Button%, X%, Y%, Shift%) O botão do Mouse foi solto.    4
OnResize
VOID O tamanho do header foi alterado.    0
OnSectionClick
SUB (Index%) A seção Index% do header foi clicada.    1
OnSectionResize
SUB (Index%) Uma seção do Header foi redimensionada.    1
OnSectionTrack
SUB (Index%, Width%, State%) Uma seção do Header foi arrastada.    3
QHeader exemplo:


$TYPECHECK ON
$INCLUDE "RAPIDQ.INC"

DECLARE SUB DrawSection (Index AS INTEGER, Pressed AS INTEGER, Rect AS QRECT, Sender AS QHEADER)
DECLARE SUB SectionTrack (Index AS INTEGER, Width AS INTEGER, State AS INTEGER, Sender AS QHEADER)

CREATE Form AS QFORM
    Caption = "QHeader exemplo"
    Center
    CREATE Header AS QHEADER
        AddSections "1", "2", "3"
        Sections(1).AllowClick = FALSE
        Sections(0).Style = hsOwnerDraw
        Sections(0).Width = 100
        Sections(1).Style = hsOwnerDraw
        Sections(2).Style = hsOwnerDraw
        OnDrawSection = DrawSection
        OnSectionTrack = SectionTrack
    END CREATE
    CREATE ListB
ox1 AS QLISTBOX
        Align = alLeft
        Width = 100
        AddItems "1. Rapid-Q", "2. Taxas"
    END CREATE
    CREATE StatusBar AS QSTATUSBAR
        SimplePanel = TRUE
        SimpleText = "Sem movimento"
    END CREATE
    ShowModal
END CREATE

SUB DrawSection (Index AS INTEGER, Pressed AS INTEGER, Rect AS QRECT, Sender AS QHEADER)
    Sender.TextOut(Rect.Left+5,Rect.Top+1, STR$(Index+1), &HFF0000, -1)
    SELECT CASE Index
        CASE 0
            Sender.FillRect(Rect.Left+20,Rect.Top+2,Rect.Right-20,Rect.Bottom-2, &H00FF00)
        CASE 1
            Sender.Circle(Rect.Left+20,Rect.Top+2,Rect.Right-20,Rect.Bottom-2, &HFF, &HFF)
        CASE 2
    END SELECT
END SUB

SUB SectionTrack (Index AS INTEGER, Width AS INTEGER, State AS INTEGER, Sender AS QHEADER)
    StatusBar.SimpleText = "Movimento "+STR$(Width)
    SELECT CASE Index
        CASE 0
            ListBox1.Width = Width
    END SELECT
END SUB
Sinta-se à vontade para dar sugestões e fazer críticas construtivas.

Anterior           Alto da página           Página Inicial             Próxima