Print Page | Close Window

one bug in V10.3

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4698
Printed Date: 21 November 2024 at 10:02am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: one bug in V10.3
Posted By: tNgLoo
Subject: one bug in V10.3
Date 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
}



Replies:
Posted By: Oleg
Date Posted: 02 August 2006 at 9:20am
Hmm.
yes, problem. :(
 
Workaround for now is call XTPSkinManager()->ApplyWindow(m_hWnd); after pRibbonBar->EnableFrameTheme();


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: andujar
Date Posted: 02 August 2006 at 11:02am

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() in that same location and came up with these results:

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



Posted By: tNgLoo
Date Posted: 02 August 2006 at 11:28am
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 redrawConfused


Posted By: Oleg
Date Posted: 02 August 2006 at 11:40am
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


Posted By: andujar
Date Posted: 02 August 2006 at 12:08pm
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.


Posted By: Oleg
Date Posted: 02 August 2006 at 12:47pm
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


Posted By: ABuenger
Date Posted: 03 August 2006 at 3:21pm
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


Posted By: Oleg
Date Posted: 03 August 2006 at 3:24pm
Hi,
Yes, may be we will release 10.3.1 or something with this fix...


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: tNgLoo
Date Posted: 03 August 2006 at 9:51pm
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.


Posted By: Oleg
Date Posted: 04 August 2006 at 8:38am
:( yes, fixed for next update.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: tNgLoo
Date Posted: 08 August 2006 at 10:27pm
when the dlg minimized (IsIconic() == TRUE),  FlashWindow() also cause the desktop and some programs(e.g.  MS_WORD, photoShop...) redraw.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net