Guidance
指路人
g.yi.org
software / rapidq / Examples / Tools - IDE, Designer, Builder / FreeQ IDE src / MenuDesigner / FrmMain.bas

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

  

     CREATE OpenDialog AS QOPENDIALOG
      CAPTION = "Open Menu Template"
      Filter = "Menu Template (*.mnu)|*.mnu|All Files (*.*)|*.*"
     END CREATE

     CREATE FrmMain AS QFORM
      ICOHandle = MenuDesigner_ico
      CAPTION = "MenuDesigner  $NoName.mnu"
      Width = 560
      Height = 430
      BorderStyle = 1
      DelBorderIcons = 2
      AutoScroll = 0
      Center
'Menu
      CREATE mnuMain AS QMAINMENU
       CREATE mnuFile AS QMENUITEM
        CAPTION = "&File"
        CREATE mnuFileNew AS QMENUITEM
         CAPTION = "&New"
         onclick = mnuFileNew_Click
        END CREATE
        CREATE mnuFileOpen AS QMENUITEM
         CAPTION = "&Open..."
         onclick = mnuFileOpen_Click
        END CREATE
        CREATE mnuFileSave AS QMENUITEM
         CAPTION = "&Save"
         onclick = mnuFileSave_Click
        END CREATE
        CREATE mnuFileSaveAs AS QMENUITEM
         CAPTION = "Save &As..."
         onclick = mnuFileSaveAs_Click
        END CREATE
        CREATE mnuFileseparator AS QMENUITEM
         CAPTION = "-"
        END CREATE
        CREATE mnuFileExit AS QMENUITEM
         CAPTION = "&Exit"
         onclick = mnuFileExit_Click
        END CREATE
       END CREATE
       CREATE mnuView AS QMENUITEM
        CAPTION = "&View"
        CREATE mnuViewTBar AS QMENUITEM
         CAPTION = "&ToolBar"
         Checked = True
         onclick = mnuViewTBar_Click
        END CREATE
        CREATE mnuViewOptions AS QMENUITEM
         CAPTION = "&Options"
         onclick = mnuViewOptions_Click
        END CREATE
       END CREATE
       CREATE mnuHelp AS QMENUITEM
        CAPTION = "&Help"
        CREATE mnuHelpAbout AS QMENUITEM
         CAPTION = "About..."
         onclick = mnuHelpAbout_Click
        END CREATE
       END CREATE
      END CREATE
