Announcement

Collapse
No announcement yet.

Using PBForms

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using PBForms

    I have created a Form using PBForms1.5, which in turn has created DDT code which is as follows. The form contains a Label, a Text Box, a command button QUIT and button Cancel on a dialog box.

    I presume that the code created by PBForms is the complete code for a DDT and should run. I have not added or removed any code from that listing.

    When I run it, it tells me there is an 'end If' missing on line 30, as there is an 'end if' on that line and no 'end if' code is missing.

    Whast is the problem ??

    ########## CODE STARTS HERE ################

    #PBFORMS Created v1.50
    '------------------------------------------------------------------------------
    ' The first line in this file is a PB/Forms metastatement.
    ' It should ALWAYS be the first line of the file. Other
    ' PB/Forms metastatements are placed at the beginning and
    ' end of "Named Blocks" of code that should be edited
    ' with PBForms only. Do not manually edit or delete these
    ' metastatements or PB/Forms will not be able to reread
    ' the file correctly. See the PB/Forms documentation for
    ' more information.
    ' Named blocks begin like this: #PBFORMS BEGIN ...
    ' Named blocks end like this: #PBFORMS END ...
    ' Other PB/Forms metastatements such as:
    ' #PBFORMS DECLARATIONS
    ' are used by PB/Forms to insert additional code.
    ' Feel free to make changes anywhere else in the file.
    '------------------------------------------------------------------------------

    #COMPILE EXE
    #DIM ALL

    '------------------------------------------------------------------------------
    ' ** Includes **
    '------------------------------------------------------------------------------
    #PBFORMS Begin Includes
    #RESOURCE "Bettys.pbr"
    %USEMACROS = 1
    #IF NOT %DEF(%WINAPI)
    #INCLUDE "WIN32API.INC"
    #End IF
    #IF NOT %DEF(%COMMCTRL_INC)
    #INCLUDE "COMMCTRL.INC"
    #End IF
    #INCLUDE "PBForms.INC"
    #PBFORMS End Includes
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    ' ** Constants **
    '------------------------------------------------------------------------------
    #PBFORMS Begin Constants
    %IDR_IMGFILE1 = 301
    %IDOK = 1
    %IDCANCEL = 2
    %IDD_DIALOG1 = 100
    %IDR_MENU1 = 102
    %IDD_DIALOG2 = 200
    %IDD_DIALOG3 = 300
    %IDC_LABEL1 = 1001
    %IDC_SYSTREEVIEW32_1 = 1002
    %IDC_LABEL2 = 1003
    %IDC_LABEL3 = 1004
    %IDC_BUTTON1 = 1005
    %IDC_BUTTON2 = 1006
    %IDC_LINE1 = 1007
    %IDC_ABOUT = 1008
    %IDC_FRAME1 = 1101
    %IDC_CHECKBOX1 = 1102
    %IDC_CHECKBOX2 = 1103
    %IDC_CHECKBOX3 = 1104
    %IDC_CHECKBOX4 = 1105
    %IDC_LABEL4 = 1106
    %IDC_TEXTBOX1 = 1107
    %IDC_MSCTLS_UPDOWN32_1 = 1108
    %IDC_LABEL5 = 1201
    %IDC_LABEL6 = 1202
    %IDD_PersonalDetails = 302
    %IDC_LABEL7 = 1203
    %IDC_LABEL8 = 1204
    %IDC_LABEL9 = 1205
    %IDC_LABEL10 = 1206
    %IDC_LABEL11 = 1207
    %IDC_LABEL12 = 1208
    %IDC_LABEL13 = 1209
    %IDC_TEXTBOX2 = 1210 '*
    %IDC_LABEL14 = 1211
    %IDC_LABEL15 = 1212
    %IDC_LABEL16 = 1213
    %IDC_FirstName = 1214
    %IDC_LastName = 1215
    %IDC_StreetAddress = 1216
    %IDC_PostalAddress = 1217
    %IDC_Town = 1218
    %IDC_TEXTBOX3 = 1219
    %IDC_TEXTBOX4 = 1220 '*
    %IDC_Phone = -1
    %IDC_SuppPhone = 1221
    %IDC_Mobile = 1222
    %IDC_email = 1223
    %IDC_QUIT = 1224
    %IDC_Cancel = 1225
    %IDD_DIALOG4 = 303
    %IDD_DIALOG5 = 304
    %IDD_DIALOG1 = 305
    %IDC_LABELName = 1226
    %IDC_TEXTBOXName = 1227
    %IDC_BUTTONQUIT = 1228
    %IDC_BUTTONCancel = 1229
    #PBFORMS End Constants
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    ' ** Declarations **
    '------------------------------------------------------------------------------
    DECLARE FUNCTION AttachMENU1(BYVAL hDlg AS DWORD) AS DWORD
    DECLARE CALLBACK FUNCTION ShowDIALOG1Proc()
    DECLARE CALLBACK FUNCTION ShowDIALOG2Proc()
    DECLARE CALLBACK FUNCTION ShowDIALOG3Proc()
    DECLARE CALLBACK FUNCTION ShowPersonalDetailsProc()
    DECLARE CALLBACK FUNCTION ShowDIALOG4Proc()
    DECLARE CALLBACK FUNCTION ShowDIALOG5Proc()
    DECLARE CALLBACK FUNCTION ShowDIALOG1Proc()
    DECLARE FUNCTION SampleTreeViewInsertItem(BYVAL hTree AS DWORD, BYVAL hParent _
    AS DWORD, sItem AS STRING) AS LONG
    DECLARE FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
    DECLARE FUNCTION ShowDIALOG2(BYVAL hParent AS DWORD) AS LONG
    DECLARE FUNCTION ShowDIALOG3(BYVAL hParent AS DWORD) AS LONG
    DECLARE FUNCTION ShowPersonalDetails(BYVAL hParent AS DWORD) AS LONG
    DECLARE FUNCTION ShowDIALOG4(BYVAL hParent AS DWORD) AS LONG
    DECLARE FUNCTION ShowDIALOG5(BYVAL hParent AS DWORD) AS LONG
    DECLARE FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
    #PBFORMS Declarations
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    ' ** Main Application Entry Point **
    '------------------------------------------------------------------------------
    FUNCTION PBMAIN()
    PBFormsInitComCtls (%ICC_WIN95_CLASSES OR %ICC_DATE_CLASSES OR _
    %ICC_INTERNET_CLASSES)

    ShowDIALOG1 %HWND_DESKTOP
    ShowDIALOG2 %HWND_DESKTOP
    ShowDIALOG3 %HWND_DESKTOP
    ShowPersonalDetails %HWND_DESKTOP
    ShowDIALOG4 %HWND_DESKTOP
    ShowDIALOG5 %HWND_DESKTOP
    ShowDIALOG1 %HWND_DESKTOP
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    ' ** Menus **
    '------------------------------------------------------------------------------
    FUNCTION AttachMENU1(BYVAL hDlg AS DWORD) AS DWORD
    #PBFORMS Begin Menu %IDR_MENU1->%IDD_DIALOG1
    LOCAL hMenu AS DWORD
    LOCAL hPopUp1 AS DWORD

    MENU NEW BAR TO hMenu
    MENU NEW POPUP TO hPopUp1
    MENU ADD POPUP, hMenu, "&File", hPopUp1, %MF_ENABLED
    MENU ADD STRING, hPopUp1, "&Open File", %IDC_BUTTON2, %MF_ENABLED
    MENU ADD STRING, hPopUp1, "-", 0, 0
    MENU ADD STRING, hPopUp1, "O&ptions", %IDC_BUTTON1, %MF_ENABLED
    MENU ADD STRING, hPopUp1, "-", 0, 0
    MENU ADD STRING, hPopUp1, "E&xit", %IDCANCEL, %MF_ENABLED
    MENU ADD STRING, hMenu, "&About!", %IDC_ABOUT, %MF_ENABLED

    MENU ATTACH hMenu, hDlg
    #PBFORMS End Menu
    FUNCTION = hMenu
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    ' ** CallBacks **
    '------------------------------------------------------------------------------
    CALLBACK FUNCTION ShowDIALOG1Proc()

    SELECT CASE AS LONG CBMSG
    CASE %WM_INITDIALOG
    ' Initialization handler

    CASE %WM_NCACTIVATE
    STATIC hWndSaveFocus AS DWORD
    IF ISFALSE CBWPARAM THEN
    ' Save control focus
    hWndSaveFocus = GetFocus()
    ELSEIF hWndSaveFocus THEN
    ' Restore control focus
    SetFocus (hWndSaveFocus)
    hWndSaveFocus = 0
    END IF

    CASE %WM_COMMAND
    ' Process control notifications
    SELECT CASE AS LONG CBCTL
    CASE %IDC_LABEL1

    CASE %IDC_SYSTREEVIEW32_1

    CASE %IDC_LABEL2

    CASE %IDC_LABEL3

    CASE %IDC_BUTTON1
    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
    MSGBOX "%IDC_BUTTON1=" + FORMAT$(%IDC_BUTTON1), _
    %MB_TASKMODAL
    END IF

    CASE %IDC_BUTTON2
    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
    MSGBOX "%IDC_BUTTON2=" + FORMAT$(%IDC_BUTTON2), _
    %MB_TASKMODAL
    END IF

    CASE %IDCANCEL
    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
    DIALOG END CBHNDL, 0
    END IF

    CASE %IDC_LINE1

    CASE %IDC_ABOUT
    MSGBOX "%IDC_ABOUT=" + FORMAT$(%IDC_ABOUT), %MB_TASKMODAL

    END SELECT
    END SELECT
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    CALLBACK FUNCTION ShowDIALOG2Proc()

    SELECT CASE AS LONG CBMSG
    CASE %WM_INITDIALOG
    ' Initialization handler

    CASE %WM_NCACTIVATE
    STATIC hWndSaveFocus AS DWORD
    IF ISFALSE CBWPARAM THEN
    ' Save control focus
    hWndSaveFocus = GetFocus()
    ELSEIF hWndSaveFocus THEN
    ' Restore control focus
    SetFocus (hWndSaveFocus)
    hWndSaveFocus = 0
    END IF

    CASE %WM_COMMAND
    ' Process control notifications
    SELECT CASE AS LONG CBCTL
    CASE %IDC_FRAME1

    CASE %IDC_CHECKBOX1

    CASE %IDC_CHECKBOX2

    CASE %IDC_CHECKBOX3

    CASE %IDC_CHECKBOX4

    CASE %IDC_LABEL4

    CASE %IDC_TEXTBOX1

    CASE %IDC_MSCTLS_UPDOWN32_1

    CASE %IDOK
    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
    DIALOG END CBHNDL, %IDOK
    END IF

    CASE %IDCANCEL
    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
    DIALOG END CBHNDL, 0
    END IF

    END SELECT
    END SELECT
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    CALLBACK FUNCTION ShowDIALOG3Proc()

    SELECT CASE AS LONG CBMSG
    CASE %WM_INITDIALOG
    ' Initialization handler

    CASE %WM_NCACTIVATE
    STATIC hWndSaveFocus AS DWORD
    IF ISFALSE CBWPARAM THEN
    ' Save control focus
    hWndSaveFocus = GetFocus()
    ELSEIF hWndSaveFocus THEN
    ' Restore control focus
    SetFocus (hWndSaveFocus)
    hWndSaveFocus = 0
    END IF

    CASE %WM_COMMAND
    ' Process control notifications
    SELECT CASE AS LONG CBCTL
    CASE %IDC_LABEL5

    CASE %IDC_LABEL6

    CASE %IDOK
    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
    DIALOG END CBHNDL, %IDOK
    END IF

    END SELECT
    END SELECT
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    CALLBACK FUNCTION ShowPersonalDetailsProc()

    SELECT CASE AS LONG CBMSG
    CASE %WM_INITDIALOG
    ' Initialization handler

    CASE %WM_NCACTIVATE
    STATIC hWndSaveFocus AS DWORD
    IF ISFALSE CBWPARAM THEN
    ' Save control focus
    hWndSaveFocus = GetFocus()
    ELSEIF hWndSaveFocus THEN
    ' Restore control focus
    SetFocus (hWndSaveFocus)
    hWndSaveFocus = 0
    END IF

    CASE %WM_COMMAND
    ' Process control notifications
    SELECT CASE AS LONG CBCTL
    CASE %IDC_LABEL7

    CASE %IDC_LABEL8

    CASE %IDC_LABEL9

    CASE %IDC_LABEL10

    CASE %IDC_LABEL11

    CASE %IDC_LABEL12

    CASE %IDC_LABEL13

    CASE %IDC_LABEL14

    CASE %IDC_LABEL15

    CASE %IDC_LABEL16

    CASE %IDC_FirstName

    CASE %IDC_LastName

    CASE %IDC_StreetAddress

    CASE %IDC_PostalAddress

    CASE %IDC_Town

    CASE %IDC_TEXTBOX3

    CASE %IDC_Phone

    CASE %IDC_SuppPhone

    CASE %IDC_Mobile

    CASE %IDC_email

    CASE %IDC_QUIT
    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
    MSGBOX "%IDC_QUIT=" + FORMAT$(%IDC_QUIT), _
    %MB_TASKMODAL
    END IF

    CASE %IDC_Cancel
    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
    MSGBOX "%IDC_Cancel=" + FORMAT$(%IDC_Cancel), _
    %MB_TASKMODAL
    END IF

    END SELECT
    END SELECT
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    CALLBACK FUNCTION ShowDIALOG4Proc()

    SELECT CASE AS LONG CBMSG
    CASE %WM_INITDIALOG
    ' Initialization handler

    CASE %WM_NCACTIVATE
    STATIC hWndSaveFocus AS DWORD
    IF ISFALSE CBWPARAM THEN
    ' Save control focus
    hWndSaveFocus = GetFocus()
    ELSEIF hWndSaveFocus THEN
    ' Restore control focus
    SetFocus (hWndSaveFocus)
    hWndSaveFocus = 0
    END IF

    CASE %WM_COMMAND
    ' Process control notifications
    SELECT CASE AS LONG CBCTL

    END SELECT
    END SELECT
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    CALLBACK FUNCTION ShowDIALOG5Proc()

    SELECT CASE AS LONG CBMSG
    CASE %WM_INITDIALOG
    ' Initialization handler

    CASE %WM_NCACTIVATE
    STATIC hWndSaveFocus AS DWORD
    IF ISFALSE CBWPARAM THEN
    ' Save control focus
    hWndSaveFocus = GetFocus()
    ELSEIF hWndSaveFocus THEN
    ' Restore control focus
    SetFocus (hWndSaveFocus)
    hWndSaveFocus = 0
    END IF

    CASE %WM_COMMAND
    ' Process control notifications
    SELECT CASE AS LONG CBCTL

    END SELECT
    END SELECT
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    CALLBACK FUNCTION ShowDIALOG1Proc()

    SELECT CASE AS LONG CBMSG
    CASE %WM_INITDIALOG
    ' Initialization handler

    CASE %WM_NCACTIVATE
    STATIC hWndSaveFocus AS DWORD
    IF ISFALSE CBWPARAM THEN
    ' Save control focus
    hWndSaveFocus = GetFocus()
    ELSEIF hWndSaveFocus THEN
    ' Restore control focus
    SetFocus (hWndSaveFocus)
    hWndSaveFocus = 0
    END IF

    CASE %WM_COMMAND
    ' Process control notifications
    SELECT CASE AS LONG CBCTL
    CASE %IDC_LABELName

    CASE %IDC_TEXTBOXName

    CASE %IDC_BUTTONQUIT
    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
    MSGBOX "%IDC_BUTTONQUIT=" + FORMAT$(%IDC_BUTTONQUIT), _
    %MB_TASKMODAL
    END IF

    CASE %IDC_BUTTONCancel
    IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
    MSGBOX "%IDC_BUTTONCancel=" + _
    FORMAT$(%IDC_BUTTONCancel), %MB_TASKMODAL
    END IF

    END SELECT
    END SELECT
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    ' ** Sample Code **
    '------------------------------------------------------------------------------
    FUNCTION SampleTreeViewInsertItem(BYVAL hTree AS DWORD, BYVAL hParent AS _
    DWORD, sItem AS STRING) AS LONG
    LOCAL tTVItem AS TV_ITEM
    LOCAL tTVInsert AS TV_INSERTSTRUCT

    IF hParent THEN
    tTVItem.mask = %TVIF_CHILDREN OR %TVIF_HANDLE
    tTVItem.hItem = hParent
    tTVItem.cchildren = 1
    TreeView_SetItem(hTree, tTVItem)
    END IF

    tTVInsert.hParent = hParent
    tTVInsert.Item.Item.mask = %TVIF_TEXT
    tTVInsert.Item.Item.pszText = STRPTR(sItem)
    tTVInsert.Item.Item.cchTextMax = LEN(sItem)

    FUNCTION = TreeView_InsertItem(hTree, tTVInsert)
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    FUNCTION SampleTreeView(BYVAL hDlg AS DWORD, BYVAL lID AS LONG, BYVAL lCount _
    AS LONG) AS LONG
    LOCAL i AS LONG
    LOCAL j AS LONG
    LOCAL k AS LONG
    LOCAL hCtl AS DWORD
    LOCAL hRoot AS DWORD
    LOCAL hParent AS DWORD

    CONTROL HANDLE hDlg, lID TO hCtl

    FOR i = 1 TO lCount
    hRoot = SampleTreeViewInsertItem(hCtl, %NULL, USING$("Root#", i))
    FOR j = 1 TO lCount
    hParent = SampleTreeViewInsertItem(hCtl, hRoot, USING$("Item#", _
    j))
    FOR k = 1 TO lCount
    CALL SampleTreeViewInsertItem(hCtl, hParent, _
    USING$("SubItem#_.#", j, k))
    NEXT k
    NEXT j
    NEXT i
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    ' ** Dialogs **
    '------------------------------------------------------------------------------
    FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
    LOCAL lRslt AS LONG

    #PBFORMS Begin Dialog %IDD_DIALOG1->%IDR_MENU1->
    LOCAL hDlg AS DWORD

    DIALOG NEW hParent, "Interface Explorer", 104, 70, 300, 212, %WS_POPUP _
    OR %WS_BORDER OR %WS_DLGFRAME OR %WS_CAPTION OR %WS_SYSMENU OR _
    %WS_MINIMIZEBOX OR %WS_CLIPSIBLINGS OR %WS_CLIPCHILDREN OR _
    %WS_VISIBLE OR %DS_MODALFRAME OR %DS_CENTER OR %DS_3DLOOK OR _
    %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_WINDOWEDGE OR _
    %WS_EX_CONTROLPARENT OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
    %WS_EX_RIGHTSCROLLBAR, TO hDlg
    DIALOG SET ICON hDlg, "#" + FORMAT$(%IDR_IMGFILE1)
    DIALOG SET COLOR hDlg, -1, RGB(132, 207, 253)
    CONTROL ADD LABEL, hDlg, %IDC_LABEL1, " &Interface tree", 5, 5, 235, 10, _
    %WS_CHILD OR %WS_VISIBLE OR %WS_BORDER OR %SS_LEFT, %WS_EX_LEFT OR _
    %WS_EX_LTRREADING
    CONTROL SET COLOR hDlg, %IDC_LABEL1, %WHITE, %BLUE
    CONTROL ADD "SysTreeView32", hDlg, %IDC_SYSTREEVIEW32_1, _
    "SysTreeView321", 5, 15, 235, 180, %WS_CHILD OR %WS_VISIBLE OR _
    %WS_BORDER OR %WS_TABSTOP OR %TVS_HASBUTTONS OR %TVS_HASLINES OR _
    %TVS_LINESATROOT OR %TVS_DISABLEDRAGDROP OR %TVS_SHOWSELALWAYS OR _
    %TVS_FULLROWSELECT, %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
    %WS_EX_RIGHTSCROLLBAR
    CONTROL ADD LABEL, hDlg, %IDC_LABEL2, " Status", 245, 5, 50, 10, _
    %WS_CHILD OR %WS_VISIBLE OR %WS_BORDER OR %SS_LEFT, %WS_EX_LEFT OR _
    %WS_EX_LTRREADING
    CONTROL SET COLOR hDlg, %IDC_LABEL2, %WHITE, %BLUE
    CONTROL ADD LABEL, hDlg, %IDC_LABEL3, "", 245, 15, 50, 50, %WS_CHILD OR _
    %WS_VISIBLE OR %WS_BORDER OR %SS_CENTER, %WS_EX_LEFT OR _
    %WS_EX_LTRREADING
    CONTROL SET COLOR hDlg, %IDC_LABEL3, %BLACK, RGB(255, 255, 222)
    CONTROL ADD BUTTON, hDlg, %IDC_BUTTON1, "O&ptions", 245, 70, 50, 15
    CONTROL ADD BUTTON, hDlg, %IDC_BUTTON2, "&Open File", 245, 160, 50, 15
    CONTROL ADD BUTTON, hDlg, %IDCANCEL, "&Quit", 245, 180, 50, 15
    CONTROL ADD LINE, hDlg, %IDC_LINE1, "Line2", 0, 0, 300, 1

    AttachMENU1 hDlg
    #PBFORMS End Dialog

    SampleTreeView hDlg, %IDC_SYSTREEVIEW32_1, 3

    DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc TO lRslt

    #PBFORMS Begin CleanUp %IDD_DIALOG1
    #PBFORMS End CleanUp

    FUNCTION = lRslt
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    FUNCTION ShowDIALOG2(BYVAL hParent AS DWORD) AS LONG
    LOCAL lRslt AS LONG

    #PBFORMS Begin Dialog %IDD_DIALOG2->->
    LOCAL hDlg AS DWORD

    DIALOG NEW hParent, "Interface Explorer Options", 174, 132, 161, 86, _
    %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR _
    %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME OR %DS_3DLOOK OR _
    %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_WINDOWEDGE OR _
    %WS_EX_CONTROLPARENT OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
    %WS_EX_RIGHTSCROLLBAR, TO hDlg
    DIALOG SET ICON hDlg, "#" + FORMAT$(%IDR_IMGFILE1)
    DIALOG SET COLOR hDlg, -1, RGB(252, 216, 131)
    CONTROL ADD FRAME, hDlg, %IDC_FRAME1, "Options", 5, 5, 95, 75
    CONTROL SET COLOR hDlg, %IDC_FRAME1, -1, RGB(252, 216, 131)
    CONTROL ADD CHECKBOX, hDlg, %IDC_CHECKBOX1, "&Show Prefix", 15, 16, 84, _
    10
    CONTROL SET COLOR hDlg, %IDC_CHECKBOX1, -1, RGB(252, 216, 131)
    CONTROL ADD CHECKBOX, hDlg, %IDC_CHECKBOX2, "Show &Types", 15, 27, 84, 10
    CONTROL SET COLOR hDlg, %IDC_CHECKBOX2, -1, RGB(252, 216, 131)
    CONTROL ADD CHECKBOX, hDlg, %IDC_CHECKBOX3, "Show &Parameters", 15, 38, _
    84, 10
    CONTROL SET COLOR hDlg, %IDC_CHECKBOX3, -1, RGB(252, 216, 131)
    CONTROL ADD CHECKBOX, hDlg, %IDC_CHECKBOX4, "Show Methods/P&rops", 15, _
    49, 84, 10
    CONTROL SET COLOR hDlg, %IDC_CHECKBOX4, -1, RGB(252, 216, 131)
    CONTROL ADD LABEL, hDlg, %IDC_LABEL4, "Scan &Depth", 43, 63, 56, 10
    CONTROL SET COLOR hDlg, %IDC_LABEL4, -1, RGB(252, 216, 131)
    CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX1, "FORMAT$(gDepth)", 15, 61, 25, _
    13, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_LEFT OR _
    %ES_AUTOHSCROLL OR %ES_NUMBER, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
    %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
    CONTROL ADD "msctls_updown32", hDlg, %IDC_MSCTLS_UPDOWN32_1, "", 35, 61, _
    8, 13, %WS_CHILD OR %WS_VISIBLE OR %UDS_SETBUDDYINT OR _
    %UDS_ALIGNRIGHT OR %UDS_AUTOBUDDY OR %UDS_ARROWKEYS
    CONTROL ADD BUTTON, hDlg, %IDOK, "OK", 105, 10, 50, 15
    DIALOG SEND hDlg, %DM_SETDEFID, %IDOK, 0
    CONTROL ADD BUTTON, hDlg, %IDCANCEL, "Cancel", 105, 30, 50, 15
    #PBFORMS End Dialog

    DIALOG SHOW MODAL hDlg, CALL ShowDIALOG2Proc TO lRslt

    #PBFORMS Begin CleanUp %IDD_DIALOG2
    #PBFORMS End CleanUp

    FUNCTION = lRslt
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    FUNCTION ShowDIALOG3(BYVAL hParent AS DWORD) AS LONG
    LOCAL lRslt AS LONG

    #PBFORMS Begin Dialog %IDD_DIALOG3->->
    LOCAL hDlg AS DWORD
    LOCAL hFont1 AS DWORD

    DIALOG NEW hParent, "About Interface Explorer", 184, 140, 140, 70, _
    %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME OR %WS_CAPTION OR _
    %WS_SYSMENU OR %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME OR _
    %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_WINDOWEDGE OR _
    %WS_EX_CONTROLPARENT OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
    %WS_EX_RIGHTSCROLLBAR, TO hDlg
    DIALOG SET ICON hDlg, "#" + FORMAT$(%IDR_IMGFILE1)
    DIALOG SET COLOR hDlg, -1, RGB(139, 197, 197)
    CONTROL ADD LABEL, hDlg, %IDC_LABEL5, "Interface Explorer", 5, 5, 135, _
    15, %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR _
    %WS_EX_LTRREADING
    CONTROL SET COLOR hDlg, %IDC_LABEL5, -1, RGB(139, 197, 197)
    CONTROL ADD LABEL, hDlg, %IDC_LABEL6, "A PowerBASIC Forms Example " + _
    "project by PowerBASIC, Inc. Copyright © 2002.", 5, 20, 135, 20, _
    %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR _
    %WS_EX_LTRREADING
    CONTROL SET COLOR hDlg, %IDC_LABEL6, -1, RGB(139, 197, 197)
    CONTROL ADD BUTTON, hDlg, %IDOK, "OK", 45, 50, 50, 15
    DIALOG SEND hDlg, %DM_SETDEFID, %IDOK, 0

    hFont1 = PBFormsMakeFont("Arial", 14, 400, %FALSE, %FALSE, %FALSE, _
    %ANSI_CHARSET)

    CONTROL SEND hDlg, %IDC_LABEL5, %WM_SETFONT, hFont1, 0
    #PBFORMS End Dialog

    DIALOG SHOW MODAL hDlg, CALL ShowDIALOG3Proc TO lRslt

    #PBFORMS Begin CleanUp %IDD_DIALOG3
    DeleteObject hFont1
    #PBFORMS End CleanUp

    FUNCTION = lRslt
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    FUNCTION ShowPersonalDetails(BYVAL hParent AS DWORD) AS LONG
    LOCAL lRslt AS LONG

    #PBFORMS Begin Dialog %IDD_PersonalDetails->->
    LOCAL hDlg AS DWORD

    DIALOG NEW hParent, "Personal Details", 70, 70, 225, 345, TO hDlg
    CONTROL ADD LABEL, hDlg, %IDC_LABEL7, "First Name", 20, 15, 85, 20
    CONTROL ADD LABEL, hDlg, %IDC_LABEL8, "Last Name", 20, 40, 85, 15
    CONTROL ADD LABEL, hDlg, %IDC_LABEL9, "Street Address", 15, 65, 85, 20
    CONTROL ADD LABEL, hDlg, %IDC_LABEL10, "Postal Address", 15, 90, 85, 20
    CONTROL ADD LABEL, hDlg, %IDC_LABEL11, "Town / City", 15, 115, 85, 20
    CONTROL ADD LABEL, hDlg, %IDC_LABEL12, "Phone No.", 15, 170, 85, 20
    CONTROL ADD LABEL, hDlg, %IDC_LABEL13, "Mobile Phone", 15, 225, 85, 20
    CONTROL ADD LABEL, hDlg, %IDC_LABEL14, "Post Code", 15, 140, 85, 20
    CONTROL ADD LABEL, hDlg, %IDC_LABEL15, "Supplementary Phone", 15, 195, _
    80, 25
    CONTROL ADD LABEL, hDlg, %IDC_LABEL16, "eMail Address", 15, 250, 85, 15
    CONTROL ADD TEXTBOX, hDlg, %IDC_FirstName, "", 115, 15, 80, 15
    CONTROL ADD TEXTBOX, hDlg, %IDC_LastName, "", 115, 35, 80, 15
    CONTROL ADD TEXTBOX, hDlg, %IDC_StreetAddress, "", 115, 60, 80, 15
    CONTROL ADD TEXTBOX, hDlg, %IDC_PostalAddress, "", 115, 85, 80, 15
    CONTROL ADD TEXTBOX, hDlg, %IDC_Town, "", 115, 115, 80, 15
    CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX3, "", 115, 140, 80, 15
    CONTROL ADD TEXTBOX, hDlg, %IDC_Phone, "", 115, 170, 80, 15
    CONTROL ADD TEXTBOX, hDlg, %IDC_SuppPhone, "", 115, 195, 80, 15
    CONTROL ADD TEXTBOX, hDlg, %IDC_Mobile, "", 115, 220, 80, 15
    CONTROL ADD TEXTBOX, hDlg, %IDC_email, "", 115, 245, 80, 15
    CONTROL ADD BUTTON, hDlg, %IDC_QUIT, "QUIT", 115, 315, 60, 20
    CONTROL ADD BUTTON, hDlg, %IDC_Cancel, "Cancel", 25, 315, 60, 20
    #PBFORMS End Dialog

    DIALOG SHOW MODAL hDlg, CALL ShowPersonalDetailsProc TO lRslt

    #PBFORMS Begin CleanUp %IDD_PersonalDetails
    #PBFORMS End CleanUp

    FUNCTION = lRslt
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    FUNCTION ShowDIALOG4(BYVAL hParent AS DWORD) AS LONG
    LOCAL lRslt AS LONG

    #PBFORMS Begin Dialog %IDD_DIALOG4->->
    LOCAL hDlg AS DWORD

    DIALOG NEW hParent, "Dialog4", 70, 70, 201, 121, TO hDlg
    #PBFORMS End Dialog

    DIALOG SHOW MODAL hDlg, CALL ShowDIALOG4Proc TO lRslt

    #PBFORMS Begin CleanUp %IDD_DIALOG4
    #PBFORMS End CleanUp

    FUNCTION = lRslt
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    FUNCTION ShowDIALOG5(BYVAL hParent AS DWORD) AS LONG
    LOCAL lRslt AS LONG

    #PBFORMS Begin Dialog %IDD_DIALOG5->->
    LOCAL hDlg AS DWORD

    DIALOG NEW hParent, "Dialog5", 70, 70, 201, 121, TO hDlg
    #PBFORMS End Dialog

    DIALOG SHOW MODAL hDlg, CALL ShowDIALOG5Proc TO lRslt

    #PBFORMS Begin CleanUp %IDD_DIALOG5
    #PBFORMS End CleanUp

    FUNCTION = lRslt
    END FUNCTION
    '------------------------------------------------------------------------------

    '------------------------------------------------------------------------------
    FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG
    LOCAL lRslt AS LONG

    #PBFORMS Begin Dialog %IDD_DIALOG1->->
    LOCAL hDlg AS DWORD

    DIALOG NEW hParent, "Test Warren's Dialog", 70, 70, 201, 121, TO hDlg
    CONTROL ADD LABEL, hDlg, %IDC_LABELName, "Name", 10, 35, 70, 20
    CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOXName, "", 100, 35, 75, 20
    CONTROL ADD BUTTON, hDlg, %IDC_BUTTONQUIT, "QUIT", 125, 80, 60, 20
    CONTROL ADD BUTTON, hDlg, %IDC_BUTTONCancel, "Cancel", 30, 80, 65, 20
    #PBFORMS End Dialog

    DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc TO lRslt

    #PBFORMS Begin CleanUp %IDD_DIALOG1
    #PBFORMS End CleanUp

    FUNCTION = lRslt
    END FUNCTION
    '------------------------------------------------------------------------------


    ########## CODE ENDS HERE ################
    Warren Sugden

  • #2
    Several points:

    1. Please post source code inside CODE tags - see hash symbol on message editor pane. It makes it easier for people to read.

    2. Why use V1.50 of PBForms when V1.51 is a free upgrade?

    3. The #End if statements are compiler directives which should read #endif.

    4. There are two duplicated functions in there, too.

    5. I could not compile the code because you did not supply the resource file.

    My guess is that your code met with a nasty accident after PBForms created it!

    It was interesting that compiling under V9 gave out the errors in a different order to V8.

    Comment


    • #3
      In addition to the list from Chris, you'll find that there is a duplicate DECLARE statement:
      Line 106 and Line 112
      DECLARE CALLBACK FUNCTION ShowDIALOG1Proc()

      There are also two CALLBACK FUNCTIONS with the same name.
      Rod
      I want not 'not', not Knot, not Knott, not Nott, not knot, not naught, not nought, but aught.

      Comment

      Working...
      X