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

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

  
'$Include "RapidQ.inc"
     DECLARE SUB cmdBrowser_Click (Sender AS QBUTTON)
     DECLARE SUB chkOptHardTabs_Click (Sender AS QRADIOBUTTON)
     DECLARE SUB chkOptSoftTabs_Click (Sender AS QRADIOBUTTON)
     DECLARE SUB cmOptionsOk_Click (Sender AS QBUTTON)
     DECLARE SUB cmOptionsCancel_Click (Sender AS QBUTTON)
     DECLARE FUNCTION  BrowseForFolder(hwndOwner AS LONG, sPrompt AS STRING) AS STRING

     CREATE frmOptions AS QFORM
      ICOHandle = MenuDesigner_ico
      CAPTION = "MenuDesigner Options"
      Width = 450
      Height = 350
      DelBorderIcons = biMinimize
      DelBorderIcons = biMaximize
      BorderStyle = bsSingle
      Center
      CREATE GroupBox1 AS QGROUPBOX
       CAPTION = "Designer"
       Left = 10
       Top = 9
       Width = 321
       Height = 185
'        TabOrder = 0
       CREATE Label1 AS QLABEL
        CAPTION = "Work Folder: "
        Left = 25
        Top = 25
        Width = 64
       END CREATE
       CREATE txtWorkFolder AS QEDIT
        Text = ""
        Left = 25
        Top = 41
        Width = 225
'            TabOrder = 1
       END CREATE
       CREATE cmdBrowser AS QBUTTON
        CAPTION = "..."
        Left = 256
        Top = 42
        Width = 35
        Height = 20
'            TabOrder = 2
        onClick = cmdBrowser_Click
       END CREATE
       CREATE GroupBox2 AS QGROUPBOX
        CAPTION = "Menu Item Defaults"
        Left = 25
        Top = 77
        Width = 145
        Height = 89
        TabOrder = 0
        CREATE chkOptChecked AS QCHECKBOX
         CAPTION = "Checked"
         Left = 20
         Top = 20
'                TabOrder = 1
        END CREATE
        CREATE chkOptEnabled AS QCHECKBOX
         CAPTION = "Enabled"
         Left = 20
         Top = 40
'                TabOrder = 2
        END CREATE
        CREATE chkOptVisible AS QCHECKBOX
         CAPTION = "Visible"
         Left = 20
         Top = 60
'                TabOrder = 3
        END CREATE
       END CREATE
       CREATE Label3 AS QLABEL
        CAPTION = "Language:"
        Left = 198
        Top = 77
        Width = 56
        Transparent = 1
       END CREATE
       CREATE cmbOptLanguage AS QCOMBOBOX
        Text = "English"
        Left = 200
        Top = 100
        Width = 105
'            TabOrder = 4
       END CREATE
      END CREATE
      CREATE GroupBox3 AS QGROUPBOX
       CAPTION = "Code Genarador"
       Left = 8
       Top = 202
       Width = 321
       Height = 110
'        TabOrder = 2
       CREATE GroupBox4 AS QGROUPBOX
        CAPTION = ""
        Left = 25
        Top = 15
        Width = 140
        Height = 80
        TabOrder = 2
        CREATE chkOptPreDeclares AS QRADIOBUTTON
         CAPTION = "PreDeclares"
         Left = 5
         Top = 15
         Width = 89
                'enabled = False
'                TabOrder = 0
        END CREATE
        CREATE chkOptDeclares AS QRADIOBUTTON
         CAPTION = "Uncoment Declares"
         Left = 5
         Top = 35
         Width = 121
                'enabled = False
'                TabOrder = 1
        END CREATE
        CREATE chkOptOnlyMenu AS QRADIOBUTTON
         CAPTION = "Only Code for menu"
         Left = 5
         Top = 55
                'enabled = False
