轉帖|使用教程|編輯:鮑佳佳|2021-03-18 11:19:03.253|閱讀 235 次
概述:本文主要是對codejock的suite Pro中的commandBars創建應用程序自定義主題進行詳細的介紹。包含創建步驟以及相應程序代碼效果圖等。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Codejock 軟件的Xtreme Command Bars 提供非常漂亮的Office風格的命令條和One Note樣式的Tab. 這種構架完全支持菜單和工具欄的個性化設置, 它將在應用程序工作臺上給你更大的控制權, Xtreme Command Bars提供嵌入式主題支持,允許你選擇預先定義的主題如Officexp、Office 2003、 Visual Studio .NET,或者自定義主題。它是Xtreme Suite的一部分。
為您的應用程序創建自定義主題您可以通過從工具包中可用的任何主題類派生一個類來為您的應用程序創建自定義主題。
創建類似于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;
 }
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@ke049m.cn
文章轉載自: