コード例 #1
0
ファイル: ltguifillframe.cpp プロジェクト: Arc0re/lithtech
// sets the width of the frame
void CLTGUIFillFrame::SetFrameWidth( uint8 nFrameWidth )
{
	m_nFrameWidth = nFrameWidth;
	RecalcLayout();
}
コード例 #2
0
ファイル: ChildFrm.cpp プロジェクト: YueLinHo/WinMerge
void CChildFrame::ActivateFrame(int nCmdShow) 
{
	BOOL bMaximized = FALSE;
	CMDIChildWnd * oldActiveFrame = GetMDIFrame()->MDIGetActive(&bMaximized);

	if (!m_bActivated) 
	{
		m_bActivated = TRUE;

		// get the active child frame, and a flag whether it is maximized
		if (oldActiveFrame == NULL)
			// for the first frame, get the restored/maximized state from the registry
			bMaximized = theApp.GetProfileInt(_T("Settings"), _T("ActiveFrameMax"), FALSE);
		if (bMaximized)
			nCmdShow = SW_SHOWMAXIMIZED;
		else
			nCmdShow = SW_SHOWNORMAL;
	}

	// load the bars layout
	// initialize the diff pane state with default dimension
	int initialDiffHeight = ((CMergeDiffDetailView*)m_wndDetailSplitter.GetPane(1,0))->ComputeInitialHeight();
	UpdateDiffDockbarHeight(initialDiffHeight);
	// load docking positions and sizes
	CDockState pDockState;
	pDockState.LoadState(_T("Settings"));
	if (EnsureValidDockState(pDockState)) // checks for valid so won't ASSERT
		SetDockState(pDockState);
	// for the dimensions of the diff and location pane, use the CSizingControlBar loader
	m_wndLocationBar.LoadState(_T("Settings"));
	m_wndDetailBar.LoadState(_T("Settings"));

	if (bMaximized)
	{
		// If ActivateFrame() is called without tricks, Resizing panes in MergeView window could be visible.
		// Here, two tricks are used.
		// [First trick]
		// To complete resizing panes before displaying MergeView window, 
		// it needs to send WM_SIZE message with SIZE_MAXIMIZED to MergeView window before calling ActivateFrame().
		// [Second trick]
		// But it causes side effect that DirView window becomes restored window from maximized window
		// and the process could be visible.
		// To avoid it, it needs to block the redrawing DirView window.
		// I had tried to use LockWindowUpdate for this purpose. However, it had caused flickering desktop icons.
		// So instead of using LockWindowUpdate(), 
		// I wrote My[Lock/Unlock]WindowUpdate() function that uses subclassing window.
		// 
		if (oldActiveFrame)
			MyLockWindowUpdate(oldActiveFrame->m_hWnd);
		
		RECT rc;
		GetClientRect(&rc);
		SendMessage(WM_SIZE, SIZE_MAXIMIZED, MAKELPARAM(rc.right, rc.bottom));

		CMDIChildWnd::ActivateFrame(nCmdShow);

		if (oldActiveFrame)
			MyUnlockWindowUpdate(oldActiveFrame->m_hWnd);
	}
	else
	{
		RecalcLayout();

		CMDIChildWnd::ActivateFrame(nCmdShow);
	}
}
コード例 #3
0
void CFrameWnd::OnSize( UINT nType, int cx, int cy )
/**************************************************/
{
    CWnd::OnSize( nType, cx, cy );
    RecalcLayout();
}
コード例 #4
0
ファイル: MainFrm.cpp プロジェクト: open2cerp/Open2C-ERP
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	nCurAppRunMode=afxAppRunMode;
	if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	



	CExtCmdManager::g_bDisableCmdIfNoHandler=0;


	UINT nMainToolBarID=IDR_MAINFRAME;
	if(nCurAppRunMode==CONFIG_MODE)
	{
		SetTitle("2—: онфигуратор");
		nMainToolBarID=IDR_CONFIGTOOLBAR;
	}

	csProfileName=GetTitle()+"N05";
#ifdef _DEBUG
	csProfileName+="D";
#endif



	CWinApp * pApp = ::AfxGetApp();


	g_CmdManager->ProfileSetup(
		csProfileName,
		GetSafeHwnd()
		);
	

	//ћеню
