Guidance
指路人
g.yi.org
software / RapidQ / RQ Doc / html / qstringgrid.html

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
Appendix A: QSTRINGGRID
Rapid-Q Documentation by William Yu (c)1999-2000 Appendix A: QSTRINGGRID


QSTRINGGRID Component

QStringGrid allows you to present textual data in a tabular format.

QStringGrid Properties
FieldTypeR/WDefault




AlignINTEGERRWalNone
Align determines how the control aligns within its parent control.
BorderStyleINTEGERRWbsSingle
Cell2D ARRAY of STRINGRW
Cell(X, Y) is an array of strings, one string for each cell in the grid.
X = Column, Y = Row
ColINTEGERRW
Col is the index of the column that contains the selected cell.
ColCountINTEGERRW5
ColorINTEGERRW
ColumnListARRAY of STRINGRW
ColumnList maintains a list of strings deliminated by LF for use in Columned lists.
ColumnStyleARRAY of INTEGERRWgcsNone
ColumnStyle determines the style of each column.
0 = gcsList -- Column with a drop-down list for each item
1 = gcsEllipsis -- Column with an ellipsis button for each item
2 = gcsNone -- Normal column
ColWidthsARRAY of INTEGERRW
ColWidths is an indexed array giving the width in pixels of all the columns in the grid.
CursorINTEGERRWcrDefault
DefaultColWidthINTEGERRW64
DefaultRowHeightINTEGERRW24
EditorModeINTEGERRW
EnabledINTEGERRWTrue
FixedColorINTEGERRW
FixedColsINTEGERRW1
FixedColss is the number of columns on the left of the grid that cannot be scrolled.
FixedRowsINTEGERRW1
FixedRows is the number of rows on the top of the grid that cannot be scrolled.
FontQFONTW
GridHeightINTEGERRW
GridLineWidthINTEGERRW1
GridWidthINTEGERRW
HandleINTEGERR
HeightINTEGERRW
HintSTRINGRW
LeftINTEGERRW0
LeftColINTEGERRW
ParentQFORM/QPANEL/QTABCONTROLW
PopupMenuQPOPUPMENUW
RowINTEGERRW
Row is the index of the row that contains the selected cell.
RowCountINTEGERRW5
RowHeightsARRAY of INTEGERRW
RowHeights is an indexed array giving the height in pixels of all the rows in the grid.
ScrollBarsINTEGERRWssBoth
SeparatorSTRINGRW
Separator determines how the stringgrid should parse (ie. read/write) grid data. For example, you can save the grid data to a file, with each item deliminated by the Separator.
ShowHintINTEGERRWFalse
TabOrderINTEGERRW
TabStopsARRAY of INTEGERRW
TagINTEGERRW
TopINTEGERRW0
TopRowINTEGERRW
VisibleINTEGERRWTrue
VisibleColCountINTEGERR
VisibleRowCountINTEGERR
WidthINTEGERRW


QStringGrid Methods
MethodTypeDescriptionParams




AddOptionsSUBIAdd options to string gridINTEGER, Infinite
DeleteColSUB (Column%)Deletes/Remove a column1
DeleteRowSUB (Row%)Deletes/Remove a row1
DelOptionsSUBIDelete options from string gridINTEGER, Infinite
CircleSUB (x1%, y1%, x2%, y2%, c%, fill%)Draw & Fill Circle6
CopyRectSUB (D, Image, S)D and S are QRECTs, Image can be a QImage, QCanvas, or QBitmap3
DrawSUB (x%, y%, BMP)Draw Bitmap at (X,Y)3
FillRectSUB (x1%, y1%, x2%, y2%, c%)Draws & Fills a rectangle5
InsertColSUB (Column%)Inserts a blank column1
InsertRowSUB (Row%)Inserts a blank row1
LineSUB (x1%, y1%, x2%, y2%, c%)Draws a line5
LoadFromFileSUB (File$, RowOffset%, ColOffset%, MaxRows%)Loads table from file w/Separator4
LoadFromStreamSUB (S AS QFileStream/QMemoryStream, RowOffset%, ColOffset%, MaxRows%)Loads table from stream w/Separator4
PaintSUB (x%, y%, c%, borderc%)Fill Region4
PsetSUB (x%, y%, c%)Pixel plot3
RectangleSUB (x1%, y1%, x2%, y2%, c%)Draws a rectangle5
RepaintSUBForce repainting of stringgrid0
RoundRectSUB (x1%, y1%, x2%, y2%, x3%, y3%, c%)Draws & Fills a rounded rectangle7
SaveToFileSUB (File$, RowOffset%, ColOffset%, MaxRows%)Saves table to file w/Separator4
SaveToStreamSUB (S AS QFileStream/QMemoryStream, RowOffset%, ColOffset%, MaxRows%)Saves table to stream w/Separator4
SwapColsSUB (Col1%, Col2%)Swap two columns2
SwapRowsSUB (Row1%, Row2%)Swap two rows2
StretchDrawSUB (Rect AS QRECT, BMP)Draw BMP and stretch to fit inside Rect2
TextHeightFUNCTION (Text$) AS WORDReturns the height, in pixels, of Text$ string1
TextWidthFUNCTION (Text$) AS WORDReturns the width, in pixels, of Text$ string1
TextRectSUB (Rect AS QRECT, x%, y%, S$, fc%, bc%)Write text, and clip within region Rect6
TextOutSUB (x%, y%, S$, fc%, bc%)Writes text to cell5

QStringGrid Events
EventTypeOccurs when...Params




OnDrawCellSUB (Col%, Row%, State%, R AS QRect)Cells need to be redrawn4
OnEllipsisClickSUB (Col%, Row%)Pull down list is clicked2
OnKeyDownSUB (Key AS Word, Shift AS INTEGER)Key held down2
OnKeyPressSUB (Key AS BYTE)User presses a key1
OnKeyUpSUB (Key AS Word, Shift AS INTEGER)User releases a key2
OnListDropDownSUB (Col%, Row%, BYREF S AS STRING)Pull down list is clicked. S is a string with items separated by a new line character.3
OnSelectCellSUB (Col%, Row%, CanSelect%)User has selected a cell3
OnSetEditTextSUB (Col%, Row%, Value$)User has changed contents of cell3


QStringGrid Examples
CREATE Form AS QForm
  CREATE Grid AS QStringGrid
    Cell(1,1) = "hello"
  END CREATE
  Center
  ShowModal
END CREATE

'------------------------------------------------------------------
' Pulldown list example

$INCLUDE "RAPIDQ.INC"
$ESCAPECHARS ON

CONST AgeList = "10\n11\n12\n13\n14\n15\n16\n17\n18\n19"

SUB EllipsisClick (Col AS LONG, Row AS LONG, Sender AS QSTRINGGRID)
    Sender.Cell(Col, Row) = "Comments"+STR$(Row)
END SUB

CREATE Form AS QFORM
    CREATE Grid AS QSTRINGGRID
        Align = alClient
        AddOptions(goEditing)
        FixedRows = 1
        FixedCols = 0
        ColCount = 3
        RowCount = 5
        DefaultRowHeight = 20
        ColumnStyle(0) = gcsList
        ColumnStyle(1) = gcsEllipsis
        ColumnList(0) = AgeList
        Cell(0,0) = " Age"
        Cell(1,0) = " Comments"
        OnEllipsisClick = EllipsisClick
    END CREATE
    Caption = "Dropdown list example"
    Center
    ShowModal
END CREATE

Prev Component Contents Next Component
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2017-9-21  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2015-12-25 19:42:48