CREATE AppWizardForm AS QFormex
PARENT = MainForm
FormStyle = fsStayOnTop
Width = 800
Height = 600
COLOR = 4465698
CAPTION = "Application Wizard Form"
Center
OnKeyDown = AppWizardForm_KeyDown
CREATE AppWizardGroupBox AS QGROUPBOX
Top = 8
Left = 36
Width = 720
Height = 160
Font.Size = 12
Font.COLOR = clWhite
CAPTION = " Previous Projects "
CREATE ProjLink0 AS QLABEL
Left = 8
Top = 28
Width = 600
Height = 32
Font.Size = 14
Font.COLOR = clWhite
CAPTION = mnuRecentProj0.CAPTION
Cursor = crHandPoint
OnClick = ProjLinkClick
END CREATE
CREATE ProjLink1 AS QLABEL
Left = 8
Top = 70
Width = 600
Height = 32
Font.Size = 14
Font.COLOR = clWhite
CAPTION = mnuRecentProj1.CAPTION
Cursor = crHandPoint
OnClick = ProjLinkClick
END CREATE
CREATE ProjLink2 AS QLABEL
Left = 8
Top = 112
Width = 600
Height = 32
Font.Size = 14
Font.COLOR = clWhite
CAPTION = mnuRecentProj2.CAPTION
Cursor = crHandPoint
OnClick = ProjLinkClick
END CREATE
END CREATE
CREATE AppWizardGroupBox2 AS QGROUPBOX
Top = 190
Left = 36
Width = 720
Height = 320
Font.Size = 12
Font.COLOR = clWhite
CAPTION = " New Applications "
CREATE AppWizardImage1 AS QIMAGE
Left = 40
Top = 32
Width = 133
Height = 110
BMPHandle = makeGUIapp
Hint = "Create GUI app"
ShowHint = TRUE
OnClick = IDE_Create_RQGUIFile
END CREATE
CREATE AppWizardImage2 AS QIMAGE
Left = 220
Top = 32
Width = 133
Height = 110
BMPHandle = makeConsoleApp
Hint = "Create CONSOLE app"
ShowHint = TRUE
OnClick = IDE_Create_RQConsoleFile
END CREATE
CREATE AppWizardImage3 AS QIMAGE
Left = 397
Top = 32
Width = 133
Height = 110
BMPHandle = makeRQ_FB_Proj
Hint = "Create RQ /FreeBasic Project"
ShowHint = TRUE
OnClick = IDE_Create_RQ_FreeBasicProj
END CREATE
CREATE AppWizardImage4 AS QIMAGE
Left = 40
Top = 180
Width = 133
Height = 110
BMPHandle = makeFreeBasicApp
Hint = "Create FreeBasic app"
ShowHint = TRUE
OnClick = IDE_Create_FreeBasicFile
END CREATE
CREATE AppWizardImage5 AS QIMAGE
Left = 219
Top = 180
Width = 133
Height = 110
BMPHandle = makeFreeBasicDLL
Hint = "Create FreeBasic DLL"
ShowHint = TRUE
OnClick = IDE_Create_FreeBasicDLL
END CREATE
CREATE AppWizardImage6 AS QIMAGE
Left = 398
Top = 180
Width = 133
Height = 110
BMPHandle = makeFBinRQ_Proj
Hint = "Create FBinRQ Project"
ShowHint = TRUE
OnClick = IDE_Create_FBinRQ
END CREATE
END CREATE
CREATE WizardHomePageLabel AS QLABEL
Left = 8
Top = 520
Width = 600
Height = 32
Font.Size = 14
Font.COLOR = clWhite
CAPTION = IDE.HomePage
Cursor = crHandPoint
OnClick = WizardHomePageLink
END CREATE
END CREATE
SUB mnuOpenAppWizard_Click
AppWizardForm.Show
END SUB
SUB AppWizardForm_KeyDown(Key AS WORD , Shift AS INTEGER)
IF Key = 27 THEN AppWizardForm.CLOSE
END SUB
SUB AppWizardForm_Close
IF AppWizardForm.Visible THEN
AppWizardForm.CLOSE
END IF
END SUB
SUB ProjLinkClick(Sender AS QLABEL)
IF FILEEXISTS(TRIM$(Sender.CAPTION)) THEN
AppWizardForm_Close
MFE_LoadProject(TRIM$(Sender.CAPTION))
ELSE
SHOWMESSAGE "Project file: " + TRIM$(Sender.CAPTION) + " does not exist"
END IF
END SUB
SUB WizardHomePageLink(Sender AS QLABEL)
IF Sender.CAPTION <> "" THEN ShellExecute(0,"open",Sender.CAPTION,"","",1)
END SUB
SUB IDE_Create_RQGUIFile
DEFSTR TheNewName = CURDIR$ + "\" + IDE.NewFileName + STR$(IDE.NewFileIndex) + ".bas"
MFE_MakeNewFile(TheNewName)
DEFSTR s = IDE.CompilerTemplatePath + "new_application.tpl"
IF FILEEXISTS(s) = TRUE THEN
Stat.Panel(5).CAPTION = "Loading template: " + s
tmpList.LoadFromFile(s)
ELSE
tmpList.Clear
IF IDE.TypeCheckOn THEN tmpList.Text = "$TYPECHECK ON"
tmpList.AddItems(_
"$APPTYPE GUI" + CRLF + _
"$INCLUDE <RapidQ.inc>" + CRLF + _
"CREATE Form AS QFORM" + CRLF + _
" Caption = " + Quot$ + "Form" + Quot$ + CRLF + _
" Width = 640" + CRLF + _
" Height = 480" + CRLF + _
" Center" + CRLF + _
" 'OnShow = Initialize" + CRLF + CRLF + _
" 'CREATE" + CRLF + _
" 'add objects here" + CRLF + _
" 'END CREATE" + CRLF + CRLF + _
"END CREATE" + CRLF + CRLF + _
"'minimize to taskbar correctly" + CRLF + _
"SetWindowLong(Form.Handle, -8, 0)" + CRLF + _
"SetWindowLong(Application.Handle, -8, Form.Handle)" + CRLF + CRLF + _
"'run application" + CRLF + _
"Form.ShowModal")
END IF
re.SetFocus
re.AddStrings(tmpList.Text)
END SUB
SUB IDE_Create_RQConsoleFile
DEFSTR TheNewName = CURDIR$ + "\" + IDE.NewFileName + STR$(IDE.NewFileIndex) + ".bas"
MFE_MakeNewFile(TheNewName)
tmpList.Clear
tmpList.AddItems(_
"$APPTYPE CONSOLE" + CRLF + _
"SetConsoleTitle " + Quot$ + "Console" + Quot$ + CRLF + _
"CLS" + CRLF + _
"'LOCATE 25,1" + CRLF + _
"'COLOR ,3" + CRLF + CRLF + _
"'commands here" + CRLF + CRLF + _
"DO:LOOP UNTIL INKEY$ <> " + Quot$ + Quot$)
re.SetFocus
re.AddStrings(tmpList.Text)
END SUB
SUB IDE_Create_FreeBasicFile
DEFSTR TheNewName = CURDIR$ + "\" + IDE.NewFileName + STR$(IDE.NewFileIndex) + ".fbb"
MFE_MakeNewFile(TheNewName)
re.SetFocus
re.AddStrings(tmpList.Text)
IDE.LexLanguage(MFE_Tab.TabIndex) = SCLEX_FREEBASIC
IDE.ModuleType(MFE_Tab.TabIndex) = 1
IF IDE.HiLighting THEN
IDE_SetHighlighting(IDE.LexLanguage(MFE_Tab.TabIndex))
END IF
END SUB
SUB IDE_Create_FreeBasicDLL
DEFSTR TheNewName = CURDIR$ + "\" + IDE.NewFileName + STR$(IDE.NewFileIndex) + ".fbb"
MFE_MakeNewFile(TheNewName)
tmpList.Clear
tmpList.AddItems(_
"'compile with option -dll " + CRLF + _
"'==== include file section =====" + CRLF + _
"'#include " + CRLF + CRLF + CRLF + _
"'==== const/global section =====" + CRLF + CRLF + CRLF + _
"'===== subs / function ending in EXPORT ========" + CRLF + _
"'" + CRLF + _
"Extern " + Quot$ + "Windows-MS" + Quot$ + CRLF + CRLF + _
"Function myFunc Alias " + Quot$ + "myFund" + Quot$ + "( var As Integer) As INTEGER EXPORT" + CRLF + CRLF + _
"' Return " + CRLF + CRLF + _
"End Function" + CRLF + CRLF + CRLF + _
"End Extern" + CRLF)
re.SetFocus
re.AddStrings(tmpList.Text)
IDE.LexLanguage(MFE_Tab.TabIndex) = SCLEX_FREEBASIC
IDE.ModuleType(MFE_Tab.TabIndex) = 2
IF IDE.HiLighting THEN
IDE_SetHighlighting(IDE.LexLanguage(MFE_Tab.TabIndex))
END IF
END SUB
SUB IDE_Create_FBinRQ
DEFSTR TheNewName = CURDIR$ + "\" + IDE.NewFileName + STR$(IDE.NewFileIndex) + ".bas"
MFE_MakeNewFile(TheNewName)
tmpList.Clear
tmpList.AddItems(_
"'" + CRLF + _
"' ----------------------------------------------------" + CRLF + _
"' FBinRQ Project" + CRLF + _
"' ----------------------------------------------------" + CRLF + _
"'" + CRLF + _
"''pre cmd killfiles nocon nobeep optimize upx " + CRLF + _
"' add this line for tiny exe ''pre cmd noadddll renamed.Dll" + CRLF + _
"''pre cmd myIcon.Ico" + CRLF + CRLF + _
"DefStr sBuildCount = " + Quot$ + "0.000" + Quot$ + " ''pre + 0.001 3" + CRLF + _
"DefStr sCompileTime = " + Quot$ + "12:00:00" + Quot$ + " ''pre Time$" + CRLF + _
"DefStr sCompileDate = " + Quot$ + "01-01-2010" + Quot$ + " ''pre Date$" + CRLF + _
"DefStr FirstCompiled = " + Quot$ + "01-01-2010 22:10:56" + Quot$ + CRLF + _
"DefStr sTimer = " + Quot$ + " 2020.805" + Quot$ + " ''pre timer" + CRLF + _
"'" + CRLF + CRLF + _
"$IFDEF FBB" + CRLF + _
"' -------------------------------------------------------------------" + CRLF + _
"' START FREEBASIC CODE" + CRLF + _
"' -------------------------------------------------------------------" + CRLF + CRLF + _
"#Include " + Quot$ + "Windows.bi" + Quot$ + CRLF + CRLF + _
"Dim Shared As INTEGER myVar" + CRLF + CRLF + _
"' functions and subs to export to RapidQ ..." + CRLF + CRLF + _
"Function MyFund (var1 As Long) As Long Export" + CRLF + CRLF + _
"End Function" + CRLF + _
"' -------------------------------------------------------------------" + CRLF + _
"' END FREEBASIC CODE" + CRLF + _
"' -------------------------------------------------------------------" + CRLF + _
"$ENDIF" + CRLF + _
"'" + CRLF + CRLF)
re.SetFocus
re.AddStrings(tmpList.Text)
END SUB
SUB IDE_Create_RQ_FreeBasicProj
IDE_Create_RQGUIFile
IDE_Create_FreeBasicDLL
END SUB
|