Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How do I paint Non-Client Area of the Window Collapse All
Subject Author Date
howard liu Mar 11, 2008 - 4:30 AM

The Problem is very much straight forward, I already have an existing application which has some toolbars in it and the toolbars are created when the application is launched during the runtime.

I can skin this toolbar using Prof-UI CExtToolControlBar but unfortunately it does not support all the functions of CToolBar of MFC Class which is already being used in my application, hence there is no way of escaping from using the MFC CToolBar class for me ; because of which my tool bar is still getting painted in classical MFC way can you please suggest me a way to accomplish this?

I have also attached part of the code I am using for creating and displaying the toolbar below


if (!m_wndToolBar.CreateEx(toolbarparent,TBSTYLE_FLAT|TBSTYLE_TOOLTIPS,style,CRect(0,0,0,0),AFX_IDW_TOOLBAR) ||
!m_wndToolBar.SetButtons(buttons, sizeof(buttons)/sizeof(UINT)))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}

m_wndToolBar.GetToolBarCtrl().SetBitmapSize(CSize(20,20));
m_wndToolBar.GetToolBarCtrl().AutoSize();
m_wndToolBar.GetToolBarCtrl().SetExtendedStyle(TBSTYLE_EX_DRAWDDARROWS);

//Desc: For changing the Toolbar Control to transparent as part of Prof-UI imple
DWORD dwStyle = m_wndToolBar.GetToolBarCtrl().GetStyle();
m_wndToolBar.GetToolBarCtrl().SetStyle(dwStyle | TBSTYLE_TRANSPARENT );
m_wndToolBar.SetList(IDB_GRAYIMAGELIST,maintools);
m_wndToolBar.SetHotList(IDB_HOTIMAGELIST,maintools);
m_wndToolBar.MakeSetDisabledList(IDB_GRAYIMAGELIST256,maintools);

TBBUTTONINFO nfo;
memset(&nfo,0,sizeof(nfo));
nfo.cbSize=sizeof(nfo);
nfo.dwMask=TBIF_STYLE;
nfo.fsStyle=TBSTYLE_BUTTON|TBSTYLE_DROPDOWN;
m_wndToolBar.GetToolBarCtrl().SetButtonInfo(ID_VIEWMODE,&nfo);

thanks & regards,
Raghavendra

Technical Support Mar 14, 2008 - 12:46 PM

Unfortunately we do not support CToolBar skinning. We assume it is not difficult to repaint the background color of the CToolBar to have more appropriate look but we even didn’t investigate this way because the CExtToolControlBar toolbar has a richer list of features than CToolBar. And CExtToolControlBar is compatible with smart Prof-UIS docking mechanism while CToolBar does not.

You can switch to using CExtToolControlBar in the main frame/dialog window only as the first step. And then convert your application step by step. We believe all the functionality of CToolBar has the corresponding features in CExtToolControlBar but with greater quality. So just start upgrading and ask us if any questions arise.