v17 (final) Forgot Theme on CXTPTreeCtrl |
Post Reply |
Author | |
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
Posted: 12 January 2016 at 10:21am |
It seems that you have not implemented the WM_XTP_SETCONTROLTHEME message handler for the CXTPTreeCtrl.
This means, that calling: SendMessageToDescendants(WM_XTP_SETCONTROLTHEME,nTheme); RedrawWindow(NULL,NULL,RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ALLCHILDREN); as suggested in http://forum.codejock.com/forum_posts.asp?TID=22836&PID=74283&title=one-theme-for-all-controls#74283 to change the theme globally in the app. does not work. -cpede
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
And CXTPListView.
And as far as I can see the CXTPListView does not have any code for theming what so ever, CTXTPTreeView contains some?
-cpede
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
I can see that the CXTPTaskDialog is not themed either :-( Is this something that you plan to do, - or is it something that you don't want to do? I don't want to implement this myself, if you plan to do this in an upcoming release. -cpede
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
Algae
Senior Member Joined: 08 January 2007 Location: United States Status: Offline Points: 217 |
Post Options
Thanks(0)
|
It's relatively simple to configure yourself. I use the old hack:
ON_WM_SYSCOLORCHANGE() // in cpp where you set the theme. I use mainframe since it's global: SendMessageToDescendants(WM_SYSCOLORCHANGE, 0, 0L, TRUE, FALSE); // When you change a theme, the message is posted to descendants of the mainframe. Each module can respond to the message with something similar to that illustrated below: // in header afx_msg void OnSysColorChange(); // in cpp BEGIN_MESSAGE_MAP ON_WM_SYSCOLORCHANGE() // make a handler using the theme value from wherever you set themes from. Again, mine is stored in mainframe. void CMyReportView::OnSysColorChange() { GetReportCtrl().SetTheme(((CMainFrame*)AfxGetMainWnd())->GetReportTheme()); GetReportCtrl().RedrawControl(); } Unless you use WM_SYSCOLORCHANGE for anything else, you should be good to go. Unfortunately, there is no "one theme fits all" integrated method for all controls. It becomes problematic if you want some things to use a common theme and other things you don't - perhaps it requires something like a "theme override" byte for each control? That's how I'd do it The current CJ method offers more flexibility but makes it more difficult to create a single pattern for changing themes. |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
My original question was regarding the difference in the CXTPTreeCtrlView and the CXTPListCtrlView regarding themes.
It is somehow possible to theme the CXTPTreeCtrlView, but there is no code for theming the CXTPListCtrlView. I am aware of the conflict between theming (and skinning) controls, and then the general Windows styles, but I think that this should be up to the programmer to decide. Sometimes (maybe even often) a CXTPTreeCtrlView or CXTPListCtrlView is used in a prominent place in an application, and therefore it would be logical to apply a local theme to it. -cpede
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
Algae
Senior Member Joined: 08 January 2007 Location: United States Status: Offline Points: 217 |
Post Options
Thanks(0)
|
Hello cpede -
Sorry, perhaps I didn't understand your question. I don't know if v. 17 has the same capability as the v. 16.26 I'm using, but it has been possible to theme the header of a CXTPListCtrl for some time. As shown: // xtpControlThemeResource is an XTPControlTheme enum. Any of the enums should work. bool MyListCtrl::Init() { CXTPListCtrl::Init(); HWND hWndHeader = GetDlgItem(0)->GetSafeHwnd(); m_header.SubclassWindow(hWndHeader); m_header.EnablePopupMenus(TRUE); m_header.SetTheme(xtpControlThemeResource); return true; } I agree the developer should be able to choose when and where to apply themes/skins. |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
I'm talking about the standard CXTPListCtrl (a list of items), and the CXTPTreeCtrl (a list of items with different levels). I know that these are inherited directly from the MFC versions, and normally these are using the Windows colors selected.
But since most other controls, button, combo boxes, edit etc. in the XTToolkit are themed, I find it strange that the lists above are not fully themed. Nothing more than that. -cpede
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
adamg
Groupie Joined: 16 July 2018 Status: Offline Points: 32 |
Post Options
Thanks(0)
|
how have you solved the problem with themes? how do you solve the issues with not themed scrollbars? Adam
|
|
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 |