Click here to Skip to main content
Click here to Skip to main content

The Ultimate Toolbox Application Skins

By , 24 Aug 2007
 

Visit the Ultimate Toolbox main page for an overview and configuration guide to the Ultimate Toolbox library.

Source code and project files for this sample can be found in the samples\advanced\SkinsDemo directory of the sample projects download.

Overview

The Skins Demo demonstrates the skinning framework available in The Ultimate Toolbox library. You can choose between the Office 2003, Office XP and Classic skins, and you can also change skins dynamically when the application is running.

Setting a Skin to Your Application

  1. Derive your application class from COXSkinnedApp instead of from CWinApp. Do not forget to include OXSkins.h.
  2. Derive your main frame window from COXMenuBarFrame<CMDIFrameWnd, COXSizeDockBar> instead of from CMDIFrameWnd for MDI applications. For SDI applications, derive your main frame window from COXMenuBarFrame<CFrameWnd, COXSizeDockBar> instead of from CFrameWnd.
  3. In the constructor of your main frame class call the constructor of COXMenuBarFrame<…> and pass CBRS_ALIGN_ANY for the first parameter and RUNTIME_CLASS(COXSizableMiniDockFrameWnd) for the second parameter.
  4. Derive or instantiate your toolbars from COXCoolToolBar instead of from CToolBar.
  5. Add an instance of COXBitmapMenuOrganizer to your main frame class. In the WM_CREATE handler of your main frame window call COXBitmapMenuOrganizer::AttachFrameWnd(…) and then COXBitmapMenuOrganizer:: AutoSetMenuImage(…).
  6. Add an instance of COXTabClientWnd to your main frame class. This will enable the MDI tabs. In the WM_CREATE handler of your main frame window call COXTabClientWnd::Attach(...).
  7. Derive or instantiate your status bar from COXStatusBar instead of CStatusBar.
  8. Derive your view class from COXSkinedView<PARENT>, where PARENT is the class from which your view was previously derived.

In the very beginning of your application class's InitInstance call SetCurrentSkin(_T("<skin name here>")). Choose from "Classic", "Office XP", and "Office 2003" skins. You can call this method again at any time to allow the user to switch between skins.

If you are having trouble following these steps they way they are outlined, just open the SkinsDemo project and do a text search for "STEP". You will find specific comments in all the places where the code needs to be modified:

Here is the related code which shows these actions in more detail:

// STEP 1 - Derive your application class from COXSkinnedApp insted of 

// CWinApp.