/*	m_wndMenuBar.SetMdiWindowPopupName( _T("Window") );
	if( !m_wndMenuBar.Create("√лавное меню",
							 this,
							 IDC_MAIN_MENU))
	{
		TRACE0( _T( "Failed to create menubar\n" ) );
		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
	}
	pStatusBar=&m_wndStatusBar;


	//√лавна¤ панель
	if( !m_ToolMain.Create(
			_T("ќбща¤ панель инструментов"),
			this,
			IDR_MAIN_TOOLBAR
			)
		||
		!m_ToolMain.LoadToolBar(nMainToolBarID)
		)
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}
	//ѕанель инструментов модул¤
	if( !m_ToolModule.Create(
			_T("ѕанель инструментов модул¤"),
			this,
			IDR_MODULE
			)
		||
		!m_ToolModule.LoadToolBar(IDR_MODULE)
		)
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	//ѕанель инструментов формы
	if(nCurAppRunMode==CONFIG_MODE)
	{
		if( !m_ToolEdit.Create(
				_T("ѕанель инструментов формы"),
				this,
				IDR_EDITBAR
				)
			||
			!m_ToolEdit.LoadToolBar(IDR_EDITBAR)
			)
		{
			TRACE0("Failed to create toolbar\n");
			return -1;      // fail to create
		}
	}

	//—оздаем контейнер окна сообщений
	if(	!m_ParentMessageBar.Create(
			_T("ќкно сообщений"),
			this,
			ID_VIEWMESSAGEWINDOW
			)
		)
	{
		TRACE0("Failed to create m_ParentMessageBar\n");
		return -1;		// fail to create
	}
	//—оздаем само окно сообщений
	if( !m_MessageBar.Create(
			WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_HSCROLL
				|ES_MULTILINE|ES_LEFT|ES_WANTRETURN,

			CRect(0,0,0,0),
			&m_ParentMessageBar,
			m_ParentMessageBar.GetDlgCtrlID()
			)
		)
	{
		TRACE0("Failed to create m_MessageBar\n");
		return -1;		// fail to create
	}
	m_MessageBar.Init();





	if(nCurAppRunMode==CONFIG_MODE)
	{
		//—оздаем контейнер отладочного окна
		if(	!m_ParentDebugMessageBar.Create(
				_T("ќкно отладки"),
				this,
				ID_VIEWDEBUGMESSAGEWINDOW
				)
			) 
		{
			TRACE0("Failed to create m_ParentDebugMessageBar\n");
			return -1;		// fail to create
		}
		if( !m_DebugMessageBar.Create(
				WS_VISIBLE|WS_CHILD|LVS_SHAREIMAGELISTS,
				CRect(0,50,50,200),
				&m_ParentDebugMessageBar,
				m_ParentDebugMessageBar.GetDlgCtrlID()
				)
			)
		{
			TRACE0("Failed to create m_DebugMessageBar\n");
			return -1;		// fail to create
		}
		m_DebugMessageBar.Init();
		pDebugMessageBar=&m_DebugMessageBar;

		
		//—оздаем контейнер окна стека вызова
		if(	!m_ParentStackBar.Create(
				_T("—тек вызова"),
				this,
				ID_VIEW_STACK
				)
			)
		{
			TRACE0("Failed to create m_ParentStackBar\n");
			return -1;		// fail to create
		}
		if( !m_StackBar.Create(
				WS_VISIBLE|WS_CHILD|LVS_SHAREIMAGELISTS,
				CRect(0,0,50,200),
				&m_ParentStackBar,
				m_ParentStackBar.GetDlgCtrlID()
				)
			)
		{
			TRACE0("Failed to create m_StackBar\n");
			return -1;		// fail to create
		}

		m_StackBar.Init();
		pDebugStackBar=&m_StackBar;
		


		//—оздаем контейнер окна свойств
		if(	!m_ParentPropertyBar.Create(
				_T("ќкно свойств"),
				this,
				ID_PROPERTYBAR
				)
			)
		{
			TRACE0("Failed to create m_ParentPropertyBar\n");
			return -1;		// fail to create
		}
		//—оздаем окно свойств
		if( !m_PropertyBar.Create(
			CRect(0,0,50,50),
			&m_ParentPropertyBar,
			IDC_OI,
			0x50010000
				)
			)
		{
			TRACE0("Failed to create m_PropertyBar\n");
			return -1;		// fail to create
		}
		m_PropertyBar.SetBorderStyle(CObjectInspector::bsSingle);
		m_PropertyBar.SetImageList(GetImageList());
	}





	if( !m_ComboHelpSearch.Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWN,
								  CRect( 0, 0, 200, 480 ),
								  &m_ToolMain,
								  ID_HELP_SEARCH_COMBO) || 
		!m_ToolMain.SetButtonCtrl(                                           
										m_ToolMain.CommandToIndex(
										m_ComboHelpSearch.GetDlgCtrlID()) ,
										&m_ComboHelpSearch) )
	{
		TRACE0( "Failed to create help search combobox\n" );
		return -1;
	}
			
	m_ComboHelpSearch.SetItemHeight( -1, 16 );

	m_ComboHelpSearch.SetFont( &g_PaintManager->m_FontNormal );
	g_CmdManager->CmdGetPtr(csProfileName,m_ComboHelpSearch.GetDlgCtrlID())-> m_sMenuText
							   = _T( "Search help system" );



	m_wndDocSelector.Create(NULL, "ѕанель окон", WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | 
							CBRS_TOP, CRect(0,0,0,0), this, IDS_DOC_SELECTOR);
	m_wndDocSelector.SetBarStyle( CBRS_ALIGN_BOTTOM);

	
	


    //m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
	m_ToolMain.EnableDocking(CBRS_ALIGN_ANY);
	m_ToolModule.EnableDocking(CBRS_ALIGN_ANY);
	if(nCurAppRunMode==CONFIG_MODE)
		m_ToolEdit.EnableDocking(CBRS_ALIGN_ANY);
	m_ParentMessageBar.EnableDocking(CBRS_ALIGN_ANY);

	if(nCurAppRunMode==CONFIG_MODE)
	{
		m_ParentDebugMessageBar.EnableDocking(CBRS_ALIGN_ANY);
		m_ParentStackBar.EnableDocking(CBRS_ALIGN_ANY);
		m_ParentPropertyBar.EnableDocking(CBRS_ALIGN_ANY);
	}


	if( !CExtControlBar::FrameEnableDocking(this) )
	{
		ASSERT( FALSE );
		return -1;
	}


	//DockControlBar(&m_wndMenuBar,AFX_IDW_DOCKBAR_TOP);
	DockControlBar(&m_ToolMain);
	DockControlBar(&m_ToolModule,AFX_IDW_DOCKBAR_BOTTOM);
	if(nCurAppRunMode==CONFIG_MODE)
		DockControlBar(&m_ToolEdit,AFX_IDW_DOCKBAR_BOTTOM);


	RecalcLayout();

	m_ParentMessageBar.SetInitDesiredSizeHorizontal( CSize(80,80) );
	m_ParentMessageBar.DockControlBar(AFX_IDW_DOCKBAR_BOTTOM,1,this,false);

	if(nCurAppRunMode==CONFIG_MODE)
	{
		m_ParentDebugMessageBar.SetInitDesiredSizeHorizontal( CSize(80,80) );
		m_ParentDebugMessageBar.DockControlBar(AFX_IDW_DOCKBAR_BOTTOM,2,this,false);

		m_ParentStackBar.SetInitDesiredSizeHorizontal( CSize(80,80) );
		m_ParentStackBar.DockControlBar(AFX_IDW_DOCKBAR_RIGHT,1,this,false);

		m_ParentPropertyBar.SetInitDesiredSizeVertical( CSize(180,80) );
		m_ParentPropertyBar.DockControlBar(AFX_IDW_DOCKBAR_RIGHT,1,this,false);

//		m_ParentPropertyBar.SetInitDesiredSizeHorizontal( CSize(180,80) );
//		m_ParentPropertyBar.SetInitDesiredSizeFloating( CSize(380,380) );
//		m_ParentPropertyBar.FloatControlBar();

//		m_ParentPropertyBar.AutoHideModeGet();
	}







/*	g_CmdManager->SetBasicCommands(
	csProfileName,
	g_statBasicCommands);
*/
		
	RecalcLayout();
	
	CExtControlBar::ProfileBarStateLoad(
		this,
		pApp->m_pszRegistryKey,
		csProfileName,
		"Save",
		&m_dataFrameWP
		);


	//¬осстанавливаем стиль
	CString csStyle=AfxGetApp()->GetProfileString(csProfileName, "Style");
	//if(csStyle!="XP")
	//	OnViewLikeOffice2k();
	OnViewLikeOffice2k();


	//передача ошибок в окно сообщений конфигуратора
	//if(nCurAppRunMode==CONFIG_MODE)
	//или отладка
	MyDDE.Create(MAKEINTRESOURCE(IDD_MYDATAEXCHANGE_DIALOG),this);


	CheckWindow(m_ToolMain);
	CheckWindow(m_ToolModule);
	if(nCurAppRunMode==CONFIG_MODE)
	{
		CheckWindow(m_ToolEdit);
		CheckWindow(m_ParentDebugMessageBar);
		CheckWindow(m_ParentStackBar);
		CheckWindow(m_ParentPropertyBar);
	}
	CheckWindow(m_ParentMessageBar);


	//**************************
	// Install the tab view here
	//VERIFY(m_MDIClient.SubclassMDIClient(this));

