Guidance
指路人
g.yi.org
software / rapidq / Examples / Tools - IDE, Designer, Builder / FreeQ IDE src / inc ide / IDE_AppWizard.inc

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  

     CREATE AppWizardForm AS QFormex
      PARENT = MainForm
      FormStyle = fsStayOnTop
      Width = 800         'Screen.Width - 200
      Height = 600        'Screen.Height - 200 '600  'MainForm.ClientHeight - 30
      COLOR = 4465698
      CAPTION = "Application Wizard Form"
      Center
      OnKeyDown = AppWizardForm_KeyDown


    'CREATE AppWizardTab AS QTABCONTROL
    'AddTabs "Application Wizard" , "Home Page"
    'Width = AppWizardForm.ClientWidth
    'Height = AppWizardForm.ClientHeight
    'OnChange = AppWizardTabChange

    'CREATE AppWizardPanel0 AS QPANEL
    'Left = 0
    'Top = 32
    'Width = AppWizardTab.Clientwidth
    'Height = AppWizardTab.ClientHeight
    'Color = 4465698

      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  'Groupbox


      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  'Groupbox


      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  'panel 0
    '
    'CREATE AppWizardPanel1 AS QPANEL
    'Left = 0
    'Top = 32
    'Width = Screen.Width '780
    'Height = Screen.Height '580
    '
    'CREATE AppWizardIEExplorer AS QOLECONTAINER
    'Top = 0
    'Left = 0
    'Width = Screen.Width    'AppWizardPanel1.ClientWidth
    'Height = Screen.Height  'AppWizardPanel1.ClientHeight
    'END CREATE
    '
    'END CREATE  'panel 1
    '
    'END CREATE  'Tab control

     END CREATE  'app wizard form


     SUB mnuOpenAppWizard_Click
      AppWizardForm.Show
    'AppWizardExplorerNavigate(IDE.HomePage)
    'AppWizardTab.TabIndex = 0
    'AppWizardTabChange
     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
        'AppWizardIEExplorer.Free                    'need this to free Mem in COM interface
       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 AppWizardExplorerNavigate(TheWebPage AS STRING)
'IF TheWebPage <> "" THEN
'AppWizardIEExplorer.CreateObject("Shell.Explorer.1")
'AppWizardIEExplorer.Navigate(TheWebPage)
'Do               ' bugs without this
'DoEvents
'Loop Until AppWizardIEExplorer.Busy = False
'END IF
'END SUB
'


'SUB AppWizardTabChange
'SELECT CASE AppWizardTab.TabIndex
'CASE 0
'AppWizardPanel0.Visible = TRUE
'AppWizardPanel1.Visible = FALSE
'CASE 1
'AppWizardPanel1.Visible = TRUE
'AppWizardPanel0.Visible = FALSE
'END SELECT
'END SUB


     SUB IDE_Create_RQGUIFile

      DEFSTR TheNewName = CURDIR$ + "\" + IDE.NewFileName + STR$(IDE.NewFileIndex) + ".bas"  'set default new name
      MFE_MakeNewFile(TheNewName) 'make a new file

      DEFSTR s = IDE.CompilerTemplatePath + "new_application.tpl"  'already have major template?
      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"  'add TYPECHECK ON if requested before save
       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"  'set default new name
      MFE_MakeNewFile(TheNewName) 'make a new file

      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"  'set default new name
      MFE_MakeNewFile(TheNewName) 'make a new file

      re.SetFocus
      re.AddStrings(tmpList.Text)

      IDE.LexLanguage(MFE_Tab.TabIndex) = SCLEX_FREEBASIC
      IDE.ModuleType(MFE_Tab.TabIndex) = 1  'set as FreeBasic app
      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"  'set default new name
      MFE_MakeNewFile(TheNewName) 'make a new file

      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  'set as FreeBasic DLL
      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"  'set default new name
      MFE_MakeNewFile(TheNewName) 'make a new file

      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


掌柜推荐
 
 
¥1,390.00 ·
 
 
¥287.00 ·
 
 
¥410.00 ·
 
 
¥1,380.00 ·
 
 
¥1,080.00 ·
 
 
¥271.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-12-07 21:18:04