Rapid-Q Documentation by Bryn Mosher - (c) 2000 William Yu | Appendix A: QFLATBUTTON

# QFLATBUTTON Component

An Internet Explorer style flat button for Windows users.

QImage Properties

Field | Type | R/W | Default
AutoSize | INTEGER | R | True
B | INTEGER (Current Windows Desktop Blue RGB value) | R |
BMPHandle | RESOURCE | RW |
Center | INTEGER | R | True
CopyMode | INTEGER | RW | cmBlackness
CurrState | INTEGER | R | fbFlat
Cursor | INTEGER | RW | crDefault
Enabled | INTEGER | RW | True
Font | QFONT | W |
G | INTEGER (Current Windows Desktop Green RGB value) | R |
Handle | INTEGER | RW |
Height | INTEGER | RW |
Hint | STRING | RW |
Left | INTEGER | RW | 0
Parent | QFORM/QPANEL/QTABCONTROL | W |
Pixel | 2D ARRAY of INTEGER | RW |
PopupMenu | QPOPUPMENU | W |
R | INTEGER (Current Windows Desktop Red RGB value) | R |
ShowHint | INTEGER | RW | False
Stretch | INTEGER | R | False
Top | INTEGER | RW | 0
Transparent | INTEGER | R | True
Width | INTEGER | RW |
Visible | INTEGER | RW | True

QImage Methods

Method | Type | Description | Params
Circle | SUB (x1%, y1%, x2%, y2%, c%, fill%) | Draw & Fill Circle | 6
CopyRect | SUB (D, Image, S) | D and S are QRECTs, Image can be a QImage, QCanvas, or QBitmap | 3
Draw | SUB (x%, y%, BMP) | Draw Bitmap at (X,Y) | 3
FillRect | SUB (x1%, y1%, x2%, y2%, c%) | Draws & Fills a rectangle | 5
Line | SUB (x1%, y1%, x2%, y2%, c%) | Draws a line | 5
Paint | SUB (x%, y%, c%, borderc%) | Fill Region | 4
Pset | SUB (x%, y%, c%) | Pixel plot | 3
Rectangle | SUB (x1%, y1%, x2%, y2%, c%) | Draws a rectangle | 5
Repaint | SUB | Force repainting of image | 0
StretchDraw | SUB (Rect AS QRECT, BMP) | Draw BMP and stretch to fit inside Rect | 2
TextHeight | FUNCTION (Text$) AS WORD | Returns the height, in pixels, of Text$ string | 1
TextWidth | FUNCTION (Text$) AS WORD | Returns the width, in pixels, of Text$ string | 1
TextRect | SUB (Rect AS QRECT, x%, y%, S$, fc%, bc%) | Write text, and clip within region Rect | 6
TextOut | SUB (x%, y%, S$, fc%, bc%) | Writes text to image | 5

QImage Events

Event | Type | Occurs when... | Params
Depress | VOID | Show button in fbDepressed (clicked not sad) state | 0
Flatten | VOID | Show button in fbFlattened or Normal state | 0
GetColors | VOID | Refreshes palate to Windows Desktop colors | 0
OnClick | VOID | User clicked on image | 0
OnDblClick | VOID | User double clicked on image | 0
Raise | VOID | Show button in fbRaised state | 0

QFlatButton Examples

      '-- QFlatButton Example #1
      ' Note that the image displayed is ALWAYS set to Transparent = True

      $ESCAPECHARS ON ' For getting colors - You can use the default with this turned off
      $INCLUDE "RapidQ.inc"
      $INCLUDE "QFlatButton.inc"

      $RESOURCE Button1Image AS "00139sm.bmp" ' The image to be displayed on Button1

      DECLARE SUB clicked
      DECLARE SUB FlattenButtons

      DIM Form AS QForm
      DIM Button1 AS QFlatButton
      Button1.BMPHandle = Button1Image
      Button1.Parent = Form
      Button1.onclick = Clicked

      Form.OnMouseMove = FlattenButtons 'This prevents hung images and some flickering
      Form.showmodal

      SUB Clicked
        SLEEP 1
      END SUB

      SUB FlattenButtons
        Button1.Flatten
      END SUB

Prev Component | Contents | Next Component