 |
Documentation
|
GUI "MiniEd"
SUB FormLoad
GLOBAL Form1 AS CONTROL
GLOBAL Edit1 AS CONTROL
GLOBAL Button1 AS CONTROL
'********************************************************************
Form1 = BCX_FORM ( "Mini-Editor", 0, 0, 110, 80)
Edit1 = BCX_EDIT ( " BCX rocks!", Form1, 101, 0, 20, 110, 60)
Button1= BCX_BUTTON( "Change Font", Form1, 102, 35, 3, 40, 13)
'********************************************************************
Center (Form1) ' Center our Form on the screen
Show (Form1) ' Display our creation!
END SUB
BEGIN EVENTS
SELECT CASE CBMSG
'********************************************************************
CASE WM_COMMAND
'********************************************************************
IF CBCTL = 102 THEN
CALL SetCustomFont()
END IF
'********************************************************************
CASE WM_CTLCOLOREDIT
'********************************************************************
If (HANDLE)lParam = Edit1 Then
BCX_SET_EDIT_COLOR(Edit1, BCX_Font.Rgb, QBCOLOR(31))
End If
'********************************************************************
CASE WM_CLOSE
'********************************************************************
LOCAL id
id = MsgBox("Are you sure?", _
"Quit Program!", _
MB_YESNO OR MB_ICONQUESTION)
IF id = IDYES THEN DestroyWindow (hWnd)
EXIT FUNCTION
END SELECT
END EVENTS
SUB SetCustomFont()
DIM RetVal
RetVal = BCX_FONTDLG ' Fill the BCX_FONT structure
IF RetVal THEN
BCX_SET_FONT(Edit1, BCX_Font.Name$, _
BCX_Font.Size, _
BCX_Font.Bold, _
BCX_Font.Italic, _
BCX_Font.Underline, _
BCX_Font.Strikeout)
END IF
END SUB