Resource abnormal paint |
Post Reply |
Author | ||
zhou_wz
Groupie Joined: 11 December 2003 Status: Offline Points: 44 |
Post Options
Thanks(0)
Posted: 21 November 2005 at 5:31am |
|
When I run 9.6 It shows normally like expected.
|
||
zhou_wz
Groupie Joined: 11 December 2003 Status: Offline Points: 44 |
Post Options
Thanks(0)
|
|
|
||
zhou_wz
Groupie Joined: 11 December 2003 Status: Offline Points: 44 |
Post Options
Thanks(0)
|
|
But later it becames like... |
||
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
|
Yes, the line m_wndOutput.SetFont(XTPPaintManager()->GetRegularFont()); good for sample, but not for real application, because CXTPPaintManager::m_fontRegular will be changed after Theme/System Colors changed. In your application better add local variable CFont m_fntOutput and create it for Pane. (to be sure it never changed) |
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
zhou_wz
Groupie Joined: 11 December 2003 Status: Offline Points: 44 |
Post Options
Thanks(0)
|
|
But the system configuration never changed during the sample run. |
||
zhou_wz
Groupie Joined: 11 December 2003 Status: Offline Points: 44 |
Post Options
Thanks(0)
|
|
So I wonder who changed this...
|
||
A42_
Newbie Joined: 18 January 2006 Location: United States Status: Offline Points: 4 |
Post Options
Thanks(0)
|
|
I have a similar problem (Toolkit v9.8) where fonts in certain windows get changed to the System font. This happens whenever the application receives a WM_SETTINGCHANGE as well as under other (not yet identified) circumstances. Additionally, I have a control derived from CXTTreeCtrl in the same app. When the WM_SETTINGCHANGE is processed its font is also messed up. I added a handler for WM_GETFONT like this: HFONT hFont = (HFONT)Default(); LOGFONT lf; ::GetObject( hFont, sizeof LOGFONT, &lf ); return (LRESULT)hFont; Looking at the contents of the LOGFONT structure the HFONT returned is obviously bad: the lfHeight, lfWidth, lfEscapement, lfOrientation, and lfWeight members are all set to -858993460. Also -- if I return NULL from this handler (to indicate that the control should be drawn using the system font) the program crashes when CXTTreeBase dereferences the NULL CFont pointer. I also did another test here and verified that: 1) Before the WM_SETTINGCHANGE the font is the same as PaintManager's "Regular" font. 2) After the WM_SETTINGCHANGE the font is NOT the same as the "Regular" font -- it's the same as the OLD regular font. In short, it looks like the "regular" font is getting destroyed and re-created but that the windows that use it are not updated. |
||
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
|
Just don't use font from PaintManager. Creat variable for class, and create font. it happened because font in PaintManager recreated if system settings are changed. So previously handle not valid anymore...
|
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
A42_
Newbie Joined: 18 January 2006 Location: United States Status: Offline Points: 4 |
Post Options
Thanks(0)
|
|
What about classes that already use PaintManager's fonts? Like CXTTreeCtrl, CXTListView, etc? I'm deriving from those classes and not doing anything to change their fonts. |
||
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
|
Hello, CXTTreeCtrl, CXTListView classes not use PaintManager's font. You must set it. |
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
A42_
Newbie Joined: 18 January 2006 Location: United States Status: Offline Points: 4 |
Post Options
Thanks(0)
|
|
As it turns out, it's the CDockPaneWnd<> template that's responsible. From DockPaneWnd.h:
|
||
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
|
Hi, just remove this line... it is part of application, not toolkitpro... |
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
A42_
Newbie Joined: 18 January 2006 Location: United States Status: Offline Points: 4 |
Post Options
Thanks(0)
|
|
It is part of the sample code you provide showing how to use the toolkit. I can't imagine that I'm the only one to encounter this problem. A better solution would be to add something like the following to the CDockPaneWnd<> template:
|
||
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
|
Hi, in 10.0/10.1 this line was removed already.... |
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
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 |