class CSkinsDemoApp : public COXSkinnedApp
{
public:
    CSkinsDemoApp();
    ...

 
// STEP 2 - Derive you main frame window from COXMenuBarFrame<cmdiframewnd, />.

class CMainFrame : public COXMenuBarFrame<cmdiframewnd, />
{
    DECLARE_DYNAMIC(CMainFrame)
public:
    CMainFrame();
    ... 

 
// STEP 3 - Call the constructor of COXMenuBarFrame<cmdiframewnd, /> and

//        pass CBRS_ALIGN_ANY for the first parameter and

//        RUNTIME_CLASS(COXSizableMiniDockFrameWnd) for the second parameter

CMainFrame::CMainFrame() : 
    COXMenuBarFrame<cmdiframewnd,coxsizedockbar />(CBRS_ALIGN_ANY,
    RUNTIME_CLASS(COXSizableMiniDockFrameWnd))
{   ...

// STEP 4 - Derive or instantiate your toolbars from COXCoolToolBar instead 

// of CToolBar.

    COXCoolToolBar m_wndToolBar;
    COXCoolToolBar m_wndToolBar2;

// STEP 5 - Add an instance of COXBitmapMenuOrganizer to your main frame 

// class. This will enable your menus to show bitmaps.

    COXBitmapMenuOrganizer m_BMO;

// STEP 5 (Cont'd) - Call COXBitmapMenuOrganizer::AttachFrameWnd(...) and then

//    COXBitmapMenuOrganizer::AttachFrameWnd(...)

m_BMO.AttachFrameWnd(this);
m_BMO.AutoSetMenuImage();        // (place this code in the OnCreate handler 

                                 // of your CMainFrame class)


// STEP 6 - Add an instance of COXTabClientWnd to your main frame class. 

// This will enable the MDI tabs.

COXTabClientWnd m_MTIClientWnd;

// STEP 6 (Cont'd) - Call COXTabClientWnd::Attach(...) in the OnCreate() of 

// the main frame class

m_MTIClientWnd.Attach(this);

// STEP 7 - Derive or instantiate your status bar from COXStatusBar instead 

// of CStatusBar.

COXStatusBar m_wndStatusBar;

// STEP 8: Derive your view class from COXSkinnedView<...>

#define BASEVIEW CView
class CSkinsDemoView : public COXSkinnedView<baseview />
{
protected: // create from serialization only

History

Initial CodeProject release August 2007.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

The Ultimate Toolbox
Web Developer
Canada Canada
Member
Organisation
263 members

In January 2005, David Cunningham and Chris Maunder created TheUltimateToolbox.com, a new group dedicated to the continued development, support and growth of Dundas Software’s award winning line of MFC, C++ and ActiveX control products.
 
Ultimate Grid for MFC, Ultimate Toolbox for MFC, and Ultimate TCP/IP have been stalwarts of C++/MFC development for a decade. Thousands of developers have used these products to speed their time to market, improve the quality of their finished products, and enhance the reliability and flexibility of their software.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionI would love ot use this, but I have a problemmembernamezero11111112 Sep '12 - 7:50 
Thank you for such a great MFC extension!
However, I'm trying to use this in an SDI app, but my CFormView derived class gets no skin (the default gray background stays).
 
I derived like this:
 
CMyView : public COXSkinnedView
{
...
}
 
Is there a way to fix the background of a form view?
 
The menus and status bar work just fine.
QuestionCan't download 0KB filememberMember 85308688 Feb '12 - 4:16 
Can't download 0KB file
GeneralErrors in VS 2010 Beta2memberShah00700700723 Nov '09 - 5:21 
It is a very useful application. It continues to be useful if it compiles smoothly in VS 2010.
 
Ahamad Alisha

QuestionSkins and HTML Helpmemberchrisb4411 Nov '09 - 18:16 
Firstly let me thank you for this great resource.
I "skinned" my application some time ago and am really impressed, however, shock/horror, I discovered today that context help from the toolbar crashes the app. It seems that the toolbar code wants WinHelp, but my app is using HTMLHelp....
 
To confirm the problem, I used the Wizard to generate a barebones SDI project with HTML Help, compiled and ran and context help works. "Skinned" it, recompiled and context help doesn't work.
 
I'm using VS2005, but surely that's not the problem. I'm linking with the .dll version of toolbox.
 
Any ideas...
AnswerRe: Skins and HTML Helpmemberchrisb4411 Nov '09 - 23:11 
After delving further it seems the problem is in COXMenuBarFrame. All context help requests are sent to WinHelp...
 
In Oxmenubar.h at line 2214
		else
		{
		        pApp->WinHelp(dwContext);
		}
When changed to
		else
		{
			if	(pApp->m_eHelpType != afxHTMLHelp)
			{
				pApp->WinHelp(dwContext);
			}
			else
			{
				pApp->HtmlHelp(dwContext);
			}
		}
it appears to work correctly.
QuestionWhy I got Error Link?memberCuongfdd16 Jun '09 - 19:11 
Hello everyone,
 
I use SDI in VC6.0, I test my project with Skinsdemo, setting my project as in Start.
When I build this project, It shows Error Link below:
 
How can I resolve all error?
 
Thanks and Best regards,
Cuong
//========================================================================================
 
Deleting intermediate files and output files for project 'TestSkill - Win32 Debug'.
--------------------Configuration: TestSkill - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
MainFrm.cpp
TestSkill.cpp
TestSkillDoc.cpp
TestSkillView.cpp
C:\Mycode\SmartLight\samples\advanced\TestSkill\TestSkillView.cpp(56) : warning C4100: 'pDC' : unreferenced formal parameter
Generating Code...
Linking...
MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall COXTabClientWnd::~COXTabClientWnd(void)" (??1COXTabClientWnd@@UAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall COXBitmapMenuOrganizer::~COXBitmapMenuOrganizer(void)" (??1COXBitmapMenuOrganizer@@UAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall COXCoolToolBar::~COXCoolToolBar(void)" (??1COXCoolToolBar@@UAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: __thiscall COXStatusBar::COXStatusBar(void)" (??0COXStatusBar@@QAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: __thiscall COXTabClientWnd::COXTabClientWnd(void)" (??0COXTabClientWnd@@QAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: __thiscall COXBitmapMenuOrganizer::COXBitmapMenuOrganizer(void)" (??0COXBitmapMenuOrganizer@@QAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: __thiscall COXCoolToolBar::COXCoolToolBar(void)" (??0COXCoolToolBar@@QAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const COXSizableMiniDockFrameWnd::classCOXSizableMiniDockFrameWnd" (?classCOXSizableMiniDockFrameWnd@COXSizableMiniDockFrameWnd@@2UCRuntimeClass@@B)
MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall COXStatusBar::~COXStatusBar(void)" (??1COXStatusBar@@UAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: void __thiscall COXCoolToolBar::EnableDocking(unsigned long,int)" (?EnableDocking@COXCoolToolBar@@QAEXKH@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: int __thiscall COXStatusBar::SetIndicators(unsigned int const *,int)" (?SetIndicators@COXStatusBar@@QAEHPBIH@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: int __thiscall COXMenuBar::SetMenu(struct HMENU__ *)" (?SetMenu@COXMenuBar@@QAEHPAUHMENU__@@@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: int __thiscall COXMenuBar::Create(class CWnd *,unsigned long,unsigned int)" (?Create@COXMenuBar@@QAEHPAVCWnd@@KI@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "int __stdcall AdvancedAssertFailedLine(unsigned short const *,char const *,int)" (?AdvancedAssertFailedLine@@YGHPBGPBDH@Z)
TestSkillView.obj : error LNK2001: unresolved external symbol "int __stdcall AdvancedAssertFailedLine(unsigned short const *,char const *,int)" (?AdvancedAssertFailedLine@@YGHPBGPBDH@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: int __thiscall COXMenuBar::HitTest(class CPoint const &,enum _tagHITTESTORIGIN)const " (?HitTest@COXMenuBar@@QBEHABVCPoint@@W4_tagHITTESTORIGIN@@@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: int __thiscall COXMenuBar::HandleMenuKey(unsigned int)" (?HandleMenuKey@COXMenuBar@@QAEHI@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "protected: int __thiscall COXMenuBar::RecreateMenuBar(int)" (?RecreateMenuBar@COXMenuBar@@IAEHH@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall COXMenuBar::~COXMenuBar(void)" (??1COXMenuBar@@UAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: void __thiscall COXCoolToolBar::SetAdvancedCustomizationMode(int,struct HWND__ *)" (?SetAdvancedCustomizationMode@COXCoolToolBar@@QAEXHPAUHWND__@@@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: __thiscall COXMenuBar::COXMenuBar(void)" (??0COXMenuBar@@QAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_MSGMAP const * __thiscall COXSizeDockBar::GetMessageMap(void)const " (?GetMessageMap@COXSizeDockBar@@MBEPBUAFX_MSGMAP@@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall COXSizeDockBar::Dump(class CDumpContext &)const " (?Dump@COXSizeDockBar@@UBEXAAVCDumpContext@@@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual struct CRuntimeClass * __thiscall COXSizeDockBar::GetRuntimeClass(void)const " (?GetRuntimeClass@COXSizeDockBar@@UBEPAUCRuntimeClass@@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall COXSizeDockBar::~COXSizeDockBar(void)" (??1COXSizeDockBar@@UAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: __thiscall COXSizeDockBar::COXSizeDockBar(void)" (??0COXSizeDockBar@@QAE@XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual class CSize __thiscall COXSizeDockBar::CalcFixedLayout(int,int)" (?CalcFixedLayout@COXSizeDockBar@@UAE?AVCSize@@HH@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const COXMenuBar::classCOXMenuBar" (?classCOXMenuBar@COXMenuBar@@2UCRuntimeClass@@B)
TestSkill.obj : error LNK2001: unresolved external symbol "public: virtual struct CRuntimeClass * __thiscall COXSkinnedApp::GetRuntimeClass(void)const " (?GetRuntimeClass@COXSkinnedApp@@UBEPAUCRuntimeClass@@XZ)
TestSkill.obj : error LNK2001: unresolved external symbol "protected: __thiscall COXSkinnedApp::COXSkinnedApp(void)" (??0COXSkinnedApp@@IAE@XZ)
TestSkill.obj : error LNK2001: unresolved external symbol "protected: virtual __thiscall COXSkinnedApp::~COXSkinnedApp(void)" (??1COXSkinnedApp@@MAE@XZ)
TestSkill.obj : error LNK2001: unresolved external symbol "public: int __thiscall COXSkinnedApp::SetCurrentSkin(unsigned short const *)" (?SetCurrentSkin@COXSkinnedApp@@QAEHPBG@Z)
TestSkillView.obj : error LNK2001: unresolved external symbol "public: class COXFrameSkin * __thiscall COXSkin::GetFrameSkin(void)const " (?GetFrameSkin@COXSkin@@QBEPAVCOXFrameSkin@@XZ)
TestSkillView.obj : error LNK2001: unresolved external symbol "public: class COXSkin * __thiscall COXSkinnedApp::GetCurrentSkin(void)" (?GetCurrentSkin@COXSkinnedApp@@QAEPAVCOXSkin@@XZ)
TestSkillView.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const COXSkinnedApp::classCOXSkinnedApp" (?classCOXSkinnedApp@COXSkinnedApp@@2UCRuntimeClass@@B)
msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/TestSkill.exe : fatal error LNK1120: 35 unresolved externals
Error executing link.exe.
 
TestSkill.exe - 37 error(s), 1 warning(s)
AnswerRe: Why I got Error Link?editorTim Deveaux17 Jun '09 - 14:03 
It looks like you need to add the required Ultimate Toolbox source files to the project - you may also need to set the C++ | Preprocessor | Additional includes directory to the Ultimate Toolbox/include dir, as well as the additional includes dir for the Resources tab.
 
Have a look at the SkinsDemo project - it should be a guide to the files and settings you need.
 
Tim
GeneralRe: Why I got Error Link?memberCuongfdd17 Jun '09 - 16:33 
Hi Tim,
 
Thanks for your help!
My project work fine.
 
Thanks and Best regrads,
Cuong
Generali could not make it to use the OXCustumizeManagermemberMewMew200029 Jan '09 - 6:25 
Dear all,
would u please advise on a straight and short way to use the "OXCustomizeManager" ? i follow instructions on this web page and also the documentation, but i really don't know how to go far, and where to configure the pages. The worst of all came when i realized that the classes in the toolbox src package are so include to one another !!. That is i include #include "OXCustomizeManager.h" in my mainframe, then the file OXCustomizeManager.cpp or "OXCustomizeManager.h" itself will include other class...
 
Please help Cry | :(( .
Thanks
QuestionCan not redraw the menumemberJobsGuo14 Dec '08 - 18:29 
Hi,I Modify my project step by step based on this aricle.the toolbar,workspace,output all become very professor like office2003,but the menu bar still is like office2000.who can help me?thanks.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMainFrameWindow::OnCreate(lpCreateStruct) == -1)
return -1;
//m_bAutoMenuEnable=FALSE;
 
//toolbar
if (!this->CreateToolBarEx())
return -1;
 
if (!m_wndToolBar2.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar2.LoadToolBar(IDR_TOOLBAR_EX))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
 
m_wndToolBar2.ShowWindow(SW_HIDE);
 
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
//menu
m_OxMenu.AttachFrameWnd(this);
m_OxMenu.AutoSetMenuImage();
 
GetMenuBar().EnableFloating(FALSE);
m_ImageList.Create(IDB_IMAGELIST, 13, 1, RGB(0,255,0));
 
EnableDocking(CBRS_ALIGN_ANY);
 
//create workspace
{
if(!m_wndWorkspace.Create(this))
{
TRACE0("Failed to create dialog bar m_wndWorkspace\n");
return -1; // fail to create
}
 
m_pTVUsers = m_wndWorkspace.m_pTVUsers;
m_pTVHistory = m_wndWorkspace.m_pTVHistory;
 
// allow bar to be resized when floating
m_wndWorkspace.SetBarStyle(m_wndWorkspace.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
 
m_wndWorkspace.EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndWorkspace, AFX_IDW_DOCKBAR_LEFT);
}
//create output bar
{
if(!m_wndResult.Create(this))
{
TRACE0("Failed to create dialog bar m_wndResult\n");
return -1; // fail to create
}
m_wndResult.EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndResult,AFX_IDW_DOCKBAR_BOTTOM);
 
m_bReadlyWndResult = TRUE;
 
}
SetWindowText("Workwin Server");
 

//tary icon
AddTrayIcon(1);
 
m_wndResult.RedrawWindow();
return 0;
 
}
AnswerRe: Can not redraw the menueditorTim Deveaux15 Dec '08 - 13:23 
Hi
 
Not sure I can see what's wrong from your code.
 
What does this call do:
 
	//toolbar
	if (!this->CreateToolBarEx())
		return -1; 
 
And where is this used:
 
	m_ImageList.Create(IDB_IMAGELIST, 13, 1, RGB(0,255,0));
 
Also, you make an initial call to CMainFrameWindow::OnCreate - I would expect either CFrameWnd::OnCreate or CMDIFrameWnd::OnCreate, I think - you must be working with a derived class - if so, you might need to be careful with the COXMenuBarFrame template etc.
 
Tim
GeneralRe: Can not redraw the menumemberJobsGuo21 Dec '08 - 21:21 
Thanks for you reply,I remove your marked code,the application still run ok,the toolbar,workspace,ouput all display like the office 2003.
I debug the skill code.
 
template<class PARENTFRAME, class PARENTDOCKBAR>
LRESULT COXMenuBarFrame<PARENTFRAME,PARENTDOCKBAR>::HandleMDIClientMsg(HWND hWnd,
UINT msg,
WPARAM wp,
LPARAM lp)
{
// only in MDIFrame
ASSERT(m_bIsMDI);
ASSERT(::IsWindow(m_hWnd));
 
switch(msg)
{
case WM_MDISETMENU:
{
ASSERT(::IsWindow(GetMenuBar().GetSafeHwnd()));
...
}
...
}
...
}
the ASSERT popup a warn message.
I debug your sample,the IsWindow(GetMenuBar().GetSafeHwnd() is TURE,but mime is false,what happen.
Could you help me again?
thanks
QuestionOffice 2003 Skin with MDI exe [modified]memberBrandybuck3 Nov '08 - 7:32 
Hello,
 
I use the Office 2003 skin in a mdi exe. The background of the toolbar (dockable area) of the main frame is blue, but the dockable area of the mdi child windows are grey. I use toolbars in the CMDIChildWnd.
 
Is there a way to change this?
 
Another problem is that toolbar buttons that are not enabled but checked in the ui handler look like they are accessible (Office XP and Office 2003 Skin).
I tried the SkinsDemo that uses SetHotImageList but without success.
 
This is the ON_UPDATE_COMMAND_UI function
void CMainFrame::OnUpdateChecked(CCmdUI* pCmdUI)
{
pCmdUI->Enable(false);
pCmdUI->SetCheck(true);
}
 
Used Compiler: MSVC 6
Windows XP SP2
 
Greetings from Germany
 
modified on Tuesday, November 4, 2008 4:03 AM

GeneralProblems with the control title in the TabViewBar and 3DTabViewBar Controls [modified]membermalfaro30 May '08 - 10:23 
When you apply titles to the controls COXTabViewContainer and COX3DTabViewContainer, they look good just when they are docked in a vertical position, but if you dock them in horizontal position the titles of the controls were showed in the bottom of the control and it doesn't look good (is hidden). This happens inthe Office XP and Office 2003 styles.
Also when you change the skins in run time, the tabs don't repaint correctly. you have to move them to get the proper size.
Can anyone fix this??
Mauricio
 
Mauricio Alfaro
modified on Friday, May 30, 2008 4:32 PM

GeneralRe: Problems with the control title in the TabViewBar and 3DTabViewBar ControlseditorTim Deveaux4 Jun '08 - 14:29 
Hi Mauricio
 
I did some testing by adding skins to the VisualStudioLikeDemo, and see the problem that happens when the skins are changed at runtime. There's a bit of a disjunct between the COX3DTabViewContainer and the enclosing COXSizeControlBar window when docked.
 
If you can deal with a little flicker on skin change, the following code might help, but is a little kludgy - here I switch skins in the app class, hence the casting etc:
 
void CVisualStudioLikeDemoApp::OnViewSkinsNone() 
{
    // TODO: Add your command handler code here
    SetCurrentSkin(_T("Classic"));
    CMainFrame* pMF = (CMainFrame*)(GetMainWnd());
 
    CRect rect;
    pMF->m_3DTabViewBar.GetClientRect(rect);
    pMF->m_3DTabViewBar.m_TabViewContainer.MoveWindow(&rect);
 
}
 
void CVisualStudioLikeDemoApp::OnViewSkinsOffice2003() 
{
    // TODO: Add your command handler code here
    SetCurrentSkin(_T("Office 2003"));
    CMainFrame* pMF = (CMainFrame*)(GetMainWnd());
 
    CRect rect;
    pMF->m_3DTabViewBar.GetClientRect(rect);
    pMF->m_3DTabViewBar.m_TabViewContainer.MoveWindow(&rect);
    
}
 
void CVisualStudioLikeDemoApp::OnViewSkinsOfficexp() 
{
    // TODO: Add your command handler code here
    SetCurrentSkin(_T("Office XP"));
    CMainFrame* pMF = (CMainFrame*)(GetMainWnd());
 
    CRect rect;
    pMF->m_3DTabViewBar.GetClientRect(rect);
    pMF->m_3DTabViewBar.m_TabViewContainer.MoveWindow(&rect);
 
}

 
For the problem related to docking hoizontally or vertically, I think if your OnSizedOrDocked override looks like this you'll be ok:
 
//-------------------------------------------------------------------
void C3DTabViewBar::OnSizedOrDocked(int cx, int cy, BOOL bFloating, int flags)
// respond to this event as we need to override it
//-------------------------------------------------------------------
{
	UNREFERENCED_PARAMETER(bFloating);
	UNREFERENCED_PARAMETER(flags);
	UNREFERENCED_PARAMETER(cx);
	UNREFERENCED_PARAMETER(cy);
 
	CRect rect;
	GetClientRect(rect);
 
	m_TabViewContainer.MoveWindow(&rect);
 
}
 
Here you see where I took the above code - season to taste. I think the basic problem is that there is a subtle resizing of the parent window that needs to take place when the tab skins are changed, and if the window is docked that is problematic.
 
There's probaly a better soution - hope this helps for now.
 
Tim
QuestionSkins not working when a toolbar is located in a dllmemberWunni11 Feb '08 - 21:57 
I am porting an application to use Ultimate Toolbox Skins. This application has several toolbars.
All toolbars located in the main project for the application are rendered correctly. But a toolbar
which is located in a seperate dll is not rendered. It still has the old look&feel.
 
Can anybody give me a hint how to handle such a scenario?
 
Thanks,
Wunni
GeneralRe: Skins not working when a toolbar is located in a dlleditorTim Deveaux13 Feb '08 - 7:12 
Hi Wunni
 
I'm not sure what the issue is here.
 
Can you post more about the environment? Compiler, framework, and the nature of the DLL (e.g. is this a straight resource DLL), any modifications that we're made to the DLL, how you're linking to the toolbox code?
 
Thanks
 
Tim
GeneralCouldn't compile in VS 2008memberShah20072 Jan '08 - 5:06 
Has anyone compiled in VS 2008?
There are number of issues for compiling in VS 2008.
GeneralUI styles in Dialog based appmembercanercaner8 Nov '07 - 9:20 
hi
COXSkinnedApp's UI styles are supported for MFC Dialog based apps?
thx much
 
caner abalı

GeneralRe: UI styles in Dialog based appstaffTim Deveaux9 Nov '07 - 13:50 
Hi
 
Almost but not quite.
 
You can create a dialog based app and derive from COXSkinnedApp, but only those controls that are set up to work with the skins framework will paint according to the current skin. For example, if you were to use a COXStatusBar in the dialog, that would show the skinned appearance, but the dialog title bar etc will remain as is.
 
The intent of the skins framework seems to have been mostly concerned with the Office styles using SDI and MDI frames. Those classes (dock bars, toolbars, etc) that fit into these frameworks were given skins, along with the OX docking frame windows, tabbed views, shortcut bar etc.
 
This is a question that comes up often enough to go in the FAQ, most often in the context of applying skins to dialogs appearing in a skinned MDI/SDI framework - I think it could be done, just haven't stared at it long enough to pass on any ideas right now - this is not an area of the code that I am all that familiar with.
 
There is a COXSkinnedWnd template that might be useful, but it would need a bit of work to accomodate the usual CDialog ctor (again, I may be missing something on this one - not my 'core competency' Smile | :) ).
 
My 2d for now,
 
Tim
 


GeneralRe: UI styles in Dialog based appmemberhakanbeyalan21 Nov '07 - 4:41 
hey tim, thx for your reply.
GeneralMenu text change doesn't work in Office Classic modememberShah200713 Sep '07 - 18:48 
ModifyMenu function with MF_BYPOSITION | MF_STRING parameter works fine in Office XP and Office 2003 modes, but not in Office Classic mode. Is there any other way to change the top level menu text?
 
Shah
GeneralRe: Menu text change doesn't work in Office Classic modestaffTim Deveaux14 Sep '07 - 4:37 
Odd - could you post a code snippet and location for the call?
 

GeneralRe: Menu text change doesn't work in Office Classic modememberShah200717 Sep '07 - 0:53 
Hi Tim
 
I have found out the bug. After calling ModifyMenu function, one has to call DrawMenuBar function for Office Classic mode. That means, menubar is to be redrawn.
 
Shah
QuestionHow to implement in SDI CFormViewmemberShah20077 Sep '07 - 1:57 
Hi
 
This application is really good. It works fine in CView. What changes to be made to implement it in SDI CFormView application? Simply changing CView to CFormView didn't work.
 
Thank you.
 
Shah

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 25 Aug 2007
Article Copyright 2007 by The Ultimate Toolbox
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid