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

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

  

     CREATE MainForm AS QFormEx
      CAPTION = FREEQVERSIONSTR
      Top  = 0
      Left = 0

      DragEnable = True
      DragZone.Left = 0
      DragZone.Top = 0
      DragZone.Right = MainForm.Width
      DragZone.Bottom = MainForm.Height
      OnDrag = MainFormOnDrag

      OnMessage = MainForm_WndProc
      KeyPreview = True
      OnKeyDown = MainForm_KeyDown
      Width = SCREEN.Width
      Height = SCREEN.Height - 32
      WindowState = wsNormal
      COLOR = clInActiveBorder
      OnClose = FormClose
      OnShow = Splitter_Moved
      OnResize = MainFormResize
      OnLostFocus = FindReplaceForm_GetFocus
      OnGetFocus = FindReplaceForm_LostFocus

'===========================================================
      CREATE LeftPanel AS QPANEL
       Top  = 0
       Left = 0
       Width = 185
       Height = MainForm.ClientHeight
       COLOR = clBtnFace
       Align = alLeft

       CREATE LeftPanelTopPanel AS QPANEL
        Top = 1
        Left = 1
        Width = LeftPanel.Width
        Height = 17
        COLOR =  &HD8E9EC
        Align = 1

        CREATE LeftPanelCloseBut AS QBUTTON
         Top = 0
         Left = 1
         Width = 16
         Height = 16
         Font.Size = 6
'                BMPHandle = Clear_BMP
         CAPTION = "X"
         Font.Size = 9
         Hint = "Close Panel"
         ShowHint = True
         OnClick = mnuViewLeftPanel_Click            'will manage menus too...
        END CREATE

        CREATE LeftPanelRefreshBut AS QBUTTON
         Top = 0
         Left = LeftPanelCloseBut.Left + LeftPanelCloseBut.Width + 10
         Width = 16
         Height = 16
         BMPHandle = RefreshLittle_bmp
         Hint = "Refresh"
         ShowHint = True
         OnClick = LeftPanelRefresh
        END CREATE

        CREATE LeftPanelCollapseBut AS QBUTTON
         Top = 0
         Left = LeftPanelRefreshBut.Left + LeftPanelRefreshBut.Width + 10
         Width = 16
         Height = 16
                'BMPHandle = RefreshLittle_bmp
         CAPTION = "-"
         Hint = "Collapse nodes"
         ShowHint = True
         OnClick = ProjectTreeFullCollapse
        END CREATE

        CREATE LeftPanelExpandBut AS QBUTTON
         Top = 0
         Left = LeftPanelCollapseBut.Left + LeftPanelCollapseBut.Width + 10
         Width = 16
         Height = 16
                'BMPHandle = RefreshLittle_bmp
         CAPTION = "+"
         Hint = "Expand nodes"
         ShowHint = True
         OnClick = ProjectTreeFullExpand
        END CREATE

       END CREATE              'top left

       CREATE SubsCombo_objects AS QCOMBOBOX
        Top = LeftPanelTopPanel.Top + LeftPanelTopPanel.Height + 1
        Left = 19
        Width = 145
        Height = 21
        Text = ""
        COLOR = &HFFFFFF
        Align = alTop
        DropDownCount = 35
        ShowHint = 1
        Hint = "Click on an item to find the QObject type of routine you declared."
                  'Visible=0
        OnChange = SubsCombo_Change_objects
       END CREATE


      '____________________________________________________________

       CREATE LeftPanelBottomPanel AS QPANEL
        Top = SubsCombo_objects.Top + SubsCombo_objects.Height + 1 '236
        Left = 1
        Width = 183
        Height = 300
        COLOR = &HD8E9EC
        Align = alClient    'alBottom

        CREATE MainListBox1 AS QLISTBOX        'casella di selezione dei controlli sulla form
         Align = 5
         Top = 1
         Left = 1
         Width = 161
         Height = 70
'                OnClick = selezionaitemoggetto
        END CREATE
       END CREATE

      END CREATE          'left panel


      CREATE LeftSplitter AS QSPLITTER
       Left = LeftPanel.Width + 1
       Width = 4
       MinSize = 4
       Height = MainForm.ClientHeight
       COLOR = clBtnFace
       OnMoved = Splitter_Moved
      END CREATE



'===========================================================

      CREATE RightPanel AS QPANEL
       Top  = 0
       Width = 185
       Left = MainForm.ClientWidth - RightPanel.Width
       Height = MainForm.ClientHeight
       COLOR = clBtnFace
       Align = alRight

       CREATE RightPanelTopPanel AS QPANEL
        Top = 1
        Left = 1
        Width = RightPanel.Width
        Height = 17
        COLOR = &HD8E9EC
        Align = 1

        CREATE RightPanelCloseBut AS QBUTTON
         Top = 0
         Left = 1
         Width = 16
         Height = 16
