How to change a skin attribute at runtime |
Post Reply |
Author | |
Sergio
Senior Member Joined: 18 September 2006 Status: Offline Points: 216 |
Post Options
Thanks(0)
Posted: 26 March 2012 at 5:27am |
Hello,
I would like to know how can I change the attribute (dialog background color) of a skin after having loaded it. I'm currently using Codejock version 15.2.1. I have tried : XTPSkinManager()->GetSchema()->GetMetrics()->m_clrTheme[COLOR_BTNFACE + TMT_FIRSTCOLOR] = RGB(255,0,0); or XTPSkinManager()->GetSchema()->CreateProperty(_T("BtnFace"), XTP_SKINPROPERTY_COLOR, _T("230;230;230")); or XTPSkinManager()->GetSchema()->GetProperty(?) // ----> This method isn't public. or XTPColorManager()->SetColor(COLOR_BTNFACE, RGB(255,0,0)); XTPColorManager()->RefreshColors(); Please help, thanks. Regards,
|
|
Sergio
|
|
Sergio
Senior Member Joined: 18 September 2006 Status: Offline Points: 216 |
Post Options
Thanks(0)
|
Please help !
|
|
Sergio
|
|
Sergio
Senior Member Joined: 18 September 2006 Status: Offline Points: 216 |
Post Options
Thanks(0)
|
Hello,
We now really need this feature. Could you please answer? We want to modify skin attributes at runtime upon specific criterions, and we always want to use your skin project files without having to update them for each release. Thanks in advance.
|
|
Sergio
|
|
Algae
Senior Member Joined: 08 January 2007 Location: United States Status: Offline Points: 217 |
Post Options
Thanks(0)
|
Hello Sergio,
I'm not sure if this will help you since I am somewhat unclear about your request and I do not have your version readily available. At any rate, setting this permits skin colors to be applied: XTPSkinManager()->SetApplyOptions(dwApplyOptions | xtpSkinApplyColors); Also some "theme" types require setting the Luna for colors as well. See: SetLunaTheme(XTPCurrentSystemTheme systemTheme) Most of the skin features are illustrated within SkinMDISample. As far as I know, skins and colors can be dynamically changed readily but require lots of screen element redrawing. This could become a performance issue if you did it a lot. |
|
Sergio
Senior Member Joined: 18 September 2006 Status: Offline Points: 216 |
Post Options
Thanks(0)
|
Hello Algae,
We just need to do that when the application starts. We want to avoid having to change every time the Office2010.cjstyles on the Skin Builder to merge our changes in a new Codejock Release. This is time consuming and not really easy to do. So, we would like to load the factory skin Office2010 and then just update it by source code, and we won't have to make changes in Codejock folder anymore. Could you please give us (just the line of code):
Thanks in advance,
|
|
Sergio
|
|
Algae
Senior Member Joined: 08 January 2007 Location: United States Status: Offline Points: 217 |
Post Options
Thanks(0)
|
Combobox border color. Create a brush, then get XTPComboboxTheme to DrawBackground or DrawFrame. DrawFrame(pDC->GetSafeHdc(), rc, 3, hBrush); *See XTPComboBoxTheme.cpp Tab control. m_wndTabControl.GetPaintManager()->SetColor(xtpTabColorVisualStudio2010); * See sample: GUI_OneNote Bitmap background. I don't know of a CJ method for this. There may be one but this is what I use. It really depends on the background but this puts a bitmap on a designated client rect .. stretched to fit. Change the Blt to desired style. // header CBitmap m_bmp; // init somewhere m_bmp.LoadBitmap(IDB_MYBITMAP); // bitmap resource // cpp CPaintDC dc(this); // device context for painting CRect rClient; // where idc_bitmap_rect is your background area CWnd *pWnd = (CWnd*)GetDlgItem(IDC_BITMAP_RECT); pWnd->GetWindowRect(&rClient); ScreenToClient(&rClient); CDC MemDC; BITMAP bit; m_bmp.GetBitmap(&bit); MemDC.CreateCompatibleDC(&dc); MemDC.SelectObject(m_bmp); dc.StretchBlt(rClient.left, rClient.top, rClient.Width(), rClient.Height(), &MemDC, 0, 0, bit.bmWidth, bit.bmHeight, SRCCOPY); DeleteObject(MemDC); This is probably not as complete as you might like, but should point you in the right direction. Hope it helps out. |
|
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 |