Announcement

Collapse
No announcement yet.

Some DDT Questions ???

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

  • Some DDT Questions ???

    I just upgraded to PB 6.0 and I want to start learning DDT.

    I can easily write a program using the standard SDK style of code, so using DDT is like going backwards for me.

    I get the general gist of using DDT, but I have a few questions:

    (1) What siginificant changes (not details, just summary) had to be made to the win32api.inc file ?
    The PB 5.0 win32api.inc file will generate compiler errors with PB 6, so obviously some major changes had to be made.

    (2)Whats the purpose of the DDT.inc file ?
    When writing a DDT program are we expected to NOT use the win32api.inc file or do we used both ?

    (3)DDT obviously has some "default" styles for controls. Its easy to add more styles, but how do you "remove" a style that is used as a default ?

    (4) Can you combine some SDK techniques with DDT, like using CreateWindowEx or CreateToolbar to create a control in the WM_INITDIALOG message ?

    (5) The width and height of a DDT Dialog (when creating the Dialog), are they the actual Windows width and height (like with CreateWindowEx) or are they the width and height of the Client area ?
    (I know they are not pixels, but Dialog units)
    Chris Boss
    Computer Workshop
    Developer of "EZGUI"
    http://cwsof.com
    http://twitter.com/EZGUIProGuy

  • #2
    Could be I'm wrong, but DDT are simple "macros".
    So, for example, width and height in DDT Dialog are width and height of window, not of client area.

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

    Comment


    • #3
      (1) What siginificant changes (not details, just summary) had to be made to the win32api.inc file ?
      The PB 5.0 win32api.inc file will generate compiler errors with PB 6, so obviously some major changes had to be made.
      Keyword conflict mostly, but PB/DLL 6.0 introducted string equates so the file was updated to use them where appropriate.

      (2)Whats the purpose of the DDT.inc file ?
      When writing a DDT program are we expected to NOT use the win32api.inc file or do we used both ?
      DDT.INC is simply a subset of WIN32API.INC. THe smaller file makes compilation faster.

      (3)DDT obviously has some "default" styles for controls. Its easy to add more styles, but how do you "remove" a style that is used as a default ?
      As soon as you explicitly specify a standard style, the default style is no longer applied. For example, if we create a button and give it the %BS_DEFAULT style, we'll also have to give it %WM_TABSTOP as well or it will not appear in the "taborder"... just like conventional SDK programming.

      (4) Can you combine some SDK techniques with DDT, like using CreateWindowEx or CreateToolbar to create a control in the WM_INITDIALOG message ?
      There is no need to, as the CONTROL ADD "CustomControl" statement can be used to create any type of control via the DDT engine. However, from my experiments, I've been able to say, add grips to a window with CreateWindow(), but I've not got any hard data on what is not permitted. I don't imagine that there is any issue with child controls, but it is NOT advisable to create a dialog or Window via the API and then try to use DDT controls on it.

      (5) The width and height of a DDT Dialog (when creating the Dialog), are they the actual Windows width and height (like with CreateWindowEx) or are they the width and height of the Client area ?(I know they are not pixels, but Dialog units)[/B]
      If you use a dialog style that explicitly includes %WS_CAPTION then the parameters are the window height/width, not the client size.


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

      Comment


      • #4
        Thanks Lance !

        Just to clarify a few things:


        (1) Quote from PB 6 Help file:

        "xx&, yy& The width and height of the dialog, specified in dialog units. The width and height specify the client area where the controls are placed, it does not include the caption and border, if present."

        This would seem to imply that the width and height are "always" for the Client Area. Are you saying this is not so ?

        (2) Now, I wouldn't try to create a Dialog with CreateWindow and then use DDT to create controls, but you seem to be saying that if I create the Dialog with DDT that I can create a controls with the API, rather than DDT. While this would be rare, I think the Toolbar is easier to create with CreateToolbar, but I guess it can be done with DDT and then SendMessages.

        (3) Another question I have is, do you have to always use a callback for processing control events (messages) or is it OK to simply use one callback for the Dialog and then process the messages, just like you would with SDK style programming, within the Dialog callback ?


        (4) One more question: Some Controls Client area are not the same as the whole controls size (using a raised border or a flat border), so when you use the CONTROL GET SIZE command in DDT, does it only return the Client area size or the entire controls window size ?

        Once again, thanks for your patience !




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

        Comment


        • #5
          This would seem to imply that the width and height are "always" for the Client Area. Are you saying this is not so?
          There appear to be a few exceptions. For example, a dialog that is given just the %WS_BORDER style will get a caption bar, and the dialog height specified will include the caption.

          I think the Toolbar is easier to create with CreateToolbar, but I guess it can be done with DDT and then SendMessages.
          It's real easy with CONTROL ADD "TOOLBARWINDOW32" and CONTROL SEND statements... when using DDT it often helps to forget that SendMessage() exists and use CONTROL SEND or DIALOG SEND... the less you use the API, the less you become dependant on it. Unfortunately, it's not always possible to ignore the API completely though!

          (3) Another question I have is, do you have to always use a callback for processing control events (messages) or is it OK to simply use one callback for the Dialog and then process the messages, just like you would with SDK style programming, within the Dialog callback ?
          Using just the dialog CALLBACK is perfectly acceptable.

          (4) One more question: Some Controls Client area are not the same as the whole controls size (using a raised border or a flat border), so when you use the CONTROL GET SIZE command in DDT, does it only return the Client area size or the entire controls window size ?
          AFAIK, CONTROL GET SIZE always returns the actual size, not the client area. At least this is true for my experiences with the standard controls... I seem to recall that internally, it uses GetWindowRect().

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

          Comment


          • #6
            Lance
            Your reply to Chris's questions is very helpful to myself and others.

            Thanks

            Bruce

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

            Comment


            • #7
              By the way Chris, if you haven't already found it; Lance posted a excellent example of creating a ddt toolbar and then using CONTROL SEND statemnets for customizing the toolbar. He posted it in the source code forum.

              Adam


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

              Comment


              • #8
                Know that we're on the subject of DDt

                Can someone explain me how to create Tabs controls with dialogs
                in the tabs using DDT ?

                Steve.

                ------------------
                So here we are, this is the end.
                But all that dies, is born again.
                - From The Ashes (In This Moment)

                Comment


                • #9
                  steve..

                  i posted some code late last year that included a tab contol using ddt..


                  or email and i will email you the code..

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

                  Comment

                  Working...
                  X