No announcement yet.

tab pages

  • Filter
  • Time
  • Show
Clear All
new posts

  • tab pages

    Finally I received PB DLL 6.0 yesterday! I'm gradually working my way trough the manual, and hope I'll get a grasp of the language soon. But I notice I'm a bit spoiled by Visual Basic, which I used to play around with to get an understanding of programming under Windows. Making forms is quite easy with VB, and it comes with a load of bells and whistles to make your form look interesting. At the moment making forms with PB seems a bit more complicated, but I assume that's just a matter of becoming used to it. I also have PowerGEN, which I hope I'll be able to use soon.
    But one thing worries me. Using the dialog editor that comes with PB, I can't find a way of making tab pages. So my question is: is it possible to use the dialog editor and PowerGEN to make tab pages? I searched the forums database and found some examples for tab pages, but they are too complex for me to really understand what I'm doing.

    Best regards,


    P.S. Lance, thanks for your explanation of the Unicode question. I now know it's quite complicated, so a challenge awaits for me.

  • #2
    Ya know, I came from Visual Basic, and as you can tell from my other post, I haven't touched it in over two years now....

    I have a working tab control, jim H was kind enough to assist me.
    It requires drawing a form, a modeless dialog, and the tab control themselves, and tracking the msg for them from *IS* complex, but give it some time and you will understand (And not want to go back)..

    My Winlog for Windows 98 was VB initially, all the bells and whistles and 2.1 megs. It received 450 downloads in one year.

    With PowerBasic it is MORE bells and whistles, and has surpassed 12,000 downloads in one year...It's 78k compressed..

    If I can help send me an email or post your code and I'll compare to mine


    Scott Turchin

    [This message has been edited by Scott Turchin (edited February 10, 2000).]
    Scott Turchin
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi


    • #3
      Harmen -

      I came to PBdll from VB as well ...

      I recommend that you check out EZGUI at (I don't get paid for this - I bought it and find it invaluable as a RAD tool). It sounds like you would benefit greatly (Tabs are a *snap* no-brainer!). PowerGEN is really for PBdll 5.0 users, as it does not generate DDT code - plus, as you've noticed, it is hampered by the limitations of the MS Dialog Editor (!).

      William Fletcher



      • #4
        Hi Scott and William,

        Thank you both for your replies. Scott, do you have some code with remarks which clarify it all? Because I even don't know where to start with. Does Petzold mention tab controls in his book? (I already ordered his book because it is very highly recommended in this forum).

        William, I appreciate EZGUI, but before I start using these kind of programs, I would first like to know what the produced code means and does. After all, understanding the code makes it easier to make adjustments later if necessary. Because I'm still in the learning process (but then again, who isn't), I would like to understand the code I'm writing. Maybe the making of tab controls is a bit too hard now because I'm a novice in Windows programming, but since I want to use tab controls in the program I have in mind, I think it's best to try what I can and go for it.

        But thanks for mentioning EZGUI. Any references to other resources are very welcome.

        All the best,



        [This message has been edited by Harmen Mesker (edited February 11, 2000).]


        • #5

          EZGUI doesn't produce 100% code !

          You don't have to know what the generated code means, since it doesn't generate any API code.

          It is a runtime DLL that handles all the complexities of Windows for you. The only code generated by the Visual Designer is EZGUI code.

          Chris Boss
          Computer Workshop
          Developer of "EZGUI"


          • #6
            Send me an email and I will cut and paste the source you will need, or I can send you theentire source since it's just a time server and is not complete (and uses DLL's), but the code you will need is EASILY identifiable and will make sense when you see it..(Thanks to Jim H!!


            Scott Turchin

            Scott Turchin
            MCSE, MCP+I
            True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi


            • #7
              But I notice I'm a bit spoiled by Visual Basic... Making forms is quite easy with VB...making forms with PB seems a bit more complicated."
              Microsoft's VB, and to some extent PowerBASIC's "DDT" do not "spoil" you. They are 'soft' drugs which build your dependency.

              It's worked great for Microsoft: a whole generation of BASIC programmers who can paint pretty pictures but have difficulty grasping concepts like "sales tax" or "tieing one's own shoes."

              If you learn the API before DDT, you will appreciate what DDT is doing; you will also be able to understand how to override the default values used for dialogs, controls, etc.

              Michael Mattias
              Tal Systems Inc. (retired)
              Racine WI USA
              [email protected]


              • #8

                can you send me the code for the tabcontrol you mentioned? After careful examination of C-samples I've found on the Internet, I'm able to create a tabcontrol now, but I can't manage to get any controls on it - and what's a tabcontrol without controls? Maybe your code can help.

                PB also comes with an example, but for the dialog it makes use of a resource file, which makes it hard to find out how controls are placed on the tab pages. It also contains so much code that I can't see what's essential and what's not.



                P.S. I have Pretzold's book! Reading it has brought me to the saying 'don't buy books like pretzels - buy Pretzold!'



                • #9
                  Here's some code from one of my programs, in which I've implemented a TAB control.

                  Hope this helps


                  <font face="Courier New, Courier" size="3"><pre>

                  'This Code Creates the TAB Control
                  ' NOTE: hDlg is the handle of the
                  ' Parent Dialog (sized 420 x 260)
                  ' {My program placed the TABControl32
                  ' in the lower right corner.

                  'Add'l Coverages (Via TAB Control)
                  LOCAL iItem AS LONG
                  LOCAL hCtl AS LONG
                  LOCAL tie AS TC_ITEM
                  LOCAL sTmp AS STRING

                  icc.dwICC = %ICC_TAB_CLASSES
                  icc.dwSize = SIZEOF(icc)
                  InitCommonControlsEx icc

                  CONTROL ADD "SysTabControl32", hDlg, %IDC_TAB, "", 140, 93, 270, 140, _
                  %WS_CLIPSIBLINGS, 0

                  'Get hWnd of Tab Control
                  CONTROL HANDLE hDlg, %IDC_TAB TO g_Tabhdl

                  'Create the Individual TABS (They are Children of the PARENT
                  ' and NOT the actual TABCONTROL32!
                  ' This example shows makeing 6 tabs
                  'Create TABS
                  FOR a% = 0 TO 5: '5 TABS 0-4
                  SELECT CASE a%
                  CASE 0: sTmp = "A - A"
                  CASE 1: sTmp = "B - E"
                  CASE 2: sTmp = "E - G"
                  CASE 3: sTmp = "H - P"
                  CASE 4: sTmp = "P - T"
                  CASE 5: sTmp = "T - Z"
                  END SELECT
                  tie.mask = %TCIF_TEXT OR %TCIF_IMAGE
                  tie.iImage = -1
                  tie.pszText = STRPTR( sTmp )
                  iItem = a%
                  lresult& = TabCtrl_InsertItem( g_Tabhdl, iItem, tie)
                  NEXT a%

                  REDIM g_hOptCov(5) AS GLOBAL LONG
                  FOR a% = 0 TO 5
                  DIALOG NEW hDlg,"" , 143, 94, 252, 138, _
                  %WS_CHILD OR %DS_CONTROL, 0 TO g_hOptCov(a%)
                  NEXT a%

                  'Put up the desired intially visible TAB
                  ' as MODELESS
                  DIALOG SHOW MODELESS g_hOptCov(0)
                  'Followed by the PARENT
                  'Need to route the PARENT through a CALLBACK
                  ' to capture the TAB requests/changes
                  DIALOG SHOW MODAL hDlg, CALL OptCov_CallBack TO lresult&

                  'Example of putting a control on the TAB
                  'Access is through the g_hOptCov(x)
                  ' where x = the TAB (0-5)

                  'Setup Tab #1
                  CONTROL ADD CHECKBOX, g_hOptCov(0), 250, "Accounts Receivable", 4, 0, 80, 12, %SS_left, 0
                  CONTROL ADD LABEL, g_hOptCov(0), -1, "Incr A/R Limit:", 90, 2, 50, 12, %SS_right
                  CONTROL ADD TEXTBOX, g_hOptCov(0), 251, "", 140, 0, 30, 12, %WS_TABSTOP OR %ES_NUMBER OR %SS_RIGHT, %WS_EX_CLIENTEDGE
                  CONTROL SEND g_hOptCov(0), 251, %EM_SETLIMITTEXT, 6, 0

                  'Here's how to handle the Callback function
                  'to change the TABS

                  CALLBACK FUNCTION OptCov_CallBack()

                  SELECT CASE CBMSG

                  CASE %WM_NOTIFY
                  SELECT CASE CBWPARAM
                  CASE %IDC_TAB
                  ' Init NMH pointer.
                  LOCAL lpNmh AS NMHDR PTR
                  LOCAL lPage AS LONG
                  lpNmh = CBLPARAM
                  CONTROL HANDLE CBHNDL, %IDC_TAB TO hCtl
                  lPage = TabCtrl_GetCurSel(hCtl)
                  ' All current TAB CONTROL Notification Messages
                  SELECT CASE @lpNmh.Code
                  CASE %TCN_SELCHANGING ' The page is about to change
                  DIALOG SHOW STATE g_hOptCov(lPage), %SW_HIDE
                  'returning %true will cancel
                  FUNCTION = 0
                  CASE %TCN_SELCHANGE
                  DIALOG SHOW STATE g_hOptCov(lPage), %SW_SHOW
                  FUNCTION = 0
                  END SELECT
                  END SELECT
                  END SELECT

                  END FUNCTION


                  Forgot to mention, some of this code was initially posted by another user in one of these forums. (I've edited & corrected it a bit).


                  [This message has been edited by Ray Corry (edited February 24, 2000).]