Announcement

Collapse
No announcement yet.

Problems with "Child" DDT Dialogs - (Wizards subject continued) ???

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

  • Eric Pearson
    replied
    Fred, believe me, I understand and appreciate what you're saying.

    This is a Peer Support forum and sometimes all we can do is help each other interpret the docs and the observed behavior of the compilers, based on our own personal experience. If it seems like I "argue" a lot, I only do it when I believe that it makes a difference. After all, people write serious code based on what they read and learn here, and attention to detail can make all the difference.

    -- Eric

    Peer Support = Free, and almost always available from various people of various reliability.

    Tech Support Participation in Peer Forums = Free and higly reliable, but not always available.

    Tech Support via other channels = Highly reliable, always available, but not always free.




    [This message has been edited by Eric Pearson (edited February 29, 2000).]

    Leave a comment:


  • Chris Boss
    replied
    I think the solution lies in "how" you use the DDT commands.

    When you use a Control ADD command that is class specific (ie. BUTTON) then of course DDT must do some processing of the styles, so using an "unexpected" style could cause a problem.

    Technically, when I used the %BS_AUTORADIOBUTTON or %BS_PUSHLIKE styles together, my control was no longer a Button, but became a Radio Button. This could very easily confuse DDT since it may assume the control is a Button and not a Radio.

    There are some styles that are NOT suppose to be used together using the API, so it is reasonable to expect DDT to choke when I use styles that could confuse it.

    The solution is very simple though.

    If you use a "predefined" DDT type control (BUTTON, LISTBOX, etc) use only the styles suggested in the Help file for that control.

    If you need to use "other" styles, that are valid, but not listed in the PB docs, then simply use the custom version of CONTROL ADD which requires a Class name between quotes. DDT will simply pass this on to the necessary API calls with no "tweaking".

    The number of "permutations" of different styles being mixed together can be quite large and DDT can't be expected to "double" check it all. DDT seems to "expect" the common combinations.

    So don't blame DDT, since it is just as easy to "choke" the API functions themselves by using styles that shouldn't go together.

    As Eric said, DDT is not just a simple wrapper. It does do some processing before passing data to the API. The important thing is to learn the "correct" way of using DDT.

    I experienced problems because I "assumed" DDT worked exactly like the API calls I am used to. This was my "error" not DDT.

    While I am more used to SDK style coding, I am "getting" use to DDT and I do find it a bit cleaner than API calls (doesn't use AsciiZ and pointers).

    ------------------


    [This message has been edited by Chris Boss (edited February 29, 2000).]

    Leave a comment:


  • Fred Oxenby
    replied
    Eric, I have only the Help-file and the printed documentation
    to base my decisions on when it comes to how the DDT-engine works.
    Other people have participated in beta-testing etc and have a deeper
    knowledge than I have.
    When I encounter a problem I rely on what the help-file tells me.
    If I decide that this problem is too severe, (a GPF or a hang),
    in respect of the cause, I normally investigate it.
    Ask official and unofficial questions.
    If I don't get any answers on my official request, I take that ad notam,
    creates a workaround and will draw whatever conclusion there is to be drawn...


    ------------------
    Fred
    mailto:[email protected][email protected]</A>
    http://www.oxenby.se

    Leave a comment:


  • Eric Pearson
    replied
    Fred --

    [You doubled the size of your message while I was composing my response. This is only a response to the first half.]

    > This does not tell me that styles not listed is not supported..

    And it does not tell you that all styles that are not listed are supported.

    That same section of the Help File goes on to list default styles and required styles, and the word "almost" in your quote implies (to me, anyway) that there are some styles that are excluded.

    Guys, I feel like we've beaten this topic to death. Can we stop now, and agree to disagree?

    -- Eric

    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>



    [This message has been edited by Eric Pearson (edited February 29, 2000).]

    Leave a comment:


  • Fred Oxenby
    replied
    Eric, this is a direct quote of PBDLL-Help
    Control Styles
    When creating child controls for your dialogs, you are free to
    use almost any control style permitted by Windows.
    These styles mostly start with the %WS_ prefix (Window Style),and are included in
    the WIN32API.INC file included in your WINAPI directory.
    This does not tell me that styles not listed is not supported..
    On the other hand it would be very easy for PB to replay (on a direct question to [email protected])
    that this style (PUSHLIKE) is not supported by the
    DDT-engine...
    On the other hand I agree with you (and Lance) that using
    undocumented features of any kind, is the responsability
    of the programmer.
    I also think that it is important that all "official" documents
    including example-code does not contain such references to
    undocumented features.

    ------------------
    Fred
    mailto:[email protected][email protected]</A>
    http://www.oxenby.se



    [This message has been edited by Fred Oxenby (edited February 29, 2000).]

    Leave a comment:


  • Eric Pearson
    replied
    Semen --

    > I think that DDT doesn't test parameters, because (...)
    > sometimes I used incorrect values (not specially)
    > and it was not any message during compiling and execution.

    That doesn't mean that the parameters are not being analyzed. When you use incorrect equates, the compiler is really dealing with numbers, not "words" like WS_VISIBLE. Consider this code, which will compile and run just fine...

    Code:
    %YES   = 1
    %NO    = 0
    %BLUE  = 1
    %GREEN = 2
     
    IF YesOrNo& = %BLUE THEN...
    It is very possible to use equates that do not really make sense, and they may or may not be detected at compile time or run time. The compiler (and the API for that matter) do not analyze the "words", but they do analyze the numeric values.

    > Don't beleive that DDT analyzes parameters.
    > If parameters are omitted, DDT simply accepts
    > default values during compilation (!)

    But that proves my point. DDT looks at the parameter, sees that it is missing, and uses a default value. And if a parameter is specified, I promise you that certain checks are performed. The various DDT functions are not simply API wrappers that allow you to use API equate definitions without restrictions. If they were, there would be no restrictions about mixing DDT and API techniques.

    Sorry, but due to a non-disclosure agreement, this has to be the end of my participation in this particular aspect of this discussion. If you don't believe me, you'll need to debate it with somebody else.

    -- Eric

    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>



    [This message has been edited by Eric Pearson (edited February 29, 2000).]

    Leave a comment:


  • Semen Matusovski
    replied
    Eric --

    Let's begin from end.

    > Don't beleive that DDT analyzes parameters.
    If parameters are omitted, DDT simply accepts default values during compilation (!)
    I think that DDT doesn't test parameters, because
    1) sometimes I used incorrect values (not specially) and it was not any message during compiling and execution.
    2) to include in executable module the test of parameters requires a lot of additional code. It's not a PB style, like I understand it (and I agree that developer should be responsible)

    > So, if problem exist, first of all, it's necessary
    > to test "clean" API-functions without DDT.

    When I wrote it, I want to say: if the same module works under NT, but not works under Win95, it possible to expect that problem is in OS, not in DDT engine like it is (remember, two monthes ago we discussed a problem with centering multi-line text on buttons under Win98 FE)

    > About "macroes".
    I hope so, but not sure. Could be you saw my question about Dialog New. Yes, I need to know restrictions and also think that they exist and understand that it's necessary to mix DDT and API very carefully.

    ------------------

    Leave a comment:


  • Eric Pearson
    replied
    Semen --

    > If not declared in PB.HLP, this doesn't mean that not works.

    That's clearly true, but if a particular technique is not listed in the PB/CC Help File as an option for a particular DDT function, and if DDT provides an alternative techique, it is not fair to imply that DDT is "broken" because it does not accept a particular Win32 parameter. DDT does what the Help File says it does and, as you've found, it may do more. But I would not depend on using "undocumented features" unless you are prepared to avoid using all future versions of PB/DLL and DDT, which may or may not allow the use of those features. As Lance says, "do it at your own risk".

    (On a related topic, the same thing almost certainly applies to the DDT "message loop" technique. If PowerBASIC does not officially "bless" it, they are free to make changes in future versions of DDT that might cause it to fail.)

    > In my impression DDT-engine is macros (it's positive).
    >I think that DDT simply transfers parameters to API functions.

    Lance has addressed this in other threads. Sometimes yes, sometimes no. The inner workings of DDT are proprietary, and I suspect that PowerBASIC will not reveal exactly how it works.

    > these styles are not described in PB.HLP. But all works.

    Clearly not "all", or this thread would not exist.

    > So, if problem exist, first of all, it's necessary
    > to test "clean" API-functions without DDT.

    Sorry, I'm confused... What problem are you talking about? CONTROL ADD BUTTON does what the PB/DLL Help File says that it does, right? If you are saying that you may need to experiment with API functions if DDT does not support an "undocumented feature" that you expect it to, I certainly can't argue with that. But you do have the alternative of checking the Help File to see if DDT support the feature in another way, like CONTROL ADD OPTION.

    IMO, DDT provides a lot more than some simple API wrappers. And I believe that it is a mistake to assume that you can mix DDT and API functions/options without restrictions.

    > Don't beleive that DDT analyzes parameters.

    That is absolutely not correct. All DDT functions have default parameters, required parameters, and excluded parameters. The most common example (lately) is that the WM_VISIBLE style is required.

    -- Eric


    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>

    Leave a comment:


  • Semen Matusovski
    replied
    Eric --
    If not declared in PB.HLP, this doesn't mean that not works.
    In my impression DDT-engine is macros (it's positive).

    I open Rector/Newcomer book and select styles and sometimes found that these styles are not described in PB.HLP. But all works.

    I think that DDT simply transfers parameters to API functions.
    (if not mentioned, takes default values).
    So, if problem exist, first of all, it's necessary to test "clean" API-functions without DDT.
    Don't beleive that DDT analyzes parameters.

    [This message has been edited by Semen Matusovski (edited February 29, 2000).]

    Leave a comment:


  • Eric Pearson
    replied
    Chris --

    > %BS_AUTORADIOBUTTON or %BS_PUSHLIKE
    >
    > For some reason both DDT and Win 95 together don't
    > like it when you use them for the DDT BUTTON command.

    Correct. But then again, the PB/DLL Help File does not list either of those as valid options
    for CONTROL ADD BUTTON. As you've found, it is not safe to assume that every equate in the
    Win32API.INC file can be used with every DDT function. The PB/DLL Help File lists the valid
    options for each DDT function.

    CONTROL ADD OPTION (not BUTTON) must be used to create radio buttons, and %BS_AUTORADIOBUTTON
    is the default style. Likewise, CONTROL ADD CHECKBOX and CHECK3STATE must be used to create
    checkboxes, which are another type of "button".

    HTH.

    -- Eric

    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>



    [This message has been edited by Eric Pearson (edited February 29, 2000).]

    Leave a comment:


  • Chris Boss
    replied
    YES, YES, YES !!!!!!!!!!!!!!!!!!!!

    Thats it !!!!!!!!!!!!!!!!


    Thanks Fred !

    The problem has nothing to do with Child DDT Dialogs, but has to do with the CONTROL ADD BUTTON command when it uses the following style combination:

    %BS_AUTORADIOBUTTON or %BS_PUSHLIKE

    For some reason both DDT and Win 95 together don't like it when you use them for the DDT BUTTON command.

    The solution was "SO" simple !

    Simple use the custom version of the CONTROL ADD command and define BUTTON as a class, rather than a COMMAND.

    Here is my updated code (and formated the way it was suppose to be, since I played around with all sorts of stuff trying to find the cause of the GPF):

    Code:
    $COMPILE EXE
    $DIM ALL                    '   This is helpful to prevent errors in coding
    
    $INCLUDE "win32api.inc"        ' The Windows API include file !
    ' *************************************************************************************
    
    
    ' *************************************************************************************
    '                         Application Constants and Declares
    ' *************************************************************************************
    
    
    ' ----------------------------------------------------------
    %Form1_File                                     = 500
    ' ----------------------------------------------------------
    %Form1_New_File                                 = 505
    %Form1_Open_File                                = 510
    %Form1_Save_File                                = 515
    %Form1_Save_File_As                             = 520
    %Form1_Separator_525                            = 525
    %Form1_Exit                                     = 530
    
    ' ----------------------------------------------------------
    %Form1_Edit                                     = 600
    ' ----------------------------------------------------------
    %Form1_Cut                                      = 605
    %Form1_Copy                                     = 610
    %Form1_Paste                                    = 615
    
    ' ----------------------------------------------------------
    %Form1_Help                                     = 700
    ' ----------------------------------------------------------
    %Form1_Display_Help_Contents                    = 705
    %FORM1_BUTTON1            = 100
    %FORM1_BUTTON2            = 105
    %FORM1_BUTTON3            = 110
    %FORM1_IBUTTON1           = 115
    %FORM1_CHECK1             = 120
    %FORM1_RADIO1             = 125
    %FORM1_TEXT1              = 130
    %FORM1_LISTBOX1           = 135
    %FORM1_COMBOBOX1          = 140
    %FORM1_VSCROLL1           = 145
    %FORM1_HSCROLL1           = 150
    %FORM1_LABEL1             = 155
    %FORM1_PROGRESS1          = 160
    %FORM1_UPDOWN1            = 165
    %FORM1_FRAME1             = 170
    %FORM1_TAB1               = 175
    ' --------------------------------------------------
    DECLARE SUB ShowDialog_Form1(BYVAL hParent&)
    DECLARE CALLBACK FUNCTION Form1_DLGPROC
    DECLARE SUB ShowDialog_Form2(BYVAL hParent&)
    DECLARE CALLBACK FUNCTION Form2_DLGPROC
    ' --------------------------------------------------
    ' ------------------------------------------------
    
    DECLARE SUB Form1_New_File_Select()
    DECLARE SUB Form1_Open_File_Select()
    DECLARE SUB Form1_Save_File_Select()
    DECLARE SUB Form1_Save_File_As_Select()
    DECLARE SUB Form1_Exit_Select()
    DECLARE SUB Form1_Cut_Select()
    DECLARE SUB Form1_Copy_Select()
    DECLARE SUB Form1_Paste_Select()
    DECLARE SUB Form1_Display_Help_Contents_Select()
    DECLARE CALLBACK FUNCTION CBF_FORM1_BUTTON1()
    DECLARE CALLBACK FUNCTION CBF_FORM1_BUTTON2()
    DECLARE CALLBACK FUNCTION CBF_FORM1_BUTTON3()
    DECLARE CALLBACK FUNCTION CBF_FORM1_IBUTTON1()
    DECLARE CALLBACK FUNCTION CBF_FORM1_CHECK1()
    DECLARE CALLBACK FUNCTION CBF_FORM1_RADIO1()
    DECLARE CALLBACK FUNCTION CBF_FORM1_TEXT1()
    DECLARE CALLBACK FUNCTION CBF_FORM1_LISTBOX1()
    DECLARE CALLBACK FUNCTION CBF_FORM1_COMBOBOX1()
    DECLARE SUB FORM1_VSCROLL1_Change(BYVAL CVal&)
    DECLARE SUB FORM1_HSCROLL1_Change(BYVAL CVal&)
    DECLARE SUB FORM1_UPDOWN1_Change(BYVAL CVal&)
    DECLARE SUB FORM1_TAB1_Change(BYVAL CVal&)
    
    ' *************************************************************************************
    '                         Application Global Variables and Types
    ' *************************************************************************************
    
    GLOBAL hForm1&    ' Dialog handle
    GLOBAL hForm2&
    
    ' Global Handles for menus
    GLOBAL hForm1_Menu0&
    GLOBAL hForm1_Menu1&
    GLOBAL hForm1_Menu2&
    GLOBAL hForm1_Menu3&
    
    
    ' *************************************************************************************
    '                               Application Entrance
    ' *************************************************************************************
    
    FUNCTION PBMAIN
        LOCAL Count&
    
        ShowDialog_Form1 0
        DO
            DIALOG DOEVENTS TO Count&
        LOOP UNTIL Count&=0
    
    
    END FUNCTION
    
    
    ' *************************************************************************************
    '                               Application Dialogs
    ' *************************************************************************************
    
    SUB ShowDialog_Form1(BYVAL hParent&)
        LOCAL Style&, ExStyle&
        LOCAL N&, CT&        '  Variables used for Reading Data in Arrays for Listbox and Combobox
        '   hParent& = 0 if no parent Dialog
        Style& = %WS_POPUP OR %WS_CLIPCHILDREN OR %WS_CLIPSIBLINGS OR %DS_MODALFRAME OR %WS_CAPTION OR %WS_MINIMIZEBOX OR %WS_SYSMENU OR %WS_MAXIMIZEBOX OR %DS_CENTER
        ExStyle& = %WS_EX_CONTROLPARENT
        DIALOG NEW hParent&, "Your Dialog", 0, 0,  283,  138, Style&, ExStyle& TO hForm1&
    
        ' ---------------------------
        MENU NEW BAR TO hForm1_Menu0&
        ' ---------------------------
        MENU NEW POPUP TO hForm1_Menu1&
        MENU ADD POPUP, hForm1_Menu0& ,"&File", hForm1_Menu1&, %MF_ENABLED
        ' - - - - - - - - - - - - - -
        MENU ADD STRING, hForm1_Menu1&, "&New File",  %Form1_New_File, %MF_ENABLED
        MENU ADD STRING, hForm1_Menu1&, "&Open File",  %Form1_Open_File, %MF_ENABLED
        MENU ADD STRING, hForm1_Menu1&, "&Save File",  %Form1_Save_File, %MF_ENABLED
        MENU ADD STRING, hForm1_Menu1&, "Save File &As",  %Form1_Save_File_As, %MF_ENABLED
        MENU ADD STRING, hForm1_Menu1&, "-",  %Form1_Separator_525, %MF_ENABLED
        MENU ADD STRING, hForm1_Menu1&, "E&xit",  %Form1_Exit, %MF_ENABLED
        MENU NEW POPUP TO hForm1_Menu2&
        MENU ADD POPUP, hForm1_Menu0& ,"&Edit", hForm1_Menu2&, %MF_ENABLED
        ' - - - - - - - - - - - - - -
        MENU ADD STRING, hForm1_Menu2&, "Cu&t",  %Form1_Cut, %MF_ENABLED
        MENU ADD STRING, hForm1_Menu2&, "&Copy",  %Form1_Copy, %MF_ENABLED
        MENU ADD STRING, hForm1_Menu2&, "&Paste",  %Form1_Paste, %MF_ENABLED
        MENU NEW POPUP TO hForm1_Menu3&
        MENU ADD POPUP, hForm1_Menu0& ,"&Help", hForm1_Menu3&, %MF_ENABLED
        ' - - - - - - - - - - - - - -
        MENU ADD STRING, hForm1_Menu3&, "Display Help &Contents",  %Form1_Display_Help_Contents, %MF_ENABLED
        MENU ATTACH hForm1_Menu0&, hForm1&
        DIALOG SHOW MODELESS hForm1& , CALL Form1_DLGPROC
    END SUB
    
    SUB ShowDialog_Form2(BYVAL hParent&)
        LOCAL Style&, ExStyle&
        LOCAL N&, CT&        '  Variables used for Reading Data in Arrays for Listbox and Combobox
        Style& = %WS_CHILD OR %WS_CLIPCHILDREN OR %WS_CLIPSIBLINGS OR %DS_CONTROL
        ExStyle& = 0
        DIALOG NEW hForm1&, "", 0, 0,  283,  128, Style&, ExStyle& TO hForm2&
        CONTROL ADD "BUTTON", hForm2&,  %FORM1_BUTTON1,  "Button  1", 203, 2, 53, 15, %WS_CHILD OR %WS_VISIBLE OR %BS_AUTORADIOBUTTON OR %BS_PUSHLIKE OR %WS_GROUP OR %WS_TABSTOP CALL CBF_FORM1_BUTTON1
        CONTROL ADD "BUTTON", hForm2&,  %FORM1_BUTTON2,  "Button  2", 203, 20, 53, 15, %WS_CHILD OR %WS_VISIBLE OR %BS_AUTORADIOBUTTON OR %BS_PUSHLIKE OR %WS_TABSTOP CALL CBF_FORM1_BUTTON2
        CONTROL ADD "BUTTON", hForm2&,  %FORM1_BUTTON3,  "Button  3", 203, 37, 53, 15, %WS_CHILD OR %WS_VISIBLE OR %BS_AUTORADIOBUTTON OR %BS_PUSHLIKE OR %WS_TABSTOP CALL CBF_FORM1_BUTTON3
        CONTROL ADD IMGBUTTON, hForm2&,  %FORM1_IBUTTON1, "FORM1_IBUTTON1_ICO", 229, 59, 27, 25, %WS_CHILD OR %WS_VISIBLE OR %BS_PUSHBUTTON OR %BS_ICON OR %WS_TABSTOP CALL CBF_FORM1_IBUTTON1
        CONTROL ADD CHECKBOX, hForm2&,  %FORM1_CHECK1,  "Check  1", 5, 5, 53, 12 CALL CBF_FORM1_CHECK1
        CONTROL ADD OPTION, hForm2&,  %FORM1_RADIO1,  "Radio  1", 5, 15, 53, 12, %WS_CHILD OR %WS_VISIBLE OR %BS_AUTORADIOBUTTON OR %WS_GROUP OR %WS_TABSTOP CALL CBF_FORM1_RADIO1
        CONTROL ADD TEXTBOX, hForm2&,  %FORM1_TEXT1,  "", 5, 30, 53, 12, %WS_CHILD OR %WS_VISIBLE OR %ES_AUTOHSCROLL OR %WS_TABSTOP, %WS_EX_CLIENTEDGE CALL CBF_FORM1_TEXT1
          ' - - - - - - - - - - - - - - - - - - - - - - - - -
          DIM LISTBOX1_List(4) AS LOCAL STRING
          DATA "Item 1","Item 2","Item 3","Item 4","Item 5"
          FOR N&=0 TO 4
              CT&=CT&+1
              LISTBOX1_List(N&)=READ$(CT&)
          NEXT N&
          ' - - - - - - - - - - - - - - - - - - - - - - - - -
        CONTROL ADD LISTBOX, hForm2&,  %FORM1_LISTBOX1, LISTBOX1_List(), 69, 7, 53, 44, %WS_CHILD OR %WS_VISIBLE OR %LBS_NOTIFY OR %LBS_SORT OR %LBS_NOINTEGRALHEIGHT OR %WS_VSCROLL OR %WS_TABSTOP, %WS_EX_CLIENTEDGE CALL CBF_FORM1_LISTBOX1
          ' - - - - - - - - - - - - - - - - - - - - - - - - -
          DIM COMBOBOX1_List(4) AS LOCAL STRING
          DATA "Item 1","Item 2","Item 3","Item 4","Item 5"
          FOR N&=0 TO 4
              CT&=CT&+1
              COMBOBOX1_List(N&)=READ$(CT&)
          NEXT N&
          ' - - - - - - - - - - - - - - - - - - - - - - - - -
        CONTROL ADD COMBOBOX, hForm2&,  %FORM1_COMBOBOX1, COMBOBOX1_List(), 128, 7, 53, 52, %WS_CHILD OR %WS_VISIBLE OR %CBS_DROPDOWNLIST OR %CBS_SORT OR %WS_VSCROLL OR %CBS_NOINTEGRALHEIGHT OR %WS_TABSTOP, %WS_EX_CLIENTEDGE CALL CBF_FORM1_COMBOBOX1
        CONTROL ADD SCROLLBAR, hForm2&,  %FORM1_VSCROLL1,  "", 197, 62, 11, 49, %WS_CHILD OR %WS_VISIBLE OR %SBS_VERT
        CONTROL ADD SCROLLBAR, hForm2&,  %FORM1_HSCROLL1,  "", 213, 106, 53, 10, %WS_CHILD OR %WS_VISIBLE OR %SBS_HORZ
        CONTROL ADD LABEL, hForm2&,  %FORM1_LABEL1,  "Label  1", 128, 34, 61, 12, %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER
        CONTROL ADD FRAME, hForm2&,  %FORM1_FRAME1,  "Frame  1", 133, 49, 53, 44, %WS_CHILD OR %WS_VISIBLE OR %BS_GROUPBOX, %WS_EX_TRANSPARENT
        DIALOG SHOW MODELESS hForm2& , CALL Form2_DLGPROC
    END SUB
    
    ' *************************************************************************************
    '                             Dialog Callback Procedure
    '                             for Form Form1
    '                             uses Global Handle - hForm1&
    ' *************************************************************************************
    CALLBACK FUNCTION Form1_DLGPROC
        LOCAL hDlg AS LONG
    
        SELECT CASE CBMSG
            CASE %WM_INITDIALOG
                ShowDialog_Form2 hForm1&
    
            CASE %WM_COMMAND
                ' Process Messages to Controls that have no Callback Function
                ' and Process Messages to Menu Items
                SELECT CASE CBCTL
                    CASE  %Form1_New_File                                     ' Popup Menu Item Selected
                        Form1_New_File_Select
                    CASE  %Form1_Open_File                                    ' Popup Menu Item Selected
                        Form1_Open_File_Select
                    CASE  %Form1_Save_File                                    ' Popup Menu Item Selected
                        Form1_Save_File_Select
                    CASE  %Form1_Save_File_As                                 ' Popup Menu Item Selected
                        Form1_Save_File_As_Select
                    CASE  %Form1_Separator_525                                ' Popup Menu Item Selected
    
                    CASE  %Form1_Exit                                         ' Popup Menu Item Selected
                        Form1_Exit_Select
                    CASE  %Form1_Cut                                          ' Popup Menu Item Selected
                        Form1_Cut_Select
                    CASE  %Form1_Copy                                         ' Popup Menu Item Selected
                        Form1_Copy_Select
                    CASE  %Form1_Paste                                        ' Popup Menu Item Selected
                        Form1_Paste_Select
                    CASE  %Form1_Display_Help_Contents                        ' Popup Menu Item Selected
                        Form1_Display_Help_Contents_Select
                    CASE ELSE
                END SELECT
            CASE %WM_NOTIFY
                ' Process Messages to Controls that use Notification method
            CASE ELSE
        END SELECT
    END FUNCTION
    
    
    CALLBACK FUNCTION Form2_DLGPROC
        LOCAL hDlg AS LONG
    
        SELECT CASE CBMSG
            CASE %WM_COMMAND
                ' Process Messages to Controls that have no Callback Function
                ' and Process Messages to Menu Items
                SELECT CASE CBCTL
                    CASE ELSE
                END SELECT
            CASE %WM_NOTIFY
                ' Process Messages to Controls that use Notification method
            CASE ELSE
        END SELECT
    END FUNCTION
    
    ' *************************************************************************************
    '                               XXXXX Dynamic Dialogs Library
    ' *************************************************************************************
    
    ' -------------------------------------------------------------------------------------
    
    
    ' -------------------------------------------------------------------------------------
    
    
    ' -------------------------------------------------------------------------------------
    
    
    ' *************************************************************************************
    '               Application Callback Functions (or Procedures) for Controls
    ' *************************************************************************************
    
    ' ------------------------------------------------
    SUB Form1_New_File_Select()
    
    END SUB
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    SUB Form1_Open_File_Select()
    
    END SUB
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    SUB Form1_Save_File_Select()
    
    END SUB
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    SUB Form1_Save_File_As_Select()
    
    END SUB
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    SUB Form1_Exit_Select()
    
    END SUB
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    SUB Form1_Cut_Select()
    
    END SUB
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    SUB Form1_Copy_Select()
    
    END SUB
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    SUB Form1_Paste_Select()
    
    END SUB
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    SUB Form1_Display_Help_Contents_Select()
    
    END SUB
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    CALLBACK FUNCTION CBF_FORM1_BUTTON1
        IF CBCTLMSG=%BN_CLICKED THEN
    
        END IF
        IF CBCTLMSG=%BN_SETFOCUS THEN
    
        END IF
        IF CBCTLMSG=%BN_KILLFOCUS THEN
    
        END IF
    END FUNCTION
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    CALLBACK FUNCTION CBF_FORM1_BUTTON2
        IF CBCTLMSG=%BN_CLICKED THEN
    
        END IF
        IF CBCTLMSG=%BN_SETFOCUS THEN
    
        END IF
        IF CBCTLMSG=%BN_KILLFOCUS THEN
    
        END IF
    END FUNCTION
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    CALLBACK FUNCTION CBF_FORM1_BUTTON3
        IF CBCTLMSG=%BN_CLICKED THEN
    
        END IF
        IF CBCTLMSG=%BN_SETFOCUS THEN
    
        END IF
        IF CBCTLMSG=%BN_KILLFOCUS THEN
    
        END IF
    END FUNCTION
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    CALLBACK FUNCTION CBF_FORM1_IBUTTON1
        IF CBCTLMSG=%BN_CLICKED THEN
    
        END IF
        IF CBCTLMSG=%BN_SETFOCUS THEN
    
        END IF
        IF CBCTLMSG=%BN_KILLFOCUS THEN
    
        END IF
    END FUNCTION
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    CALLBACK FUNCTION CBF_FORM1_CHECK1
        IF CBCTLMSG=%BN_CLICKED THEN
    
        END IF
        IF CBCTLMSG=%BN_SETFOCUS THEN
    
        END IF
        IF CBCTLMSG=%BN_KILLFOCUS THEN
    
        END IF
    END FUNCTION
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    CALLBACK FUNCTION CBF_FORM1_RADIO1
        IF CBCTLMSG=%BN_CLICKED THEN
    
        END IF
        IF CBCTLMSG=%BN_SETFOCUS THEN
    
        END IF
        IF CBCTLMSG=%BN_KILLFOCUS THEN
    
        END IF
    END FUNCTION
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    CALLBACK FUNCTION CBF_FORM1_TEXT1
        IF CBCTLMSG=%EN_CHANGE THEN
    
        END IF
        IF CBCTLMSG=%EN_SETFOCUS THEN
    
        END IF
        IF CBCTLMSG=%EN_KILLFOCUS THEN
    
        END IF
    END FUNCTION
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    CALLBACK FUNCTION CBF_FORM1_LISTBOX1
        LOCAL CVal&
        ' Return Current Selection in CVal&
        CONTROL SEND CBHNDL , CBCTL, %LB_GETCURSEL, 0,0 TO CVal&
        IF CBCTLMSG=%LBN_SELCHANGE THEN
    
        END IF
        IF CBCTLMSG=%LBN_DBLCLK THEN
    
        END IF
        IF CBCTLMSG=%LBN_SETFOCUS THEN
    
        END IF
        IF CBCTLMSG=%LBN_KILLFOCUS THEN
    
        END IF
    END FUNCTION
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    CALLBACK FUNCTION CBF_FORM1_COMBOBOX1
        LOCAL CVal&
        ' Return Current Selection in CVal&
        CONTROL SEND CBHNDL , CBCTL, %CB_GETCURSEL, 0,0 TO CVal&
        IF (CBCTLMSG=%CBN_SELCHANGE) OR  (CBCTLMSG=%CBN_EDITCHANGE) OR (CBCTLMSG=%CBN_EDITUPDATE) THEN
    
        END IF
        IF CBCTLMSG=%CBN_DBLCLK THEN
    
        END IF
        IF CBCTLMSG=%CBN_SETFOCUS THEN
    
        END IF
        IF CBCTLMSG=%CBN_KILLFOCUS THEN
    
        END IF
    END FUNCTION
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    SUB FORM1_VSCROLL1_Change(BYVAL CVal&)
    END SUB
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    SUB FORM1_HSCROLL1_Change(BYVAL CVal&)
    END SUB
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    SUB FORM1_UPDOWN1_Change(BYVAL CVal&)
    END SUB
    ' ------------------------------------------------
    
    ' ------------------------------------------------
    SUB FORM1_TAB1_Change(BYVAL CVal&)
    END SUB
    ' ------------------------------------------------
    
    ' *************************************************************************************
    '                                 Put Your Code Here
    ' *************************************************************************************


    ------------------

    Leave a comment:


  • Fred Oxenby
    replied
    Actually I dont think it is AUTORADIOBUTTON giving the
    problem, it is the combination with PUSHLIKE
    From my posting
    Contol Add Option does not recognise %BS_AUTORADIOBUTTON or %BS_PUSHLIKE
    and does not create a toggle/pushbutton.
    The problem is when you have this push-buttons on the
    main dialog and there are child-dialogs on the main dialog.



    ------------------
    Fred
    mailto:[email protected][email protected]</A>
    http://www.oxenby.se

    Leave a comment:


  • Eric Pearson
    replied
    Fred --

    From your other post (from August)...

    > Contol Add Option does not recognise %BS_AUTORADIOBUTTON

    I'm writing this from home so I can't double-check, but I think I read in the PB/DLL Help File
    (just today) that %BS_AUTORADIOBUTTON is the default style for CONTROL ADD OPTION.

    Doesn't it work that way?

    -- Eric


    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>



    [This message has been edited by Eric Pearson (edited February 28, 2000).]

    Leave a comment:


  • Fred Oxenby
    replied
    the problem with %bs_autoradiobutton was reported to
    powerbasic in july 1999.
    still waiting for an answer lance
    workaround: place the bs_autoradio pushlike on a childdialog.


    ------------------
    fred
    mailto:[email protected][email protected]</a>
    http://www.oxenby.se



    [this message has been edited by fred oxenby (edited february 28, 2000).]

    Leave a comment:


  • Jim Huguley
    replied

    Chris...
    A small trick...
    Code:
    Style& = %WS_CHILD OR %DS_CONTROL
    ExStyle& = 0
    DIALOG NEW hForm1&, "", 0, 0, 283, 128, Style&, ExStyle& TO hForm2&
    '***** Add this line To show dialog
    DIALOG SHOW STATE hForm2&, %SW_SHOW
    
    ' add back the Controls here for the Child Dialog and see the GPF
    ------------------
    Jim..
    [email protected]

    Leave a comment:


  • Eric Pearson
    replied
    It looks to me like %BS_AUTORADIOBUTTON is only a valid button style if the button is created with CreateWindow or CreateWindowEx. If DDT is not doing that...?

    In any event, it's not listed in the PB/DLL Help File as a valid option for CONTROL ADD BUTTON.

    See CONTROL ADD OPTION.

    -- Eric

    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>



    [This message has been edited by Eric Pearson (edited February 28, 2000).]

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Chris
    Your code GPFs on my win98 machine.
    If I take out the %BS_AUTORADIOBUTTON it compiles and runs OK.
    Maybe with DDT you need to create a autoradiobutton a diffrent way.
    Kevin

    ------------------
    mailto:[email protected][email protected]</A>
    :-)



    [This message has been edited by KevinVoell (edited February 28, 2000).]

    Leave a comment:


  • Chris Boss
    replied
    Thanks for the feedback !



    [This message has been edited by Chris Boss (edited February 28, 2000).]

    Leave a comment:


  • Eric Pearson
    replied
    It runs fine on NT4 but GPFs on 95a. I haven't tried to find out why...

    -- Eric

    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>

    Leave a comment:


  • Chris Boss
    replied
    Likely, I have implimented my code poorly, since I am not a DDT expert.

    Could anyone suggest a better way of implimenting the child dialog ?

    Could I be using a style that Win 95 doesn't like ?


    [This message has been edited by Chris Boss (edited February 28, 2000).]

    Leave a comment:

Working...
X