Thread: unable to see any tooltips in toolbar

  1. #1
    jeena
    Guest

    Red face unable to see any tooltips in toolbar

    am unable to see any tooltips in the toolbar though i did set the prompt in the resource for the toolbar .button it's really ........ing me off ... please somebody tell me whats wrong

  2. #2
    Normal vector Carlos's Avatar
    Join Date
    Sep 2001
    Location
    Budapest
    Posts
    463
    Have you added CBRS_TOOLTIPS style to the aother styles in the Create or SetBarStyle?

    Check MSDN -> tooltips -> activating for more info.

    Have a nice code!

  3. #3
    jam
    Guest

    my code

    here goes my code


    m_ctb.CreateEx(this,TBSTYLE_TOOLTIPS |TBSTYLE_FLAT | TBSTYLE_TRANSPARENT |WS_CHILD | WS_VISIBLE );

    m_ctb.LoadToolBar(IDR_TOOLBAR1);
    m_ctb.EnableDocking(CBRS_ALIGN_ANY);

  4. #4
    Normal vector Carlos's Avatar
    Join Date
    Sep 2001
    Location
    Budapest
    Posts
    463
    Try to eliminate TBSTYLE_TRANSPARENT. It might cause problems.
    Quote from MSDN:

    "TBSTYLE_TRANSPARENT :: Version 4.71. Creates a transparent toolbar. In a transparent toolbar, the toolbar is transparent but the buttons are not. Button text appears under button bitmaps. To prevent repainting problems, this style should be set before the toolbar control becomes visible."

    As you see, it's version is also higher (e.g. TBSTYLE_FLAT is v 4.70).

  5. #5
    jam
    Guest

    Thumbs down

    nope it's still not working ... actually i resized my toolbar shamelessly copied the code from code guru ...without this the toolbar was not showing up ...now the damn tooltips are not coming



    CRect rcClientOld; // Old Client Rect
    CRect rcClientNew; // New Client Rect with Tollbar Added
    GetClientRect(rcClientOld); // Retrive the Old Client WindowSize

    // Called to reposition and resize control bars in the client
    // area of a window. The reposQuery FLAG does not really draw the
    // Toolbar. It only does the calculations. And puts the new
    // ClientRect values in rcClientNew so we can do the rest of the
    // Math.
    RepositionBars(AFX_IDW_CONTROLBAR_FIRST,
    AFX_IDW_CONTROLBAR_LAST,0,reposQuery,rcClientNew);

    // All of the Child Windows (Controls) now need to be moved so
    // the Tollbar does not cover them up. Offest to move all child
    // controls after adding Tollbar
    CPoint ptOffset(rcClientNew.left-rcClientOld.left,
    rcClientNew.top-rcClientOld.top);

    CRect rcChild;

    // Handle to the Dialog Controls
    CWnd* pwndChild = GetWindow(GW_CHILD);
    while(pwndChild) // Cycle through all child controls
    {
    pwndChild->GetWindowRect(rcChild); // Get the child control RECT
    ScreenToClient(rcChild);

    // Changes the Child Rect by the values of the claculated offset
    rcChild.OffsetRect(ptOffset);
    pwndChild->MoveWindow(rcChild,FALSE); // Move the Child Control
    pwndChild = pwndChild->GetNextWindow();
    }

    CRect rcWindow;
    GetWindowRect(rcWindow); // Get the RECT of the Dialog

    // Increase width to new Client Width
    rcWindow.right += rcClientOld.Width() - rcClientNew.Width();

    // Increase height to new Client Height
    rcWindow.bottom += rcClientOld.Height() - rcClientNew.Height();

    MoveWindow(rcWindow,FALSE); // Redraw Window

    // Now we REALLY Redraw the Toolbar
    RepositionBars(AFX_IDW_CONTROLBAR_FIRST,
    AFX_IDW_CONTROLBAR_LAST,0);

  6. #6
    Normal vector Carlos's Avatar
    Join Date
    Sep 2001
    Location
    Budapest
    Posts
    463
    If you need modify the toolbars position/size, you must use CCS_ADJUSTABLE style, which (quote from MSDN)

    "Allows toolbars to be customized by the user. If this style is used, the toolbar’s owner window must handle the customization notification messages sent by the toolbar, as described in CToolBarCtrl: Handling Customization Notifications."

    If you prefer to use this style instead of CCS_TOP (default), you need to manage the workarounds needed...

    I guess that's your problem, but a debug session will show you the real problem.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. toolbar button question
    By supernater in forum Windows Programming
    Replies: 1
    Last Post: 05-25-2009, 08:24 PM
  2. Toolbar color
    By mrafcho001 in forum Windows Programming
    Replies: 2
    Last Post: 04-17-2006, 10:55 AM
  3. Dockable Toolbar (Like taskbar or office toolbar)
    By om3ga in forum Windows Programming
    Replies: 2
    Last Post: 11-20-2005, 03:09 AM
  4. Toolbar Tooltips not displaying
    By JaWiB in forum Windows Programming
    Replies: 2
    Last Post: 11-04-2005, 11:49 PM
  5. What toolbar editor do you use?
    By _Elixia_ in forum Windows Programming
    Replies: 1
    Last Post: 08-09-2003, 04:57 AM