No announcement yet.

PB/DLL -a complete GUI tool?

  • Filter
  • Time
  • Show
Clear All
new posts

  • PB/DLL -a complete GUI tool?

    The available HELP with PB/DLL 6.0 on the subject of DDT is obviously not the complete story which one might expect in a Programmer's or User's Guide or equivalent. Someone with more extensive knowledge of the Pandora's box of tricks which is Windows might find it quite simple, but I am not such a one. When I bought PB/DLL version 1 I did receive a reference guide by mail, but not in the case of PB/DLL 5 nor version 6, both of which I purchased. The version 1 guide is pre-DDT.

    Before going into much detail I have just one question, and this concerns the extent to which one may replace a thing like Delphi for GUI purposes by using DDT instead, thus creating an application entirely in PB/DLL. The simplest yes/no answer to this would be to send a bitmap snapshot of a specimen screen (one of the more complex ones) from the application in question, e.g., one which (in Delphi) draws a diagram of varying combinations of rectangles and which is redrawn for
    "what-if" purposes. Such a bitmap is of the order of 480Kb, however.
    The calculation for this Delphi screen is done entirely in PB/DLL 5, and it returns the simplest information possible (colours and coordinates) for this diagram so that even Pascal can understand. The
    screen contains a heck of a lot else besides, the diagram being only a small portion of it.

    If PB/DLL can create this screen - well, then it has to be a complete GUI tool, and if there is complete instructions for use to go with it
    then the Borlands and their friends are in very serious trouble in the coming millennium.

    Is it feasible to send such a bitmap file?

  • #2
    Deiny, using DDT I have created several complete applications with "graphics" drawn onto the window. For example, the next generation of DOSPRINT will feature a GUI Print Preview that has been built entirely with DDT, and can be resized, etc.

    Therefore my answer is YES... PB/DLL is a "complete GUI tool".

    To be fair, I have a fair few hours of Windows programming under my belt, but the key to my "success" has been constant study... I own three *Win32 programming books (each 1000-1500 pages long), and I constantly read and reread them. (Hint: I keep one in the "little room", but don't tell my Wife!)

    I also use PowerGEN to create GUI apps, and I occasionally use James C. Fullers PBWINADP IDE too... it really depends on what I'm trying to accomplish, and how much time I have. In recent times, I find myself using DDT more and more often simply because I can often reduce the code size significantly compared with, say, a pure SDK-style application as may be generated with PowerGEN.

    If your PB/DLL code is already generating the graphical coordinates for the image, it should be a hop/skip/jump to creating the whole thing with PB/DLL.

    Email the BMP to me directly ( mailto:[email protected][email protected]</A> ) and I'll take a look at it.

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


    • #3

      I'm trying to learn windows programming by doing and reading. I'm interested in knowing the titles of the 3 windows books you refer to.

      Thanks, Phil


      • #4

        A recommended book is "Programming Windows" by Charles Petzold.

        A complete online Win32API documentation is available at:


        [email protected]


        • #5
          Lance is always plugging Rector and Newcomer's Win32 Programming. Since this title has the Lance Edmonds Seal Of Approval , I went to a local bookstore and purchased a copy, although I've not yet had the time to read much of it.
          If you try to make something idiot-proof, someone will invent a better idiot.


          • #6
            Hey guys, Lance knows what he's talking about. Rector/Newcomer is a great
            starting point because it gets down into the bowels of Windows. Petzold
            just expands that horizon. I know from experience, I should have bought
            Rector/Newcomer first instead of the other way around.



            • #7
              It's 'funny' how my rantings get percieved!

              Yes, my personal fav's are:

              1. Charles Petzold (Programming Windows) - I have edition 4 and 5, but there is not that much new in Edition 5, so if you can find a copy of edition 4 cheap, then go for it. I recommend Petzold for Windows "newbies".

              2. Rector & Newcomer (Win32 Programming) - I have the revised edition, which is now a coupel fo years old. An excellent book for the serious GUI programmer, or anyone who is writing a real application. Because this book deals with the nitty-gritty, I personally don't recomend it for the beginner (esp as the example code uses "message-crackers" which do not translate easily to PB).

              3. Dan Applemen (VB guide to the Win32 API) - I have mixed feelings about this book - it's not one that I recommend because a lot of the book is irrelevent to PB. Given that a lot of the book is taken up with (useless) .FRM and VB declarations (many of which vary from the conventional WIN32API.INC approach), there is not a huge amount of information left to glean. Either of the 1st two books above will exceed the value in Appleman's book!

              4. MSDN - while MS's info is not a book, I often read articles in MSDN - it's amazing how often I think to myself "I saw something in MSDN about that!" and go hunting for the gold. MSDN is a rich pool of information on all sorts of issues and problems. Very useful!

              Getting back to the original question by Dieny, the Delphi app he wants to replace will not be a quick job, but it is definately possible with PB/DLL and DDT (with additional API work for the "custom controls" such as a tab-control, toolbar, etc).

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


              • #8
                Now: is there a way to set the FONT of a label or listbox or whatever?
                (HELP doesn't help).

                Also, it seems strange that the listbox has a DoubleClick event, but no
                Click event. As per HELP.

                In fact, how can one express (in PB/DLL 6 DDT) ---


                --- in order to simulate a USER click?

                Have asked Sales what manual(s) may be available for PB.DLL 6, and waiting for an "of course, two huge volumes, totally free" response.


                • #9
                  is there a way to set the FONT of a label or listbox or whatever?
                  Check out the WM_SETFONT message.
                  If you try to make something idiot-proof, someone will invent a better idiot.


                  • #10
                    To programmatically perform a mouse click on a button, you send the control a %BM_CLICK message.

                    Messages like %WM_SETFONT and %BM_CLICK are typical of the topics discussed in most "good" Windows programming books.

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


                    • #11
                      Right, thanks, so far, everybody! The FONT story I got going, eventually, because the magic word "WM_SETFONT" only means a relevant word, but how to use it, in this new language? I used Windows FIND to locate the word, then copied the MakeFont routine from one of the Sample modules (SMTP, I think) and then also copied the statements that use it, and, miracle of miracles, it works, for the various Windows fonts!

                      A few other idiotic questions are --

                      1. Can one specify COLOR, BACKGROUND COLOR and FONT COLOR anywhere, for any control, or even just some of them? If so, what form do these instruction(s) take? Suspect one of those parameters in MakeFont may well be a colour specifier.

                      2. HELP says: If the listbox has the %LBS_SORT style the new string_expression will be inserted into the listbox in alphabetical order, otherwise it is added to the end of the list.

                      NOT TRUE! Even without %LBS_SORT items are still added in alphabetical order. I notice that Listbox_InsertString is not available. says of it 'REMARKS: Unlike Listbox_AddString, Listbox_InsertString does not cause a list with the
                      %LBS_SORT style to be sorted (but can't test this).

                      3. The %BM_CLICK is all very well for a button, but what about an item on a popup menu? Say one wants to click a button to also cause the popup menu(s) to drop down? This --

                      Control Send hDlg, hPopup3, %WM_MENUSELECT, 1100, %WM_COMMAND

                      ---and any number of variations on the theme, staunchly refuses to respond (1100 is the ID equate for the popup menu item).

                      4. By more copying (plagiarism) I got a toolbar to show just below the top menu, very nicely (using toolbar.bmp) but the images are absent or invisible.

                      tbb(0).iBitmap = %STD_FILENEW

                      In the original copy the %STD_FILENEW was simply "0" but neither works anyway.

                      All this in the absence of a comprehensive manual. Still waiting on Sales for an answer to the enquiry as to what manuals are available.


                      • #12

                        Only one manual is available and it is equivelant to the help file that came with PB/DLL.

                        What you need is to learn how to program in Windows. For that, you need to get a book, such as the Petzold book that has been recommended time and time again.


                        ps. Given that you failed to give us you correct email address earlier, I wouldn't be surprised if our sales department answered you but it bounced because of the invalid address. If you had other questions, you may want to resend your message and make sure it has the correct return address this time.

                        PowerBASIC Support
                        mailto:[email protected][email protected]</A>
                        Home of the BASIC Gurus