comes with the XTP with the office2007 skin and ribbon supported. in V10.2, it works well. but in V10.3 the dialog, this becomes strange.
1. with only skined or ribbon-ed, it's good.
2. with skin (any style, ehter office2007 or winxp.blue) and ribbon together:
a) left side and right side disappered, and no resize crusor when mouse moves on the left/right side.
b) when resize (through left-bottom/ right-bottom corner), the dialog without redraw
all my modifycations are in the OnInitialDIalog:
------
BOOL CDialogSampleDlg::OnInitDialog()
{
SetFlag(xtResizeNoSizeIcon);
CDialogSampleDlgBase::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
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, ID_SEPARATOR, SBPS_STRETCH, 100);
VERIFY(InitCommandBars());
CXTPCommandBars* pCommandBars = GetCommandBars();
{ // commented
//OnTheme(ID_THEME_WHIDBEY);
//pCommandBars->SetMenu(_T("Menu Bar"), IDR_MENU);
//CXTPToolBar* pToolBar = pCommandBars->Add(_T("Standard"), xtpBarTop);
//pToolBar->LoadToolBar(IDR_TOOLBAR);
//((CXTPControlButton*)pToolBar->GetControls()->FindControl(xtpControlButton, ID_BUTTON_PLAY, TRUE, FALSE))->SetStyle(xtpButtonIconAndCaption);
//((CXTPControlButton*)pToolBar->GetControls()->FindControl(xtpControlButton, ID_BUTTON_STOP, TRUE, FALSE))->SetStyle(xtpButtonIconAndCaption);
//((CXTPControlButton*)pToolBar->GetControls()->FindControl(xtpControlButton, ID_BUTTON_PAUSE, TRUE, FALSE))->SetStyle(xtpButtonIconAndCaption);
//pToolBar->GetControls()->CreateOriginalControls();
}
XTPImageManager()->SetIcons(IDR_MAINFRAME);
pCommandBars->GetCommandBarsOptions()->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault);
pCommandBars->GetToolTipContext()->SetStyle(xtpToolTipOffice);
pCommandBars->GetShortcutManager()->SetAccelerators(IDR_ACCELERATOR);
{//new insert
XTPSkinManager()->SetApplyOptions(xtpSkinApplyFrame | xtpSkinApplyColors);
XTPSkinManager()->LoadSkin("styles/Office2007.cjstyles"); //WinXP.Luna.cjstyles
XTPSkinManager()->ApplyWindow(m_hWnd);
//pCommandBars->SetTheme(xtpThemeRibbon);
CXTPPaintManager::SetTheme(xtpThemeRibbon);
HMODULE hModule = LoadLibrary(_T("styles/Office2007Blue.dll"));
CXTPRibbonTheme * pTheme = new CXTPRibbonTheme();
pTheme->SetImageHandle(hModule);
pCommandBars->SetPaintManager(pTheme);
CMenu menu;
menu.LoadMenu(IDR_MENU);
CXTPRibbonBar* pRibbonBar = (CXTPRibbonBar*)pCommandBars->Add(_T("The Ribbon"), xtpBarTop, RUNTIME_CLASS(CXTPRibbonBar));
if (!pRibbonBar)
{
return FALSE;
}
pRibbonBar->EnableDocking(0);
CXTPControlPopup* pControlFile = (CXTPControlPopup*)pRibbonBar->AddSystemButton(IDR_MENU);
pControlFile->SetCommandBar(menu.GetSubMenu(0));
pRibbonBar->EnableFrameTheme();
}
LoadCommandBars(_T("CommandBars"));
SetResize(IDC_SLIDER1, SZ_BOTTOM_LEFT, SZ_BOTTOM_RIGHT );
SetResize(IDC_STATIC_POSITION, SZ_TOP_LEFT, CXTResizePoint( 0.3f, 1) );
SetResize(IDC_STATIC_RECT, CXTResizePoint( 0.3f, 0), CXTResizePoint( 0.6f, 1) );
SetResize(IDC_STATIC_LENGTH, CXTResizePoint( 0.6f, 0), CXTResizePoint( 1, 1) );
RepositionControls();
m_szMin = m_rcWindow.Size();
AutoLoadPlacement(_T("Placement"));
return TRUE; // return TRUE unless you set the focus to a control
}