/**
 * WM_CREATE handler. Creates the tab window as child window. Installs
 * ourselves as context menu owner. Adds one custom pane and activates
 * this pane.
 *
 * @param           lpCreateStruct: creation information
 * @return          0 on success, -1 on failure
 * @exception       -
 * @see             
*/
int CWatchWindow::OnCreate (LPCREATESTRUCT lpCreateStruct) 
{
    if (SECControlBar::OnCreate (lpCreateStruct) == -1)
        return (-1);

    DWORD style = GetExBarStyle();
    style |= CBRS_EX_STDCONTEXTMENU;
    style |= CBRS_EX_ALLOW_MDI_FLOAT;
    SetExBarStyle(style);

    if (m_pTabWindow == NULL)
        return (-1);

    if (!m_pTabWindow->Create (this, WS_CHILD | WS_VISIBLE | TWS_FULLSCROLL | TWS_TABS_ON_BOTTOM | TWS_NOACTIVE_TAB_ENLARGED | TWS_DYNAMIC_ARRANGE_TABS))
        return (-1);

    m_pTabWindow->SetContextMenuOwner (this);

    if(AddCustomPane() == -1)
    {
        return -1;
    }

    ActivateTab(0);
    
    return (0);
}
Beispiel #2
0
HRESULT CTRiASToolBar::SetBarStyleEx (LPCSTR pcName, DWORD dwStyle, DWORD dwStyleEx, bool fDelay)
{
	AFX_MANAGE_STATE(AfxGetModuleState());
    ASSERT_VALID(this);
    ASSERT(::IsWindow(m_hWnd));

// Sichtbar/unsichtbar
bool fWasVisible = (GetStyle() & WS_VISIBLE) ? true : false;
bool fMadeVisible = (WS_VISIBLE & dwStyle) ? true : false;

// Style ändern
#if _MSC_VER >= 1200
	dwStyle &= CBRS_ALL;
#endif // _MSC_VER >= 1200
	SetBarStyle (dwStyle);
	m_pMainFrm -> ShowControlBar (this, fMadeVisible, fDelay);

// sonstige Flags
#if !defined(_USE_SEC_CLASSES)
	m_dwFlags = dwStyleEx;
#else
	m_dwFlags = dwStyleEx & TRIASTOOLBAR_FLAGS;		// TRiASExFlags
	SetExBarStyle (dwStyleEx & ~TRIASTOOLBAR_FLAGS, fWasVisible && fMadeVisible);	// SEC-ExFlags
	if(m_dwExStyle & CBRS_EX_COOLBORDERS)
		Invalidate();

	if (fWasVisible || fMadeVisible)
		m_pMainFrm -> DelayRecalcLayout();		// evl. neu zeichnen
#endif // _USE_SEC_CLASSES

// Caption neu setzen
	if (NULL != pcName)		
		SetWindowText (pcName);

	return NOERROR;
}