Originally posted by: Dylan
When I implement the CLogo, it work good but all the tooltips of any application were destroy....
Have you a suggestion to undestroy tooltip
Thanks...
ReplyOriginally posted by: Nguyen minh Tam
I think this article is very normal. and if you want to send an article you should see back to know what you done ok?
Originally posted by: Avi Dahan
So do the following:
void CMainFrame::OnSize(UINT nType, int cx, int cy)
int CLogo::OnCreate(LPCREATESTRUCT lpCreateStruct)
//SetTimer(nLogoTimer,100,NULL);
EnableToolTips();
Thanks
In order to upadte the position of the logo - no need to set timer.
{
CFrameWnd::OnSize(nType, cx, cy);
// update the position of logo.
m_wndLogo.SetPosition();
}
In logo.cpp - you don't have to set timer.
{
if (CBitmapButton::OnCreate(lpCreateStruct) == -1)
return -1;
ASSERT(GetParentDockBar());
return 0;
}
By doing so, no more flickering in release mode.
And have a Bug-Free day.
Reply
Originally posted by: Ali
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
// finally, create the rebar and it's bands with m_wndReBar is a CRebar object
.....
The easiest way to add your logo to the main frame :
{
if (!m_wndToolBar.CreateEx(this) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
// create a logo bar, m_wndLogo is a CDialogBar object, IDR_MAINFRAME is a dialog resource
if (!m_wndLogo.Create(this, IDR_MAINFRAME, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR))
{
TRACE0("Failed to create logobar\n");
return -1; // fail to create
}
if (!m_wndReBar.Create(this))
{
TRACE(_T("Failed to create rebar\n"));
return -1; // fail to create
}
// let the rebar own the toolbar
m_wndToolBar.SetOwner(&m_wndReBar);
// add rebar bands
if( !m_wndReBar.AddBar(&m_wndLogo, NULL, GetSysColor(COLOR_3DFACE), NULL, RBBS_FIXEDSIZE | RBBS_FIXEDBMP)||
!m_wndReBar.AddBar(&m_wndToolBar, NULL, NULL, RBBS_FIXEDBMP | RBBS_BREAK))
{
TRACE(_T("Failed to add rebar bands\n"));
return -1; // fail to add bands
}
.....
return 1;
}
Originally posted by: harish
hey how do i use it in sdk. :O
ReplyOriginally posted by: Shihan
I Want VB Project With Coding
ReplyOriginally posted by: Carlos A.
The logo does not work properly under Windows 2000. It appears and dissapears. Do you know why?
Carlos A.
ReplyOriginally posted by: Jakub
What to do to avoid flickering:
change line 71 of CLogo.cpp from:
CRect UnionToolbarRect;
to
CRect UnionToolbarRect(0,0,0,0);
I hope it works.
Jakub
Originally posted by: pipi
I notice that the logo fickle in a undesirable way in release build?? any suggestion?
ReplyOriginally posted by: Romdles
Having a create function take a set of parameters not needing change (the null, the style, and a rect of dimensions 0) seems silly to me. Rather, I would suggest you have some overloaded constructors or overloaded create functions:
one that takes the string, and control bar
another that takes string, control bar, and two uint bitmap identifiers
This makes the whole thing easier and more obvious to implement. Just a suggestion.