You can create a custom theme for your application by deriving a class from any of the theme classes available in the toolkit.
Create a double gripper theme similar to Visual Studio 6.0.
CXTPDefaultTheme to inherit Office 2000 theme
CXTPOfficeTheme to inherit Office XP theme
CXTPOffice2003Theme to inherit Office 2003 theme
CXTPNativeXPTheme to inherit Native XP theme
class CDoubleGripperTheme : public CXTPDefaultTheme { };
class CDoubleGripperTheme : public CXTPDefaultTheme { virtual CSize DrawCommandBarGripper( CDC* pDC, CXTPCommandBar* pBar, BOOL bDraw); }; [...] // DrawCommandBarGripper function. // if bDraw if FALSE must return gripper size. // if bDraw is TRUE must draw gripper. CSize CDoubleGripperTheme::DrawCommandBarGripper(CDC* pDC, CXTPCommandBar* pBar, BOOL bDraw) { // If Toolbar is vertical docked if (pBar->GetPosition() == xtpBarRight || pBar->GetPosition() == xtpBarLeft) { if (bDraw) { CXTPClientRect rc(pBar); Draw3dRect(pDC, CRect(3, 3, rc.right - 3, 6), COLOR_BTNHILIGHT, COLOR_3DSHADOW); Draw3dRect(pDC, CRect(3, 7, rc.right - 3, 10), COLOR_BTNHILIGHT, COLOR_3DSHADOW); } return CSize(0, 10); } // if Toolbar is horizontal docked else if (pBar->GetPosition() == xtpBarTop || pBar->GetPosition() == xtpBarBottom) { CXTPClientRect rc(pBar); if (bDraw) { Draw3dRect(pDC, CRect(3, 3, 6, rc.bottom - 3), COLOR_BTNHILIGHT, COLOR_3DSHADOW); Draw3dRect(pDC, CRect(7, 3, 10, rc.bottom - 3), COLOR_BTNHILIGHT, COLOR_3DSHADOW); } return CSize(10, 0); } } return CXTPDefaultTheme::DrawCommandBarGripper(pDC, pBar, bDraw); }
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { ... // Use our own theme for drawing command bar grippers. CXTPPaintManager::SetCustomTheme(new CDoubleGripperTheme()); return 0; }
User Comments
No comments yet, sign in to comment.