$INCLUDE "RAPIDQ.INC" DIM Form AS QFORM Form.BorderStyle = bsDialog Form.ShowModal
DIM Form AS QForm DIM Button AS QButton Button.Parent = Form '' Add button to form
SUB AddButtonClick '' Do stuff END SUB AddButton.OnClick = AddButtonClick
SUB KeyPressed(Key AS WORD) '' Do stuff PRINT Key END SUB Form.OnKeyPress = KeyPressed
SUB KeyDown(Key AS WORD, Shift AS INTEGER) '' Do stuff PRINT Key;" ";Shift END SUB Form.OnKeyDown = KeyDown
DO A$=INKEY$ IF A$=CHR$(0)+"H" THEN PRINT "Up arrow key pressed" LOOP
OKButton1.Kind = bkOK CancelButton1.Kind = bkCancel
IF Dialog1.ShowModal = mrOK THEN '' User pressed OK ELSE '' User cancelled END IF
OKButton1.Kind = bkOK
OKButton1.ModalResult = mrOK
SUB ButtonClick Dialog1.ModalResult = mrOK END SUB OKButton1.ModalResult = mrNone '' No result OKButton1.OnClick = ButtonClick
DIM MainForm AS QForm MainForm.Left = 100 MainForm.Top = 50 MainForm.Height = 300 MainForm.Width = 400 MainForm.Caption = "Hello world!"
CREATE MainForm AS QForm Left = 100 Top = 50 Height = 300 Width = 400 Caption = "Hello world!" END CREATE
CREATE MainForm AS QForm Center CREATE Button1 AS QButton Left = 10: Top = 10: Height = 20: Width = 20 END CREATE ShowModal END CREATE
CREATE MainForm AS QForm Center CREATE MainMenu AS QMainMenu CREATE FileMenu AS QMenuItem Caption = "&File" CREATE OpenItem AS QMenuItem Caption = "&Open" END CREATE CREATE SaveItem AS QMenuItem Caption = "&Save" END CREATE END CREATE END CREATE ShowModal END CREATE