void CXTFlatComboBoxThemeOffice2003::DrawArrowBack(CDC* pDC, CRect& rcArrow, int eState, CXTFlatComboBox* pCombo) { rcArrow.left = rcArrow.right - (m_cxArrow - 2); if (eState == xtMouseHover) { XTPDrawHelpers()->GradientFill(pDC, &rcArrow, XTPColorManager()->grcLunaSelected, FALSE); CXTPPenDC pen(*pDC, GetMSO2003Color(XPCOLOR_HIGHLIGHT_BORDER)); pDC->MoveTo(rcArrow.left-1, rcArrow.top); pDC->LineTo(rcArrow.left-1, rcArrow.bottom); } else if (eState == xtMouseSelect) { XTPDrawHelpers()->GradientFill(pDC, &rcArrow, XTPColorManager()->grcLunaPushed, FALSE); CXTPPenDC pen(*pDC, GetMSO2003Color(XPCOLOR_HIGHLIGHT_BORDER)); pDC->MoveTo(rcArrow.left-1, rcArrow.top); pDC->LineTo(rcArrow.left-1, rcArrow.bottom); } else if (pCombo->IsWindowEnabled()) { rcArrow.DeflateRect(1, 1); XTPDrawHelpers()->GradientFill(pDC, &rcArrow, XTPColorManager()->grcMenuItemPopup, FALSE); } }
void CXTPExcelTabCtrlThemeOffice2003::DrawButtonBack(CDC* pDC, CRect& rect, CXTPExcelTabCtrlButtonState& state) { if (state.m_bEnabled && state.m_bHilight) { if (state.m_bPressed) { XTPDrawHelpers()->GradientFill(pDC, &rect, XTPColorManager()->grcLunaPushed, FALSE); } else { XTPDrawHelpers()->GradientFill(pDC, &rect, XTPColorManager()->grcLunaSelected, FALSE); } pDC->Draw3dRect(&rect, m_clrBorder3DHilite, m_clrBorder3DHilite); } else { pDC->FillSolidRect(rect, m_clr3DFace); pDC->Draw3dRect(rect, m_clr3DFace, m_clr3DFace); } rect.DeflateRect(1, 1); }
void CXTPShortcutListBoxThemeOffice2003::RefreshMetrics(CXTPShortcutListBox* pList) { CXTPShortcutListBoxThemeOfficeXP::RefreshMetrics(pList); if (!XTPColorManager()->IsLunaColorsDisabled()) { XTPCurrentSystemTheme systemTheme = XTPColorManager()->GetCurrentSystemTheme(); switch (systemTheme) { case xtpSystemThemeBlue: case xtpSystemThemeRoyale: case xtpSystemThemeAero: // normal colors m_crgBack.SetStandardValue(RGB(0xdd, 0xec, 0xfe), RGB(0x4a, 0x7a, 0xc9)); m_crgItemBorder.SetStandardValue(RGB(0x00, 0x00, 0x80), RGB(0x00, 0x00, 0x80)); m_crItemText.SetStandardValue(RGB(0x00, 0x00, 0x00)); m_crItemTextDisabled.SetStandardValue(RGB(0x6d, 0x96, 0xd0)); // hot, pressed colors m_crgItemBackHot.SetStandardValue(RGB(0xff, 0xf0, 0xc5), RGB(0xff, 0xd6, 0x9b)); m_crgItemBackPressed.SetStandardValue(RGB(0xfe, 0x90, 0x4d), RGB(0xfe, 0xc9, 0x85)); break; case xtpSystemThemeOlive: // normal colors m_crgBack.SetStandardValue(RGB(0xf3, 0xf2, 0xe7), RGB(0x9f, 0xab, 0x80)); m_crgItemBorder.SetStandardValue(RGB(0x3f, 0x5d, 0x38), RGB(0x3f, 0x5d, 0x38)); m_crItemText.SetStandardValue(RGB(0x00, 0x00, 0x00)); m_crItemTextDisabled.SetStandardValue(RGB(0x9f, 0xae, 0x7a)); // hot, pressed colors m_crgItemBackHot.SetStandardValue(RGB(0xff, 0xf0, 0xc5), RGB(0xff, 0xd6, 0x9b)); m_crgItemBackPressed.SetStandardValue(RGB(0xfe, 0x90, 0x4d), RGB(0xfe, 0xc9, 0x85)); break; case xtpSystemThemeSilver: // normal colors m_crgBack.SetStandardValue(RGB(0xee, 0xee, 0xf4), RGB(0xa2, 0xa2, 0xb5)); m_crgItemBorder.SetStandardValue(RGB(0x4b, 0x4b, 0x6f), RGB(0x4b, 0x4b, 0x6f)); m_crItemText.SetStandardValue(RGB(0x00, 0x00, 0x00)); m_crItemTextDisabled.SetStandardValue(RGB(0xa8, 0xa7, 0xbe)); // hot, pressed colors m_crgItemBackHot.SetStandardValue(RGB(0xff, 0xf0, 0xc5), RGB(0xff, 0xd6, 0x9b)); m_crgItemBackPressed.SetStandardValue(RGB(0xfe, 0x90, 0x4d), RGB(0xfe, 0xc9, 0x85)); break; default: // normal colors m_crgBack.SetStandardValue(XTPColorManager()->LightColor(GetXtremeColor(COLOR_3DFACE), GetXtremeColor(COLOR_WINDOW), 0xcd), GetXtremeColor(COLOR_3DFACE)); break; } } }
CXTPSkinManagerSchema* CXTPSkinManager::CreateSchema(LPCTSTR lpszResourcePath, LPCTSTR lpszIniFileName) { if (XTPColorManager()->IsLowResolution() || !CXTPSkinManagerModuleList::IsEnumeratorExists()) return NULL; CXTPSkinManagerResourceFile* pResourceFile = new CXTPSkinManagerResourceFile(this); if (!pResourceFile->Open(lpszResourcePath, lpszIniFileName)) { CMDTARGET_RELEASE(pResourceFile); return NULL; } CXTPSkinManagerSchema* pSchema = pResourceFile->CreateSchema(); if (!pSchema) { CMDTARGET_RELEASE(pResourceFile); return NULL; } CMDTARGET_RELEASE(pResourceFile); if (FAILED(pSchema->ReadProperties())) { CMDTARGET_RELEASE(pSchema); return NULL; } pSchema->RefreshMetrcis(); return pSchema; }
void CMainFrame::SetOfficeTheme(int nCalendarTheme) { // xtpThemeOffice2000, // Office 2000 theme. // xtpThemeOfficeXP, // Office XP theme. // xtpThemeOffice2003, // Office 2003 theme. // xtpThemeNativeWinXP, // Windows XP themes support. // xtpThemeWhidbey, // Visual Studio 2005 theme. // xtpThemeOffice2007, // Office 2007 theme. // xtpThemeRibbon, // Office 2007 style ribbon theme // xtpThemeVisualStudio2008, // Visual Studio 2008 theme // xtpThemeCustom // Custom theme. static int sarThemesMap[xtpCalendarThemeOffice2007+1] = {0}; if (sarThemesMap[xtpCalendarThemeOffice2000] == 0) { sarThemesMap[xtpCalendarThemeOffice2000] = xtpThemeOffice2000; sarThemesMap[xtpCalendarThemeOfficeXP] = xtpThemeOfficeXP; sarThemesMap[xtpCalendarThemeOffice2003] = xtpThemeOffice2003; sarThemesMap[xtpCalendarThemeOffice2007] = xtpThemeRibbon; } // 0 - Blue, 1 - Silver, 2 - Black int nTheme2007Style = 0; if (nCalendarTheme > xtpCalendarThemeOffice2007) { nTheme2007Style = nCalendarTheme - xtpCalendarThemeOffice2007 - 100; nCalendarTheme = xtpCalendarThemeOffice2007; } XTPPaintTheme nTheme2 = (XTPPaintTheme)sarThemesMap[nCalendarTheme]; //------------------------------------ CString strFilePath = _GetTheme2007Style_file(nTheme2007Style); XTPOffice2007Images()->SetHandle(strFilePath); //=============================================================== #ifdef _XTP_INCLUDE_RIBBON CXTPPaintManager::SetTheme(nTheme2); if (nTheme2 == xtpThemeRibbon) EnableOffice2007Frame(GetCommandBars()); else EnableOffice2007Frame(0); #else CXTPPaintManager::SetTheme((XTPPaintTheme)min(nTheme2, xtpThemeOffice2003)); #endif // _XTP_INCLUDE_RIBBON XTPColorManager()->SetLunaTheme((nTheme2 == xtpThemeOffice2000) ? xtpSystemThemeUnknown : xtpSystemThemeAuto); RecalcLayout(FALSE); GetCommandBars()->RedrawCommandBars(); RedrawWindow(); m_nOfficeTheme = nCalendarTheme; CCalendarDemoView *pView = DYNAMIC_DOWNCAST(CCalendarDemoView, GetActiveView()); if (pView) pView->OnOfficeThemeChanged(nCalendarTheme); }
void CXTPPopupThemeOffice2003::RefreshMetrics() { CXTPPopupThemeOfficeXP::RefreshMetrics(); m_clrBackground.SetStandardValue(XTPColorManager()->grcDockBar.clrDark, XTPColorManager()->grcDockBar.clrLight);//.SetStandardValue(RGB(214, 231, 252), RGB(168, 198, 238)); m_clrGripper.SetStandardValue(XTPColorManager()->grcShortcutBarGripper); m_clrFrame.SetStandardValue(GetXtremeColor(XPCOLOR_FRAME)); if (!XTPColorManager()->IsLunaColorsDisabled()) { XTPCurrentSystemTheme systemTheme = XTPColorManager()->GetCurrentSystemTheme(); switch (systemTheme) { case xtpSystemThemeBlue: case xtpSystemThemeRoyale: case xtpSystemThemeAero: m_clrButtonSelected = RGB(255, 238, 194); m_clrButtonPressed = RGB(254, 128, 62); m_clrButtonPressedBorder.SetStandardValue(RGB(0, 0, 128)); m_clrButtonSelectedBorder.SetStandardValue(RGB(0, 0, 128)); break; case xtpSystemThemeOlive: m_clrButtonSelected = RGB(255, 238, 194); m_clrButtonPressed = RGB(254, 128, 62); m_clrButtonPressedBorder.SetStandardValue(RGB(63, 93, 56)); m_clrButtonSelectedBorder.SetStandardValue(RGB(63, 93, 56)); break; case xtpSystemThemeSilver: m_clrButtonSelected = RGB(255, 238, 194); m_clrButtonPressed = RGB(254, 128, 62); m_clrButtonPressedBorder.SetStandardValue(RGB(75, 75, 111)); m_clrButtonSelectedBorder.SetStandardValue(RGB(75, 75, 111)); break; } } }
void CXTPSplitterWndThemeOffice2003::RefreshMetrics() { CXTPSplitterWndThemeOfficeXP::RefreshMetrics(); // set splitter colors. if (!XTPColorManager()->IsLunaColorsDisabled()) { XTPCurrentSystemTheme systemTheme = XTPColorManager()->GetCurrentSystemTheme(); switch (systemTheme) { case xtpSystemThemeBlue: case xtpSystemThemeRoyale: case xtpSystemThemeAero: m_crBack.SetStandardValue(RGB(165, 195, 255)); m_crOuterBorder.SetStandardValue(RGB(165, 195, 255)); m_crInnerBorder.SetStandardValue(RGB(0, 44, 148)); break; case xtpSystemThemeOlive: m_crBack.SetStandardValue(RGB(226, 231, 191)); m_crOuterBorder.SetStandardValue(RGB(226, 231, 191)); m_crInnerBorder.SetStandardValue(RGB(99, 130, 90)); break; case xtpSystemThemeSilver: m_crBack.SetStandardValue(RGB(223, 223, 234)); m_crOuterBorder.SetStandardValue(RGB(223, 223, 234)); m_crInnerBorder.SetStandardValue(RGB(123, 125, 148)); break; } } // set split box colors. m_crBoxBack = m_crBack; m_crOuterBoxBorder = m_crOuterBorder; m_crInnerBoxBorder = m_crInnerBorder; }
void CXTPExcelTabCtrlThemeOffice2003::RefreshMetrics(CXTPExcelTabCtrl* pTab) { CXTPExcelTabCtrlThemeOfficeXP::RefreshMetrics(pTab); if (XTPColorManager()->GetCurrentSystemTheme() != xtpSystemThemeUnknown) { m_clr3DFacePushed.SetStandardValue(GetMSO2003Color(XPCOLOR_HIGHLIGHT_PUSHED)); m_clr3DFaceHilite.SetStandardValue(GetMSO2003Color(XPCOLOR_HIGHLIGHT)); m_clrBtnTextPushed.SetStandardValue(GetMSO2003Color(XPCOLOR_PUSHED_TEXT)); m_clrBtnTextHilite.SetStandardValue(GetMSO2003Color(XPCOLOR_HIGHLIGHT_TEXT)); m_clrBorder3DShadow.SetStandardValue(GetMSO2003Color(XPCOLOR_HIGHLIGHT_BORDER)); m_clrBorder3DHilite.SetStandardValue(GetMSO2003Color(XPCOLOR_HIGHLIGHT_BORDER)); } }
BOOL CXTPSkinManager::LoadSkin(LPCTSTR lpszResourcePath, LPCTSTR lpszIniFileName) { CMDTARGET_RELEASE(m_pSchema); CXTPSkinManagerApiHook* pApiHook = CXTPSkinManagerApiHook::GetInstance(); pApiHook->FinalizeHookManagement(); XTPSoundManager()->StopThread(); BOOL bEnabled = m_bEnabled; if (XTPColorManager()->IsLowResolution() || !CXTPSkinManagerModuleList::IsEnumeratorExists() || !ReadSkinData(lpszResourcePath, lpszIniFileName)) { m_bEnabled = FALSE; CMDTARGET_RELEASE(m_pSchema); XTPColorManager()->RefreshColors(); OnSkinChanged(bEnabled, m_bEnabled); return FALSE; } m_bEnabled = TRUE; pApiHook->InitializeHookManagement(); m_pSchema->RefreshMetrcis(); XTPColorManager()->RefreshColors(); OnSkinChanged(bEnabled, m_bEnabled); return TRUE; }
void CXTPSkinManager::SetApplyOptions(DWORD dwOptions) { m_dwApplyOptions = dwOptions; if (!m_bEnabled) return; CXTPSkinManagerApiHook* pApiHook = CXTPSkinManagerApiHook::GetInstance(); pApiHook->FinalizeHookManagement(); pApiHook->InitializeHookManagement(); m_pSchema->RefreshMetrcis(); XTPColorManager()->RefreshColors(); OnSkinChanged(m_bEnabled, m_bEnabled); }
void CXTFlatEditThemeOffice2003::RefreshMetrics() { CXTFlatEditThemeOfficeXP::RefreshMetrics(); XTPCurrentSystemTheme systemTheme = XTPColorManager()->GetCurrentSystemTheme(); switch (systemTheme) { case xtpSystemThemeBlue: case xtpSystemThemeRoyale: case xtpSystemThemeAero: m_clrHighlightText.SetStandardValue(0); m_clrPushedText.SetStandardValue(0); m_clrHighlight.SetStandardValue(RGB(255, 238, 194)); m_clrPushed.SetStandardValue(RGB(254, 128, 62)); m_clrFrameHighlight.SetStandardValue(RGB(0, 0, 128)); m_clrFrameNormal.SetStandardValue(RGB(127, 157, 185)); m_clrNormal.SetStandardValue(RGB(169, 199, 240)); break; case xtpSystemThemeOlive: m_clrHighlightText.SetStandardValue(0); m_clrPushedText.SetStandardValue(0); m_clrHighlight.SetStandardValue(RGB(255, 238, 194)); m_clrPushed.SetStandardValue(RGB(254, 128, 62)); m_clrFrameHighlight.SetStandardValue(RGB(63, 93, 56)); m_clrFrameNormal.SetStandardValue(RGB(164, 185, 127)); m_clrNormal.SetStandardValue(RGB(197, 212, 159)); break; case xtpSystemThemeSilver: m_clrHighlightText.SetStandardValue(0); m_clrPushedText.SetStandardValue(0); m_clrHighlight.SetStandardValue(RGB(255, 238, 194)); m_clrPushed.SetStandardValue(RGB(254, 128, 62)); m_clrFrameHighlight.SetStandardValue(RGB(75, 75, 111)); m_clrFrameNormal.SetStandardValue(RGB(165, 172, 178)); m_clrNormal.SetStandardValue(RGB(192, 192, 211)); break; default: m_clrFrameNormal.SetStandardValue(GetXtremeColor(COLOR_3DSHADOW)); } m_clrFrameEdit.SetStandardValue(m_clrFrameNormal); }
void CXTPSkinManager::RedrawAllControls() { if (!m_bEnabled) return; if (!m_pSchema) return; POSITION pos = m_pSchema->m_mapClasses.GetStartPosition(); CString strClassName; CXTPSkinManagerClass* pClass; while (pos != NULL) { m_pSchema->m_mapClasses.GetNextAssoc( pos, strClassName, (void*&)pClass); pClass->GetImages()->RemoveAll(); } m_pSchema->GetMetrics()->RefreshMetrics(); XTPColorManager()->RefreshColors(); OnSkinChanged(TRUE, TRUE); }
BOOL CXTPTabPaintManager::IsLunaColorsDisabled() const { return m_bDisableLunaColors || XTPColorManager()->IsLunaColorsDisabled(); }
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { AfxGetApp()->m_nCmdShow = SW_HIDE; if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; //界面居中显示 this ->CenterWindow(CWnd::GetDesktopWindow()); 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 } m_wndStatusBar.SetPaneInfo(0, m_wndStatusBar.GetItemID(0), SBPS_STRETCH, NULL); m_wndStatusBar.SetPaneInfo(1, m_wndStatusBar.GetItemID(1), SBPS_NORMAL, 180); m_wndStatusBar.SetPaneInfo(2, m_wndStatusBar.GetItemID(2), SBPS_NORMAL, 100); m_wndStatusBar.SetPaneInfo(3, m_wndStatusBar.GetItemID(3), SBPS_NORMAL, 100); m_wndStatusBar.SetPaneInfo(4, m_wndStatusBar.GetItemID(4), SBPS_NORMAL, NULL); m_wndStatusBar.SetPaneInfo(5, m_wndStatusBar.GetItemID(5), SBPS_NORMAL, NULL); m_wndStatusBar.SetPaneInfo(6, m_wndStatusBar.GetItemID(6), SBPS_NORMAL, NULL); /////////////////////////////////////////////////////////////////////////////////////// m_wndStatusBar.EnableCustomization(); if (!m_TrayIcon.Create(_T(""), // Toolktip text this, // Parent window IDR_MAINFRAME, // Icon resource ID IDR_MINIMIZE, // Resource ID of popup menu IDM_SHOW, // Default menu item for popup menu false)) // True if default menu item is located by position { TRACE0("Failed to create tray icon\n"); return -1; } if (!InitCommandBars()) { return -1; } CXTPCommandBars* pCommandBars = GetCommandBars(); CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME); pMenuBar->SetFlags(xtpFlagAddMDISysPopup); CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("Standard"), xtpBarTop); if (!pCommandBar || !pCommandBar->LoadToolBar(IDR_TOOLBAR3)) { TRACE0("Failed to create toolbar\n"); return -1; }; pCommandBars->GetCommandBarsOptions()->bShowTextBelowIcons = TRUE; pCommandBars->GetCommandBarsOptions()->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault); m_paneManager.InstallDockingPanes(this); m_paneManager.SetTheme(xtpPaneThemeWinExplorer); CXTPDockingPane* pwndPaneLog = CreatePane(300, 141, RUNTIME_CLASS(CLogView), _T("日志信息"), xtpPaneDockBottom); CXTPDockingPane* pwndPaneShortcuts = CreatePane(200, 145, RUNTIME_CLASS(CShortcuts), _T("快捷功能"), xtpPaneDockRight,pwndPaneLog); CXTPDockingPane* pwndPaneIPUP = CreatePane(200, 145, RUNTIME_CLASS(CIPUpdate), _T("域名更新"), xtpPaneDockRight,pwndPaneLog); pwndPaneIPUP->Select(); m_paneManager.AttachPane( pwndPaneIPUP ,pwndPaneShortcuts ); pwndPaneShortcuts->SetOptions(xtpPaneNoCaption); pwndPaneIPUP->SetOptions(xtpPaneNoCaption); XTPColorManager()->DisableLunaColors(TRUE); CXTPPaintManager::SetTheme(xtpThemeOffice2003); LoadCommandBars(_T("CommandBars")); SetTimer(1,1000,NULL); return 0; }
COLORREF CXTColorRef::GetColor(int nIndex) { return XTPColorManager()->GetColor(nIndex); }
STDMETHODIMP CTabbedComponent::Create(LONGLONG hParentWnd, ITangramNode* pNode, LONGLONG* hWnd) { BSTR bstrTag = L""; BSTR bstrTagColor = L""; AFX_MANAGE_STATE(AfxGetStaticModuleState()); USES_CONVERSION; pNode->get_Attribute(L"style",&bstrTag); pNode->get_Attribute(L"color",&bstrTagColor); HWND hPWnd = (HWND)hParentWnd; CString m_strTag = OLE2T(bstrTag); CString m_strTagColor = OLE2T(bstrTagColor); //VARIANT var; //IXMLDOMElement* pEle; //pNode->get_XMLElement(&pEle); //pEle->getAttribute(L"Tag",&var); //m_strTag = CString(var.bstrVal); //HRESULT hr = pEle->Release(); HRESULT hr = S_OK; m_strTag.Trim(); m_strTagColor.Trim(); int nColor = _wtoi(m_strTagColor); if (m_strTag.CompareNoCase(_T("")) == 0) m_strTag = _T("10"); if(::IsWindow(hPWnd)) { CRect rt; ::GetClientRect(hPWnd,&rt); CTabbedWnd* pTangramTabWnd = new CTabbedWnd(pNode); //CComObject<CTangramTabbedWnd>* pTangramTabWnd; hr = CComObject<CTangramTabbedWndDisp>::CreateInstance(&pTangramTabWnd->m_pTangramTabWndDisp); hr = pTangramTabWnd->m_pTangramTabWndDisp->AddRef(); pTangramTabWnd->m_pTangramNode = pNode; BOOL bRet = pTangramTabWnd->Create(NULL,_T(""),WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, rt, CWnd::FromHandle(hPWnd), 0); CString strFlag = m_strTag;//OLE2T(bstrTagName); //strFlag.Format(_T("%d"),m_pTangramXMLObj->m_nStyle); CString strPos = strFlag.Left(1); strFlag = strFlag.Mid(1); int nTabPos = _ttoi(strPos) - 1; XTPTabPosition position = (XTPTabPosition)nTabPos; pTangramTabWnd->GetPaintManager()->SetPosition(position); int nStyle = _ttoi(strFlag); XTPColorManager()->SetLunaTheme( xtpSystemThemeAero); pTangramTabWnd->GetPaintManager()->SetAppearance((XTPTabAppearanceStyle)nStyle); pTangramTabWnd->GetPaintManager()->m_bHotTracking = TRUE; pTangramTabWnd->GetPaintManager()->m_bShowIcons = TRUE; pTangramTabWnd->GetPaintManager()->DisableLunaColors(FALSE); XTPTabColorStyle color = (XTPTabColorStyle)xtpTabColorOffice2003;// m_comboColor.GetItemData(m_nColor); if(nColor) { color = (XTPTabColorStyle)nColor;// m_comboColor.GetItemData(m_nColor); } pTangramTabWnd->GetPaintManager()->SetColor(color); //pTangramTabWnd->GetPaintManager()->SetColorSet(); pTangramTabWnd->GetPaintManager()->SetOneNoteColors(true); pTangramTabWnd->GetPaintManager()->DisableLunaColors(false); * hWnd = (long)pTangramTabWnd->m_hWnd; hr = pTangramTabWnd->m_pTangramTabWndDisp->Release(); return S_OK; } return S_OK; }
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { AfxGetApp()->m_nCmdShow = SW_HIDE; if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; //界面居中显示 this ->CenterWindow(CWnd::GetDesktopWindow()); 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 } m_wndStatusBar.SetPaneInfo(0, m_wndStatusBar.GetItemID(0), SBPS_STRETCH, NULL); m_wndStatusBar.SetPaneInfo(1, m_wndStatusBar.GetItemID(1), SBPS_NORMAL, 485); m_wndStatusBar.SetPaneInfo(2, m_wndStatusBar.GetItemID(2), SBPS_NORMAL, 100); m_wndStatusBar.SetPaneInfo(3, m_wndStatusBar.GetItemID(3), SBPS_NORMAL, NULL); m_wndStatusBar.SetPaneInfo(4, m_wndStatusBar.GetItemID(4), SBPS_NORMAL, NULL); m_wndStatusBar.SetPaneInfo(5, m_wndStatusBar.GetItemID(5), SBPS_NORMAL, NULL); XTPColorManager()->DisableLunaColors(TRUE); if (!m_TrayIcon.Create(_T("Online: 0"), // Toolktip text this, // Parent window IDR_MAINFRAME, // Icon resource ID IDR_MINIMIZE, // Resource ID of popup menu IDM_SHOW, // Default menu item for popup menu false)) // True if default menu item is located by position { TRACE0("Failed to create tray icon\n"); return -1; } /* if (!InitCommandBars()) { return -1; } CXTPCommandBars* pCommandBars = GetCommandBars(); CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME); pMenuBar->SetFlags(xtpFlagAddMDISysPopup); // Create ToolBar CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("Standard"), xtpBarTop); if (!pCommandBar || !pCommandBar->LoadToolBar(IDR_TOOLBAR4)) { TRACE0("Failed to create toolbar\n"); return -1; }*/ // CXTPCommandBarsOptions* pOptions = pCommandBars->GetCommandBarsOptions(); // pOptions->bShowExpandButtonAlways= FALSE; // pOptions->bShowTextBelowIcons = true; // pOptions->bLargeIcons = TRUE; // pCommandBar->GetImageManager()->SetIcons(IDR_TOOLBAR4,IDB_BARNEW); // RedrawWindow(0, 0, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ALLCHILDREN); // GetCommandBars()->GetPaintManager()->RefreshMetrics(); // ModifyStyle(WS_THICKFRAME, 0); // ModifyStyle(0, WS_THICKFRAME); // pCommandBars->GetCommandBarsOptions()->bShowTextBelowIcons = TRUE; // pCommandBars->GetCommandBarsOptions()->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault); XTPColorManager()->DisableLunaColors(TRUE); // pCommandBars->SetTheme(xtpThemeOfficeXP); CXTPPaintManager::SetTheme(xtpThemeVisualStudio2008); /* xtpThemeOffice2000, // Office 2000 theme. xtpThemeOfficeXP, // Office XP theme. xtpThemeOffice2003, // Office 2003 theme. xtpThemeNativeWinXP, // Windows XP themes support. xtpThemeWhidbey, // Visual Studio 2005 theme. xtpThemeVisualStudio2008, // Visual Studio 2008 theme xtpThemeVisualStudio6, // Visual Studio 6 theme xtpThemeVisualStudio2010, // Visual Studio 2010 theme xtpThemeCustom // Custom theme. */ m_paneManager.InstallDockingPanes(this); m_paneManager.SetTheme(xtpPaneThemeVisualStudio2005Beta2); // 设置主题 // xtpPaneThemeOffice2003, // Office 2003 Style Theme // xtpPaneThemeWinNative, // Windows Native Style Theme // xtpPaneThemeVisualStudio2005Beta2, // Visual Studio 2005 Whidbey Beta 2 Style Theme // xtpPaneThemeVisualStudio2008, // Visual Studio 2008 Style Theme // xtpPaneThemeVisualStudio2010, // Visual Studio 2010 Beta 1 Style Theme CXTPDockingPane* pwndPaneLog = CreatePane(20, 141, RUNTIME_CLASS(CLogView), _T(" 日志信息 "), xtpPaneDockBottom); // CXTPDockingPane* pwndPaneTool = CreatePane(20, 141, RUNTIME_CLASS(CTools), _T(" Batch "), xtpPaneDockBottom); // CXTPDockingPane* pwndPaneDDOSFlood = CreatePane(20, 141, RUNTIME_CLASS(CDDOSFlood), _T(" 常规测试1 "), xtpPaneDockBottom); // CXTPDockingPane* pwndPaneDDOSFlood1 = CreatePane(20, 141, RUNTIME_CLASS(CDDOSFlood1), _T(" 常规测试2 "), xtpPaneDockBottom); // CXTPDockingPane* pwndPaneDDOSWeb = CreatePane(20, 141, RUNTIME_CLASS(CDDOSWeb), _T(" Web测试1 "), xtpPaneDockBottom); // CXTPDockingPane* pwndPaneDDOSWeb1 = CreatePane(20, 141, RUNTIME_CLASS(CDDOSWeb1), _T(" Web测试2 "), xtpPaneDockBottom); // CXTPDockingPane* pwndPaneDDOSDNS = CreatePane(20, 141, RUNTIME_CLASS(CDDOSDrDos), _T(" DNS "), xtpPaneDockBottom); // m_paneManager.AttachPane( pwndPaneDDOSFlood, pwndPaneLog ); // m_paneManager.AttachPane( pwndPaneDDOSFlood, pwndPaneTool ); // m_paneManager.AttachPane( pwndPaneDDOSFlood1, pwndPaneDDOSFlood ); // m_paneManager.AttachPane( pwndPaneDDOSWeb, pwndPaneDDOSFlood1 ); // m_paneManager.AttachPane( pwndPaneDDOSWeb1, pwndPaneDDOSWeb ); // m_paneManager.AttachPane( pwndPaneDDOSDNS, pwndPaneDDOSWeb1 ); pwndPaneLog->Select(); pwndPaneLog->SetOptions(xtpPaneNoCloseable|xtpPaneNoHideable|xtpPaneNoFloatable|xtpPaneNoCaption|xtpPaneNoDockable|xtpPaneNoFloatableByTabDoubleClick|xtpPaneNoFloatableByCaptionDoubleClick|xtpPaneNoHoverShow); // pwndPaneTool->SetOptions(xtpPaneNoCloseable|xtpPaneNoHideable|xtpPaneNoFloatable|xtpPaneNoCaption|xtpPaneNoDockable|xtpPaneNoFloatableByTabDoubleClick|xtpPaneNoFloatableByCaptionDoubleClick|xtpPaneNoHoverShow); // pwndPaneDDOSFlood->SetOptions(xtpPaneNoCloseable|xtpPaneNoHideable|xtpPaneNoFloatable|xtpPaneNoCaption|xtpPaneNoDockable|xtpPaneNoFloatableByTabDoubleClick|xtpPaneNoFloatableByCaptionDoubleClick|xtpPaneNoHoverShow); // pwndPaneDDOSFlood1->SetOptions(xtpPaneNoCloseable|xtpPaneNoHideable|xtpPaneNoFloatable|xtpPaneNoCaption|xtpPaneNoDockable|xtpPaneNoFloatableByTabDoubleClick|xtpPaneNoFloatableByCaptionDoubleClick|xtpPaneNoHoverShow); // pwndPaneDDOSWeb->SetOptions(xtpPaneNoCloseable|xtpPaneNoHideable|xtpPaneNoFloatable|xtpPaneNoCaption|xtpPaneNoDockable|xtpPaneNoFloatableByTabDoubleClick|xtpPaneNoFloatableByCaptionDoubleClick|xtpPaneNoHoverShow); // pwndPaneDDOSWeb1->SetOptions(xtpPaneNoCloseable|xtpPaneNoHideable|xtpPaneNoFloatable|xtpPaneNoCaption|xtpPaneNoDockable|xtpPaneNoFloatableByTabDoubleClick|xtpPaneNoFloatableByCaptionDoubleClick|xtpPaneNoHoverShow); // pwndPaneDDOSDNS->SetOptions(xtpPaneNoCloseable|xtpPaneNoHideable|xtpPaneNoFloatable|xtpPaneNoCaption|xtpPaneNoDockable|xtpPaneNoFloatableByTabDoubleClick|xtpPaneNoFloatableByCaptionDoubleClick|xtpPaneNoHoverShow); // XTPColorManager()->DisableLunaColors(TRUE); // CXTPPaintManager::SetTheme(xtpThemeOfficeXP); // LoadCommandBars(_T("CommandBars")); // SetTimer(1,1000,NULL); return 0; }