Announcement

Collapse
No announcement yet.

Hangup using DDT dialog as child.

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

  • Hangup using DDT dialog as child.

    What's wrong here;

    When i place a control on the DDT child dialog, and click the optionbutton, the app hangs.

    When i remove the %DS_CONTROL style, the app works ok.
    I need this style because of some painting problems described earlier and using tabstops.

    Thanks,

    Code:
    'PowerBasic/DLL Projectfile.
    'Project : !TEST
    'Created : 2000-3-14 17:14:34
    
    $COMPILE EXE "c:\temp\test.EXE"
    
    Option Explicit
    
    $INCLUDE "c:\pbdll60\winapi\win32api.inc"
    
    Callback Function DlgProc() As Long
    
        Dim a   As Long
        Dim PS  As PaintStruct
        Dim R   As Rect
        Dim T   As String
    
        Static hInst    As Long
        Static hBrush   As Long
        Static OldBrush As Long
        Static hIcon    As Long
        Static hFont    As Long
        Static ResDPIX  As Long
        Static ResDPIY  As Long
    
        Select case cbMsg
        Case %WM_INITDIALOG
    
            hInst = GetWindowLong( cbhndl, %GWL_HINSTANCE )
    
            a = GETDC( CbHndl )
            ResDPIX = GetDeviceCaps( a, %LOGPIXELSX )
            ResDPIY = GetDeviceCaps( a, %LOGPIXELSY )
            ReleaseDC CbHndl, a
    
            hIcon = LoadIcon( hInst, "APPDEFICON")
            If hIcon Then SendMessage CbHndl, %WM_SETICON, %ICON_BIG, hIcon
    
            hFont = CreateFont( Clng( -( 8 * ResDPIY ) / 72 ), 0, 0, 0 _
            , %FW_NORMAL _          'Fontweight
            , Abs ( IsTrue( 0 ) ) _ 'Italic
            , Abs ( IsTrue( 0 ) ) _ 'Underlined
            , Abs ( IsTrue( 0 ) ) _ 'Strikethru
            , 0, 0, 0, 0, 0 , "Ms Sans Serif" )
    
            hBrush = CreateSolidBrush( RGB( 255, 0, 0 ) )
    
            SendMessage GetDlgItem( CbHndl, 102 ), %WM_SETFONT, hFont, 0
    
        Case %WM_DESTROY
    
            If hFont    Then DeleteObject hFont:  hFont = 0
            If hBrush   Then DeleteObject hBrush: hBrush = 0
            If hIcon    Then DestroyIcon  hIcon:  hIcon = 0
    
        Case %WM_ERASEBKGND
        Case %WM_PAINT
    
            T = "Hello World"
    
            Call BeginPaint( cbhndl, ps)
    
            GetClientRect cbhndl, R
    
            DrawText PS.hDC, ByVal StrPtr( T ), Len( T ), R, %DT_SINGLELINE OR %DT_CENTER OR %DT_VCENTER
    
            If hBrush Then
    
                OldBrush = SelectObject( PS.hDC, hBrush )
    
                Rectangle PS.hDC, R.nRight - 30, R.nTop + 10, R.nRight - 20, R.nTop + 20
    
                Call SelectObject( PS.hDC, OldBrush )
    
            End If
    
            EndPaint cbhndl, ps
    
            Function = 1
            Exit Function
    
        Case %WM_MOUSEMOVE
        Case %WM_COMMAND
    
            Select Case CBCTL
            Case 100
    
                beep
                DIALOG END CBHNDL, 1
                Function = 1
                Exit Function
    
            Case 101
    
            End Select
    
        Case %WM_SIZE
    
            InValidateRect cbhndl, ByVal 0&, -1
    
        End Select
    
    End Function
    
    Function WinMain ( ByVal hCurInstance  As Long, _
                       ByVal hPrevInstance As Long, _
                       lpszCmdLine         As ASCIIZ PTR, _
                       ByVal nCmdShow      As Long ) As Long
    
        Dim a       As Long
        Dim hCombo  As Long
        Dim hFrame  As Long
        Dim hDlg    As Long
        Dim hDlg1 As Long
    
        'Prepare new dialog.
        DIALOG NEW 0, "DDT Skeleton",,, 240, 180 _
        ,  %WS_OVERLAPPED _
        Or %WS_SYSMENU _
        Or %WS_MINIMIZEBOX _
        Or %WS_MAXIMIZEBOX _
        Or %WS_THICKFRAME _
        Or %WS_CLIPSIBLINGS _
        Or %WS_CLIPCHILDREN _
        TO hDlg
    
        If hDlg = 0 Then Exit Function
    
        'Add some controls
        CONTROL ADD BUTTON,     hDlg, 100, "&Quit",2, 2, 40, 14, %WS_TABSTOP
    
        CONTROL ADD OPTION,   hDlg, 105, "Option1", 4, 120, 50, 15
        CONTROL ADD OPTION,   hDlg, 106, "Option2", 4, 135, 50, 15
        CONTROL ADD CHECKBOX, hDlg, 107, "Check1",  5, 150, 50, 15
    
        DIALOG NEW hDlg, "", 40,40, 60, 60 _
        ,  %WS_CHILD _
        Or %WS_BORDER _
        Or %WS_CLIPSIBLINGS _
        Or %WS_CLIPCHILDREN _
        Or %DS_CONTROL _
        TO hDlg1
    
    'msgbox Str$( hDlg1 )
    
        CONTROL ADD BUTTON,     hDlg1, 108, "DEF",2, 2, 40, 14, %WS_VISIBLE Or %WS_TABSTOP Or %BS_DEFAULT
    
        DIALOG SHOW MODELESS hDlg1
        DIALOG SHOW MODAL hDlg CALL DlgProc
    
        FUNCTION = 1    'Success
    
    End Function

  • #2
    There is a confict beetween Option on parent dialog and %DS_CONTROL.
    But I found, that if to move Option to Child dialog all works fine


    [This message has been edited by Semen Matusovski (edited March 14, 2000).]

    Comment


    • #3
      E. B.

      Try creating the child Dialog during the %WM_INITDIALOG message. Also make the Parent Dialog Modeless (use a DoEvents loop after it).


      ------------------
      Chris Boss
      Computer Workshop
      Developer of "EZGUI"
      http://cwsof.com
      http://twitter.com/EZGUIProGuy

      Comment


      • #4
        Interesting, but %WS_GROUP is a key to a problem. Try:
        Code:
           #Compile Exe
           #Register None
           DefLng A-Z
           #Include "win32api.inc"
           Function PbMain
              Dialog New 0, "Your Dialog", , , 210, 140, %WS_SYSMENU To hDlg1
              Control Add Option, hDlg1, 101, "Option1", 10, 10, 53, 15, %WS_GROUP Or %WS_TABSTOP
              Control Add Option, hDlg1, 102, "Option2", 10, 30, 53, 15,
              Control Add Button, hDlg1, 103, "Button1", 10, 80, 53, 15, %WS_GROUP Or %WS_TABSTOP
              Control Add Button, hDlg1, 104, "Button2", 10, 100, 53, 15
              Dialog New hDlg1, "", 100, 0, 100, 120, %WS_CHILD Or %DS_CONTROL Or %WS_BORDER, %WS_EX_CLIENTEDGE To hDlg2
              Control Add CheckBox, hDlg2, 108, "Check 1", 5, 5, 53, 12
              Control Add Option, hDlg2, 109, "Radio 1", 5, 15, 53, 12
              Control Add TextBox, hDlg2, 110, "", 5, 30, 53, 12
              Dialog Show Modeless hDlg2
              Dialog Show Modal hDlg1
           End Function
        Edwin --

        I added %WS_TABSTOP Or %WS_GROUP to "Option1" and "Check1";
        and all works (at least on my PC)

        PS. I forgot to add that this code is based on Chris' wizard.

        [This message has been edited by Semen Matusovski (edited March 14, 2000).]

        Comment


        • #5
          Ok, there are a few problems with the coding styles used in this thread generally - I point these out because posting code that is poorly constructed misleads those that are not fluent in DDT and GUI programming:

          1. Modeless dialog(s) used without a DIALOG DOEVENTS message pump. As Chris pointed out - the correct way to use a modeless child dialog as a child control would be to create the child dialog during %WM_INITDIALOG - however, you would need to use PostMessage() to send a custom message to the callback to actually perform the modeless dialog construction and message loop.

          For example:
          Code:
            CASE %WM_INITDIALOG
              ...
              PostMessage CBHNDL, %WM_USER + 999&, 0, 0
              ...
            CASE %WM_USER + 999&
              LOCAL hDlg1 AS LONG, X1 AS LONG
              DIALOG NEW CBHNDL, .... to hDlg1
              ....
              DIALOG SHOW MODELESS hDlg1
              DO
                DIALOG DOEVENTS
                DIALOG GET SIZE HDLG1 TO X1,X1
              LOOP UNTIL ISFALSE X1
          ...

          2. %DS_CONTROL STYLE for a child dialog goes hand in hand with %WS_EX_CONTROLPARENT style for the parent dialog.

          It is an interesting observation that adding %WS_GROUP to the "checkable" controls solves the problem however. I'll ask R&D about this, but I suspect that has something to do with Windows querying the tab-order and the child dialog not cooperating.


          ------------------
          Lance
          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          Lance
          mailto:[email protected]

          Comment


          • #6
            I tried a empty createdialogParam on a DDT dialog.
            This gives me a border wich is diff. to a ddt child dialog.

            But when i put controls on it, makes no diff. what kind (olmenu uses createWindow) the app hangs.
            One of the last messages is wm_getdlgcode i think.
            Hard to determine with my code.

            Your example about the WM_USER/DIALOG DOEVENTS, is this necessary for my example?
            I create the child just before the main dialog is shown.
            Should be enough?
            Or do i miss some info here?
            I.o.w. do i have to create child controls in WM_INITDIALOG ALLWAYS?

            Thanks,



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

            Comment


            • #7
              If you want to create a *real* application that uses modeless dialog(s) as children of modal dialogs, then the WM_INITDIALOG technique is necessary to ensure that you have a message pump running.

              If you omit the message pump, Modeless dialogs do not work properly - this is not strictly a DDT behavior - it is an API behavior.

              For example, try creating child dialogs with their own child controls (ie, for pages on a tab control) and don't provide a message pump...


              ------------------
              Lance
              PowerBASIC Support
              mailto:[email protected][email protected]</A>
              Lance
              mailto:[email protected]

              Comment


              • #8
                If you look at my "Transparent child" example posted on the source code forum, you will see that using %DS_CONTROL and creating the child during WM_INITDIALOG seems to work OK with DDT, without any other necessary steps.

                I will be testing this more thoroughly in the next week or so.


                ------------------
                Chris Boss
                Computer Workshop
                Developer of "EZGUI"
                http://cwsof.com
                http://twitter.com/EZGUIProGuy

                Comment


                • #9
                  Chris --
                  Try to do following:
                  delete %WS_GROUP in
                  Control Add Button, hForm1&, %FORM1_BUTTON_SL, "Show Layer", 10, 80, 53, 15, %WS_CHILD Or %WS_VISIBLE Or %WS_TABSTOP Call CBF_FORM1_SHOW
                  Control Add Button, hForm1&, %FORM1_BUTTON_HL, "Hide Layer", 10, 100, 53, 15, %WS_CHILD Or %WS_VISIBLE Or %WS_TABSTOP Call CBF_FORM1_HIDE
                  and insert after them
                  Control Add Option, hForm1&, 1001, "Option", 10, 115, 53, 15


                  You will immediatelly receive the same problem as Edwin

                  PS. It looks not like DDT problem.
                  I tried to replace Option by "Button" with %BS_AUTORADIOBUTTON. The same troubles.
                  RADIOBUTTON - no problems.
                  "Hangs" really means that CPU is 100% busy.

                  But if to add %WS_GROUP to any another element on parent window (even for label !) all works fine. Crazy ...

                  [This message has been edited by Semen Matusovski (edited March 15, 2000).]

                  Comment


                  • #10
                    Here is a Wizard using DDT (I also posted it on source code forum).

                    It is quite simple. The main thing is to NOT nest the dialogs but to create the child dialogs during the WM_INITDIALOG message one at a time.

                    Code:
                    #COMPILE EXE
                    #DIM ALL          '  This is helpful to prevent errors in coding
                    
                    
                    #INCLUDE "win32api.inc"   ' Must come first before other include files !
                    
                    ' *************************************************************
                    '              Application Constants and Declares
                    ' *************************************************************
                    
                    ' --------------------------------------------------
                    DECLARE SUB ShowDialog_Form1(BYVAL hParent&)
                    DECLARE CALLBACK FUNCTION Form1_DLGPROC
                    ' --------------------------------------------------
                    ' ------------------------------------------------
                    
                    DECLARE CALLBACK FUNCTION CBF_FORM1_PREVIOUS()
                    DECLARE CALLBACK FUNCTION CBF_FORM1_NEXT()
                    DECLARE CALLBACK FUNCTION CBF_FORM1_APPLY()
                    
                    
                    ' *************************************************************
                    '            Application Global Variables and Types
                    ' *************************************************************
                    
                    GLOBAL hForm1&    ' Dialog handle
                    GLOBAL hWizard&()
                    GLOBAL CurrentPage&
                    
                    
                    ' *************************************************************
                    '                    Application Entrance
                    ' *************************************************************
                    
                    FUNCTION PBMAIN
                        LOCAL Count&
                        REDIM hWizard&(1 TO 5)
                        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 %DS_MODALFRAME OR %WS_CAPTION OR %WS_MINIMIZEBOX OR %WS_SYSMENU OR %DS_CENTER
                        ExStyle& = 0
                        DIALOG NEW hParent&, "Wizard Example", 0, 0,  267,  177, Style&, ExStyle& TO hForm1&
                        CONTROL ADD "Button", hForm1&,  105,  "Previous", 45, 155, 53, 15, _
                            %WS_CHILD OR %WS_VISIBLE OR %BS_PUSHBUTTON OR %WS_TABSTOP CALL CBF_FORM1_PREVIOUS
                        CONTROL ADD "Button", hForm1&,  110,  "Next", 109, 155, 53, 15, _
                            %WS_CHILD OR %WS_VISIBLE OR %BS_PUSHBUTTON OR %WS_TABSTOP CALL CBF_FORM1_NEXT
                        CONTROL ADD "Button", hForm1&,  115,  "Apply", 173, 155, 53, 15, _
                            %WS_CHILD OR %WS_VISIBLE OR %BS_PUSHBUTTON OR %WS_TABSTOP CALL CBF_FORM1_APPLY
                        DIALOG SHOW MODELESS hForm1& , CALL Form1_DLGPROC
                    END SUB
                    
                    SUB ShowDialog_Wizard(BYVAL hParent&, BYVAL N&)
                        LOCAL Style&, ExStyle&, Desc$()
                        LOCAL WP$, WT$, TX$, P&, CT&, D$
                        DIM Desc$(1 TO 8)
                        SELECT CASE N&
                            CASE 1
                                WP$="One"
                                TX$="Apples|Oranges|Pears|Lemons|Grapes|Bananas|Limes|Plumbs"
                            CASE 2
                                WP$="Two"
                                TX$="Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Vacation"
                            CASE 3
                                WP$="Three"
                                TX$="One|Two|Three|Four|Five|Six|Seven|Eight"
                            CASE 4
                                WP$="Four"
                                TX$="Basic|C++|Pascal|Fortran|Assembler|Prolog|Lisp|Java"
                            CASE 5
                                WP$="Five"
                                TX$="Red|Green|Blue|Orange|Purple|Black|White|Yellow"
                            CASE ELSE
                        END SELECT
                        WT$="Wizard Page "+WP$
                        CT&=0
                        DO
                            P&=INSTR(TX$,"|")
                            IF P&=0 THEN
                                D$=TX$
                                TX$=""
                                IF D$="" THEN EXIT DO
                            ELSE
                                D$=LEFT$(TX$,P&-1)
                                TX$=MID$(TX$,P&+1)
                            END IF
                            CT&=CT&+1
                            Desc$(CT&)=D$
                        LOOP
                        Style& = %WS_CHILD OR %DS_CONTROL
                        ExStyle& = 0
                        DIALOG NEW hParent&, "", 0, 0,  267,  150, Style&, ExStyle& TO hWizard&(N&)
                        CONTROL ADD FRAME, hWizard&(N&),  100,  WT$, 13, 10, 240, 133, _
                            %WS_CHILD OR %WS_VISIBLE OR %BS_GROUPBOX, _
                            %WS_EX_TRANSPARENT
                        CONTROL ADD CHECKBOX, hWizard&(N&),  120,  Desc$(1), 51, 44, 53, 12
                        CONTROL ADD CHECKBOX, hWizard&(N&),  125,  Desc$(2), 51, 62, 53, 12
                        CONTROL ADD CHECKBOX, hWizard&(N&),  130,  Desc$(3), 51, 79, 53, 12
                        CONTROL ADD CHECKBOX, hWizard&(N&),  135,  Desc$(4), 51, 96, 53, 12
                        CONTROL ADD OPTION, hWizard&(N&),  140,  Desc$(5), 168, 44, 53, 12
                        CONTROL ADD OPTION, hWizard&(N&),  145,  Desc$(6), 168, 62, 53, 12
                        CONTROL ADD OPTION, hWizard&(N&),  150,  Desc$(7), 168, 79, 53, 12
                        CONTROL ADD OPTION, hWizard&(N&),  155,  Desc$(8), 168, 96, 53, 12
                        DIALOG SHOW MODELESS hWizard&(N&)
                    END SUB
                    
                    ' *************************************************************
                    '                             Dialog Callback Procedure
                    '                             for Form Form1
                    '                             uses Global Handle - hForm1&
                    ' *************************************************************
                    
                    CALLBACK FUNCTION Form1_DLGPROC
                        SELECT CASE CBMSG
                            CASE %WM_INITDIALOG
                                ShowDialog_Wizard hForm1&, 1
                                DIALOG SHOW STATE hWizard&(1), %SW_SHOW
                                CurrentPage&=1
                                ShowDialog_Wizard hForm1&, 2
                                DIALOG SHOW STATE hWizard&(2), %SW_HIDE
                                ShowDialog_Wizard hForm1&, 3
                                DIALOG SHOW STATE hWizard&(3), %SW_HIDE
                                ShowDialog_Wizard hForm1&, 4
                                DIALOG SHOW STATE hWizard&(4), %SW_HIDE
                                ShowDialog_Wizard hForm1&, 5
                                DIALOG SHOW STATE hWizard&(5), %SW_HIDE
                            CASE ELSE
                        END SELECT
                    END FUNCTION
                    
                    ' *************************************************************
                    '  Application Callback Functions (or Procedures) for Controls
                    ' *************************************************************
                    
                    ' ------------------------------------------------
                    CALLBACK FUNCTION CBF_FORM1_PREVIOUS
                    LOCAL RFlag&
                        IF CBCTLMSG=%BN_CLICKED THEN
                             IF CurrentPage&>1 THEN
                                 SendMessage hForm1&, %WM_SETREDRAW, 0,0
                                 ' ------------------------------------------------
                                 DIALOG SHOW STATE hWizard&(CurrentPage&), %SW_HIDE
                                 CurrentPage&=CurrentPage&-1
                                 DIALOG SHOW STATE hWizard&(CurrentPage&), %SW_SHOW
                                 ' ------------------------------------------------
                                 SendMessage hForm1&, %WM_SETREDRAW, 1,0
                                 RFlag&=%RDW_INVALIDATE OR %RDW_ERASE OR %RDW_UPDATENOW OR %RDW_ALLCHILDREN
                                 RedrawWindow hForm1&, BYVAL %NULL, %NULL, RFlag&
                             END IF
                        END IF
                    END FUNCTION
                    ' ------------------------------------------------
                    
                    ' ------------------------------------------------
                    CALLBACK FUNCTION CBF_FORM1_NEXT
                    LOCAL RFlag&
                        IF CBCTLMSG=%BN_CLICKED THEN
                             IF CurrentPage&<5 THEN
                                 SendMessage hForm1&, %WM_SETREDRAW, 0,0
                                 ' ------------------------------------------------
                                 DIALOG SHOW STATE hWizard&(CurrentPage&), %SW_HIDE
                                 CurrentPage&=CurrentPage&+1
                                 DIALOG SHOW STATE hWizard&(CurrentPage&), %SW_SHOW
                                 ' ------------------------------------------------
                                 SendMessage hForm1&, %WM_SETREDRAW, 1,0
                                 RFlag&=%RDW_INVALIDATE OR %RDW_ERASE OR %RDW_UPDATENOW OR %RDW_ALLCHILDREN
                                 RedrawWindow hForm1&, BYVAL %NULL, %NULL, RFlag&
                             END IF
                        END IF
                    END FUNCTION
                    ' ------------------------------------------------
                    
                    ' ------------------------------------------------
                    CALLBACK FUNCTION CBF_FORM1_APPLY
                        IF CBCTLMSG=%BN_CLICKED THEN
                    
                        END IF
                    END FUNCTION
                    ' ------------------------------------------------

                    ------------------
                    Chris Boss
                    Computer Workshop
                    Developer of "EZGUI"
                    http://cwsof.com
                    http://twitter.com/EZGUIProGuy

                    Comment


                    • #11
                      Lance,

                      I might be stupid but,

                      Again, when i create a modal DDT box and add a modeless box to it (as above).
                      Should i use 'your' doevents-loop.

                      As far as i understand, the modal box's message loop should do.
                      Am i wrong?

                      Iow, should i implement this postmessage stuff in my modal box (see example)
                      Then this app will consist from 2 loops...?

                      Thanks,


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

                      Comment


                      • #12
                        Chris:

                        I appreciate your comments about %DS_CONTROL, but if you try the code and examples that EZGUI and "DDT-Boss" create then you'll find that your tab controls do not work with keyboard navigation alone... you may want to revisit your tab control code?

                        For example, try to use the DDT demo without touching your mouse, and try to:
                        1. TAB to the tab control
                        2. Tab around controls on a tab page and then change tabs all with the keyboard.

                        I'm not trying to put down your project or your skills - in fact the reverse is true! I'd like to see your app's and generated behave normally

                        EB:

                        From WIN32.HLP (Modeless Dialogs):
                        The application is responsible for retrieving and dispatching input messages to the dialog box. Most applications use the main message loop for this.
                        Because Windows itself takes over the message queue processing for the entire application when there is a modal dialog created - any messages that are not for the modal dialog are dispatched to the "appropriate" window.

                        So, as I understand Windows behavior - theerw are several reasons for a separate DIALOG DOEVENTS loop:

                        1. a message pump for queued messages can yield or freeze due to other activity going on in your application - a separate message pump helps to ensure that this does not cause a modeless dialog to become unresponsive to queued messages.

                        2. if you revise your app code in the future and remove the modal dialog, you may introduce bugs into the app simply because you did not still have a modeless message pump working. ie, better safe than sorry!

                        3. I can't think of another reason off the top of my head, but there is probably at least one more!

                        My $0.02...


                        ------------------
                        Lance
                        PowerBASIC Support
                        mailto:[email protected][email protected]</A>
                        Lance
                        mailto:[email protected]

                        Comment


                        • #13
                          Lance;

                          If you are refering to the DDT sample I posted (not this example above) on the source code forum, likely I forgot the %WS_TABSTOP style for the Tab control.

                          Withe EZGUI you can simply select the T (Tabstop) property (and also the G - Group property) and the tab control will respond to the Tab key (and arrow key from tab to tab).

                          Now with the DDT Visual Designer I am working on, the "idea" for handling Tab controls will be this:

                          TAB control is a child of the Main Parent Dialog.

                          Each Tab will be treated as a layer of controls which are on their own Dialog which is a child of the Main Parent as well. These Dialogs will use the %DS_CONTROL style and will also be "Transparent" (WS_EX_TRANSPARENT), so the Tab control will "show through".

                          DS_CONTROL does "seem" to handle the tabbing correctly, since Windows only needs a ISDialogMessage for the Parent Dialog to handle this correctly (which a doevents in DDT does seem to do).

                          The code above demonstrates a Wizard (no Tab control) with multiple child dialogs and they all handle the tab control correctly. I even tried changing the Parent to Modal and it worked fine.

                          A Tab control would use the same technique, except the child dialogs would be transparent and the tab control would be on the Parent (not a child).

                          I am not sure what problem you are seeing (I may be wrong) ?


                          ------------------
                          Chris Boss
                          Computer Workshop
                          Developer of "EZGUI"
                          http://cwsof.com
                          http://twitter.com/EZGUIProGuy

                          Comment


                          • #14
                            Lance;

                            The only DDT example I have posted with a tab control on it, was actually the one in the Third Party forum and I checked the code and simply forgot the %WS_TABSTOP style. Besides that example does not demonstrate using a Tab control. I just through one in with a bunch of other controls.

                            My DDT Visual Designer is not finished yet and I don't have the Layering features yet for building controls on tab controls yet.

                            That example was simply and example of the "style" of code my generator produces and it also demonstrates how my code handles colors.

                            I have yet to add fonts and layers yet to the DDT Designer (coming soon). I have this thing for bulding software "in pieces" "step by step". Each piece is tested well before adding the next.

                            When I have an actual working tab control example I will post it, so you can see how it works.

                            DDT is so much different that SDK style code and it is taking me awhile to get the hang of it.

                            ------------------
                            Chris Boss
                            Computer Workshop
                            Developer of "EZGUI"
                            http://cwsof.com
                            http://twitter.com/EZGUIProGuy

                            Comment


                            • #15
                              My first encounter was with a couple of demos that ship with EZGUI - TAB1.EXE and TAB2.EXE

                              The behavior (as I see it)

                              * TABing around dialog does not set focus to the tab itself, so keyboard navigation between tab pages is not possible with the TAB key.

                              * However, if you use the arrow keys, then focus moves in an unusual way, and it does become possible to move between pages - the interface is most unusual in this respect. Once the tab control itself has keyboard focus, you (correctly) cannot move focus from with tab with the arrow keys (this bit is how I would expect it to work).

                              Compare the behavior of this to, say, the tab control in the "properties" of the task bar - it behaves very differently with TAB and arrow keys. The arrow keys should work within a "group of control only" (not the whole dialog) and TAB moves between controls and between groups of controls.

                              I must admit that I've only run the EXE's - I've not had time to look at the source code so it could be a "soft" problem.

                              You have really done an amazing job with these products, Chris. Please don't take my comments personally - I mean them to be positive feedback!

                              I hope this explains it?

                              ------------------
                              Lance
                              PowerBASIC Support
                              mailto:[email protected][email protected]</A>
                              Lance
                              mailto:[email protected]

                              Comment


                              • #16
                                Thanks Lance for catching that !

                                If you look at the source code for the Tab examples that come with EZGUI, the Tab control doesn't have the T (Tabstop) property. I forgot it in the examples.

                                If you add the T property and then recompile the programs they will then let the Tab control get the focus.

                                When a tab control gets the focus, you cannot TAB between pages. Tab controls work like a radio button (option button) group does. Only the currently selected tab (or with radio , current radio) gets the focus using the Tab key. Just like Radio buttons, you have to "change" the selected tab with the arrow keys.



                                ------------------
                                Chris Boss
                                Computer Workshop
                                Developer of "EZGUI"
                                http://cwsof.com
                                http://twitter.com/EZGUIProGuy

                                Comment


                                • #17
                                  Lance;

                                  One other note:

                                  In EZGUI the last parameter in all the control creation commands is a string that contains a property string (single letters that represent a property).

                                  The tab control supports only three EZGUI properties:

                                  T - Tabstop
                                  G - Group
                                  M - Multi Row



                                  ------------------
                                  Chris Boss
                                  Computer Workshop
                                  Developer of "EZGUI"
                                  http://cwsof.com
                                  http://twitter.com/EZGUIProGuy

                                  Comment


                                  • #18
                                    Thanks Lance for catching that !
                                    <snip>
                                    When a tab control gets the focus, you cannot TAB between pages. Tab controls work like a radio button (option button) group does. Only the currently selected tab (or with radio , current radio) gets the focus using the Tab key. Just like Radio buttons, you have to "change" the selected tab with the arrow keys.
                                    My 2nd point was that the examples permit the arrow keys to move focus to the tab control. Fire up your TAB2.EXE example and experiment with using the arrow keys to move around. Then use an "official" MS tab control (such as the tab control used for setting the Properties of the taskbar) - you'll see that the MS tab control limits the use of the arrow keys to specific groups of controls, but TAB2.EXE seems to either not have groups set correctly or there it ignores group boundaries?

                                    I'd be happy to test any (modified) examples for EZGUI.




                                    ------------------
                                    Lance
                                    PowerBASIC Support
                                    mailto:[email protected][email protected]</A>
                                    Lance
                                    mailto:[email protected]

                                    Comment


                                    • #19
                                      Lance;

                                      I am not sure what your point is. On my computer (WIN95 OSR2), the example you mentioned of the Tab control

                                      "official" MS tab control (such as the tab control used for setting the Properties of the taskbar)
                                      allows me to move the focus to the Tab control with the arrow keys (just like EZGUI and the DDT code I wrote does).

                                      What version of windows are you using ?

                                      Also, (as VB programmers become quickly aware) there are "multiple" "official" versions of some of the common controls like the Tab control. There is more than one Tab control OCX (ActiveX) created by Microsoft. I have at least two on my computer. I don't know whether Microsoft still uses the core Common control for all of them and just subclasses it to make different versions with different features or whether they actually made new controls, but they do act differently and have different features.

                                      The DDT code I have written so far doesn't act any differently than EZGUI does.

                                      The other problem is that MS keeps updating the common control DLL (and OCX) with each version of Internet explorer and the new versions may have new "styles" available that allows you to change things (like keyboard control).

                                      Since, I see no difference between how the tab control works with DDT code I have written and how it works with EZGUI, it is no big deal to me.

                                      ------------------
                                      Chris Boss
                                      Computer Workshop
                                      Developer of "EZGUI"
                                      http://cwsof.com
                                      http://twitter.com/EZGUIProGuy

                                      Comment


                                      • #20
                                        Lance;

                                        I am in error on that last statement.

                                        Actually, the first tab (on the Taskbar properties Tab control) does allow me to move the focus to the tab control using the arrow keys from the checkboxs, but the next tab with just buttons in different sections, does NOT allow me to move the focus with the arrow key to the tab control (as you correctly said).

                                        Now if the tab control in one instances allows the arrow key to set focus on the tab control and on another tab does not, then likely it has to do with "how" the control is implimented. Remember that a tab controls tabs are likely seperate dialogs (windows) and how the message loop is processed for each window may play a part.

                                        As far as I can tell, you can't do what you suggest with DDT either ! Could you make a simple DDT example that "prevents" the arrow key from setting focus to the tab control, but still responds to the Tab key ?



                                        ------------------
                                        Chris Boss
                                        Computer Workshop
                                        Developer of "EZGUI"
                                        http://cwsof.com
                                        http://twitter.com/EZGUIProGuy

                                        Comment

                                        Working...
                                        X