//	m_ToolMain.InsertButton();



	return 0;
}
コード例 #5
0
void CXTPDockingPaneSidePanel::OnNcLButtonDown(UINT nHitTest, CPoint point)
{
	if (nHitTest >= HTSIZEFIRST && nHitTest <= HTSIZELAST)
	{
		_RestoreFocus();
		Expand();
		SetCapture();
		m_pLayout->MoveToTail(this);

		CXTPWindowRect rcWindow(this);

		CRect rcClient(GetDockingPaneManager()->GetClientPane()->GetPaneWindowRect());
		rcClient.DeflateRect(GetDockingPaneManager()->GetSideDockingMargin());

		rcWindow.OffsetRect(-rcClient.TopLeft());


		MINMAXINFO mmi;
		GetMinMaxInfo(&mmi);

		BOOL bResizeTop = nHitTest == HTTOP || nHitTest == HTTOPLEFT || nHitTest == HTTOPRIGHT;
		BOOL bResizeBottom = nHitTest == HTBOTTOM || nHitTest == HTBOTTOMLEFT || nHitTest == HTBOTTOMRIGHT;
		BOOL bResizeRight = nHitTest == HTRIGHT || nHitTest == HTTOPRIGHT || nHitTest == HTBOTTOMRIGHT;
		BOOL bResizeLeft = nHitTest == HTLEFT || nHitTest == HTTOPLEFT || nHitTest == HTBOTTOMLEFT;

		while (::GetCapture() == m_hWnd)
		{
			MSG msg;

			if (!GetMessage(&msg, NULL, 0, 0))
				break;

			if (msg.message == WM_MOUSEMOVE)
			{
				CPoint pt = CPoint(msg.lParam);
				ClientToScreen(&pt);

				CPoint ptOffset = pt - point;
				point = pt;

				if (bResizeTop) rcWindow.top += ptOffset.y;
				if (bResizeBottom) rcWindow.bottom += ptOffset.y;
				if (bResizeRight) rcWindow.right += ptOffset.x;
				if (bResizeLeft) rcWindow.left += ptOffset.x;

				m_rcWindow = rcWindow;

				if (m_rcWindow.Height() > mmi.ptMaxTrackSize.y)
				{
					if (bResizeTop) m_rcWindow.top = m_rcWindow.bottom - mmi.ptMaxTrackSize.y; else m_rcWindow.bottom = m_rcWindow.top + mmi.ptMaxTrackSize.y;
				}
				if (m_rcWindow.Height() < mmi.ptMinTrackSize.y)
				{
					if (bResizeTop) m_rcWindow.top = m_rcWindow.bottom - mmi.ptMinTrackSize.y; else m_rcWindow.bottom = m_rcWindow.top + mmi.ptMinTrackSize.y;
				}

				if (m_rcWindow.Width() > mmi.ptMaxTrackSize.x)
				{
					if (bResizeLeft) m_rcWindow.left = m_rcWindow.right - mmi.ptMaxTrackSize.x; else m_rcWindow.right = m_rcWindow.left + mmi.ptMaxTrackSize.x;
				}
				if (m_rcWindow.Width() < mmi.ptMinTrackSize.x)
				{
					if (bResizeLeft) m_rcWindow.left = m_rcWindow.right - mmi.ptMinTrackSize.x; else m_rcWindow.right = m_rcWindow.left + mmi.ptMinTrackSize.x;
				}

				RecalcLayout(FALSE);
			}
			else if (msg.message == WM_KEYDOWN && msg.wParam == VK_ESCAPE) break;
			else if (msg.message == WM_LBUTTONUP) break;
			else ::DispatchMessage(&msg);
		}

		if (CWnd::GetCapture() == this) ReleaseCapture();
	}
}
コード例 #6
0
//---------------------------------------------------------------------------
void wxTabbedWindow::OnSize ( wxSizeEvent& WXUNUSED(event) )
{
    SetBackgroundColour( wxColour( 192,192,192 ) );
    RecalcLayout(true);
}
コード例 #7
0
ファイル: Mainfrm.cpp プロジェクト: quinsmpang/Tools
void CMainFrame::ChooseColor(UINT nColor)
{
	m_nColor = nColor;

	switch (nColor)
	{
	case IDM_MODERN:
		{
			SetReBarColors( RGB(225, 230, 255), RGB(240, 242, 250), RGB(248, 248, 248), RGB(180, 200, 230) );

			StatusBarTheme sbt = {TRUE, RGB(225, 230, 255), RGB(240, 242, 250)};
			SetStatusBarTheme (&sbt);

			ToolBarTheme tbt = {TRUE, RGB(180, 250, 255), RGB(140, 190, 255), RGB(150, 220, 255), RGB(80, 100, 255), RGB(127, 127, 255)};
			SetToolBarTheme(&tbt);

			MenuTheme mt = {TRUE, RGB(180, 250, 255), RGB(140, 190, 255), RGB(240, 250, 255), RGB(120, 170, 220), RGB(127, 127, 255)};
			SetMenuTheme(&mt);
		}
		break;
	case IDM_BLUE:	// ICY_BLUE Theme
		{
			SetReBarColors( RGB(150,190,245), RGB(196,215,250), RGB(220,230,250), RGB( 70,130,220) );

			StatusBarTheme sbt = {TRUE, RGB(150,190,245), RGB(196,215,250)};
			SetStatusBarTheme (&sbt);

			ToolBarTheme tbt = {TRUE, RGB(255, 230, 190), RGB(255, 190, 100), RGB(255, 140, 40), RGB(255, 180, 80), RGB(128, 128, 255)};
			SetToolBarTheme(&tbt);

			MenuTheme mt = {TRUE, RGB(255, 230, 190), RGB(255, 190, 100), RGB(150,190,245), RGB(220,230,250), RGB(128, 128, 200)};
			SetMenuTheme(&mt);
		}
		break;
	case IDM_GREY:	// Grey Theme
		{
			SetReBarColors( RGB(210, 210, 200), RGB(238, 236, 224), RGB(248, 247, 243), RGB(195, 195, 172) );

			StatusBarTheme sbt = {TRUE, RGB(210, 210, 200), RGB(238, 236, 224)};
			SetStatusBarTheme (&sbt);

			ToolBarTheme tbt = {TRUE, RGB(192, 210, 238), RGB(192, 210, 238), RGB(152, 181, 226), RGB(152, 181, 226), RGB(49, 106, 197)};
			SetToolBarTheme(&tbt);

			MenuTheme mt = {TRUE, RGB(196, 215, 250), RGB( 120, 180, 220), RGB(210, 210, 200), RGB(248, 247, 243), RGB(128, 128, 200)};
			SetMenuTheme(&mt);
		}
		break;
	case IDM_OLIVE:
		{
			SetReBarColors( RGB(160, 180, 80), RGB(180, 200, 100), RGB(200, 220, 120), RGB(80, 159, 78) );

			StatusBarTheme sbt = {TRUE, RGB(160, 180, 80), RGB(180, 200, 100)};
			SetStatusBarTheme (&sbt);

			ToolBarTheme tbt = {TRUE, RGB(255, 230, 190), RGB(255, 190, 100), RGB(255, 140, 40), RGB(255, 180, 80), RGB(128, 128, 255)};
			SetToolBarTheme(&tbt);

			MenuTheme mt = {TRUE, RGB(255, 200, 190), RGB(255, 210, 90), RGB(255, 230, 190), RGB(230, 160, 190), RGB(128, 128, 128)};
			SetMenuTheme(&mt);
		}
		break;
	case IDM_GOLD:
		{
			SetReBarColors( RGB(230, 180, 0), RGB(240, 210, 90), RGB(255, 240, 150), RGB(180, 140, 50) );

			StatusBarTheme sbt = {TRUE, RGB(230, 180, 0), RGB(240, 210, 90)};
			SetStatusBarTheme (&sbt);

			ToolBarTheme tbt = {TRUE, RGB(192, 210, 238), RGB(192, 210, 238), RGB(152, 181, 226), RGB(152, 181, 226), RGB(49, 106, 197)};
			SetToolBarTheme(&tbt);

			MenuTheme mt = {TRUE, RGB(196, 215, 250), RGB( 120, 180, 220), RGB(240, 210, 90), RGB(255, 240, 150), RGB(128, 128, 128)};
			SetMenuTheme(&mt);
		}
		break;
	case IDM_OCHRE:
		{
			SetReBarColors( RGB(248, 132, 12), RGB(248, 198, 10), RGB(248, 210, 20), RGB(248, 141, 6) );

			StatusBarTheme sbt = {TRUE, RGB(248, 132, 12), RGB(248, 198, 10)};
			SetStatusBarTheme (&sbt);

			ToolBarTheme tbt = {TRUE, RGB(192, 210, 238), RGB(192, 210, 238), RGB(152, 181, 226), RGB(152, 181, 226), RGB(49, 106, 197)};
			SetToolBarTheme(&tbt);

			MenuTheme mt = {TRUE, RGB(196, 215, 250), RGB( 120, 180, 220), RGB(150,190,245), RGB(220,230,250), RGB(128, 128, 128)};
			SetMenuTheme(&mt);
		}
		break;
	case IDM_PINK:
		{
			SetReBarColors( RGB(255, 130, 190), RGB(250, 205, 235), RGB(250, 205, 235), RGB(255, 120, 170) );

			StatusBarTheme sbt = {TRUE, RGB(255, 130, 190), RGB(250, 205, 235)};
			SetStatusBarTheme (&sbt);

			ToolBarTheme tbt = {TRUE, RGB(192, 210, 238), RGB(192, 210, 238), RGB(248, 147, 220), RGB(248, 153, 179), RGB(49, 106, 197)};
			SetToolBarTheme(&tbt);

			MenuTheme mt = {TRUE, RGB(196, 215, 250), RGB( 120, 180, 220), RGB(255, 130, 190), RGB(250, 205, 235), RGB(128, 128, 128)};
			SetMenuTheme(&mt);
		}
		break;
	case IDM_MAUVE:
		{
			SetReBarColors( RGB(210, 128, 155), RGB(230, 160, 190), RGB(230, 158, 188), RGB(110, 100, 125) );

			StatusBarTheme sbt = {TRUE, RGB(210, 128, 155), RGB(230, 160, 190)};
			SetStatusBarTheme (&sbt);

			ToolBarTheme tbt = {TRUE, RGB(192, 210, 238), RGB(192, 210, 238), RGB(152, 181, 226), RGB(152, 181, 226), RGB(49, 106, 197)};
			SetToolBarTheme(&tbt);

			MenuTheme mt = {TRUE, RGB(196, 215, 250), RGB( 120, 180, 220), RGB(150,190,245), RGB(220,230,250), RGB(128, 128, 128)};
			SetMenuTheme(&mt);
		}
		break;
	case IDM_BLACK:
		{
			SetReBarColors( RGB(128, 138 ,176), RGB(98, 108 ,136), RGB(77, 87, 97), RGB(7, 17, 27) );

			StatusBarTheme sbt = {TRUE, RGB(128, 138 ,176), RGB(98, 108 ,136)};
			SetStatusBarTheme (&sbt);

			ToolBarTheme tbt = {TRUE, RGB(49, 106, 197), RGB(64,177,230), RGB(27,65, 160), RGB(64,177,230), RGB(49, 106, 197)};
			SetToolBarTheme(&tbt);

			MenuTheme mt = {TRUE, RGB(84,197,240), RGB(89, 136, 217), RGB(59, 126, 197), RGB(94,187,230), RGB(128, 128, 128)};
			SetMenuTheme(&mt);
		}
		break;
	default:
		{
			m_nColor = IDM_MODERN;
			SetReBarColors( RGB(225, 230, 255), RGB(240, 242, 250), RGB(248, 248, 248), RGB(180, 200, 230) );

			StatusBarTheme sbt = {TRUE, RGB(225, 230, 255), RGB(240, 242, 250)};
			SetStatusBarTheme (&sbt);

			ToolBarTheme tbt = {TRUE, RGB(180, 250, 255), RGB(140, 190, 255), RGB(150, 220, 255), RGB(80, 100, 255), RGB(127, 127, 255)};
			SetToolBarTheme(&tbt);

			MenuTheme mt = {TRUE, RGB(180, 250, 255), RGB(140, 190, 255), RGB(240, 250, 255), RGB(120, 170, 220), RGB(127, 127, 255)};
			SetMenuTheme(&mt);
		}
		break;
	}

	// Check the appropriate menu item
	int nFileItem = GetMenuItemPos(GetFrameMenu(), _T("Theme"));
	if (nFileItem >= 0)
	{
		CMenu* pThemeMenu = GetFrameMenu()->GetSubMenu(nFileItem);
		pThemeMenu->CheckMenuRadioItem(IDM_BLUE, IDM_MODERN, nColor, 0);
	}

	RecalcLayout();
}
コード例 #8
0
void CDataShield::SetYTransT(double Y_Trans_Total)
{
	m_Y_Translation_Total = ASFloatToFixed(Y_Trans_Total / m_UnitK);
	RecalcLayout();
}
コード例 #9
0
void CDataShield::SetRAngleT(double RAngle_Total)
{
	// ????????? А нужно ли?
	m_Rotation_Angle_Total = RAngle_Total;
	RecalcLayout();
}
コード例 #10
0
void CDataShield::SetXScaleT(double X_Scale_Total)
{
	m_X_Scale_Total = ASFloatToFixed(X_Scale_Total);
	RecalcLayout();
}
コード例 #11
0
void CDataShield::SetYScaleT(double Y_Scale_Total)
{
	m_Y_Scale_Total = ASFloatToFixed(Y_Scale_Total);
	RecalcLayout();
}
コード例 #12
0
void CDataShield::SetOPMode(OPERATION_MODE m_mode)
{
	m_OPMode = m_mode;
	// Перерасчет размеров
	RecalcLayout();
}
コード例 #13
0
void gkToolBarPaneBase::OnSize(UINT nType, int cx, int cy) 
{
	IPaneBase::OnSize(nType, cx, cy);
	RecalcLayout();
}
コード例 #14
0
ファイル: MainFrm.cpp プロジェクト: fourier/Geometry2d
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	CWinApp * pApp = ::AfxGetApp();
	ASSERT( pApp != NULL );
	ASSERT( pApp->m_pszRegistryKey != NULL );
	ASSERT( pApp->m_pszRegistryKey[0] != _T('\0') );
	ASSERT( pApp->m_pszProfileName != NULL );
	ASSERT( pApp->m_pszProfileName[0] != _T('\0') );

	ASSERT( pApp->m_pszProfileName != NULL );


	g_CmdManager->ProfileSetup(
		pApp->m_pszProfileName,
		GetSafeHwnd()
		);
	VERIFY(
		g_CmdManager->UpdateFromMenu(
			pApp->m_pszProfileName,
			IDR_MAINFRAME
			)
		);
	
	


	if(!m_wndMenuBar.Create(
		NULL, // _T("Menu Bar"),
		this,
		IDR_Geometry2dTYPE
		))
	{
	    TRACE0("Failed to create menubar\n");
		return -1; 
	}

	if( !m_wndToolBar.Create(
			_T("ToolBar"),
			this,
			AFX_IDW_TOOLBAR
			)
		||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME)
		)
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if( !m_wndTriangleToolBar.Create(
			_T("Triangle"),
			this,
			IDR_TRIANGLE
			)
		||
		!m_wndTriangleToolBar.LoadToolBar(IDR_TRIANGLE)
		)
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if( !m_wndBoundaryToolBar.Create(
			_T("Boundary conditions"),
			this,
			IDR_BOUNDARY_BAR
			)
		||
		!m_wndBoundaryToolBar.LoadToolBar(IDR_BOUNDARY_BAR)
		)
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if( !m_wndPrimitivesToolBar.Create(
			_T("Primitives"),
			this,
			IDR_PRIMITIVES
			)
		||
		!m_wndPrimitivesToolBar.LoadToolBar(IDR_PRIMITIVES)
		)
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}


    CExtCmdItem * pCmdItem = NULL;

	pCmdItem =
		g_CmdManager->CmdGetPtr(
			pApp->m_pszProfileName,
			ID_BUTTON_NODE
			);
	ASSERT( pCmdItem != NULL );
	pCmdItem->m_sToolbarText = _T("Add nodes");

	pCmdItem =
		g_CmdManager->CmdGetPtr(
			pApp->m_pszProfileName,
			ID_BUTTON_SEGMENT
			);
	ASSERT( pCmdItem != NULL );
	pCmdItem->m_sToolbarText = _T("Add segments");

	pCmdItem =
		g_CmdManager->CmdGetPtr(
			pApp->m_pszProfileName,
			ID_BUTTON_MARKER1
			);
	ASSERT( pCmdItem != NULL );
	pCmdItem->m_sToolbarText = _T("Set marker to inner");

	pCmdItem =
		g_CmdManager->CmdGetPtr(
			pApp->m_pszProfileName,
			ID_BUTTON_MARKER2
			);
	ASSERT( pCmdItem != NULL );
	pCmdItem->m_sToolbarText = _T("Set marker to outer");

	pCmdItem =
		g_CmdManager->CmdGetPtr(
			pApp->m_pszProfileName,
			ID_BUTTON_HOLE
			);
	ASSERT( pCmdItem != NULL );
	pCmdItem->m_sToolbarText = _T("Set hole field");
	
	pCmdItem =
		g_CmdManager->CmdGetPtr(
			pApp->m_pszProfileName,
			ID_BUTTON_NODE_CHECK
			);
	ASSERT( pCmdItem != NULL );
	pCmdItem->m_sToolbarText = _T("Select node");

	pCmdItem =
		g_CmdManager->CmdGetPtr(
			pApp->m_pszProfileName,
			ID_BUTTON_BOUNDARY_LINE
			);
	ASSERT( pCmdItem != NULL );
	pCmdItem->m_sToolbarText = _T("Symmetry conditions");

	pCmdItem =
		g_CmdManager->CmdGetPtr(
			pApp->m_pszProfileName,
			ID_BUTTON_BOUNDARY_CURVE
			);
	ASSERT( pCmdItem != NULL );
	pCmdItem->m_sToolbarText = _T("Boundary conditions");

	if( !m_wndPropertiesToolBar.Create(
			_T("Properties"),
			this,
			IDR_OPTIONS
			)
		||
		!m_wndPropertiesToolBar.LoadToolBar(IDR_OPTIONS)
		)
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}
	
	pCmdItem =
		g_CmdManager->CmdGetPtr(
			pApp->m_pszProfileName,
			ID_BUTTON_PROPERTIES
			);
	ASSERT( pCmdItem != NULL );
	pCmdItem->m_sToolbarText = _T("Properties");

	pCmdItem =
		g_CmdManager->CmdGetPtr(
			pApp->m_pszProfileName,
			ID_BUTTON_TRIANGULATE
			);
	ASSERT( pCmdItem != NULL );
	pCmdItem->m_sToolbarText = _T("Triangulate");

	pCmdItem =
		g_CmdManager->CmdGetPtr(
			pApp->m_pszProfileName,
			ID_BUTTON_NODE_OPTIONS
			);
	ASSERT( pCmdItem != NULL );
	pCmdItem->m_sToolbarText = _T("Node options");

	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_wndProperties.SetInitDesiredSizeVertical(
		CSize( 200, 400 )
		);
	m_wndProperties.SetInitDesiredSizeHorizontal(
		CSize( 400, 200 )
		);

	m_wndNodeOptions.SetInitDesiredSizeVertical(
		CSize( 200, 400 )
		);
	m_wndNodeOptions.SetInitDesiredSizeHorizontal(
		CSize( 400, 200 )
		);

	if(	!m_wndProperties.Create(
		_T("Properties"),
		this,
		ID_VIEW_WIZARD_SHEET_PLACER	)
		)
	{
		TRACE0("Failed to create m_wndProperties\n");
		return -1;		// fail to create
	}

	if(	!m_wndNodeOptions.Create(
		_T("Node options"),
		this,
		ID_NODEOPTIONS_HOLDER)
		)
	{
		TRACE0("Failed to create m_wndProperties\n");
		return -1;		// fail to create
	}


	if( !m_wndInBarProperties.Create(
		IDD_PROPERTIES_DLG,
		&m_wndProperties)
		)
	{
		TRACE0("Failed to create m_wndInBarProperties\n");
		return -1;		// fail to create
	}
	m_wndInBarProperties.ShowSizeGrip( FALSE );

	if( !m_wndInBarNodeProperties.Create(
		IDD_NODE_PROPERTIES,
		&m_wndNodeOptions)
		)
	{
		TRACE0("Failed to create m_wndInBarProperties\n");
		return -1;		// fail to create
	}
	m_wndInBarProperties.ShowSizeGrip( FALSE );


	m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	m_wndTriangleToolBar.EnableDocking(CBRS_ALIGN_ANY);
	m_wndPropertiesToolBar.EnableDocking(CBRS_ALIGN_ANY);
	m_wndBoundaryToolBar.EnableDocking(CBRS_ALIGN_ANY);
	m_wndPrimitivesToolBar.EnableDocking(CBRS_ALIGN_ANY);
	m_wndProperties.EnableDocking(CBRS_ALIGN_ANY);
	m_wndNodeOptions.EnableDocking(CBRS_ALIGN_ANY);
	RecalcLayout();
	
	
	if( !CExtControlBar::FrameEnableDocking(this) )
	{
		ASSERT( FALSE );
		return -1;
	}
	DockControlBar(&m_wndMenuBar);	
	DockControlBar(&m_wndToolBar);	
	DockControlBar(&m_wndTriangleToolBar);	
	DockControlBar(&m_wndBoundaryToolBar);	
	DockControlBar(&m_wndPropertiesToolBar);	
	DockControlBar(&m_wndPrimitivesToolBar);	
	DockControlBar(&m_wndProperties);	
	DockControlBar(&m_wndNodeOptions);	

	m_wndProperties.DockControlBar( AFX_IDW_DOCKBAR_LEFT, 2, this, false );
	m_wndNodeOptions.DockControlBar( AFX_IDW_DOCKBAR_RIGHT, 2, this, false );
	
	int nIndicator=m_wndStatusBar.CommandToIndex(ID_INDICATORXY);
	m_wndStatusBar.SetPaneInfo(nIndicator, ID_INDICATORXY, SBPS_NORMAL, 100);
	
	nIndicator=m_wndStatusBar.CommandToIndex(ID_INDICATORMODE);
	m_wndStatusBar.SetPaneInfo(nIndicator, ID_INDICATORMODE, SBPS_NORMAL, 60);

	RecalcLayout();
	
	return 0;
}
コード例 #15
0
void CTTCheckBtnGroup::OnSize(UINT nType, int cx, int cy)
{
	CButton::OnSize(nType, cx, cy);
	RecalcLayout();
	Invalidate(FALSE);
}
コード例 #16
0
ファイル: FRAMEWND.CPP プロジェクト: Joincheng/lithtech
//------------------------------------------------------------------------
void CMRCFrameWndSizeDock::SaveBarSizes(LPCTSTR pszSection, BOOL bSave)
// Saves all the sizeable bars info
// uses the "ID" of the bar as a key. The bar will already exist on a 
// load, so this seems safe enough
//------------------------------------------------------------------------
{
	
	struct BarSizeSaveInfo BSI;
	CMRCSizeControlBar* pBar;
	char szBarId[20] = "BarSize_";

	CPtrArray arrFloatingBars;
	
	POSITION pos = m_listControlBars.GetHeadPosition();
	while (pos != NULL)
	{
		pBar = (CMRCSizeControlBar *) m_listControlBars.GetNext(pos);
		ASSERT(pBar != NULL);
		if (pBar->IsKindOf(RUNTIME_CLASS(CMRCSizeControlBar)))
		{
			UINT nID = pBar->GetDlgCtrlID();
			_itoa(nID, szBarId + 8, 10);

			if (bSave)
			{
				BSI.VertDockSize 	= pBar->m_VertDockSize;
				BSI.HorzDockSize	= pBar->m_HorzDockSize;
				BSI.FloatSize 		= pBar->m_FloatSize;
				BSI.bMDIFloating = FALSE;
				// if floating in a MDI Float window.
				CFrameWnd * pBarFrame = pBar->GetDockingFrame();
				if (pBarFrame != NULL && pBarFrame->IsKindOf(RUNTIME_CLASS(CMRCMDIFloatWnd)))
				{
					ASSERT(pBar->IsFloating());
					BSI.bMDIFloating = TRUE;
				}
				
				MRCWriteProfileBinary (pszSection, szBarId, &BSI, sizeof BSI);
			}
			else
			{
				if (MRCGetProfileBinary (pszSection, szBarId, &BSI, sizeof BSI))
				{
					pBar->m_VertDockSize	= BSI.VertDockSize;
					pBar->m_HorzDockSize	= BSI.HorzDockSize;
					pBar->m_FloatSize 		= BSI.FloatSize;
					
					// Now have to set the actual window size. The reason for this is
					// that the Adjustment algorithm looks at actual window rect sizes, so
					// it doesn't have to worry about borders etc.
					CSize NewSize = pBar->CalcFixedLayout(FALSE, (pBar->m_dwStyle & CBRS_ORIENT_HORZ));
					pBar->SetWindowPos(0, 0, 0, NewSize.cx, NewSize.cy, 
								SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOZORDER | SWP_NOMOVE);
					if (pBar->IsFloating())
					{
						if (BSI.bMDIFloating)	// floating in an MDI frame - do the float
						{
							// have to cast to CMRCMDIFrameWndSizeDock - as this is a CFrameWnd function
							ASSERT(this->IsKindOf(RUNTIME_CLASS(CMRCMDIFrameWndSizeDock)));
							arrFloatingBars.Add(pBar);
						}
						else
						{
							CFrameWnd * pFrame = pBar->GetParentFrame();
							if (pFrame != NULL)
								pFrame->RecalcLayout();
						}
					}
				}
#ifdef _VERBOSE_TRACE
				TRACE("Bar ID=%d, Floating(%d,%d), HorzDocked(%d,%d), VertDocked(%d.%d)\n",
						nID,
						BSI.FloatSize.cx,	BSI.FloatSize.cy,
						BSI.VertDockSize.cx, BSI.VertDockSize.cy,
						BSI.HorzDockSize.cx, BSI.HorzDockSize.cy);
#endif
			
			}

#ifdef _VERBOSE_TRACE
			CString strTitle;
			pBar->GetWindowText(strTitle);
			TRACE("%s '%s' ID=%d Float(%d,%d) Horz(%d,%d) Vert(%d,%d)\n",
					LPCTSTR(pBar->GetRuntimeClass()->m_lpszClassName),
					LPCTSTR(strTitle), nID,
					pBar->m_FloatSize.cx, pBar->m_FloatSize.cy,
					pBar->m_HorzDockSize.cx,  pBar->m_HorzDockSize.cy,
					pBar->m_VertDockSize.cx,  pBar->m_VertDockSize.cy);
#endif
		}
	}

	RecalcLayout();			// recalc the layout - so we end up with a meaningful set of bars
	if (!bSave)
	{
		for (int i = 0; i < arrFloatingBars.GetSize(); i++)
		{
			pBar = (CMRCSizeControlBar *) arrFloatingBars[i];
			ASSERT(pBar->m_pDockContext != NULL);
			((CMRCMDIFrameWndSizeDock *)this)->FloatControlBarInMDIChild(pBar,
											pBar->m_pDockContext->m_ptMRUFloatPos);
		}
	}
}
コード例 #17
0
//---------------------------------------------------------------------------
void wxTabbedWindow::SetActiveTab( int tabNo )
{
    mActiveTab = tabNo;
    RecalcLayout(true);
    Refresh();
}
コード例 #18
0
void CXTPCoreTreeControl::OnSize(UINT nType, int cx, int cy)
{
	CWnd::OnSize(nType, cx, cy);

	RecalcLayout();
}
コード例 #19
0
void CMainFrame::OnViewChange(UINT nCmdID)
// There is an ON_COMMAND_RANGE message map entry associated with
// OnViewChange:
// ON_COMMAND_RANGE(ID_VIEW_CHANGE1, ID_VIEW_CHANGE2, &OnViewChange)
{
   CView* pViewAdd;
   CView* pViewRemove;
   CDocument* pDoc = GetActiveDocument();

   // cvView1 and cvView2 are enum members defined in my CMainFrame class
   if((nCmdID == ID_VIEW_CHANGE1) && (m_currentView == cvView1))
      return;
   if((nCmdID == ID_VIEW_CHANGE2) && (m_currentView == cvView2))
      return;

   if (nCmdID == ID_VIEW_CHANGE2)
   {
      if (m_pView2 == NULL)
      {
         m_pView1 = GetActiveView();
         m_pView2 = new CMyView2;

         //Note that if OnSize has been overridden in CMyView2 
         //and GetDocument() is used in this override it can 
         //cause assertions and, if the assertions are ignored,
         //cause access violation.

         m_pView2->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, rectDefault, this, 
            AFX_IDW_PANE_FIRST + 1, NULL);
      }
      pViewAdd = m_pView2;
      pViewRemove = m_pView1;
      m_currentView = cvView2;
   }
   else
   {
      pViewAdd = m_pView1;
      pViewRemove = m_pView2;
      m_currentView = cvView1;
   }

   // Set the child i.d. of the active view to AFX_IDW_PANE_FIRST,
   // so that CFrameWnd::RecalcLayout will allocate to this 
   // "first pane" that portion of   the frame window's client area 
   // not allocated to control   bars.  Set the child i.d. of the 
   // other view to anything other than AFX_IDW_PANE_FIRST; this
   // examples switches the child id's of the two views.

   int nSwitchChildID = pViewAdd->GetDlgCtrlID();
   pViewAdd->SetDlgCtrlID(AFX_IDW_PANE_FIRST);
   pViewRemove->SetDlgCtrlID(nSwitchChildID);

   // Show the newly active view and hide the inactive view.

   pViewAdd->ShowWindow(SW_SHOW);
   pViewRemove->ShowWindow(SW_HIDE);

   // Connect the newly active view to the document, and
   // disconnect the inactive view.
   pDoc->AddView(pViewAdd);
   pDoc->RemoveView(pViewRemove);

   SetActiveView(pViewAdd);
   RecalcLayout();
}
コード例 #20
0
ファイル: MainFrm.cpp プロジェクト: yellowcd/sMIShop
void CMainFrame::ViewPropertyWnd()
{
	m_wndProperties.ShowWindow(m_wndProperties.IsVisible() ? SW_HIDE : SW_SHOW);
	RecalcLayout(FALSE);
}
コード例 #21
0
ファイル: form.cpp プロジェクト: amiel/jugglemaster
void JMFrame::showQuickBrowser(bool show) {
  m_wndDlgBar.ShowWindow(show ? SW_SHOW : SW_HIDE);
  RecalcLayout();
}
コード例 #22
0
ファイル: MainFrm.cpp プロジェクト: yellowcd/sMIShop
void CMainFrame::OnViewNaviview()
{
	// 네비게이터 스위치
	m_wndNaviView.ShowPane(m_wndNaviView.IsVisible() ? SW_HIDE : SW_SHOW,0,0);
	RecalcLayout(FALSE);
}
コード例 #23
0
ファイル: MainFrm.cpp プロジェクト: Catherine0320/YAP
void CMainFrame::OnViewCaptionBar()
{
	m_wndCaptionBar.ShowWindow(m_wndCaptionBar.IsVisible() ? SW_HIDE : SW_SHOW);
	RecalcLayout(FALSE);
}
コード例 #24
0
ファイル: MainFrm.cpp プロジェクト: yellowcd/sMIShop
void CMainFrame::OnFilewView()
{
	//파일뷰 스위치
	m_wndFileView.ShowPane(m_wndFileView.IsVisible() ? SW_HIDE : SW_SHOW, 0, 0);
	RecalcLayout(FALSE);
}
コード例 #25
0
ファイル: MainFrm.cpp プロジェクト: ZhaoboMeng/k-line-print
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;
	}