'                BMPHandle = Clear_BMP
         CAPTION = "X"
         Font.Size = 9
         Hint = "Close Panel"
         ShowHint = True
         OnClick = mnuViewRightPanel_Click            'will manage menus too...
        END CREATE

        CREATE RightPanelExportBut AS QBUTTON
         Top = 0
         Left = RightPanelCloseBut.Left + RightPanelCloseBut.Width + 10
         Width = 16
         Height = 16
         BMPHandle = ExportToWindow_bmp
         Hint = "Insert Results into Editor"
         ShowHint = True
         OnClick = ExportPanelText_Click
        END CREATE

        CREATE RightPanelRefreshBut AS QBUTTON
         Top = 0
         Left = RightPanelExportBut.Left + RightPanelExportBut.Width + 10
         Width = 16
         Height = 16
         BMPHandle = RefreshLittle_bmp
         Hint = "Refresh"
         ShowHint = True
         OnClick = RightPanelRefresh
        END CREATE

        CREATE RightPanelCollapseBut AS QBUTTON
         Top = 0
         Left = RightPanelRefreshBut.Left + RightPanelRefreshBut.Width + 10
         Width = 16
         Height = 16
                'BMPHandle = RefreshLittle_bmp
         CAPTION = "-"
         Hint = "Collapse nodes"
         ShowHint = True
         OnClick = RightPanelCollapse_Click
        END CREATE

        CREATE RightPanelExpandBut AS QBUTTON
         Top = 0
         Left = RightPanelCollapseBut.Left + RightPanelCollapseBut.Width + 10
         Width = 16
         Height = 16
                'BMPHandle = RefreshLittle_bmp
         CAPTION = "+"
         Hint = "Expand nodes"
         ShowHint = True
         OnClick = RightPanelExpand_Click
        END CREATE
       END CREATE

                  '_____________________Quick search panel _______________
       CREATE PanelSearch AS QPANEL
        Top = RightPanelTopPanel.Top + RightPanelTopPanel.Height + 1
        Left = 1
        Width = RightPanel.Width
        Height = 30
        COLOR = &HD8E9EC
        Align = 1


        CREATE SearchNextBut AS QBUTTON
         Top = 1
         Width = 28
         Left = Panelsearch.Width + SearchNextBut.Width - 1
         Height = 28
         Hint = "Search Next"
         ShowHint = True
         BMPHandle = next_BMP
         Default = 1        'no ding
         OnClick = IDESearchForward
        END CREATE

        CREATE SearchPrevBut AS QBUTTON
         Top = 1
         Width = 28
         Left = SearchNextBut.Left - SearchPrevBut.Width - 4
         Height = 28
         Hint = "Search Previous"
         ShowHint = True
         BMPHandle = Prev_BMP
         Default = 1        'no ding
         OnClick = IDESearchBackward
        END CREATE

        CREATE Poor AS QEDIT
         Left = 1
         Top = 1
         Width = SearchPrevBut.Left - 4
         Height = 30
         Text = ""
        END CREATE
       END CREATE      'panelsearch

      END CREATE          'right panel


      CREATE RightSplitter AS QSPLITTER
       Top  = 0
       Width = 5
       MinSize = 5
       Left = RightPanel.Width - RightSplitter.Width - 1
       Height = MainForm.ClientHeight
       COLOR = clInActiveBorder
       Align = alRight
       OnMoved = Splitter_Moved
      END CREATE


'===========================================================

      CREATE MFE_Tab AS QTABCONTROL
       MultiLine = True
       ScrollOpposite = False
'        ButtonStyle = True      '        FlatButtons = True, '        HotTrack = True
       Font.Bold = True
       TabInactiveFont = IDE_InactiveFont
       COLOR = IDE.FileTabContolBack
       TabInactiveColor = IDE.FileTabContolInactive
       Align = alClient
       Left = LeftPanel.Width
       Top = 0
       Height = MainForm.ClientHeight
       Width = MainForm.ClientWidth - RightPanel.Width - LeftPanel.Width - RightSplitter.Width - LeftSplitter.Width
       Font.Name = "Arial"
       OnChange = MFE_ChangeActive


       CREATE CenterPanel AS QPANEL
        Top = 38
        Left = 0
        Width = MFE_Tab.Width
        Height = MFE_Tab.Height - 50
        COLOR = clBtnFace
        Align = alClient
        Visible = False

        CREATE re AS QScintilla
         Set_Scrollbars = ssBoth
         BorderStyle = 0
         OnMouseDown = MainRichEditMouseDown
         OnMouseUp = MainRichEditMouseUp                     'get end of drag
         OnKeyUp = MainRichEditKeyUp
         OnKeyDown = MainRichEditKeyDown
         Init(MainForm.Handle)								'set to window handle to get Ctrl-xxx keys, native code is faster
         Top = 0
         Left = 0
         Width = CenterPanel.ClientWidth
         Height = CenterPanel.ClientHeight
         SendEditor(SCI_SETCARETWIDTH, 2&, 0&)               'set caret cursor to 3 pixels width
         SendEditor(SCI_SETYCARETPOLICY, CARET_SLOP OR CARET_EVEN, 1)      'scroll 1 line when caret goes out of bounds
         Set_SelColor(IDE.SelectionFore, IDE.SelectionBack)
         Set_Font(IDE.MainFont)
         SetStyle(STYLE_LINENUMBER, IDE.LineNumbersFore, IDE.LineNumbersBack, 0,0,0)
         SendEditor(SCI_USEPOPUP, 0&, 0&)                    'use our own custom popup menu
         Set_WantTabs(IDE.UseTabs)                           'spaces or tabs?
        END CREATE              'scintilla plugin


        CREATE BottomSplitter AS QSPLITTER
         Cursor = crVSplit
         Align = alBottom
         Height = 5
         MinSize = 5
         Top = re.Height + re.Top + BottomSplitter.Height
         Width = CenterPanel.Width
         COLOR = &HD8E9EC
         OnMoved = Splitter_Moved
        END CREATE


        CREATE BottomPanel AS QPANEL
         Height = 105
         Top  = MainForm.ClientHeight - BottomPanel.Height
         Width = MainForm.ClientWidth - RightPanel.Width - RightSplitter.Width - LeftPanel.Width - LeftSplitter.Width
         COLOR = clBtnFace
         Align = alBottom

         CREATE RichEditCompile AS QRICHEDIT
          PARENT = BottomPanel
          Align = alBottom
          Top = 5
          Width = BottomPanel.Width
          Height = BottomPanel.Height - 5
          Font.Name = "Courier New"
          Font.Size = 10
          AddString "Compile Log:"
          ScrollBars = 3
          OnMouseDown = RichEditCompile_MouseDown
         END CREATE
        END CREATE      'bottom panel

       END CREATE        'center panel
      END CREATE        'Tab control

