Originally posted by: kim yong kyu
How Can make button's event's hanlder in source .?
Originally posted by: Ninaad
This is a very nice piece of code. I had tried trapping the TTN_NEEDTEXT event, but that didnt work. Excellent piece of code. thanks
ReplyOriginally posted by: Jos� Leandro Massada
well... the toolbar buttons display grey if you click on another cformview (for example) the solution that worked in my case was not to let any view except the one with the toolbar to get activated, i just overloaded OnMouseActivate in those views like this:
int CSomeFormView::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
pDesktopWnd->SetActiveWindow();
return MA_NOACTIVATE;//RHtmlView::OnMouseActivate(pDesktopWnd, nHitTest, message);
}
pDesktopWnd->SetActiveWindow() activates the top most window (in case the window is not active and the user clicks the view).
returning MA_NOACTIVATE doesn't allows the view to activate, but allows the mouse click to continue, so the view still gets the mouse click.
See MFC Documentation on OnMouseActivate for more info.
sorry for the quick, ugly, english, but i'm kinda busy :D
regards
btw, giving focus to the toolbar on OnInitialUpdate is also a good idea :)
Originally posted by: Rohit Roy
Provide me this solution "an object will be visible when an event (clicking a button) will take place"
Originally posted by: david
i want it's always visible,how can i do?thanks a lot!
ReplyOriginally posted by: Maxim A. Sidorov
It helped much, thanks. But it's a very hard to add each button into tooltip control. Have you ever try to implement EnableToolTip() & handler for TTN_NEEDTEXT ? It should be great!
Originally posted by: Dave
Nicely done.
this should be a great help
Originally posted by: Rick Shide
You're going to have to wait until after the mainframe is initially drawn to add tooltips that will work for verical scrollbars. The toolbar positions are not yet finalized.
e.g.
BOOL CToolBarsApp::InitInstance()
{
...
// The one and only window has been initialized ...
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
// NOW it's OK
CWnd* pWnd = m_pMainWnd->GetDescendantWindow(AFX_IDW_PANE_FIRST, TRUE);
if (pWnd != NULL && pWnd->IsKindOf(RUNTIME_CLASS(CToolBarsView)))
{
CToolBarsView *pView = (CToolBarsView*)pWnd;
pView->FunctionToInitToolTipsInToolbars();
}
Originally posted by: Camilla
Hi!
I have had great help from your code to add toolbars to
CFormView. Unfortunately the tooltips won't work.
So I downloaded your demoprogram, and there all the tooltips, EXCEPT the ones on toolbar nr 3 button 1 and 2....works.
This is really strange, and I can't find the reason to this problem.
Maybe someone have an idea?
Originally posted by: Phil Cremer
The toolbar works great except for when you want to open an existing file.