'                TabOrder = 2
        END CREATE
       END CREATE
       CREATE GroupBox5 AS QGROUPBOX
        CAPTION = ""
        Left = 180
        Top = 15
        Width = 120
        Height = 80
        TabOrder = 2
        CREATE chkOptHardTabs AS QRADIOBUTTON
         CAPTION = "Hard Tabs"
         Left = 5
         Top = 15
         Width = 81
         onclick = chkOptHardTabs_Click
'                TabOrder = 3
        END CREATE
        CREATE chkOptSoftTabs AS QRADIOBUTTON
         CAPTION = "Soft Tabs"
         Left = 5
         Top = 35
         Width = 73
         onclick = chkOptSoftTabs_Click
'                TabOrder = 4
        END CREATE
        CREATE Label2 AS QLABEL
         CAPTION = "Spaces:"
         Left = 30
         Top = 55
         Width = 40
         Transparent = 1
        END CREATE
        CREATE txtOptSpaces AS QEDIT
         Text = "3"
         Left = 75
         Top = 53
         Width = 25
         enabled = False
         MaxLength = 1
'                TabOrder = 5
        END CREATE
       END CREATE
      END CREATE
      CREATE cmdOptionsOK AS QBUTTON
       CAPTION = "&OK"
       Left = 352
       Top = 250
       Kind = bkOK
'        TabOrder = 3
       onclick = cmOptionsOk_Click
      END CREATE
      CREATE cmdOpttionsCancel AS QBUTTON
       CAPTION = "Cancel"
       Left = 352
       Top = 285
       Kind = bkCancel
'        TabOrder = 4
       onclick = cmOptionsCancel_Click
      END CREATE
     END CREATE

     SUB cmdBrowser_Click (Sender AS QBUTTON)
      DIM strResFolder AS STRING
      DIM hWnd AS LONG
      hWnd = frmOptions.handle
      strResFolder = BrowseForFolder(hwnd, "Please select a folder.")

      IF strResFolder <> "" THEN
       txtWorkFolder.text = strResFolder
      END IF

     END SUB

     SUB chkOptHardTabs_Click (Sender AS QRADIOBUTTON)
      IF chkOptHardTabs.Checked THEN txtOptSpaces.enabled = False
     END SUB

     SUB chkOptSoftTabs_Click (Sender AS QRADIOBUTTON)
      IF chkOptSoftTabs.Checked THEN txtOptSpaces.enabled = True
     END SUB

     SUB cmOptionsOk_Click (Sender AS QBUTTON)
      SetDefaults
      frmOptions.CLOSE
     END SUB

     SUB cmOptionsCancel_Click (Sender AS QBUTTON)
      GetDefaults
      frmOptions.CLOSE
     END SUB

     FUNCTION BrowseForFolder(hwndOwner AS LONG, sPrompt AS STRING) AS STRING
    'declare variables to be used
      DIM iNull AS INTEGER
      DIM lpIDList AS LONG
      DIM lResult AS LONG
      DIM sPath AS STRING
'     Dim udtBI As BrowseInfo

    'initialise variables
      WITH udtBI
       .hwndOwner = hwndOwner
       .lpszTitle = lstrcat(sPrompt, "")
       .ulFlags = BIF_RETURNONLYFSDIRS OR BIF_DONTGOBELOWDOMAIN
      END WITH

    'Call the browse for folder API
      lpIDList = SHBrowseForFolder(udtBI)

    'get the resulting string path
      IF lpIDList THEN
       sPath = STRING$(260, 0)
       lResult = SHGetPathFromIDList(lpIDList, sPath)
       CALL CoTaskMemFree(lpIDList)
       iNull = INSTR(sPath, CHR$(0))
       IF iNull THEN sPath = LEFT$(sPath, iNull - 1)
      END IF

    'If cancel was pressed, sPath = ""
      BrowseForFolder = sPath
     END FUNCTION


'Form.ShowModal
掌柜推荐
 
 
¥490.00 ·
 
 
¥307.00 ·
 
 
¥288.00 ·
 
 
¥900.00 ·
 
 
¥790.00 ·
 
 
¥487.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-11-14 18:07:51