'===========================================================

      CREATE Stat AS QSTATUSBAR        'add status bar before bottom aligned
       Top = MainForm.Height - Stat.Height
       AddPanels "" , "" , "" , "" , "", ""
       Panel(0).Width = 64                     'auto indent
       Panel(0).Alignment = taLeftJustify
       Panel(1).Width = 64                     'Code folding
       Panel(1).Alignment = taLeftJustify
       Panel(2).Width = 74                     'Code completion
       Panel(2).Alignment = taLeftJustify
       Panel(3).Width = 130                    'row / Col
       Panel(3).Alignment = taCenter
       Panel(4).Width = 160                    'pos / Selection len
       Panel(4).Alignment = taCenter
       Panel(5).Alignment = taLeftJustify      'last one is general info
       Panel(5).Width = 800
      END CREATE

'    CREATE prog AS QProgressBar
'        Kind = PBS_MARQUEE
'        Parent = Stat.Handle    'must set this way
'        Width = 150
'        Left = Stat.Width -160
'        Visible = False
'    END CREATE

     END CREATE        'Main form


'
'  need to set open dialog box to the mainForm
'  just get to it
     fDialog.PARENT = MainForm.Handle


      '----------------------------------------------------------------------

     SUB FormClose(ByRef Action AS INTEGER)
    'To prevent the form from closing when the 'X' button is clicked set  Action = False in the sub
      ExitClick
      IF IDE.CancelOnClose THEN Action = False
     END SUB


     SUB ExitClick
      IF IDE.SaveSettingsOnExit AND (IDE.MFEActiveProject = "") THEN
       ini.FileName = TheMainIniFile
       MainFormResize                  'this will get current form dimensions to IDE variables
       WriteIDE_FormVariables          'write them so form is the same next start
       WriteIDEVariables(False)        'write settings but don't reset
      END IF
      MFE_CloseAll
      IF IDE.CancelOnClose THEN EXIT SUB

    'comment out next line to check debugger output
'    IF FILEEXISTS (IDE.Path + "~" + (cDebugFileName -".bas") + ".EXE") THEN KILL IDE.Path + "~" + (cDebugFileName -".bas") + ".EXE"
'    IF FILEEXISTS (IDE.Path + "~" +  cDebugFileName) THEN KILL IDE.Path + "~" +  cDebugFileName
      KILL IDE.Path + "~" + (cDebugFileName -".bas") + ".EXE"
      KILL IDE.Path + "~" +  cDebugFileName
      Application.Terminate
     END SUB



     SUB MainForm_WndProc(Hwnd AS LONG, Msg AS LONG, wParam  AS LONG, lParam AS LONG)
      DEFSTR s
      IF Msg = WM_COPYDATA THEN                   'single instance... instance loading is sending message
       DIM CD AS COPYDATASTRUCT
       MEMCPY UDTPTR(CD), lParam , SIZEOF(CD)
       s = SPACE$(Cd.cbData)
       MEMCPY VARPTR(s),Cd.lpData,Cd.cbData
       IF UCASE$(StripFileExt(s)) = ".QPROJ" THEN
        MFE_LoadProject(s)
       ELSE
        MFE_Load(s)        	               'files with spaces ??Make sure we get any file in a directory with spaces in the folder name
       END IF
       ShowWindow(MainForm.Handle, SW_SHOW)    'restore me
      END IF
     END SUB


掌柜推荐
 
 
¥1,800.00 ·
 
 
¥489.00 ·
 
 
¥288.00 ·
 
 
¥908.00 ·
 
 
¥748.00 ·
 
 
¥264.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-12-07 21:18:03