'ToolBar
      CREATE pnlToolBar AS QPANEL
       Left = 0
       Top = 0
       Width = 170
       Height = 35
       Align = 1
       BevelInner = bvRaised
       BevelOuter = bvLowered
       CREATE pnlToolBar1 AS QPANEL
        Left = 0
        Top = 0
        Width = 200
        Height = 35
        BevelInner = bvRaised
        BevelOuter = bvLowered
        CREATE cmdNew AS QXPButton
         BMPhandle = New_bmp
         Left = 10
         Top = 5
         Width = 25
         ShowHint = 1
         Hint = "New"
         OnClick = cmdNew_Click
        END CREATE
        CREATE cmdOpen AS QXPButton
         BMPhandle = Open_bmp
         Left = 35
         Top = 5
         Width = 25
         ShowHint = 1
         Hint = "Open"
             'TabOrder = 1
         OnClick = cmdOpen_Click
        END CREATE
        CREATE cmdSave AS QXPButton
         BMPhandle = Save_bmp
         Left = 60
         Top = 5
         Width = 25
         ShowHint = 1
         Hint = "Save"
            'TabOrder = 2
         OnClick = cmdSave_Click
        END CREATE
        CREATE cmdOptions AS QXPButton
         BMPhandle = Options_bmp
         Left = 100
         Top = 5
         Width = 25
         ShowHint = 1
         Hint = "Options"
            'TabOrder = 3
         OnClick = cmdOptions_Click
        END CREATE
        CREATE cmdHelp AS QXPButton
         BMPhandle = Help_bmp
         Left = 140
         Top = 5
         Width = 25
         ShowHint = 1
         Hint = "About"
            'TabOrder = 4
         OnClick = cmdHelp_Click
        END CREATE
        CREATE cmdExit AS QXPButton
         BMPhandle = Exit_bmp
         Left = 165
         Top = 5
         Width = 25
         ShowHint = 1
         Hint = "Exit"
            'TabOrder = 5
         OnClick = cmdExit_Click
        END CREATE
       END CREATE
      END CREATE

      CREATE pnlMain AS QPANEL
       BevelInner = bvnone
       BevelOuter = bvnone
       BevelInner = bvRaised
       BevelOuter = bvLowered
       Height = 350
       Align = 1
      'debug
       CREATE Lbldebug AS QLABEL
        CAPTION = "debug"
        Left = 12
        Top = 329
        Width = 39
       END CREATE
      'Caption
       CREATE LblCaption AS QLABEL
        CAPTION = "Ca&ption:"
        Left = 12
        Top = 17
        Width = 39
       END CREATE
       CREATE txtCaption AS QEDIT
        Text = ""
        Left = 60
        Top = 15
        Width = 175
        TabOrder = 0
        OnChange = txtCaptionChange
       END CREATE
      'Name
       CREATE LblName AS QLABEL
        CAPTION = "Na&me:"
        Left = 12
        Top = 47
        Width = 31
        Transparent = 1
       END CREATE
       CREATE txtName AS QEDIT
        Text = ""
        Left = 60
        Top = 45
        Width = 175
        TabOrder = 1
        OnChange = txtNameChange
       END CREATE
      'Checked
       CREATE chkChecked AS QCHECKBOX
        CAPTION = "&Checked"
        Left = 12
        Top = 90
        Width = 68
        TabOrder = 2
        onClick = chkChecked_click
       END CREATE
      'Enabled
       CREATE chkEnabled AS QCHECKBOX
        CAPTION = "&Enabled"
        Left = 79
        Top = 90
        Width = 60
        TabOrder = 3
    '    Checked = 1
        onClick = chkEnabled_click
       END CREATE
      'Visible
       CREATE chkVisible AS QCHECKBOX
        CAPTION = "&Visible"
        Left = 148
        Top = 90
        Width = 50
        TabOrder = 4
    '    Checked = 1
        onClick = chkVisible_click
       END CREATE
      'ShortCut
       CREATE LblShortCut AS QLABEL
        CAPTION = "&ShortCut"
        Left = 210
        Top = 91
        Width = 38
        Transparent = 1
       END CREATE
       CREATE CmbShortCut AS QCOMBOBOX
        AddItems  "(None)", _
         "Ctrl+A", _
         "Ctrl+B", _
         "Ctrl+C", _
         "Ctrl+D", _
         "Ctrl+E", _
         "Ctrl+F", _
         "Ctrl+G", _
         "Ctrl+H", _
         "Ctrl+I", _
         "Ctrl+J", _
         "Ctrl+K", _
         "Ctrl+L", _
         "Ctrl+M", _
         "Ctrl+N", _
         "Ctrl+O", _
         "Ctrl+P", _
         "Ctrl+Q", _
         "Ctrl+R", _
         "Ctrl+S", _
         "Ctrl+T", _
         "Ctrl+U", _
         "Ctrl+V", _
         "Ctrl+W", _
         "Ctrl+X", _
         "Ctrl+Y", _
         "Ctrl+Z", _
         "F1", _
         "F2", _
         "F3", _
         "F4", _
         "F5", _
         "F6", _
         "F7", _
         "F8", _
         "F9", _
         "F10", _
         "F11", _
         "F12", _
         "Crtl+F1", _
         "Crtl+F2", _
         "Crtl+F3", _
         "Crtl+F4", _
         "Crtl+F5", _
         "Crtl+F6", _
         "Crtl+F7", _
         "Crtl+F8", _
         "Crtl+F9", _
         "Crtl+F10", _
         "Crtl+F11", _
         "Crtl+F12", _
         "Shift+F1", _
         "Shift+F2", _
         "Shift+F3", _
         "Shift+F4", _
         "Shift+F5", _
         "Shift+F6", _
         "Shift+F7", _
         "Shift+F8", _
         "Shift+F9", _
         "Shift+F10", _
         "Shift+F11", _
         "Shift+F12", _
         "Shift+Ctrl+F1", _
         "Shift+Ctrl+F2", _
         "Shift+Ctrl+F3", _
         "Shift+Ctrl+F4", _
         "Shift+Ctrl+F5", _
         "Shift+Ctrl+F6", _
         "Shift+Ctrl+F7", _
         "Shift+Ctrl+F8", _
         "Shift+Ctrl+F9", _
         "Shift+Ctrl+F10", _
         "Shift+Ctrl+F11", _
         "Shift+Ctrl+F12", _
         "Ctrl+Ins", _
         "Shift+Ins", _
         "Del", _
         "Shift+Del", _
         "Alt+Enter"
        ItemIndex = 0
        Left = 265
        Top = 86
        Width = 95
        DropDownCount = 11
        TabOrder = 5
        OnChange = cmbShortCut_Change
       END CREATE
      'Left button
       CREATE cmdLeft AS QXPButton
        CAPTION = ""
        BMPHandle = ARW06LT_bmp
        Left = 12
        Top = 120
        Width = 40
        Height = 22
        TabOrder = 6
        onClick = cmdLeft_Click
       END CREATE
      'Right button
       CREATE cmdRight AS QXPButton
        CAPTION = ""
        BMPHandle = ARW06RT_bmp
        Left = 52
        Top = 120
        Width = 40
        Height = 22
        TabOrder = 7
        onClick = cmdRight_Click
       END CREATE
      'Down Button
       CREATE cmdDown AS QXPButton
        CAPTION = ""
        BMPHandle = ARW06DN_bmp
        Left = 92
        Top = 120
        Width = 40
        Height = 22
        TabOrder = 8
        onClick = cmdDown_Click
       END CREATE
      'Up Button
       CREATE cmdUp AS QXPButton
        CAPTION = ""
        BMPHandle = ARW06UP_bmp
        Left = 132
        Top = 120
        Width = 40
        Height = 22
        TabOrder = 9
        onClick = cmdUp_Click
       END CREATE
      'Next Button
       CREATE cmdNext AS QXPButton
        CAPTION = "&Next"
        Left = 175
        Top = 120
        Width = 60
        Height = 22
        TabOrder = 10
        Spacing = 13
        onClick = cmdNext_Click
       END CREATE
      'Insert button
       CREATE cmdInsert AS QXPButton
        CAPTION = "&Insert"
        Left = 238
        Top = 120
        Width = 60
        Height = 22
        TabOrder = 11
        onClick = cmdInsert_Click
       END CREATE
      'Delete Button
       CREATE cmdDelete AS QXPButton
        CAPTION = "&Delete"
        Left = 301
        Top = 120
        Width = 60
        Height = 22
        TabOrder = 12
        onClick = cmdDelete_Click
       END CREATE
      'List Items
       CREATE LstItems AS QLISTBOX
        Left = 12
        Top = 145
        Width = 349
        Height = 180
        TabOrder = 13
        ItemIndex=0
        additems
        item(0)=""
        itemindex=0
        onClick = lstItems_Click
       END CREATE
      'Wizard Buttton  'does nothing
