int CColorPopup::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CBCGPToolBar::IsCustomizeMode () && !m_bEnabledInCustomizeMode) { // Don't show color popup in cistomization mode return -1; } if (CMiniFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; DWORD toolbarStyle = dwDefaultToolbarStyle; if (GetAnimationType () != NO_ANIMATION && !CBCGPToolBar::IsCustomizeMode ()) { toolbarStyle &= ~WS_VISIBLE; } if (!m_wndColorBar.Create (this, toolbarStyle | CBRS_TOOLTIPS | CBRS_FLYBY, 1)) { TRACE(_T ("Can't create popup menu bar\n")); return -1; } CWnd* pWndParent = GetParent (); ASSERT_VALID (pWndParent); m_wndColorBar.SetOwner (pWndParent); m_wndColorBar.SetBarStyle(m_wndColorBar.GetBarStyle() | CBRS_TOOLTIPS); ActivatePopupMenu (BCGCBProGetTopLevelFrame (pWndParent), this); RecalcLayout (); return 0; }
int TexturePopup::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMFCToolBar::IsCustomizeMode ()) { // Don't show color popup in customization mode return -1; } if (CMiniFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; DWORD toolbarStyle = AFX_DEFAULT_TOOLBAR_STYLE; if (GetAnimationType () != NO_ANIMATION && !CMFCToolBar::IsCustomizeMode ()) { toolbarStyle &= ~WS_VISIBLE; } mPicture.Create("", WS_VISIBLE|WS_CHILD|SS_BITMAP, CRect(0, 0, 64, 64), this); mPicture.SetBitmap(MiscUtils::loadBitmap(mTexName, 64)); SetCapture(); SetWindowPos(NULL, 0, 0, 70, 90, SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE); return 0; }