Announcement

Collapse
No announcement yet.

Tab Control Notifications

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

  • Tab Control Notifications

    Greetings,

    I am in the process of writing a flight planning program. So far, the program has one main Dialog and five Tab Control Dialogs.
    Using the Sample Tab Control program supplied with PBWin80, I have had success in getting the Tab Controls to work just fine.
    The question I have is, "Which notification is sent to the Tab Dialog Which Presently Has Focus, when you click on another tab so as to display a different Dialog?"
    I have looked on the Microsoft Web Sight and in the PB Forum with no luck yet.
    Elsewhere in the program, I use WM_NOTIFY / EN_KILLFOCUS to update a Textbox when it looses focus and this works fine.
    I wish to emulate this process and gather / process the information entered on this dialog when it looses focus.

    Thank You
    Gavin

  • #2
    WM_NOTIFY/TCN_SELCHANGING (before, may be prevented at this point)
    WM_NOTIFY/TCN_SELCHANGE (too late, already changed!)
    WM_NOTIFY/TCN_FOCUSCHANGE (I never used this one).

    All are sent to the OWNER window, not to the tab dialogs. You'll have to control stuff from there.
    Last edited by Michael Mattias; 7 Sep 2008, 09:27 AM.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Do you have PBWin 9.0?

      The reason I ask is that TABs have received a significant boost with new DDT added especially for TABs. The example code for DDT\TABS (TABCONTROL.BAS) shows how much easier TABS have become to handle than before. Changing TAB pages is handled by the DDT engine, unless you need to intercept a message.

      For PBWin 8 though, you need to process the %TCN_SELCHANGING message.
      Rick Angell

      Comment


      • #4
        Thank You Michael and Richard.
        As stated, Notifications are sent to the OWNER window, not the tab dialog!
        This is where I was making my mistake, but all is fine now.
        As for PB9, Order placed, money paid, still waiting.
        Once again, thanks
        Gavin

        Comment


        • #5
          >As stated, Notifications are sent to the OWNER window, not the tab dialog!

          What can be handy here is to save a handle to the tab's dialog ("CBHNDL") in the Tab Item's "lparam" member.

          Here's a couple of functions I created to deal with the "item lparam" for tab controls..

          Code:
          FUNCTION TabCtrl_SetItemlParam (BYVAL hWnd AS LONG, BYVAL iRow AS LONG, BYVAL lparam AS LONG) AS LONG
              LOCAL tci AS TC_ITEM
          
              tci.Mask         = %TCIF_PARAM
              tci.lparam       = lparam
              TabCtrl_SetItem    hWnd, iRow, tci
          END FUNCTION
          
          FUNCTION TabCtrl_GetItemlParam (BYVAL hWnd AS LONG, BYVAL iRow AS LONG) AS LONG
              LOCAL tci AS TC_ITEM
          
              tci.Mask         = %TCIF_PARAM
              TabCtrl_GetItem    hWnd, iRow, tci
              FUNCTION         = tci.lparam
          END FUNCTION
          MCM
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Thank you Miahael,
            More study required on my behalf.
            I shall refer to the Windows Help for SDK and the COMMCTRL.inc file and learn how to use these Macros.

            Gavin

            Comment


            • #7
              Gavin...If you think of Macros as "Replace my code with a function" at compile time that may help

              may not...but it depends on how you think coding wise
              Engineer's Motto: If it aint broke take it apart and fix it

              "If at 1st you don't succeed... call it version 1.0"

              "Half of Programming is coding"....."The other 90% is DEBUGGING"

              "Document my code????" .... "WHYYY??? do you think they call it CODE? "

              Comment

              Working...
              X