'      CREATE cmdWizard AS QBUTTON
'         Caption = "Wi&zard"
'         BMPHandle = MENU_bmp
'         Left = 265
'         Top = 15
'         Width = 90
'         Height = 41
'      END CREATE

      'Preview Button
       CREATE cmdPreview AS QXPButton
        CAPTION = "Previe&w"
        BMPhandle = preview_bmp
        Left = 410
        Top = 15
        Width = 115
        Height = 73
        TabOrder = 16
        OnClick = cmdPreview_Click
       END CREATE
      'Grid
       CREATE stgItems AS QSTRINGGRID
        Left = 379
        Top = 145
        Height = 180
        Width = 162
        TabOrder = 17
        ColCount = 2
        RowCount = 8
        DefaultColWidth = 104
        DefaultRowHeight = 19
        ScrollBars = 1
        ColWidths(0) = 53
        Separator = ","
        Cell(0,0) = "Properties"
        Cell(1,0) = "Values"
        Cell(0,1) = "Name"
        Cell(0,2) = "Caption"
        Cell(0,3) = "Checked"
        Cell(0,4) = "Enabled"
        Cell(0,5) = "Visible"
        Cell(0,6) = "ShortCut"
        Cell(0,7) = "Level"
        FixedCols = 1
        FixedRows = 1
        col=0
        row=0
        enabled = False
       END CREATE
      END CREATE
     END CREATE

     WITH stgItems
      .Cell(1,1) = ""
      .Cell(1,2) = ""
      .Cell(1,3) = "0 -False"
      .Cell(1,4) = "0 -False"
      .Cell(1,5) = "0 -False"
      .Cell(1,6) = "0 -(None)"
      .Cell(1,7) = "0"
     END WITH

     SUB mnuFileNew_Click (Sender AS QMENUITEM)
      NewMenu
     END SUB

     SUB mnuFileOpen_Click (Sender AS QMENUITEM)
      FileOpen
     END SUB

     SUB mnuFileSave_Click (Sender AS QMENUITEM)
      SaveMenu
     END SUB

     SUB mnuFileSaveAs_Click (Sender AS QMENUITEM)
      SaveAs
     END SUB

     SUB mnuFileExit_Click (Sender AS QBUTTON)
      ExitProgram
     END SUB

     SUB mnuViewTBar_Click (Sender AS QMENUITEM)
      IF mnuViewTBar.Checked THEN
       mnuViewTBar.Checked = False
       pnlToolBar.Visible = False
       frmMain.Height = 395
      ELSE
       mnuViewTBar.Checked = True
       pnlToolBar.Visible = True
       frmMain.Height = 430
      END IF
     END SUB

     SUB mnuViewOptions_Click (Sender AS QMENUITEM)
      Options
     END SUB

     SUB mnuHelpAbout_Click (Sender AS QMENUITEM)
      About
     END SUB

     SUB cmdNew_Click (Sender AS QBUTTON)
      NewMenu
     END SUB

     SUB cmdOpen_Click (Sender AS QBUTTON)
      FileOpen
     END SUB

     SUB cmdSave_Click (Sender AS QBUTTON)
      SaveMenu
     END SUB

     SUB cmdOptions_Click (Sender AS QBUTTON)
      Options
     END SUB

     SUB cmdHelp_Click (Sender AS QBUTTON)
      About
     END SUB

     SUB cmdExit_Click (Sender AS QBUTTON)
      ExitProgram
     END SUB

     SUB txtCaptionChange(Sender AS QEDIT)
      stgItems.Cell(Indice + 1,2) = txtCaption.text
      CaptionStr = STRING$(Level, "=") + txtCaption.text
      lstItems.Item(Indice)= CaptionStr
     END SUB

     SUB txtNameChange(Sender AS QEDIT)
      stgItems.Cell(Indice + 1,1) = txtName.text
     END SUB

     SUB ChkChecked_Click (Sender AS QCHECKBOX)
      IF chkChecked.checked THEN
       stgItems.Cell(Indice + 1,3) = "1 -True"
      ELSE
       stgItems.Cell(Indice + 1,3) = "0 -False"
      END IF
     END SUB

     SUB ChkEnabled_Click (Sender AS QCHECKBOX)
      IF chkEnabled.checked THEN
       stgItems.Cell(Indice + 1,4) = "1 -True"
      ELSE
       stgItems.Cell(Indice + 1,4) = "0 -False"
      END IF
     END SUB

     SUB ChkVisible_Click (Sender AS QCHECKBOX)
      IF chkVisible.checked THEN
       stgItems.Cell(Indice + 1,5) = "1 -True"
      ELSE
       stgItems.Cell(Indice + 1,5) = "0 -False"
      END IF
     END SUB

     SUB cmbShortCut_Change (Sender AS QCOMBOBOX)
      DIM SelectCut AS INTEGER
      SelectCut= cmbShortCut.ItemIndex
      stgItems.Cell(Indice + 1,6) = STR$(SelectCut)+ " -" + cmbShortCut.Item(SelectCut)
     END SUB

     SUB cmdLeft_Click(Sender AS QBUTTON)
      SetFocus (txtCaption.Handle)
      IF Level = 0 THEN
       EXIT SUB
      ELSE
       DEC Level
       stgItems.cell(Indice + 1,7) = STR$(Level)
       CaptionStr = STRING$(Level, "=") + txtCaption.text
       lstItems.Item(Indice)= CaptionStr
      END IF
     END SUB

     SUB cmdRight_Click(Sender AS QBUTTON)
      SetFocus (txtCaption.Handle)
      IF Level = 4 THEN
       EXIT SUB
      ELSE
       INC Level
       stgItems.cell(Indice + 1,7) = STR$(Level)
       CaptionStr = STRING$(Level, "=") + txtCaption.text
       lstItems.Item(Indice)= CaptionStr
      END IF
     END SUB

     SUB cmdDown_Click(Sender AS QBUTTON)
      SetFocus (txtCaption.Handle)
      maxItem = lstItems.Itemcount
      IF Indice + 1 > maxItem - 1 THEN
       EXIT SUB
      ELSE
       stgItems.SwapCols(Indice + 1, Indice + 2)
       WriteFields
       INC Indice
       lstItems.ItemIndex = Indice
       WriteFields
      END IF
     END SUB

     SUB cmdUp_Click(Sender AS QBUTTON)
      SetFocus (txtCaption.Handle)
      IF Indice = 0 THEN
       EXIT SUB
      ELSE
       stgItems.SwapCols(Indice , Indice + 1)
       WriteFields
       DEC Indice
       lstItems.ItemIndex = Indice
       WriteFields
      END IF
     END SUB

     SUB cmdNext_Click(Sender AS QBUTTON)
      SetFocus (txtCaption.Handle)
      maxItem = lstItems.Itemcount - 1
      INC Indice
      IF Indice > maxItem THEN
       IF lstItems.Item(MaxItem) = "" THEN
        Indice = 0
        lstItems.ItemIndex = Indice
        WriteFields
        EXIT SUB
       ELSE
        lstItems.additems= ""
        lstItems.ItemIndex = Indice
        stgItems.InsertCol(Indice + 1)
        NewItem
        WriteFields
       END IF
      ELSE
       lstItems.ItemIndex = Indice
       CALL WriteFields
      END IF
     END SUB

     SUB cmdInsert_Click(Sender AS QBUTTON)
      SetFocus (txtCaption.Handle)
      LstItems.InsertItem(Indice,"")
      stgItems.InsertCol(Indice + 1)
      LstItems.ItemIndex = Indice
      NewItem
     END SUB

     SUB cmdDelete_Click(Sender AS QBUTTON)
      SetFocus (txtCaption.Handle)
      maxItem = lstItems.Itemcount - 1
      IF maxItem = 0 THEN
       LstItems.InsertItem(Indice,"")
       stgItems.InsertCol(Indice + 1)
       LstItems.ItemIndex = Indice
       Level = 0
       NewItem
       lstItems.delItems(Indice + 1)
       stgItems.deleteCol(Indice + 2)
      ELSE
       lstItems.delItems(Indice)
       stgItems.deleteCol(Indice+1)
       IF Indice = maxItem THEN DEC Indice
       LstItems.ItemIndex = Indice
       WriteFields
      END IF
     END SUB

     SUB lstItems_Click (Sender AS QLISTBOX)
      SetFocus (txtCaption.Handle)
      Indice = lstItems.ItemIndex
      WriteFields
     END SUB

     SUB cmdPreview_Click (Sender AS QBUTTON)
      IF ValidateMenu THEN
       Screen.Cursor = crHourGlass
       MadePreviewMenu
       WriteCode
       Screen.Cursor = crDefault
       frmMain.Visible =False
       frmPreview.SHOWMODAL
       frmMain.Visible = True
       SetFocus (txtCaption.Handle)
      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:04