$INCLUDE "RAPIDQ.INC"
DIM SAVEDIALOG AS QSAVEDIALOG
SAVEDIALOG.Filter = "*.txt"
DECLARE SUB SAVETEXT
DECLARE SUB QUITAPPLICATION
CREATE Form AS QFORM
CAPTION = "RichEdit"
Width = 564
Height = 485
Center
CREATE MAINMENU AS QMAINMENU
CREATE MENUITEM1 AS QMENUITEM
CAPTION = "File"
CREATE MENUITEM2 AS QMENUITEM
CAPTION = "Save..."
OnClick = SAVETEXT
END CREATE
CREATE MENUITEM3 AS QMENUITEM
CAPTION = "-"
END CREATE
CREATE MENUITEM4 AS QMENUITEM
CAPTION = "Quit"
OnClick = QUITAPPLICATION
END CREATE
END CREATE
END CREATE
CREATE RichEdit1 AS QRICHEDIT
Left = 0
Top = 0
Width = 556
Height = 458
Align = 5
AddStrings "This is an example which shows how to save text to a file."
PlainText = 1
END CREATE
END CREATE
Form.SHOWMODAL
SUB SAVETEXT
IF SAVEDIALOG.EXECUTE THEN
RichEdit1.SaveToFile SAVEDIALOG.FileName+".txt"
SHOWMESSAGE "Your File was successfully stored at: "+SAVEDIALOG.FileName+".txt"
END IF
END SUB
SUB QUITAPPLICATION
Application.Terminate
END SUB
|