Find out which colours are in use when using the MFC Feature pack in Office 2007 style - colors

I'm updating some of our legacy C++ code to use the "MFC feature pack" that Microsoft released for Visual Studio 2008. We've used the new classes to derive our application from CFrameWndEx, and are applying the Office 2007 styles to give our application a more modern appearance. This gives us gradient filled window titles, status bars etc, and the use of the ribbon toolbars.
However, our application contains some owner drawn controls, and I'd like to update these to match the color scheme used by the feature pack. Ideally I'd like to know the light and shaded toolbar colors that are currently in use.
I've had a hunt around the documentation and web and have not yet found anything. Does anyone know how to find this information out?
[Edit]
In particular we need to find out which colors are being used at runtime. You can change the appearance of your application at runtime using the new static function CMFCVisualManager::SetDefaultManager.
The following msdn page shows you what kind of styles are available, in particular the Office2007 look:
link to msdn

Have you looked in the MFC source code, which you'll find in something like
C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc

Looks like CMFCVisualManager offers several methods for getting color information, e.g.
CMFCVisualManager::GetSmartDockingBaseGuideColors()
CMFCVisualManager::GetToolbarHighlightColor()
Take a look at the MSDN docs for CMFCVisualManager.
Good suggestion, but unfortunately they just return various shades of grey, when currently I'm running my application with the style CMFCVisualManagerOffice2007::Office2007_LunaBlue
Annoyingly the msdn help is "under construction" so doesn't even tell you what they are supposed to be doing!

afxGlobalData contains some useful information on the current colours, brushes and fonts being used by the MFC Feature Pack. In particular I use afxGlobalData.m_clrBarFace when painting my own control bar backgrounds.
(note that I am not in front of my work PC so the above syntax isn't spot on.)

Have you tried: 2007 Office System Document: UI Style Guide for Solutions and Add Ins
?

I guess you could use your favourite image editor and pick the colors from a screen grab.

"I guess you could use your favourite image editor and pick the colors from a screen grab."
This is essentially what I'm doing at the moment, and I've defined a list of constants from which I pull out the colours. Doesn't seem very elegant though!

Looks like CMFCVisualManager offers several methods for getting color information, e.g.
CMFCVisualManager::GetSmartDockingBaseGuideColors()
CMFCVisualManager::GetToolbarHighlightColor()
Take a look at the MSDN docs for CMFCVisualManager.

#GateKiller, the OP isn't developing an Office 2007 add-in, so the UI guidelines won't really help. It's an MFC application using the Visual C++ 2008 Feature Pack which allows MFC apps to take on the Office 2007 look and feel.

Good suggestion, but unfortunately they just return various shades of grey, when currently I'm running my application with the style CMFCVisualManagerOffice2007::Office2007_LunaBlue
CMFCVisualManagerOffice2007::GetTabFrameColors - the clrFace output param is grey?
Perhaps they're all masks on top of a single base hue for each theme? Assuming you can determine which color scheme is in effect with CMFCVisualManagerOffice2007::GetStyle(), perhaps you can figure out what that hue is and then do some masking with the GetxxxColor() methods.

Related

Custom linked Quick Style presets in Powerpoint 2013?

I am newbie in Powerpoint and have a very weird problem. Is it possible somehow to add my own shape styles to Quick Styles? If I choose one of presets and then change something (color fill for example) this style is not anymore linked to quick style. And I can't find how to add on my own. And delete all that I don't need.
Any thoughts how to achieve that? I want to create my own shape styles. And link them all over the presentation in order to change quickly color schemes of all elements in presentation. I want to change one linked style to automatic apply to all shapes. Is it possible somehow?
Thanks,
Peter
We are building a PowerPoint add-in to do that. You are able to create styles (and select the attributes like color position etc.) then store them to a Library for later use / sharing. Let me know if you are interested to test the current version.

Android Layout Shape Design

How can I create a layout similar to this, using shapes?
there are various tools available in market for good UI designing in android, also you can use intelli j idea as an IDE and go for its tutorials ,other links like appinventor , droidDraw will also help you to make a good looking and impressive UI.
also if you want to create exact UI just like that you can use frameLayout in xml.and design it accordingly.

How can I add a button at the end of a listView?

Iwould like to add a button at the end of a listView in the same way as the bing apps do (see picture for example).
I looked for hours in google and in the microsoft documentation but canøt find anything that can give me an idea of how to do this.
Did anyone achieved this?
thanks
If you run that app (Health & Fitness), then run Visual Studio and use Debug > Attach to Process, you can open the DOM Explorer and examine how that UI is implemented.
What you'll see in this case is that it's not using a ListView at all, but rather it's own custom control that's just based on a CSS grid. That is, just because there's a grid-like view doesn't mean it's a ListView. You can always use straight HTML/CSS layout to achieve these sorts of things, which is all that's happening here. As such, it just makes separate div's for those two "More" elements.
Now if you do want to use a ListView, there are a few things you can do. First of all, if you want to render any item in a ListView differently than others, you have to make sure to use a different template. What this means is that you use an item rendering function rather than a declarative template, which then enables you to examine the item data and programmatically decide what kind of rendering to perform.
Second, if you want to have items of different sizes, then you need to use cell spanning. In Windows 8.0/WinJS 1.0 this is a property of the GridLayout. In Windows 8.1/WinJS 2.0 you instead use the CellSpanningLayout.
I have all the details for both rending functions and cell spanning written up in Chapter 7 of my second edition preview of Programming Windows Store Apps with HTML, CSS, and JavaScript, which is a free ebook from Microsoft Press so it doesn't cost you anything. :)

Teechart on Monotouch: where is the documentation?

Downloaded eval for Teechart for Monotouch iOS. Looks very promising. Could not find documentation though except windows help chm. Are there any docs available on the web?
Also running an example on iPad discovered that pan and zoom are extremely slow unless set to Auto.
chart3.Chart.Aspect.ZoomScrollStyle = Steema.TeeChart.Drawing.Aspect.ZoomScrollStyles.Auto;
Why?
Downloaded eval for Teechart for Monotouch iOS. Looks very promising. Could not find documentation though except windows help chm. Are there any docs available on the web?
Yes, you can download on our web site throught this link.
Also running an example on iPad discovered that pan and zoom are extremely slow unless set to Auto.
Why?
This was the reason we introduced the ZoomScrollStyles property, setting it to Auto, the chart will use the standard zoom and scroll gestures used for iOS (for most common 2D chart styles), meanwhile setting it to Manual, the chart will make use of the default zoom and scroll functionality based on the TeeChart for NET product.

How to change the shape of a button in visual c++?

Is there an easy way to change the shape of a button in a form?
There could be other ways, but if you are not using WPF, you can use Images for buttons.
If you are using WPF, there are lots of options you can explore.
This might be a bit old, but may point the way, look at ownerdraw properties and styles and messages. http://msdn.microsoft.com/en-us/library/ms364048(v=vs.80).aspx
As an aside why would you want to change the shape of the button. Bear in mind your users, they more than likely don't like change.
You are referring to Ownerdraw buttons. The following links shall help you.
http://www.codeproject.com/KB/buttons/roundbuttons.aspx
how to create a round/circular button in win32 API using visual c++

Resources