本文整理匯總了C++中EnableDocking函數的典型用法代碼示例。如果您正苦於以下問題:C++ EnableDocking函數的具體用法?C++ EnableDocking怎麽用?C++ EnableDocking使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EnableDocking函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: TRACE0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
/*if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}*/
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
m_wndStatusBar.SetPaneInfo(0,ID_SEPARATOR,SBPS_POPOUT|SBPS_STRETCH,200);
m_wndStatusBar.SetPaneInfo(1,ID_INDICATOR_USER,SBPS_POPOUT,150);
m_wndStatusBar.SetPaneInfo(2,ID_INDICATOR_ISADMIN,SBPS_POPOUT,150);
m_wndStatusBar.SetPaneInfo(3,ID_INDICATOR_DATE,SBPS_POPOUT,150);
CTime lt = CTime::GetCurrentTime();
CString txt ;
txt.Format("日期: %d年%d月%d日",lt.GetYear(),lt.GetMonth(),lt.GetDay());
m_wndStatusBar.SetPaneText(3,txt);
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
// m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
// DockControlBar(&m_wndToolBar);
return 0;
}
示例2: SetMenu
int CMyFrameWnd::OnCreate(LPCREATESTRUCT lpCreateStruct){
toolbar.CreateEx(this,TBSTYLE_FLAT,WS_CHILD|WS_VISIBLE|
CBRS_ALIGN_TOP|CBRS_GRIPPER|CBRS_SIZE_DYNAMIC|CBRS_TOOLTIPS|CBRS_FLYBY);
toolbar.LoadToolBar(IDR_TOOLBAR1);
toolbar.EnableDocking(CBRS_ALIGN_ANY);
toolbar.SetWindowText("tool");
m_menu.LoadMenu(IDR_MENU1);
SetMenu(&m_menu);
m_statusbar.CreateEx(this);
m_statusbar.SetIndicators(g_hIndicator,3);
m_statusbar.SetPaneInfo(1,IDS_TIME,SBPS_POPOUT,200);
m_statusbar.SetPaneInfo(2,IDS_POS,SBPS_NORMAL,200);
::SetTimer(this->m_hWnd,1,1000,NULL);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&toolbar ,AFX_IDW_DOCKBAR_TOP);
return CFrameWnd::OnCreate(lpCreateStruct);
}
示例3: CRect
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// create a view to occupy the client area of the frame
if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
{
TRACE0("Failed to create view window\n");
return -1;
}
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
ShowWindow( SW_SHOWMAXIMIZED);
return 0;
}
示例4: TRACE0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
if (!Mdiclient.SubclassWindow(m_hWndMDIClient))
{
TRACE("Failed to subclass MDI client window\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
m_wndStatusBar.SetPaneInfo(0,ID_SEPARATOR,0,120); //設置新增窗格1的寬度
m_wndStatusBar.SetPaneInfo(1,ID_SEPARATOR,0,180); //設置新增窗格1的寬度
m_wndStatusBar.SetPaneInfo(2,ID_SEPARATOR,0,180); //設置新增窗格2的寬度
m_wndStatusBar.SetPaneInfo(3,ID_SEPARATOR,SBPS_STRETCH,120);
return 0;
}
示例5: TRACE0
int CFrame::OnCreate(LPCREATESTRUCT lpcs)
{
static const UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR1,
ID_INDICATOR2,
ID_INDICATOR3,
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
if (CMDIFrameWnd::OnCreate(lpcs) == -1)
return -1;
if (!(m_wndToolBar.Create(this, WS_CHILD | WS_VISIBLE | CBRS_RIGHT) && m_wndToolBar.LoadToolBar(CFrame::IDR)))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!(m_wndStatusBar.Create(this) && m_wndStatusBar.SetIndicators(indicators, _countof(indicators))))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Remove this if you don't want tool tips or a resizeable toolbar
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
// TODO: Delete these three lines if you don't want the toolbar to be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
m_wndToolBar.SetWindowText(_T("Standard"));
return 0;
}
示例6: TRACE0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_TOOLBAR))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar,AFX_IDW_DOCKBAR_RIGHT);
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
m_StartTime = CTime::GetCurrentTime();
m_wndStatusBar.SetPaneInfo(0, ID_SEPARATOR, SBPS_NORMAL,170);
m_wndStatusBar.SetPaneInfo(1, ID_SEPARATOR, SBPS_NORMAL, 120);
m_wndStatusBar.SetPaneText(1,"登錄狀態:未登錄");
m_wndStatusBar.SetPaneInfo(2, ID_SEPARATOR, SBPS_NORMAL, 70);
m_wndStatusBar.SetPaneText(2,"緩存:0");
m_wndStatusBar.SetPaneInfo(3, ID_SEPARATOR, SBPS_NORMAL, 150);
m_wndStatusBar.SetPaneText(3,"賬戶餘額:未查詢");
m_wndStatusBar.SetPaneInfo(4, ID_SEPARATOR, SBPS_NORMAL, 50);
m_wndStatusBar.SetPaneText(4,"待存:0");
m_wndStatusBar.SetPaneInfo(5, ID_SEPARATOR, SBPS_NORMAL, 50);
m_wndStatusBar.SetPaneText(5,"啟動時間");
m_wndStatusBar.SetPaneInfo(6, ID_SEPARATOR, SBPS_NORMAL, 120);
m_wndStatusBar.SetPaneText(6,m_StartTime.Format("%Y-%m-%d %H:%M:%S"));
return 0;
}
示例7: sizeof
int CConfigFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!wndStatusBar.Create(this) ||
!wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: modify here the splitter
EnableDocking(CBRS_ALIGN_ANY);
wndSplitter.SetActivePane(0,1);
RecalcLayout();
bSyncStarted = false;
return 0;
}
示例8: TRACE0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))//IDR_MAINFRAME//IDR_TOOLBAR
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
CreateToolBar();
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
//set the view->smooth checked
CMenu* mainmenu=this->GetMenu();
// mainmenu->CheckMenuItem(ID_VIEW_3DAXISON,MF_CHECKED);
// mainmenu->CheckMenuItem(ID_VIEW_2DAXIS,MF_CHECKED);
mainmenu->CheckMenuItem(ID_VIEW_BFPLANE,MF_CHECKED);
mainmenu->CheckMenuItem(ID_VIEW_PRIMALMESH,MF_CHECKED);
return 0;
}
示例9: TRACE0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
if (!m_wndTestList.Create( this ) )
{
return -1;
}
m_wndTestList.ShowWindow( SW_SHOW );
EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndTestList.EnableDocking(CBRS_ALIGN_ANY);
DockControlBar( &m_wndTestList, AFX_IDW_DOCKBAR_LEFT);
DockControlBar(&m_wndToolBar);
return 0;
}
示例10: TRACE0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
#if _MSC_VER > 1100 // VC6+
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
#else // VC5-
if (!m_wndToolBar.Create(this, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
#endif
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// ugliness
sbar = &m_wndStatusBar;
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
示例11: TRACE0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to
// Enable drag/drop open
DragAcceptFiles(TRUE);
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
// add panes
m_wndStatusBar.SetPaneInfo( PANE_LENGTH_UNIT, ID_SEPARATOR, SBPS_NORMAL, 25);
m_wndStatusBar.SetPaneInfo( PANE_CURSOR_POSITION, ID_SEPARATOR, SBPS_NORMAL, 72);
m_wndStatusBar.SetPaneInfo( PANE_IMAGE_SIZE, ID_SEPARATOR, SBPS_NORMAL, 72);
m_wndStatusBar.SetPaneInfo( PANE_BIT_COUNT, ID_SEPARATOR, SBPS_NORMAL, 28);
m_wndStatusBar.SetPaneInfo( PANE_REGION_ID, ID_SEPARATOR, SBPS_NORMAL, 60);
m_wndStatusBar.SetPaneInfo( PANE_REGION_SIZE, ID_SEPARATOR, SBPS_NORMAL, 30);
m_wndStatusBar.SetPaneInfo( PANE_RN_COUNT, ID_SEPARATOR, SBPS_NORMAL, 15);
return 0;
}
示例12: TRACE0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.Create(this) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
if (!m_wndQueryBar.Create(this, IDD_QUERY_BAR, CBRS_TOP, ID_QUERY_BAR))
{
TRACE("Failed to create query bar\n");
return -1; // fail to create
}
// TODO: Remove this if you don't want tool tips or a resizeable toolbar
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
示例13: GetMenu
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
unsigned long index;
for (index = 1; index < NUMBER_LANGUAGES; index++)
{
GetMenu()->CheckMenuItem(identByLanguage[index], MF_BYCOMMAND | MF_UNCHECKED);
}
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.Create(this) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Remove this if you don't want tool tips or a resizeable toolbar
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
示例14: EnableDocking
//-------------------------------------------------------------------------------------
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// create top toolbar
m_top_bar.Create(this) ;
// add top toolbar on rebar
m_rebar.Create(this) ;
m_rebar.AddBar(&m_top_bar) ;
// create bottom status bar
m_bottom_status.CreateBar(this) ;
EnableDocking (CBRS_ALIGN_ANY) ;
// effect list, create it before layer manager to dock it on left of layer manager
m_effect_lib.Create(this) ;
PostMessage(WM_COMMAND, MAKEWPARAM(ID_EFFECT_LIB_VISIBLE,0)) ;
return 0 ;
}
示例15: CRect
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// 創建一個視圖以占用框架的工作區
if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
{
TRACE0("未能創建視圖窗口\n");
return -1;
}
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("未能創建工具欄\n");
return -1; // 未能創建
}
//if (!m_wndStatusBar.Create(this) ||
// !m_wndStatusBar.SetIndicators(indicators,
// sizeof(indicators)/sizeof(UINT)))
//{
// TRACE0("未能創建狀態欄\n");
// return -1; // 未能創建
//}
// TODO: 如果不需要工具欄可停靠,則刪除這三行
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
m_wndToolBar.SetButtonStyle(5,TBBS_CHECKBOX );
//m_wndToolBar.SetButtonStyle(6,TBBS_CHECKBOX );
return 0;
}