Professional UI Solutions
Site Map   /  Register


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 General Discussion » How to make a CExtRibbonOptionsPage dialog show a themed caption when used as a standalone dialog? Collapse All
Subject Author Date
Doug Pfiffner May 16, 2012 - 10:09 AM

We use some dialogs both as pages within a CExtRibbonOptionsDialog and as standalone dialog boxes. To accomplish this, we indirectly derive our dialogs from CExtRibbonOptionsPage. The dialog template is configured for normal standalone use; when used as a page, we remove styles as appropriate (WS_CAPTION, WS_POPUP, WS_SYSMENU, ...) and add others (WS_CHILD, WS_CLIPxxxx, ...). It all works fine except for one thing: the dialog’s caption is not themed in the standalone case (presumaby because the CExtRibbonOptionsPage does not support painting a caption since it normally does not have one).

So, in the standalone case, how can we force the caption to be painted themed as it would be for a CExtResizableDialog-derived dialog?

We use Prof-UIS v2.84

Thanks in advance for your prompt reply.

Doug Pfiffner May 23, 2012 - 8:44 PM

Sorry, in my previous message the figures were reversed.

Doug Pfiffner May 23, 2012 - 8:42 PM

We plan to switch to the latest Prof-UIS version after this release but we can’t do it right now as we’re very close to releasing the product and it would be too big of a risk to switch libraries at this late stage. So we need a workaround in the meanwhile.

I think there may be a misunderstanding as to what the problem is. It is not the Options dialog that’s not themed, but its pages, when used as standalone dialogs. To reiterate what we are doing:

- We have several dialog templates in our resource files that are used both as standalone dialogs *and* as pages in the Options dialog.

- The templates themselves are configured in the resource files for use as standalone dialogs (the "standard" way).

- The associated C++ classes are all derived from our own CCustomDialog class. And CCustomDialog is in turn derived from CExtRibbonOptionsPage, not CExtResizableDialog (otherwise we wouldn’t be able to use the dialogs as pages in the Options dialog).

- CCustomDialog knows whether it is being used as a standalone dialog or as a page (in the Options dialog). When used as a page, it will automatically remove inappropriate styles (such as WS_CAPTION, WS_POPUP, WS_SYSMENU, etc.) and add necessary ones (such as WS_CHILD, WS_CLIPxxxx, etc.). This is done in PreSubclassWindow and OnInitDialog.

- The problem is that when the dialog template is used as a standalone dialog, its caption will not appear themed (see figure 1). This is not a problem when used as a page within the Options dialog since, in this case, there is no caption (see figure 2).

Since CExtRibbonOptionsPage is itself derived from CExtResizableDialog, it should be able to properly paint the caption as themed, if there is one, but it doesn’t. How can we work around this problem?

Figure 1 (no problem)

Figure 2 (caption is not themed)


Technical Support May 28, 2012 - 11:30 AM

The CExtNCW template class provides themed popup window borders and caption - not CExtResizableDialog and not ribbon options page. We think you should create a stand-alone child (dialog) window and then create it inside ribbon options page and inside popup dialog.

Technical Support May 23, 2012 - 11:47 AM

Why not to switch to the newer Prof-UIS version?

Technical Support May 23, 2012 - 11:45 AM

We made ribbon options windows themed in the later Prof-UIS versions. This requires changing base classes of options dialog and page windows.

Doug Pfiffner May 18, 2012 - 1:45 PM


I would appreciate a response to my query. CExtRibbonOptionsPage is derived from CExtResizableDialog, so it should properly paint the caption as themed if there is one, but it doesn’t. How can we work around this problem?