LONG CMainFrame::OnNameOutput(UINT wParam, LONG lParam) { int wnd = (int)wParam; HGLOBAL hg = (HGLOBAL)lParam; char* p = (char*)GlobalLock(hg); CString cs; if (p && p[0]) { cs = p; } else { CString t; t.LoadString(IDS_OUTPUT); cs.Format(t, wnd); } if (wnd >=0 && wnd < MAX_OUTPUT) { m_coolBar[wnd].SetTitle(cs); //* en if(m_coolBar[wnd].IsFloating()) { CControlBar * pBar = GetControlBar(outputwindows[wnd]); FloatControlBar(pBar, CPoint(m_coolBar[wnd].m_mX,m_coolBar[wnd].m_mY),0); } //*/en } GlobalUnlock(hg); GlobalFree(hg); return 0; }
BOOL CMainFrame::CreatePaletteBar() { if (!m_wndPaletteBar.Create(this, WS_CHILD | WS_VISIBLE | CBRS_SIZE_FIXED | CBRS_TOP | CBRS_TOOLTIPS, ID_PALETTEBAR) || !m_wndPaletteBar.LoadBitmap(IDB_PALETTE) || !m_wndPaletteBar.SetButtons(palette, sizeof(palette)/sizeof(UINT))) { TRACE0("Failed to create toolbar\n"); return FALSE; // fail to create } m_wndPaletteBar.SetWindowText(_T("Palette")); m_wndPaletteBar.EnableDocking(0); // Create the Palette. We are using hardcoded numbers for ease here // normally the location would be read in from an ini file. CPoint pt(GetSystemMetrics(SM_CXSCREEN) - 100, GetSystemMetrics(SM_CYSCREEN) / 3); m_wndPaletteBar.SetColumns(3); FloatControlBar(&m_wndPaletteBar, pt); return TRUE; }
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_wndProgressBar.Create(WS_CHILD,CRect(200,2,262,18),&m_wndStatusBar,ID_INDICATOR1)) { TRACE0("Failed to create progress bar\n"); return -1; // fail to create } m_wndProgressBar.ShowWindow(SW_SHOW); m_wndProgressBar.SetRange(0,100); */ // 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); //histogram bar m_HistoBar.Create(this, IDD_HISTO, CBRS_TOP, ID_VIEW_HISTOGRAM); m_HistoBar.ShowWindow(0); m_HistoBar.EnableDocking(0); RECT r; GetWindowRect(&r); FloatControlBar(&m_HistoBar,CPoint(r.right-300,r.top+80),CBRS_ALIGN_TOP); // <<<TWAIN>>> InitTwain(m_hWnd); // if(!IsValidDriver()) AfxMessageBox("Unable to load Twain Driver."); m_fullscreen=false; return 0; }
void CMainFrame::FixToolBars () { m_toolBar.ShowWindow (SW_SHOW); #if EDITBAR CRect rc1, rc2; CPoint p; m_toolBar.GetWindowRect (rc1); GetClientRect (rc2); rc2.left = rc2.right - rc1.Height (); p.x = rc2.left; p.y = rc2.top; m_editBar.ShowWindow (SW_SHOW); FloatControlBar (&m_editBar, p, (UINT) AFX_IDW_DOCKBAR_RIGHT); #endif }
LONG CMainFrame::OnDockOutput(UINT wParam, LONG lParam) { int wnd = (int)wParam; DWORD cs; UINT nDockBarID; switch ( lParam ) { default: cs = 0; nDockBarID = 0; break; case 1: cs = CBRS_ALIGN_ANY; nDockBarID = 0; break; case 2: cs = CBRS_ALIGN_LEFT; nDockBarID = AFX_IDW_DOCKBAR_LEFT; break; case 3: cs = CBRS_ALIGN_TOP; nDockBarID = AFX_IDW_DOCKBAR_TOP; break; case 4: cs = CBRS_ALIGN_RIGHT; nDockBarID = AFX_IDW_DOCKBAR_RIGHT; break; case 5: cs = CBRS_ALIGN_BOTTOM; nDockBarID = AFX_IDW_DOCKBAR_BOTTOM; break; } if (wnd >=0 && wnd < MAX_OUTPUT) { m_coolBar[wnd].EnableDocking(cs); if(cs) { DockControlBar(&m_coolBar[wnd], nDockBarID); } else { FloatControlBar(&m_coolBar[wnd], CPoint(m_coolBar[wnd].m_mX, m_coolBar[wnd].m_mY)); } m_coolBar[wnd].m_Dock = cs; } return 0; }
LONG CMainFrame::OnPosWOutput(UINT wParam, LONG lParam) { int p1,p2; int wnd = (int)wParam; p1 = lParam & 32767; p2 = lParam>>16; UINT nId = outputwindows[wnd]; CControlBar* pBar = GetControlBar(nId); if ((pBar != NULL) && (m_coolBar[wnd])) { FloatControlBar(pBar,CPoint(p1,p2),0); m_coolBar[wnd].m_mX = p1; m_coolBar[wnd].m_mY = p2; } return 0; }
void PSMainFrame::DisplayBuildBar(BOOL bShow) { if (m_wndProvBar.GetStyle() & WS_VISIBLE && !bShow || !(m_wndProvBar.GetStyle() & WS_VISIBLE) && bShow) { // Get the position of the main window. CRect pos; CWnd* pMainWnd = AfxGetMainWnd(); pMainWnd->GetWindowRect(&pos); // Get the position of the build bar. CRect bar; m_wndProvBar.GetWindowRect(&bar); // Show the build bar. m_pFloatingFrameClass = RUNTIME_CLASS(PSMiniFrame); FloatControlBar(&m_wndProvBar, CPoint(pos.right - bar.Width(), pos.top)); ShowControlBar(&m_wndProvBar, bShow, FALSE); m_pFloatingFrameClass = RUNTIME_CLASS(CMiniDockFrameWnd); } }
int PSMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { 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_wndProvBar.Create(this, WS_CHILD)) { TRACE0("Failed to create provbar\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_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBar); m_wndProvBar.EnableDocking(0); m_pFloatingFrameClass = RUNTIME_CLASS(PSMiniFrame); FloatControlBar(&m_wndProvBar, CPoint(0, 0)); m_pFloatingFrameClass = RUNTIME_CLASS(CMiniDockFrameWnd); return 0; }
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; if (!m_wndStatusBar.Create(this)) { TRACE0("상태 표시줄을 만들지 못했습니다.\n"); return -1; // 만들지 못했습니다. } m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT)); EnableDocking(CBRS_ALIGN_ANY); // TODO: 히스토그램 창 생성 // DONE m_dlgHistogram.Create(this, IDD_HISTOGRAM, CBRS_TOP, ID_VIEW_HISTOGRAM); m_dlgHistogram.ShowWindow(0); m_dlgHistogram.EnableDocking(0); RECT r; GetWindowRect(&r); FloatControlBar(&m_dlgHistogram,CPoint(r.right-300,r.top+80),CBRS_ALIGN_TOP); return 0; }
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; GlobalToolTips_G.Create(this); m_bCreated=TRUE; if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create } if (!m_wndToolBarFullScreen.Create(this) || !m_wndToolBarFullScreen.LoadToolBar(IDR_FULLSCREENTOOLBAR)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create } CString CS; CS.LoadString(IDS_STANDARD); m_wndToolBar.SetWindowText(CS); CS.LoadString(IDS_FULLSCREEN); m_wndToolBarFullScreen.SetWindowText(CS); 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_dataView.Create(this,IDD_OVERALLDATAVIEW,CBRS_LEFT,0xe004); // 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); m_wndToolBarFullScreen.EnableDocking(0); CPoint pt(10,10); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBar); FloatControlBar(&m_wndToolBarFullScreen,pt); ShowControlBar(&m_wndToolBarFullScreen,FALSE,FALSE); int i; for (i=1;i<4;i++) //This assumes that the separators do not count as indicators { m_wndStatusBar.SetPaneInfo(i,indicators[i],SBPS_NORMAL,STATUS_POS_PANE_WIDTH); } m_wndStatusBar.SetPaneInfo(4,indicators[4],SBPS_NORMAL,STATUS_SPIN_PANE_WIDTH); m_wndStatusBar.SetPaneInfo(5,indicators[5],SBPS_NORMAL,STATUS_TILT_PANE_WIDTH); m_wndStatusBar.SetPaneInfo(6,indicators[6],SBPS_NORMAL,STATUS_SIZE_PANE_WIDTH); InitializeTreeImageList(); //used by all the tree controls CRect rect2; rect2.left=0; rect2.right=0; rect2.bottom=64; rect2.right=64; if (!m_wndRuler.Create(this,WS_CHILD|WS_VISIBLE,AFX_IDW_CONTROLBAR_FIRST+4)) { TRACE0("Failed to create ruler\n"); } CAppSettings *Set=theApp.GetSettings(); if (!Set->m_bRuler) { m_wndRuler.ShowWindow(SW_HIDE); } m_viewTab.AddString(IDS_FREEFORM,ID_MOVEMENT_FREEFORMVIEW,FALSE); m_viewTab.AddString(IDS_PLAN,ID_MOVEMENT_PLANVIEW,FALSE); m_viewTab.AddString(IDS_PROFILE,ID_MOVEMENT_PROFILEVIEW,FALSE); m_viewTab.AddString(IDS_MIXED,ID_MOVEMENT_MIXEDVIEW,FALSE); if (!m_viewTab.Create(this,this,WS_CHILD|WS_VISIBLE,AFX_IDW_CONTROLBAR_FIRST+5)) { TRACE0("Failed to create view tab\n"); } if (!Set->m_bBottomTabs) { m_viewTab.ShowWindow(SW_HIDE); } SetActiveViewTab(VT_FREEFORM); m_wndStatusBar.ShowWindow(Set->m_bStatusBar?SW_SHOW:SW_HIDE); m_wndToolBar.ShowWindow(Set->m_bToolBar?SW_SHOW:SW_HIDE); // CG: The following line was added by the Splash Screen component. CSplashWnd::ShowSplashScreen(this); return 0; }
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; // main toolbar if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) { TRACE0("Failed to create main toolbar!\n"); return -1; // fail to create main toolbar } m_wndToolBar.SetWindowText(STR_TOOLBAR_MAIN); // edit mode bar if (!m_wndEditModeBar.Create(this, IDD_BAR_EDITMODE, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR)) { TRACE0("Failed to create edit mode bar!\n"); return -1; // fail to create edit mode bar } m_wndEditModeBar.SetWindowText(STR_TOOLBAR_EDITMODE); // view mode bar if (!m_wndViewModeBar.Create(this, IDD_BAR_VIEWMODE, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR)) { TRACE0("Failed to create view mode bar!\n"); return -1; // fail to create view mode bar } m_wndViewModeBar.SetWindowText(STR_TOOLBAR_VIEWMODE); // zoom bar if (!m_wndZoomBar.Create(this) || !m_wndZoomBar.LoadToolBar(IDR_ZOOMBAR)) { TRACE0("Failed to create zoom bar!\n"); return -1; // fail to create zoom bar } m_wndZoomBar.SetWindowText(STR_TOOLBAR_ZOOM); // toolbars bar if (!m_wndToolBarsBar.Create(this) || !m_wndToolBarsBar.LoadToolBar(IDR_TOOLBARS)) { TRACE0("Failed to create toolbars bar!\n"); return -1; // fail to create toolbars bar } m_wndToolBarsBar.SetWindowText(STR_TOOLBAR_TOOLBARS); // status bar 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 status bar } m_wndStatusBar.SetPaneStyle(0, SBPS_NORMAL); // tilepoints edit bar if (!m_wndTilesEditBar.Create(this, IDD_BAR_TILE, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR)) { TRACE0("Failed to create tilepoints edit bar!\n"); return -1; // fail to create } m_wndTilesEditBar.SetWindowText(STR_TOOLBAR_TILEPOINT); // tilepoints toolbar if (!m_wndTilesEditToolBar.Create(this) || !m_wndTilesEditToolBar.LoadToolBar(IDR_TILESBAR)) { TRACE0("Failed to create tilepoints toolbar!\n"); return -1; // fail to create } m_wndTilesEditToolBar.SetWindowText(STR_TOOLBAR_TILETOOLS); // doodads edit bar if (!m_wndDoodsEditBar.Create(this, IDD_BAR_DOODADS, CBRS_ALIGN_RIGHT, AFX_IDW_DIALOGBAR)) { TRACE0("Failed to create doodads edit bar!\n"); return -1; // fail to create } m_wndDoodsEditBar.SetWindowText(STR_TOOLBAR_DOODAD); // doodads toolbar if (!m_wndDoodadsEditToolBar.Create(this) || !m_wndDoodadsEditToolBar.LoadToolBar(IDR_DOODADSBAR)) { TRACE0("Failed to create doodads toolbar!\n"); return -1; // fail to create } m_wndDoodadsEditToolBar.SetWindowText(STR_TOOLBAR_DOODTOOLS); // units edit bar if (!m_wndUnitsEditBar.Create(this, IDD_BAR_UNITS, CBRS_ALIGN_RIGHT, AFX_IDW_DIALOGBAR)) { TRACE0("Failed to create units edit bar!\n"); return -1; // fail to create } m_wndUnitsEditBar.SetWindowText(STR_TOOLBAR_UNIT); // path toolbar if (!m_wndPathEditBar.Create(this, IDD_BAR_PATHING, CBRS_ALIGN_RIGHT, AFX_IDW_DIALOGBAR)) { TRACE0("Failed to create path bar!\n"); return -1; // fail to create } m_wndPathEditBar.SetWindowText(STR_TOOLBAR_PATHTOOLS); // shadows toolbar if (!m_wndShadowsEditBar.Create(this) || !m_wndShadowsEditBar.LoadToolBar(IDR_SHADOWSBAR)) { TRACE0("Failed to create shadows toolbar!\n"); return -1; // fail to create } m_wndShadowsEditBar.SetWindowText(STR_TOOLBAR_SHADOWTOOLS); m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndEditModeBar.SetBarStyle(m_wndEditModeBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndViewModeBar.SetBarStyle(m_wndViewModeBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndZoomBar.SetBarStyle(m_wndZoomBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndToolBarsBar.SetBarStyle(m_wndToolBarsBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndTilesEditBar.SetBarStyle(m_wndTilesEditBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndDoodsEditBar.SetBarStyle(m_wndDoodsEditBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndUnitsEditBar.SetBarStyle(m_wndUnitsEditBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndPathEditBar.SetBarStyle(m_wndPathEditBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndTilesEditToolBar.SetBarStyle(m_wndPathEditBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndDoodadsEditToolBar.SetBarStyle(m_wndPathEditBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndShadowsEditBar.SetBarStyle(m_wndShadowsEditBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); m_wndEditModeBar.EnableDocking(CBRS_ALIGN_TOP | CBRS_ALIGN_BOTTOM); m_wndViewModeBar.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT); m_wndZoomBar.EnableDocking(CBRS_ALIGN_ANY); m_wndToolBarsBar.EnableDocking(CBRS_ALIGN_ANY); m_wndTilesEditBar.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT); m_wndDoodsEditBar.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT); m_wndUnitsEditBar.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT); m_wndPathEditBar.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT); m_wndTilesEditToolBar.EnableDocking(CBRS_ALIGN_ANY); m_wndDoodadsEditToolBar.EnableDocking(CBRS_ALIGN_ANY); m_wndShadowsEditBar.EnableDocking(CBRS_ALIGN_ANY); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBar, AFX_IDW_DOCKBAR_TOP); DockControlBarLeftOf((CToolBar*)&m_wndEditModeBar, &m_wndToolBar); DockControlBarLeftOf(&m_wndToolBarsBar, (CToolBar*)&m_wndEditModeBar); DockControlBarLeftOf(&m_wndZoomBar, &m_wndToolBarsBar); DockControlBar(&m_wndViewModeBar, AFX_IDW_DOCKBAR_RIGHT); DockControlBar(&m_wndTilesEditBar, AFX_IDW_DOCKBAR_RIGHT); // FloatControlBar(&m_wndTilesEditBar,CPoint(600, 100), CBRS_ALIGN_BOTTOM | CBRS_ALIGN_RIGHT ); DockControlBar(&m_wndTilesEditToolBar, AFX_IDW_DOCKBAR_LEFT); DockControlBar(&m_wndDoodadsEditToolBar, AFX_IDW_DOCKBAR_LEFT); FloatControlBar(&m_wndDoodsEditBar,CPoint(608, 100), CBRS_ALIGN_BOTTOM | CBRS_ALIGN_RIGHT ); FloatControlBar(&m_wndShadowsEditBar,CPoint(616, 100), CBRS_ALIGN_BOTTOM | CBRS_ALIGN_RIGHT ); FloatControlBar(&m_wndPathEditBar,CPoint(624, 100), CBRS_ALIGN_BOTTOM | CBRS_ALIGN_RIGHT ); FloatControlBar(&m_wndUnitsEditBar,CPoint(632, 100), CBRS_ALIGN_BOTTOM | CBRS_ALIGN_RIGHT ); ShowControlBar(&m_wndDoodsEditBar, false, false); ShowControlBar(&m_wndUnitsEditBar, false, false); ShowControlBar(&m_wndPathEditBar, false, false); ShowControlBar(&m_wndShadowsEditBar, false, false); ShowControlBar(&m_wndDoodadsEditToolBar, false, false); //set displayed mode to the default mode m_wndEditModeBar.UpdateEditMode(MODE_DEFAULT); // m_wndViewModeBar.UpdateEditMode(MODE_DEFAULT); //init TilePoint Edit toolbar m_wndTilesEditBar.InitDilaogBar(); m_wndDoodsEditBar.InitDialogBar(); m_wndPathEditBar.InitDialogBar(); SetPositionText(""); return 0; }
// CMainFrame message handlers void CMainFrame::OnViewFullScreen() { RECT rectDesktop; WINDOWPLACEMENT wpNew; if (!IsFullScreen()) { // need to hide all status bars m_wndStatusBar.ShowWindow(SW_HIDE); m_wndToolBar.ShowWindow(SW_HIDE); m_wndProgressDialogBar.ShowWindow(SW_HIDE); m_wndMasterlistDialogBar.ShowWindow(SW_HIDE); // We'll need these to restore the original state. GetWindowPlacement (&m_wpPrev); m_wpPrev.length = sizeof m_wpPrev; //Adjust RECT to new size of window ::GetWindowRect(::GetDesktopWindow(), &rectDesktop); ::AdjustWindowRectEx(&rectDesktop, GetStyle(), TRUE, GetExStyle()); // Remember this for OnGetMinMaxInfo() m_FullScreenWindowRect = rectDesktop; wpNew = m_wpPrev; wpNew.showCmd = SW_SHOWNORMAL; wpNew.rcNormalPosition = rectDesktop; m_pwndFullScrnBar=new CToolBar; if (!m_pwndFullScrnBar->Create(this,CBRS_SIZE_DYNAMIC|CBRS_FLOATING) || !m_pwndFullScrnBar->LoadToolBar(IDR_FULLSCREEN)) { // TRACE0("Failed to create toolbar\n"); return; // fail to create } //don't allow the toolbar to dock m_pwndFullScrnBar->EnableDocking(0); m_pwndFullScrnBar->SetWindowPos(0, 100,100, 0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_SHOWWINDOW); m_pwndFullScrnBar->SetWindowText(_T("Full Screen")); FloatControlBar(m_pwndFullScrnBar, CPoint(100,100)); m_bFullScreen=TRUE; } else { m_pwndFullScrnBar->DestroyWindow(); delete m_pwndFullScrnBar; m_bFullScreen=FALSE; m_wndStatusBar.ShowWindow(SW_SHOWNORMAL); m_wndToolBar.ShowWindow(SW_SHOWNORMAL); m_wndProgressDialogBar.ShowWindow(SW_SHOWNORMAL); m_wndMasterlistDialogBar.ShowWindow(SW_SHOWNORMAL); wpNew = m_wpPrev; } //pView = (CRecordeOperatorDoc*)pChild->GetActiveDocument(); //if (!pDoc) // return; SetWindowPlacement(&wpNew); CChildFrame* pChild = NULL; pChild = (CChildFrame*)GetActiveFrame(); if (pChild) pChild->FullScreen(m_FullScreenWindowRect); }
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; //if (!m_wndToolBar.Create(this) || 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_wndCmdBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndCmdBar.LoadToolBar(IDR_TOOLBAR2)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create } /* if (!m_wndProgressBar.Create(WS_CHILD,CRect(200,2,262,18),&m_wndStatusBar,ID_INDICATOR1)) { TRACE0("Failed to create progress bar\n"); return -1; // fail to create } m_wndProgressBar.ShowWindow(SW_SHOW); m_wndProgressBar.SetRange(0,100); */ // 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); m_wndCmdBar.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_wndCmdBar.EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndCmdBar); //histogram bar m_HistoBar.Create(this, IDD_HISTO, CBRS_TOP, ID_VIEW_HISTOGRAM); m_HistoBar.ShowWindow(0); m_HistoBar.EnableDocking(0); RECT r; GetWindowRect(&r); FloatControlBar(&m_HistoBar,CPoint(r.right-300,r.top+80),CBRS_ALIGN_TOP); m_pDlgFlood = new DlgFloodFill(this); // <<<TWAIN>>> InitTwain(m_hWnd); // if(!IsValidDriver()) AfxMessageBox("Unable to load Twain Driver."); m_fullscreen=false; #ifdef VATI_EXTENSIONS // load the window size and positions CRect rect; rect.left = AfxGetApp()->GetProfileInt ( _T("Screen"), _T("left"), 0 ) ; rect.top = AfxGetApp()->GetProfileInt ( _T("Screen"), _T("top"), 0 ) ; rect.right = AfxGetApp()->GetProfileInt ( _T("Screen"), _T("right"), 850 ) ; rect.bottom = AfxGetApp()->GetProfileInt ( _T("Screen"), _T("bottom"), 650 ) ; // resize if (rect.left && rect.top && rect.right && rect.bottom ) MoveWindow( & rect,0 ); #endif return 0; }
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 } UINT Style, ID; int Size; m_wndStatusBar.GetPaneInfo(0 , ID, Style, Size); m_wndStatusBar.SetPaneInfo(0 , ID, Style, 30); m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_INFO1 , ID, Style, Size); m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_INFO1, ID, Style, 150); m_wndStatusBar.GetStatusBarCtrl().SetText(0, NUM_INDICATOR_INFO1, SBT_OWNERDRAW ); m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_INFO2 , ID, Style, Size); m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_INFO2, ID, Style, 150); m_wndStatusBar.GetStatusBarCtrl().SetText(0, NUM_INDICATOR_INFO2, SBT_OWNERDRAW ); m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_INFO3 , ID, Style, Size); m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_INFO3, ID, Style, 150); m_wndStatusBar.GetStatusBarCtrl().SetText(0, NUM_INDICATOR_INFO3, SBT_OWNERDRAW ); m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_INFO4 , ID, Style, Size); m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_INFO4, ID, Style, 150); m_wndStatusBar.GetStatusBarCtrl().SetText(0, NUM_INDICATOR_INFO4, SBT_OWNERDRAW ); m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_INFO5 , ID, Style, Size); m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_INFO5, ID, Style, 150); m_wndStatusBar.GetStatusBarCtrl().SetText(0, NUM_INDICATOR_INFO5, SBT_OWNERDRAW ); m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_CONNECTED , ID, Style, Size); m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_CONNECTED , ID, Style, 14); m_wndStatusBar.GetStatusBarCtrl ().SetText(0, NUM_INDICATOR_CONNECTED, SBT_OWNERDRAW ); m_wndStatusBar.GetPaneInfo(NUM_INDICATOR_LOGGED , ID, Style, Size); m_wndStatusBar.SetPaneInfo(NUM_INDICATOR_LOGGED , ID, Style, 14); m_wndStatusBar.GetStatusBarCtrl ().SetText(0, NUM_INDICATOR_LOGGED, SBT_OWNERDRAW ); m_wndStatusBar.GetPaneInfo(NUM_PATH_WRITING , ID, Style, Size); m_wndStatusBar.SetPaneInfo(NUM_PATH_WRITING , ID, Style, 14); m_wndStatusBar.GetStatusBarCtrl ().SetText(0, NUM_PATH_WRITING, SBT_OWNERDRAW ); m_wndStatusBar.GetPaneInfo(NUM_TICKER , ID, Style, Size); m_wndStatusBar.SetPaneInfo(NUM_TICKER , ID, Style, 20); // 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_editBar.Create(this , CBRS_BOTTOM , 100 ); //vls-begin// multiple output // CString t; // t.LoadString(IDS_OUTPUT); // LPCSTR strTitle = t; // // if (!m_coolBar.Create(this, strTitle, CSize(200, 100), ID_VIEW_OUTPUTWINDOW, WS_CHILD | WS_VISIBLE | CBRS_TOP) ) // { // TRACE0("Failed to create output window\n"); // return -1; // fail to create // } // // m_coolBar.SetBarStyle(m_coolBar.GetBarStyle()|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_SIZE_DYNAMIC); // m_coolBar.EnableDocking(CBRS_ALIGN_ANY); // DockControlBar(&m_coolBar); // LoadBarState("JMC"); // m_coolBar.Load(); CString t; t.LoadString(IDS_OUTPUT); for (int i = 0; i < MAX_OUTPUT; i++) { CString str; str.Format(t, i); LPCSTR strTitle = str; m_coolBar[i].m_wndCode = i; m_coolBar[i].m_wndAnsi.m_wndCode = i; if (!m_coolBar[i].Create(this, strTitle, CSize(200, 100), outputwindows[i], WS_CHILD | WS_VISIBLE | CBRS_TOP) ) { TRACE0("Failed to create output window\n"); return -1; // fail to create } m_coolBar[i].SetBarStyle(m_coolBar[i].GetBarStyle()|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_SIZE_DYNAMIC); m_coolBar[i].Load(); DockControlBar(&m_coolBar[i]); m_coolBar[i].m_pDockContext->ToggleDocking(); CControlBar* pBar = GetControlBar(outputwindows[i]); wposes[i][0] = m_coolBar[i].m_mX; wposes[i][1] = m_coolBar[i].m_mY; if(pBar->IsFloating()) { FloatControlBar(pBar,CPoint(m_coolBar[i].m_mX,m_coolBar[i].m_mY),0); } } LoadBarState("JMC"); InitOutputNameFunc(GetOutputName); //vls-end// SetTimer(1, 1000, NULL); // Load history here CFile histFile; if ( histFile.Open("history.dat", CFile::modeRead ) ) { CArchive ar(&histFile, CArchive::load ); m_editBar.GetHistory().Serialize (ar); m_editBar.m_nCurrItem = m_editBar.GetHistory().GetCount(); } char trayTitle[BUFFER_SIZE] = ""; CSmcDoc* pDoc = (CSmcDoc*)GetActiveDocument(); if ( pDoc ) { CString text; text.Format(IDS_JABA_TITLE, pDoc->m_strProfileName); strcpy(trayTitle, text); } sysTray = CTray(IDR_MAINFRAME, trayTitle); // GetDlgItem(ID_VIEW_MUDEMULATOR)->SetWindowText("Emulation"); return 0; }
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; 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 (!InitCommandBars()) return -1; CXTPPaintManager::SetTheme(xtpThemeOffice2003); CXTPCommandBars* pCommandBars = GetCommandBars(); pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME); CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("Standard"), xtpBarTop); if (!pCommandBar || !pCommandBar->LoadToolBar(IDR_MAINFRAME)) { TRACE0("Failed to create toolbar\n"); return -1; } pCommandBars->GetImageManager()->SetIcons(IDR_MAINFRAME, IDR_TOOLBAR_ALPHA); pCommandBars->GetShortcutManager()->SetAccelerators(IDR_MAINFRAME); // Load the previous state for command bars. LoadCommandBars(_T("CommandBars")); EnableDocking(CBRS_ALIGN_ANY); SetOfficeTheme(xtpCalendarThemeOffice2007); // Initialize dialog bar if (!m_dlgDatePicker.Create(this, IDD_DATEPICKER, CBRS_LEFT|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_HIDE_INPLACE, ID_VIEW_DATEPICKER)) return -1; // fail to create // Initialize dialog bar if (!m_dlgOptions.Create(this, IDD_CALENDAR_DEMO_VIEW, CBRS_ALIGN_TOP|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_HIDE_INPLACE, ID_VIEW_PROPERTIES)) return -1; // fail to create //m_dlgOptions.EnableDocking(CBRS_ALIGN_ANY); m_dlgOptions.EnableDocking(0); m_dlgOptions.SetWindowText(_T("Options")); ShowControlBar(&m_dlgOptions, FALSE, FALSE); FloatControlBar(&m_dlgOptions, CPoint(100, 200)); // docking for DatePicker m_dlgDatePicker.EnableDocking(CBRS_ALIGN_LEFT); m_dlgDatePicker.SetWindowText(_T("Date Picker")); ShowControlBar(&m_dlgDatePicker, TRUE, FALSE); //FloatControlBar(&m_dlgDatePicker, CPoint(100, GetSystemMetrics(SM_CYSCREEN) / 3)); return 0; }