CWinApp * pApp = ::AfxGetApp();
	ASSERT( pApp != NULL );
	ASSERT( pApp->m_pszRegistryKey != NULL );
	ASSERT( pApp->m_pszRegistryKey[0] != _T('\0') );
	ASSERT( pApp->m_pszProfileName != NULL );
	ASSERT( pApp->m_pszProfileName[0] != _T('\0') );

	ASSERT( pApp->m_pszProfileName != NULL );
	g_CmdManager->ProfileSetup(
		pApp->m_pszProfileName,
		GetSafeHwnd()
		);
	VERIFY(
		g_CmdManager->UpdateFromMenu(
			pApp->m_pszProfileName,
			IDR_MAINFRAME
			)
		);
	
	m_wndMenuBar.SetUpdateFileMruList(FALSE);
	if(
		!m_wndMenuBar.Create(
			_T("menubar"),
			this,
			ID_VIEW_MENUBAR
			)

		||
		!m_wndMenuBar.LoadMenuBar(IDR_MAINFRAME)
		)
    {
        TRACE0("Failed to create menubar\n");
        return -1;      // failed to create
    }

	if( !m_wndToolBar.Create(
			_T("ToolBar"),
			this,
			AFX_IDW_TOOLBAR
			)
		||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME)
		)
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if(	!m_wndResizableBar0.Create(
			_T("Resizable Bar 0"),
			this,
			ID_VIEW_RESIZABLE_BAR_0
			)
		)
	{
		TRACE0("Failed to create m_wndResizableBar0\n");
		return -1;		// fail to create
	}

	if(	!m_wndResizableBar1.Create(
			_T("Resizable Bar 1"),
			this,
			ID_VIEW_RESIZABLE_BAR_1
			)
		)
	{
		TRACE0("Failed to create m_wndResizableBar1\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_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	m_wndResizableBar0.EnableDocking(CBRS_ALIGN_ANY);
	m_wndResizableBar1.EnableDocking(CBRS_ALIGN_ANY);
	
///	EnableDocking(CBRS_ALIGN_ANY);
	CExtControlBar::FrameEnableDocking(this);

	DockControlBar(&m_wndMenuBar);
	DockControlBar(&m_wndToolBar);
	DockControlBar(&m_wndResizableBar0,AFX_IDW_DOCKBAR_LEFT);
	RecalcLayout();
CRect wrAlredyDockedBar;
	m_wndResizableBar0.GetWindowRect( &wrAlredyDockedBar );
	wrAlredyDockedBar.OffsetRect( 0, 1 );
	DockControlBar(&m_wndResizableBar1,AFX_IDW_DOCKBAR_LEFT,&wrAlredyDockedBar);

	VERIFY(
		g_CmdManager->SetBasicCommands(
			pApp->m_pszProfileName,
			g_statBasicCommands
			)
		);

	CExtControlBar::ProfileBarStateLoad(
		this,
		pApp->m_pszRegistryKey,
		pApp->m_pszProfileName,
		&m_dataFrameWP
		);
	g_CmdManager->SerializeState(
		pApp->m_pszProfileName,
		pApp->m_pszRegistryKey,
		pApp->m_pszProfileName,
		false
		);

	return 0;
}
コード例 #26
0
ファイル: MainFrm.cpp プロジェクト: yellowcd/sMIShop
void CMainFrame::OnToolboxView()
{
	//툴박스 스위치
	m_wndToolBox.ShowPane(m_wndToolBox.IsVisible() ? SW_HIDE : SW_SHOW, 0, 0);
	RecalcLayout(FALSE);
}
コード例 #27
0
ファイル: Ctrl_pat.cpp プロジェクト: azherali/openmpt
BOOL CCtrlPatterns::OnInitDialog()
//--------------------------------
{
    CWnd::EnableToolTips(true);
    CRect rect, rcOrderList;
    CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
    CModControlDlg::OnInitDialog();

    if ((!m_pModDoc) || (!m_pSndFile) || (!pMainFrm)) return TRUE;
    LockControls();
    // Order List
    m_BtnNext.GetWindowRect(&rect);
    ScreenToClient(&rect);
    rcOrderList.left = rect.right + 4;
    rcOrderList.top = rect.top;
    rcOrderList.bottom = rect.bottom + GetSystemMetrics(SM_CYHSCROLL);
    GetClientRect(&rect);
    rcOrderList.right = rect.right - 4;
    m_OrderList.Init(rcOrderList, this, m_pModDoc, pMainFrm->GetGUIFont());
    // Toolbar buttons
    m_ToolBar.Init();
    m_ToolBar.AddButton(IDC_PATTERN_NEW, TIMAGE_PATTERN_NEW);
    m_ToolBar.AddButton(IDC_PATTERN_PLAY, TIMAGE_PATTERN_PLAY);
    m_ToolBar.AddButton(IDC_PATTERN_PLAYFROMSTART, TIMAGE_PATTERN_RESTART);
    m_ToolBar.AddButton(IDC_PATTERN_STOP, TIMAGE_PATTERN_STOP);
    m_ToolBar.AddButton(ID_PATTERN_PLAYROW, TIMAGE_PATTERN_PLAYROW);
    m_ToolBar.AddButton(IDC_PATTERN_RECORD, TIMAGE_PATTERN_RECORD, TBSTYLE_CHECK, ((m_bRecord) ? TBSTATE_CHECKED : 0)|TBSTATE_ENABLED);
    m_ToolBar.AddButton(ID_SEPARATOR, 0, TBSTYLE_SEP);
    m_ToolBar.AddButton(ID_PATTERN_VUMETERS, TIMAGE_PATTERN_VUMETERS, TBSTYLE_CHECK, ((m_bVUMeters) ? TBSTATE_CHECKED : 0)|TBSTATE_ENABLED);
    m_ToolBar.AddButton(ID_VIEWPLUGNAMES, TIMAGE_PATTERN_PLUGINS, TBSTYLE_CHECK, ((m_bPluginNames) ? TBSTATE_CHECKED : 0)|TBSTATE_ENABLED); //rewbs.patPlugNames
    m_ToolBar.AddButton(ID_PATTERN_CHANNELMANAGER, TIMAGE_CHANNELMANAGER);
    m_ToolBar.AddButton(ID_SEPARATOR, 0, TBSTYLE_SEP);
    m_ToolBar.AddButton(ID_PATTERN_MIDIMACRO, TIMAGE_MACROEDITOR);
    m_ToolBar.AddButton(ID_PATTERN_CHORDEDIT, TIMAGE_CHORDEDITOR);
    m_ToolBar.AddButton(ID_SEPARATOR, 0, TBSTYLE_SEP);
    m_ToolBar.AddButton(ID_EDIT_UNDO, TIMAGE_UNDO);
    m_ToolBar.AddButton(ID_PATTERN_PROPERTIES, TIMAGE_PATTERN_PROPERTIES);
    m_ToolBar.AddButton(ID_PATTERN_EXPAND, TIMAGE_PATTERN_EXPAND);
    m_ToolBar.AddButton(ID_PATTERN_SHRINK, TIMAGE_PATTERN_SHRINK);
    //        m_ToolBar.AddButton(ID_PATTERN_AMPLIFY, TIMAGE_SAMPLE_AMPLIFY);
    m_ToolBar.AddButton(ID_SEPARATOR, 0, TBSTYLE_SEP);
    m_ToolBar.AddButton(ID_PATTERNDETAIL_LO, TIMAGE_PATTERN_DETAIL_LO, TBSTYLE_CHECK, TBSTATE_ENABLED);
    m_ToolBar.AddButton(ID_PATTERNDETAIL_MED, TIMAGE_PATTERN_DETAIL_MED, TBSTYLE_CHECK, TBSTATE_ENABLED);
    m_ToolBar.AddButton(ID_PATTERNDETAIL_HI, TIMAGE_PATTERN_DETAIL_HI, TBSTYLE_CHECK, TBSTATE_ENABLED|TBSTATE_CHECKED);
    m_ToolBar.AddButton(ID_SEPARATOR, 0, TBSTYLE_SEP);
    m_ToolBar.AddButton(ID_OVERFLOWPASTE, TIMAGE_PATTERN_OVERFLOWPASTE, TBSTYLE_CHECK, ((CMainFrame::m_dwPatternSetup & PATTERN_OVERFLOWPASTE) ? TBSTATE_CHECKED : 0) | TBSTATE_ENABLED);

    // Special edit controls -> tab switch to view
    m_EditSequence.SetParent(this);
    m_EditSpacing.SetParent(this);
    m_EditPatName.SetParent(this);
    m_EditPatName.SetLimitText(MAX_PATTERNNAME - 1);
    m_EditOrderListMargins.SetParent(this);
    m_EditOrderListMargins.SetLimitText(3);
    // Spin controls
    m_SpinSpacing.SetRange(0, MAX_SPACING);
    m_SpinSpacing.SetPos(CMainFrame::gnPatternSpacing);

    m_SpinInstrument.SetRange(-1, 1);
    m_SpinInstrument.SetPos(0);

    if(CMainFrame::gbShowHackControls == true)
    {
            m_SpinOrderListMargins.ShowWindow(SW_SHOW);
            m_EditOrderListMargins.ShowWindow(SW_SHOW);
            m_SpinOrderListMargins.SetRange(0, m_OrderList.GetMarginsMax());
            m_SpinOrderListMargins.SetPos(m_OrderList.GetMargins());
    }
    else
    {
            m_SpinOrderListMargins.ShowWindow(SW_HIDE);
            m_EditOrderListMargins.ShowWindow(SW_HIDE);
    }

    SetDlgItemInt(IDC_EDIT_SPACING, CMainFrame::gnPatternSpacing);
    SetDlgItemInt(IDC_EDIT_ORDERLIST_MARGINS, m_OrderList.GetMargins());
    CheckDlgButton(IDC_PATTERN_FOLLOWSONG, !(CMainFrame::m_dwPatternSetup & PATTERN_FOLLOWSONGOFF));                //rewbs.noFollow - set to unchecked

    m_SpinSequence.SetRange(0, m_pSndFile->Order.GetNumSequences() - 1);
    m_SpinSequence.SetPos(m_pSndFile->Order.GetCurrentSequenceIndex());
    SetDlgItemText(IDC_EDIT_SEQUENCE_NAME, m_pSndFile->Order.m_sName.c_str());

    m_OrderList.SetFocus();

    UpdateView(HINT_MODTYPE|HINT_PATNAMES, NULL);
    RecalcLayout();

    m_bInitialized = TRUE;
    UnlockControls();

    return FALSE;
}
コード例 #28
0
ファイル: MainFrm.cpp プロジェクト: zxlooong/bcgexp
void CMainFrame::OnAppLook(UINT id)
{
    CBCGPDockManager::SetDockMode (BCGP_DT_SMART);

    m_nAppLook = id;

    CBCGPTabbedControlBar::m_StyleTabWnd = CBCGPTabWnd::STYLE_3D;

    switch (m_nAppLook)
    {
    case ID_VIEW_APPLOOK_2000:
        // enable Office 2000 look:
        CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager));
        break;

    case ID_VIEW_APPLOOK_XP:
        // enable Office XP look:
        CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerXP));
        break;

    case ID_VIEW_APPLOOK_WIN_XP:
        // enable Windows XP look (in other OS Office XP look will be used):
        CBCGPWinXPVisualManager::m_b3DTabsXPTheme = TRUE;
        CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPWinXPVisualManager));
        break;

    case ID_VIEW_APPLOOK_2003:
        // enable Office 2003 look:
        CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2003));
        CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
        break;

    case ID_VIEW_APPLOOK_VS2005:
        // enable VS 2005 look:
        CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerVS2005));
        CBCGPTabbedControlBar::m_StyleTabWnd = CBCGPTabWnd::STYLE_3D_ROUNDED;
        CBCGPVisualManager::GetInstance ();
        CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
        break;

    case ID_VIEW_APPLOOK_VS2008:
        // enable VS 2008 look:
        CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerVS2008));
        CBCGPVisualManager::GetInstance ();
        CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
        break;

    case ID_VIEW_APPLOOK_2007_1:
        // enable Office 2007 look:
        CBCGPVisualManager2007::SetStyle (CBCGPVisualManager2007::VS2007_LunaBlue);
        CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007));
        CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
        break;

    case ID_VIEW_APPLOOK_2007_2:
        // enable Office 2007 look:
        CBCGPVisualManager2007::SetStyle (CBCGPVisualManager2007::VS2007_ObsidianBlack);
        CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007));
        CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
        break;

    case ID_VIEW_APPLOOK_2007_3:
        // enable Office 2007 look:
        CBCGPVisualManager2007::SetStyle (CBCGPVisualManager2007::VS2007_Aqua);
        CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007));
        CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
        break;

    case ID_VIEW_APPLOOK_2007_4:
        // enable Office 2007 look:
        CBCGPVisualManager2007::SetStyle (CBCGPVisualManager2007::VS2007_Silver);
        CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007));
        CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
        break;

    default:
        ASSERT (FALSE);
    }

    CBCGPDockManager* pDockManager = GetDockManager ();
    if (pDockManager != NULL)
    {
        ASSERT_VALID (pDockManager);
        pDockManager->AdjustBarFrames ();
    }

    CBCGPTabbedControlBar::ResetTabs ();

    RecalcLayout ();
    RedrawWindow ();

    theApp.WriteInt (_T("ApplicationLook"), m_nAppLook);
}
コード例 #29
0
ファイル: mainfrm.cpp プロジェクト: paud/d2x-xl
void CMainFrame::OnToggleTexturePane() 
{
RecalcLayout (m_toolMode, (m_textureMode == 1) ? 2 : 1);
}
コード例 #30
0
ファイル: ltguifillframe.cpp プロジェクト: Arc0re/lithtech
void CLTGUIFillFrame::SetScale(const LTVector2& vfScale)
{
	CLTGUICtrl::SetScale( vfScale );
	RecalcLayout();
}