Announcement

Collapse

Maintenance

The forum could be offline for 30-60 minutes in the very near future for maintenance (said 3pm Pacific). I was behind on getting this notice. I do apologize.
See more
See less

Wizard Style Dialog?

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

  • Wizard Style Dialog?

    Hi!

    Does anyone have any samples of producing a "wizard"
    style dialog in PB? I'm thinking I'll have to create
    forms within the main form, but would like to be pointed
    in the right direction. Thanks!

    Scott
    Scott Wolfington
    [url="http://www.boogietools.com"]http://www.boogietools.com[/url]

  • #2
    Oh yeah, I'd like to do it using DDT. Thanks!

    Scott
    Scott Wolfington
    [url="http://www.boogietools.com"]http://www.boogietools.com[/url]

    Comment


    • #3
      I'm doing this lately.
      Not really using DDT but the principle is the same;

      Just one dialog, add standard buttons (next >, < Back etc..)
      All with indexes < 100
      This means you can add controls starting from id 100 and up.
      And create a small proc to discard the controls from 100 to...

      So easy is it to me..
      (SO much more handy than VB forms where you can destroy controls)



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

      Comment


      • #4
        Thanks E B!

        This sounds like an interesting way to do it. Is there
        a way, using DDT, to *hide* a control instead of killing
        it? All that I can find in the help file is the CONTROL
        KILL statement. Thanks!

        Scott
        Scott Wolfington
        [url="http://www.boogietools.com"]http://www.boogietools.com[/url]

        Comment


        • #5
          Scott,

          to "hide" a control, move it outside dialog's client area using CONTROL SET LOC

          Lasse Rantanen
          [email protected]

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

          Comment


          • #6
            You cant use this then?

            Call ShowWindow(GetDlgItem(hDlg&,CtlId&),%SW_Hide)

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

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

            Comment


            • #7
              Using a Child Window to hold the controls for each Page in a Wizard is the easiest solution. Simply use the %DS_CONTROL style to make the child window handle the TAB keys.

              While showing and hiding groups of controls "can" work, it will result in a very poor Paint quality when things change if there are lots of controls. If you use this technique, you must turn off the "Redraw" state of the Dialog before showing and hiding the controls, turn the "Redraw" state back on, then invalidate the entire Dialog (or force a Redraw) so it will be repainted.



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

              Comment


              • #8
                Scott;

                I don't think you can create Child Dialogs with DDT. I tried it and I keep getting GPFs.

                I think you may need to use CreateDialogIndirect API call to create the child dialogs (that act like a control that hold other controls) in the WM_INITDIALOG message for the Parent Dialog. If you use the MS Sans Serif, 8 point font for the Dialog Template, you should be able to use some of the DDT commands to put controls on it (not sure if it will work).

                I can create Parent and Child Dialogs for Wizards using CreateDialogIndirect, but I don't know what tricks DDT does under the hood. It didn't seem to like when I tried to create a child Dialog (%WS_CHILD) on the Parent Dialog.



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

                Comment


                • #9
                  From memory, the key is to create the "child" dialogs as borderless modeless dialogs with the %DS_CONTROL style. The parent dialog needs to have the extended style %WS_EX_CONTROLPARENT. At creation, all of the modeless dialogs are hidden, and visually located on top of the parent dialog. Then as your "next" and "previous" buttons are clicked, the current dialog is hidden and the appropriate "child" dialog made visible.

                  The technique is similar to using DDT to create a tab control... there have been examples of this in the Source Code Forum.

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

                  Comment


                  • #10
                    Hi!

                    Lance, how do I hide a child dialog using DDT? I've
                    got my child dialogs working, but don't know how to
                    hide the current Dialog before displaying the next one.

                    Thanks!
                    Scott
                    Scott Wolfington
                    [url="http://www.boogietools.com"]http://www.boogietools.com[/url]

                    Comment


                    • #11
                      Freeze;
                      SendMessage hWnd, %WM_SETREDRAW, 0, 0

                      Unload controls...

                      Load new controls...

                      Refresh;

                      SendMessage hWnd, %WM_SETREDRAW, -1, 0
                      RedrawWindow hWnd, ByVal 0&, ByVal 0&, %RDW_ERASE Or %RDW_INVALIDATE Or %RDW_ALLCHILDREN



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

                      Comment


                      • #12

                        Scott...

                        This code will hide Child1 and show Child2
                        Code:
                        DIALOG SHOW STATE hDlgChild1, %SW_HIDE
                        DIALOG SHOW STATE hDlgChild2, %SW_SHOW

                        ------------------
                        Jim..
                        [email protected]
                        Jim..

                        Comment


                        • #13
                          Thanks Jim,

                          I'll give that a try.

                          Scott
                          Scott Wolfington
                          [url="http://www.boogietools.com"]http://www.boogietools.com[/url]

                          Comment


                          • #14
                            All,

                            Everything is working great. Nice and fast on the
                            repaints too. :-)

                            Scott
                            Scott Wolfington
                            [url="http://www.boogietools.com"]http://www.boogietools.com[/url]

                            Comment

                            Working...
                            X