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 QListBox (Caixa com lista)

QListBox implementa uma janela com uma caixa com lista (com rolamento
vertical [scrolling]). O 1º item em uma listbox é 0, o próximo é 1, e etc...
Demais componentes    - Click Barra lateral esquerda
Informações adicionais - Click propriedades  em azul
Propriedades de QListBox
   Campo    Tipo    R/W+    Padrão    Suporte#
 Align
 INTEGER    RW  alNone    W
 BorderStyle
 INTEGER    RW  bsSingle    W
 Color
 INTEGER    RW      WX
 Columns
 INTEGER    RW  0    W
 CopyMode
 INTEGER    RW  cmBlackness    W
 Cursor
 INTEGER    RW  crDefault    W
 Enabled
 INTEGER    RW  True    WXG
 ExtendedSelect
 INTEGER    RW  True    WX
 Font
 QFONT    W      W
 Height
 INTEGER    RW      WXG
 Hint
 STRING    RW      WXG
 Item
 ARRAY of STRING    RW      WXG
 ItemCount
 INTEGER    R      WXG
 ItemHeight
 INTEGER    RW      W
 ItemIndex
 INTEGER    RW      WXG
 Left
 INTEGER    RW  0    WXG
 MultiSelect
 INTEGER    RW  False    WX
 Parent
 QFORM/QPANEL/QTABCONTROL    W      WXG
 PopupMenu
 QPOPUPMENU    W      W
 SelCount
 INTEGER    R      W
 Selected
 ARRAY of INTEGER    RW      WX
 ShowHint
 INTEGER    RW  False    WXG
 Sorted
 INTEGER    RW  False    WG
 Style
 INTEGER    RW  lbStandard    W
 TabOrder
 INTEGER    RW      W
 TabWidth
 INTEGER    RW  0    W
 Tag
 INTEGER    RW      WXG
 Text
 STRING    RW      W
 Top
 INTEGER    RW  0    WXG
 TopIndex
 INTEGER    RW      W
 Visible
 INTEGER    RW  True    WXG
 Width
 INTEGER    RW      WXG
+ R = Propriedade de leitura   W = Propriedade de escrita             #W = Windows  X = Linux  G = Solaris
Métodos de QListBox
   Método    Tipo    Descrição  Parâmetros  Suporte#
 AddItems
 SUBI  Adiciona itens à listbox  STRINGs,
 Infinite
  WXG
 Circle  SUB (x1%, y1%, x2%, y2%, c%,
  fill%)
 Desenha e preenche Circle   6   W
 Clear
 SUB  Apaga a inteira listbox   0   WXG
 CopyRect  SUB (D, Image, S)  D e S são QRECTs, ou QBitmapImage pode ser
 QImage, QCanvas ou Bitmap
  3   W
 DelItems
 SUBI  Apaga itens pelos indices   Index #s,
  Infinite
  WXG
 Draw  SUB (x%, y%, BMP)  Desenha Bitmap em (X,Y)   3   W
 FillRect
 SUB (x1%, y1%, x2%, y2%, c%)  Desenha e prenche um retangulo   5   W
 InsertItem  SUB (Index%, String$)  Insere item em Index%   2   WXG
 Line
 SUB (x1%, y1%, x2%, y2%, c%)  Desenha uma linha   5   W
 LoadFromFile  SUB (FileName AS STRING)  Carrega um arquivo para a lista   1   W
 Paint
 SUB (x%, y%, c%, borderc%)  Preenche a região   4   W
 Pset  SUB (x%, y%, c%)  Plota um Pixel   3   W
 Rectangle
 SUB (x1%, y1%, x2%, y2%, c%)  Desenha um retangulo   5   W
 Repaint  SUB  Força repintar a listbox   0   W
 RoundRect
 SUB (x1%, y1%, x2%, y2%,
  x3%, y3%, c%)
 Desenha e preenche um retangulo arredondado   7   W
 SaveToFile  SUB (FileName AS STRING)  Grava a list em arquivo   1   W
 StretchDraw
 SUB (Rect AS QRECT, BMP)  Desenha BMP e ajusta para caber dentro do Rect   2   W
 TextHeight  FUNCTION (Text$) AS WORD  Retorna a altura, em pixels, da string Text$   1   W
 TextWidth
 FUNCTION (Text$) AS WORD  Retorna a largura, em pixels, da string Text$   1   W
 TextRect  SUB (Rect AS QRECT, x%, y%,
 S$, fc%, bc%)
 Escreve texto, e monta-o dentro da região do Rect   6   W
 TextOut
 SUB (x%, y%, S$, fc%, bc%)  Escreve texto na imagem   5   W
#W = Windows  X = Linux  G = Solaris
Eventos de QListBox
   Evento    Tipo    Ocorre quando...    Parâmetros  Suporte#
 OnClick
 VOID  Usuário clicou num item    0    WXG
 OnDblClick
 VOID  Usuário dá 2 cliques num item    0    WXG
 OnDrawItem
 SUB (Index%, State%, R AS QRect)  Items é repintado por quem traça as
 listboxes
   3    W
 OnEnter
 VOID  Usuário pressiona Enter para selecionar
 um item
   0    W
 OnMeasureItem
 SUB (Index%, Height%)  Calcula a altura para quem traça
 listboxes variáveis
   3    W
 WndProc
 SUB (Hwnd%, Msg%, wParam%, lParam%)  Mensagens enviadas para QListBox    4    W
#W = Windows  X = Linux  G = Solaris
QListBox exemplo:

'-- Arrastar um botão
  DIM Form AS QForm
  DIM ListBox AS QListBox

  ListBox.Parent = Form
  ListBox.AddItems "1. Apples", "2. Oranges", "3. Bananas"
  ListBox.DelItems 1,2      '' Deletes Oranges and Bananas

  ListBox.Item(0) = "1. Strawberries"   '-- Change the first item

  Form.ShowModal
Sinta-se à vontade para dar sugestões e fazer críticas construtivas.

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