|
Hello, does anybody tried to implement chevrons for vertical toolbar with rebar? Thank you!
|
|
|
|
|
first! good code , but rubbish design..
and the bug, i spitted the editview windows into two windows,one editview, and another is CFormveie derived class, but!but!but!but!but!but!but!but!but!
the Cformview derived class can't get any mousemove message,
|
|
|
|
|
BOOL CSDIDemoApp::PreTranslateMessage(MSG* pMsg)
{
CString strInfo;
strInfo.Format(_T("pMsg,message:%08d,(%04d,%04d)"),pMsg->message,pMsg->pt.x, pMsg->pt.y);
OutputDebugString(strInfo);
return CWinAppEx::PreTranslateMessage(pMsg);
}
----------- no problem! ----------------
|
|
|
|
|
BOOL CTestFormView::PreTranslateMessage(MSG* pMsg)<br />
{<br />
<br />
CString strInfo;<br />
strInfo.Format(_T("CTestFormView.pMsg,message:%08d,(%04d,%04d)"),pMsg->message,pMsg->pt.x, pMsg->pt.y);<br />
OutputDebugString(strInfo);<br />
<br />
<br />
return CFormView::PreTranslateMessage(pMsg);<br />
}
-- only WM_PAINT message ---
|
|
|
|
|
Hello,
the ...Theme...XP functions are now called ...Theme... without XP and are located in UxTheme.dll
Header uxtheme.h
Import library UxTheme.lib
Minimum operating systems Windows XP
Andreas.
|
|
|
|
|
Hello,
the buttons Close/Minimize/Maximize that are drawn in the function CMenuBarButton::DrawButton are not themed in vista. This is because the member m_hTheme is 0, because in the function CMenuBar::OnCreate OpenTheme is not called, because it is not XP but Vista.
You should set m_eOs to osWinXP in the constructor CWinAppEx::CWinAppEx if dwMajorVersion is greater equal 5 and dwMinorVersion not equal 0.
Andreas.
modified on Wednesday, November 25, 2009 3:47 AM
|
|
|
|
|
I'd like to add it into my GPL project but on top of the source code it says "You must obtain the author's consent before you can include this code in a software library."
|
|
|
|
|
I've used GuiLib successfully when my application was compiled using VC 2003 and I and my customers have appreciated it very much.
However, I've been unable to run my application in VC 2008. To compile GuiLib in 2008, I had to change
HMENU CMenuBar::GetMenu()
{
return m_hMenu;
}
to
CMenu* CMenuBar::GetMenu()
{
return CMenu::FromHandle( m_hMenu )
}
After successfully compiling GuiLib in VC 2008 with the change, my application fails in the winmain.cpp function AfxWinMain. CWinThread* pThread = AfxGetThread() returns 0X000000000.
I'd greatly appreciate any help!
Richard
|
|
|
|
|
When a window is small enough that the toolbar has to display a chevron to display the rest of the toolbar there is a problem if the chevron is on the secondary monitor. Basically when you click the chevron the dropdown menu appears on the primary monitor while the chevron is on the secondary monitor. This is real easy to fix.
In ToolBarEx.cpp in CToolBarPopup::SetPosition() function (line 802) change
GetDesktopWindow()->GetWindowRect( rcDesktop ); to
HMONITOR hMonitor = ::MonitorFromPoint( pt, MONITOR_DEFAULTTONEAREST );
MONITORINFO mi;
mi.cbSize = sizeof( mi );
GetMonitorInfo(hMonitor, &mi);
rcDesktop = mi.rcWork; and bingo the dropdown menu now appears on the same screen as the chevron.
Al.
"Of all the things I've lost in life I miss my mind the most" - Ozzy Osbourne
|
|
|
|
|
Thanks Al.
You can also modify within CMenuBar::OpenPopup, replacing...
GetDesktopWindow()->GetWindowRect(rcScreen);
With
POINT CurrentPoint;
GetCursorPos(&CurrentPoint);
HMONITOR hMonitor = ::MonitorFromPoint( CurrentPoint, MONITOR_DEFAULTTONEAREST );
MONITORINFO mi;
mi.cbSize = sizeof( mi );
GetMonitorInfo(hMonitor, &mi);
rcScreen = mi.rcWork;
- Nigel
|
|
|
|
|
As per the subject really.
I have a dialog app that could do with a modern toolbar (large buttons) and I don't really want to rewrite the app as a an SDI app.
--
http://www.coruscant.co.uk/
|
|
|
|
|
void CToolBarEx::ReloadButtons()<br />
{<br />
CToolBarCtrl& tbCtrl = GetToolBarCtrl();<br />
for ( int nIndex = 0, nButtons = tbCtrl.GetButtonCount(); nIndex < nButtons; nIndex++ )<br />
{<br />
TBBUTTON tbinfo;<br />
VERIFY( tbCtrl.GetButton( 0, &tbinfo ) );<br />
VERIFY( GetButtonInfo( tbinfo.idCommand, tbinfo ) );<br />
VERIFY( tbCtrl.DeleteButton( 0 ) );<br />
VERIFY( tbCtrl.AddButtons( 1, &tbinfo ) );<br />
}<br />
}
it seems that the button is deleted then added again, why?
|
|
|
|
|
Hello,
compiling your code with Visual Studio 2005 and the C++ Code Analyzer enabled. I get th e following warnings:
StdAfx.cpp
WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)
menubar.cpp(648) : warning C6246: Local declaration of 'mii' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '604' of 'd:\devtemp\menubardemo\guilib\menubar.cpp': Lines: 604
menubar.cpp(1025) : warning C6246: Local declaration of 'nPosition' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '1018' of 'd:\devtemp\menubardemo\guilib\menubar.cpp': Lines: 1018
menubar.cpp(1500) : warning C6011: Dereferencing NULL pointer 'm_pMenuBar': Lines: 1495, 1497, 1499, 1500
preview.cpp(130) : warning C6011: Dereferencing NULL pointer 'm_pReBar': Lines: 127, 128, 130
preview.cpp(134) : warning C6011: Dereferencing NULL pointer 'm_pPreviewToolBar': Lines: 127, 128, 130, 131, 133, 134
preview.cpp(167) : warning C6011: Dereferencing NULL pointer 'pToolBar': Lines: 161, 162, 165, 166, 167
sizablerebar.cpp(432) : warning C6011: Dereferencing NULL pointer 'pFrameWnd': Lines: 413, 418, 419, 420, 423, 424, 426, 427, 429, 430, 432
sizablerebar.cpp(735) : warning C6011: Dereferencing NULL pointer 'pFrameWnd': Lines: 733, 734, 735
toolbarex.cpp(655) : warning C6011: Dereferencing NULL pointer 'm_pCustomizeDlg': Lines: 635, 636, 639, 648, 649, 650, 651, 654, 655
toolbarex.cpp(990) : warning C6011: Dereferencing NULL pointer 'protected: static class CToolBarPopup * CToolBarPopup::m_pPopup': Lines: 985, 987, 989, 990
toolbarex.cpp(995) : warning C6011: Dereferencing NULL pointer 'm_pPopup': Lines: 985, 987, 989, 990, 993, 995
menubardemo\guilib\preview.h(189) : warning C6011: Dereferencing NULL pointer 'pView': Lines: 163, 164, 167, 168, 174, 175, 181, 182, 183, 184, 187, 188, 189
menubardemo\guilib\preview.h(268) : warning C6011: Dereferencing NULL pointer 'pState': Lines: 163, 164, 167, 168, 174, 175, 181, 182, 183, 184, 187, 188, 189, 191, 193, 194, 208, 209, 211, 221, 224, 227, 230, 231, 232, 234, 246, 248, 249, 251, 252, 253, 258, 268
menubardemo\guilib\preview.h(232) : warning C6011: Dereferencing NULL pointer 'pView->m_pPreviewToolBar': Lines: 163, 164, 167, 168, 174, 175, 181, 182, 183, 184, 187, 188, 189, 191, 193, 194, 208, 209, 211, 221, 224, 227, 230, 231, 232
Could you please fix this in your next version,
Thanks,
Andreas.
|
|
|
|
|
Hello,
Compiling your code with Visual Studio 2005 fails:
\guilib\sizablerebar.cpp(485) : error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CSizableReBar::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'
This is because the return type of OnNcHitTest has been changed. The MSDN documentation (8.0.50727) says:
<br />
afx_msg UINT OnNcHitTest(<br />
CPoint point <br />
);<br />
But in the header file afxmsg.h the marco is defined as:
<br />
#define ON_WM_NCHITTEST() \<br />
{ WM_NCHITTEST, 0, 0, 0, AfxSig_l_p, \<br />
(AFX_PMSG)(AFX_PMSGW) \<br />
(static_cast< LRESULT (AFX_MSG_CALL CWnd::*)(CPoint) > (&ThisClass :: OnNcHitTest)) }<br />
With return value LRESULT.
You can use _MSC_VER >= 1400 to solve the problem.
For example:
<br />
#if _MSC_VER >= 1400<br />
afx_msg LRESULT OnNcHitTest(CPoint point);<br />
#else<br />
afx_msg UINT OnNcHitTest(CPoint point);<br />
#endif <br />
Andreas.
|
|
|
|
|
It's very good artic.but how to link the static lib into my project?
thanks.
|
|
|
|
|
Thank you for your work!
You toolbar is set with TBSTYLE_FLAT style, everything seems fine. But if I remove the TBSTYLE_FLAT style from the toolbar in your SDI example and them toggle on/off to show/hide text on toolbar, all the buttons will disappear from the toolbar. It's really strange
|
|
|
|
|
Thanks for this excellent article.
How To change menu font (font of menu and submenu items) at runtime ?
(I checked many owner-drawn menu control samples also but none of them have implemented it)
Is it possible ? How to implement it ?
BCGSoftControlBar library has somehow implemented it (but that library is too expensive for small project)
Any idea or direction ?
Ana
Ana_v123
|
|
|
|
|
Is it themeware or how can we make it theme aware?
Mubi
|
|
|
|
|
nice toobar code but it doesn't support windows xp icons (24bit rgb with alpha channel)
|
|
|
|
|
It DOES support 24bit toolbar bitmaps with alpha channel
|
|
|
|
|
can anyone explain how to position bitmaps on the toolbar bitmap strip? I can't find any logical placement to them, they seem to be different sized images and almost placed randomly.
|
|
|
|
|
I read in the source code and found that the bitmaps are expected to be specific sizing. The size of the small bitmaps (small and small hot) is expected to be 16x15 images, the size of the large (Large and Large hot) is expected to be 24x24. I changed the size of my bitmaps accordingly and it fixed the problem for me (Set the pixel grid to 16x15 or 24x24). Each of my toolbars now has four bitmap resources in the application (small, small hot, large, large hot). Also the background color of the bitmaps was expected to be the purple (fuschia) color for the transparency (not the standard toolbar grey). Hope this helps.
|
|
|
|
|
When I hide the frame, and show it again, the menu is white. When I run the mouse pointer over the menu buttons, they paint one by one. How do I get the menu to paint on its own when I show the frame?
Also, how do I remove a button from view programaticly (as in the customize dialog)?
|
|
|
|
|
I'll answer the second part of this myself.
void CMyToolBar::HideButton( int nButton )
{
int nIndex = CommandToIndex( m_aButtons[nButton].tbinfo.idCommand );
if( -1 != nIndex )
VERIFY( GetToolBarCtrl().DeleteButton( nIndex ) );
}
|
|
|
|
|
i can't add a new button to the toolbar
sameh salah
|
|
|
|
|