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
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
END CREATE
CREATE cmdBrowser AS QXPButton
CAPTION = "..."
Left = 256
Top = 42
Width = 35
Height = 20
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
END CREATE
CREATE chkOptEnabled AS QCHECKBOX
CAPTION = "Enabled"
Left = 20
Top = 40
END CREATE
CREATE chkOptVisible AS QCHECKBOX
CAPTION = "Visible"
Left = 20
Top = 60
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
END CREATE
END CREATE
CREATE GroupBox3 AS QGROUPBOX
CAPTION = "Code Genarador"
Left = 8
Top = 202
Width = 321
Height = 110
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
END CREATE
CREATE chkOptDeclares AS QRADIOBUTTON
CAPTION = "Uncoment Declares"
Left = 5
Top = 35
Width = 121
END CREATE
CREATE chkOptOnlyMenu AS QRADIOBUTTON
CAPTION = "Only Code for menu"
Left = 5
Top = 55
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
END CREATE
CREATE chkOptSoftTabs AS QRADIOBUTTON
CAPTION = "Soft Tabs"
Left = 5
Top = 35
Width = 73
onclick = chkOptSoftTabs_Click
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
END CREATE
END CREATE
END CREATE
CREATE cmdOptionsOK AS QXPButton
CAPTION = "&OK"
Left = 352
Top = 250
Kind = bkOK
onclick = cmOptionsOk_Click
END CREATE
CREATE cmdOpttionsCancel AS QXPButton
CAPTION = "Cancel"
Left = 352
Top = 285
Kind = bkCancel
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
DIM iNull AS INTEGER
DIM lpIDList AS LONG
DIM lResult AS LONG
DIM sPath AS STRING
WITH udtBI
.hwndOwner = hwndOwner
.lpszTitle = lstrcat(sPrompt, "")
.ulFlags = BIF_RETURNONLYFSDIRS OR BIF_DONTGOBELOWDOMAIN
END WITH
lpIDList = SHBrowseForFolder(udtBI)
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
BrowseForFolder = sPath
END FUNCTION
|