one bug in V10.3 |
Post Reply |
Author | |
tNgLoo
Groupie Joined: 21 April 2005 Status: Offline Points: 31 |
Post Options
Thanks(0)
Posted: 02 August 2006 at 9:04am |
I try to modify the DialogSample that 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
} |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hmm.
yes, problem. :(
Workaround for now is call XTPSkinManager()->ApplyWindow(m_hWnd); after pRibbonBar->EnableFrameTheme();
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
andujar
Newbie Joined: 02 August 2006 Location: United States Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Hello - I rebuilt my existing application embedding the theme/skin into the exe and am experiencing the same exact issue. The suggesstion did not fix it. I played around with XTPSkinManager()->SetApplyOptions(xtpSkinApplyMetrics); // shows correct window border but nothing else is themed (reportcontrol header, title bars, scrollbars, etc) XTPSkinManager()->SetApplyOptions(xtpSkinApplyMetrics|xtpSkinApplyColors); // shows correct window border and reportcontrol headers, but scrollbars are non-themed XTPSkinManager()->SetApplyOptions(xtpSkinApplyMetrics|xtpSkinApplyColors|xtpSkinApplyFrame); //everything is themed but the window border is broken as per the first post of this thread. Thanks |
|
tNgLoo
Groupie Joined: 21 April 2005 Status: Offline Points: 31 |
Post Options
Thanks(0)
|
I have a not so good solution:
In each dialog that with skin and ribbon, add XTPSkinmanager()->SetAutoApplyNewWindow(FALSE); to constructor, and just after pRibbonBar->EnableFrameTheme(); , add XTPSkinManager()->ApplyWindow(m_hWnd); XTPSkinmanager()->SetAutoApplyNewWindow(TRUE);
any dialog will will be skined.
But when such dialog resize, all controls, child windows in it flick. And when this dialog close, all windows in the desktop do redraw
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Another solution is fix sources -
replace in XTPSkinObjectFrame.cpp
BOOL CXTPSkinObjectFrame::IsCustomDrawFrame()
{ #ifdef _XTP_ACTIVEX if (HasCaption()) return FALSE; if (SendMessage(m_nCustomDrawFrameMessage) != 0)
return TRUE; #endif return FALSE; } :(
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
andujar
Newbie Joined: 02 August 2006 Location: United States Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Oleg -
1. what do I need to rebuild to make that source change effective? Is there a simple script that will update just the necessary file(s) or do I need to rebuild everything (which obviously takes a long time and I'd like to avoid if possible).
2. are there any other side effects to this update? or is this the "official" fix?
Thanks.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
1. Make this fix and run Deployment wizard
2. this changes was made for ActiveX, but they break MFC version :( So, yes, it is official fix.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
Oleg, have you considered to release bug fixes so that not every customer has to patch his files himself?
I guess you are using some version system (CVS, Perforce, MKS, ...) so whenever you release a new version you should move it into the trunk / release depot and then branch a bugfix tree from there.
You could then release a zip file with the updated source files or a diff file to apply the patches.
That would result in a better customer experience. Of course as soon as a new release is out you should stop the bugfixes for the previous one.
|
|
Codejock support
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Yes, may be we will release 10.3.1 or something with this fix...
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
tNgLoo
Groupie Joined: 21 April 2005 Status: Offline Points: 31 |
Post Options
Thanks(0)
|
Not fully fix! Click the program's icon in the taskbar to minimize/restore the program, each time we minimizing the window, the entire destop redraws.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
:( yes, fixed for next update.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
tNgLoo
Groupie Joined: 21 April 2005 Status: Offline Points: 31 |
Post Options
Thanks(0)
|
when the dlg minimized (IsIconic() == TRUE), FlashWindow() also cause the desktop and some programs(e.g. MS_WORD, photoShop...) redraw.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |