Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » How to make minor modifications to a CExtPaintManager? Collapse All
Subject Author Date
Offer Har Feb 21, 2007 - 7:19 PM

Dear Support,

I am using in my application the CExtPaintManagerOffice2007_R3_Obsidian as my installed paint manager.
I need to make minor modifications to it (change the default font color, use s different shade of gray as the dialogs background color)
What is the simplest way to achieve these goals?
Is there any tutorial on how to do it?

Thanks,
Ron.

Technical Support Feb 22, 2007 - 10:59 AM

The most Prof-UIS classes use the g_PaintManager->m_FontNormal font stored in the global paint manager. This allows you to easily change the entire GUI font (see the FunnyBars sample for details).

You can see how all the color constants are initialized in the CExtPaintManager::InitTranslatedColors() method and it is overridden in other paint managers . You can change any of them according to your requirements. As for the background gradient colors, simply override InitTranslatedColors() and modify the _2003CLR_GRADIENT_DARK and _2003CLR_GRADIENT_LIGHT constants.

You can set a custom paint manager in this way:

g_PaintManager.InstallPaintManager( new CYourPaintManager );



Offer Har Feb 22, 2007 - 11:03 AM

Are there any guidelines for deriving my own paint manager?
Can I derive my custom paint from any existing paint class?
Is there minimal function set i must implement?

Thanks,
Ron.

Technical Support Feb 23, 2007 - 2:22 AM

We implemented these paint manager classes as an internal and ready-to-use part of the framework. Actually to create a new paint manager, you would have to override most of the virtual methods. So the easiest way to create a new theme is to override InitTranslatedColors() method of an existing paint manager and set new custom colors.

Offer Har Feb 23, 2007 - 9:46 AM

Dear Support,

Is there any documentation of all the various values of the enums e_2003_colors_t, e_xp_colors_t and e_translated_colors_t?

There are so me values...

Thanks,
Ron.

Technical Support Feb 24, 2007 - 12:25 PM

The color constants are internal parts of different Prof-UIS paint managers which also have the status of internal parts of the library.

Offer Har Feb 23, 2007 - 8:36 AM

SO, if i derive a class from CExtPaintManagerOffice2007_R3_Obsidian, implement the virtual InitTranslatedColors, call the base class implementation and then do some color changes it should be fine?

Thanks,
Ron.

Technical Support Feb 24, 2007 - 12:08 PM

First of all the Office 2007 theme is colorizable only partially because it is partially based on bitmaps. We recommend to use the Office 2003 theme if you want to colorize everything like you can see in the ThemeColorizer sample application. The Office 2007 themes in fact is a colorized version of the Office 2003 theme plus a set of bitmap based painting algorithms for such UI items as push/check/radio buttons, combo boxes and non client window areas. The colorization is based on two colors: accent color and background color. All the other colors are computed from these two base colors in the InitTranslatedColors() method. If you choose the colorization based on the InitTranslatedColors() method, then we recommend you copy its body from the base class and compute all the colors like you wish. A simpler way is based on the meant above two colors only and the CColorizedThemeOffice2003 class from the ThemeColorizer sample application is a ready to use solution where custom accent/background colors are provided by the OnQueryThemeColors() virtual method.

Borremans Pierre Nov 7, 2009 - 12:30 AM

How to modify only the statusbar color ?

Borremans Pierre Nov 7, 2009 - 12:41 AM

How to modify only the background color of the statusbar and the mainframe menu ?

Technical Support Nov 8, 2009 - 10:43 AM

Prof-UIS supports inherited background painting feature. This feature is demonstrated in the TabbedBars sample application. The view window is a One Note tab page container with 3 colored tabs. The last tab page is the dialog which allows you to configure the inherited background painting in scope of main frame window and one note tab page container window. We discussed this in these threads:

http://www.prof-uis.com/prof-uis/tech-support/faq/miscellaneous.aspx#how-to-paint-a-custom-background-consistent-between-the-windows-in-my-application
http://www.prof-uis.com/prof-uis/tech-support/general-forum/custom-background-colour-for-cextresizabledialog-54409.aspx
http://www.prof-uis.com/prof-uis/tech-support/general-forum/how-to-change-background-color-of-a-modeless-dialog-box-64189.aspx
http://www.prof-uis.com/prof-uis/tech-support/general-forum/handling-wm_paint-message-for-cextresizabledialog-61578.aspx

And, of course, the status bar is also painted using the inherited background. You can use this feature for painting status bar only.

The popup menu uses its own CExtPopupMenuWnd::g_nMsgPopupDrawBackground registered message. You can see how to use it in the ProfUIS_Controls sample application (CPagePopupMenus::OnExtMenuDrawBackground()).