Glass-Control
-
Is it possible to give glass to ONE single control (toolbar,...) of a dialog-based application, which is otherwise "normal" ?? I am using WTL and ATL with VC 2005. Maybe this glass-control can be separated into an activex-control.
-
Is it possible to give glass to ONE single control (toolbar,...) of a dialog-based application, which is otherwise "normal" ?? I am using WTL and ATL with VC 2005. Maybe this glass-control can be separated into an activex-control.
-
Thank you very much for your answer. I have already seen you article and thats the reason i think it MUST work, somehow. But i don't see how to create a glass-toolbar in a dialog-based application. In your extension the function CreateAeroToolBarCtrl() is only available for WTL::CFrameWindowImpl. Maybe i miss a thing, but i can't see. Hoping for a (positive) response. :rose: :) :rose: JJ
-
Thank you very much for your answer. I have already seen you article and thats the reason i think it MUST work, somehow. But i don't see how to create a glass-toolbar in a dialog-based application. In your extension the function CreateAeroToolBarCtrl() is only available for WTL::CFrameWindowImpl. Maybe i miss a thing, but i can't see. Hoping for a (positive) response. :rose: :) :rose: JJ
Hi Jürgen,
Jürgen Jung wrote:
But i don't see how to create a glass-toolbar in a dialog-based application. In your extension the function CreateAeroToolBarCtrl() is only available for WTL::CFrameWindowImpl. Maybe i miss a thing, but i can't see.
- Derive your dialog from
aero::CDialogImpl
and chain the message map as shown in the article. - Declare in your dialog class aaero:CToolbarCtrl
variable, saym_ATB
. - In yourOnInitDialog()
handler: + withm_ATB
create the toolbar control if it is not part of the DIALOGTEMPLATE resource, or subclass it. +SetOpaque()
the dialog client area except the toolbar rectangle. That should be enough to get what you want:) For instance, with any of the article's sampleCAboutDlg
, remove theIDC_STATIC
group box to get some room and in aboutdlg.h:// aboutdlg.h : interface of the CAboutDlg class
// ...
class CAboutDlg : public aero::CDialogImpl<CAboutDlg>
{
public:
enum { IDD = IDD_ABOUTBOX };
aero::CToolBarCtrl m_ATB; // added
// ...
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CenterWindow(GetParent());
// create the toolbar and aero enable it
CToolBarCtrl tb = AtlCreateSimpleToolBar(m_hWnd, IDR_MAINFRAME);
aero::Subclass(m_ATB, tb);
// compute the opaque rectangle
RECT rClient, rTB;
GetClientRect(&rClient);
m_ATB.GetWindowRect(&rTB);
rClient.top += rTB.bottom - rTB.top;
// Set the opaque area
SetOpaque(rClient);return FALSE;
}
If you need to follow-up on this thread, better do it in the article forum. cheers, AR