翻譯|使用教程|編輯:鮑佳佳|2020-08-05 10:22:46.820|閱讀 407 次
概述:本文主要是對(duì)codejock的suite Pro中的commandBars創(chuàng)建應(yīng)用程序自定義主題進(jìn)行詳細(xì)的介紹。包含創(chuàng)建步驟以及相應(yīng)程序代碼效果圖等。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Codejock 軟件的Xtreme Command Bars 提供非常漂亮的Office風(fēng)格的命令條和One Note樣式的Tab. 這種構(gòu)架完全支持菜單和工具欄的個(gè)性化設(shè)置, 它將在應(yīng)用程序工作臺(tái)上給你更大的控制權(quán), Xtreme Command Bars提供嵌入式主題支持,允許你選擇預(yù)先定義的主題如Officexp、Office 2003、 Visual Studio .NET,或者自定義主題。它是Xtreme Suite的一部分。
點(diǎn)擊下載Xtreme Command Bars最新試用版
為您的應(yīng)用程序創(chuàng)建自定義主題您可以通過從工具包中可用的任何主題類派生一個(gè)類來為您的應(yīng)用程序創(chuàng)建自定義主題。
創(chuàng)建類似于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 CXTPDefaultTh
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; }
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: