Geoyar
2008-07-14 22:56:01 UTC
Hi,
I have problems with CMFCToolBar.
I am using the slider sample from Samples\C++\MFC\Visual C++ Feature
Pack\Slider and VS2008 Standard.
I added my CMFCToolbar member, m_wndMyTB , to MainFrm.h and added
CMFCToolBar::SetLargeIcons();
......................................
if (!m_wndMyTB.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE |CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS |CBRS_FLYBY | CRBS_SIZE_DYNAMIC) ||
!m_wndMyTB.LoadToolBar(IDR_MYTB))
{
TRACE0("Failed to create toolbar MyTB\n");
return -1; // fail to create
}
m_wndMyTB.SetButtonText(0, CString(_T("NoApple")));
m_wndMyTB.SetButtonText(1, CString(_T("Visa")));
.............................
m_wndMyTB.EnableDocking(CBRS_ALIGN_ANY);
................................
DockPane(&m_wndMyTB);
.................................
m_wndMyTB.EnableCustomizeButton (TRUE, ID_VIEW_CUSTOMIZE, _T("Customize..."));
to CMainFrame::OnCreate().
The new toolbar was displayed to the right of the standard toolbar with the
slider control on the standard toolbar, but:
1. In View\toolbars menu I see only one, standard toolbar.
2. In the Customize dialog box\toolbars I see menu bar and two standard
bars, the first is my MyTB (under name Standard) and the second toolbar is
the ntoolbar from the slider example.
3. The app does not react on my attempt to show labels for m_wndMyTB and do
not show labels for the standard toolbar from OnCreate like
m_wndToolBar.EnableTextLabels(FALSE) and m_wndMyTB.EnableTextLabels().
It displays and hides labels only from the Customise\toolbars Show Text
Labels check box. But after you chech the box for m_wndMyTB once and exit the
app, on the next start it shows labels for both toolbars.
Any help?
My machine is HP Pavilion a120n under Window XP SP2.
Please respont to ***@toast.net
Thank you
geoyar
I have problems with CMFCToolBar.
I am using the slider sample from Samples\C++\MFC\Visual C++ Feature
Pack\Slider and VS2008 Standard.
I added my CMFCToolbar member, m_wndMyTB , to MainFrm.h and added
CMFCToolBar::SetLargeIcons();
......................................
if (!m_wndMyTB.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE |CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS |CBRS_FLYBY | CRBS_SIZE_DYNAMIC) ||
!m_wndMyTB.LoadToolBar(IDR_MYTB))
{
TRACE0("Failed to create toolbar MyTB\n");
return -1; // fail to create
}
m_wndMyTB.SetButtonText(0, CString(_T("NoApple")));
m_wndMyTB.SetButtonText(1, CString(_T("Visa")));
.............................
m_wndMyTB.EnableDocking(CBRS_ALIGN_ANY);
................................
DockPane(&m_wndMyTB);
.................................
m_wndMyTB.EnableCustomizeButton (TRUE, ID_VIEW_CUSTOMIZE, _T("Customize..."));
to CMainFrame::OnCreate().
The new toolbar was displayed to the right of the standard toolbar with the
slider control on the standard toolbar, but:
1. In View\toolbars menu I see only one, standard toolbar.
2. In the Customize dialog box\toolbars I see menu bar and two standard
bars, the first is my MyTB (under name Standard) and the second toolbar is
the ntoolbar from the slider example.
3. The app does not react on my attempt to show labels for m_wndMyTB and do
not show labels for the standard toolbar from OnCreate like
m_wndToolBar.EnableTextLabels(FALSE) and m_wndMyTB.EnableTextLabels().
It displays and hides labels only from the Customise\toolbars Show Text
Labels check box. But after you chech the box for m_wndMyTB once and exit the
app, on the next start it shows labels for both toolbars.
Any help?
My machine is HP Pavilion a120n under Window XP SP2.
Please respont to ***@toast.net
Thank you
geoyar