Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
9089253afThis file is pinned to the selected release. Download the original to open it in your design tool.
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include <ctrlext.h>
#include "shared.h"
#include "view_share.h"
#include "CAD.h"
//#include "Ruler.h"
#include "MainFrm.h"
//#include "GearsDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
//dealing with docking panels............
//https://www.codeproject.com/articles/493218/understanding-cdockablepane
static HWND handle_to_main_window;
//for now just used by TinyCADDoc to populate the lib tree.......
//note, the Tiny call expects blocking as it comes from a thread.
//forwards to: CMainFrame::OnTinyWnd(...)
bool AddTreeViewNode(tree_view_struct* data) //ID_TINY_WND
{
return ::SendMessage(handle_to_main_window,ID_TINY_WND, (WPARAM)data, 0);
}
//typically called by docs to populate the info windows..........
void SetInfoWnd(const info_notify& info, void* pinfo) //APP_INFO_NOTIFY
{
::SendMessage(handle_to_main_window, APP_INFO_NOTIFY, (WPARAM)&info, (WPARAM)pinfo);
}
//used to populate windows like info and layer views
//should be two way like OnTinyWnd(...) ????????
LRESULT CMainFrame::OnInfoNotify(WPARAM wp, LPARAM lp)
{
info_notify* pNote = reinterpret_cast< info_notify* >(wp);
assert(pNote->sig == 1234);//only in debug build
BUG_OS("CMainFrame::OnInfoNotify " << dbg_call_str[ pNote->the_call] << '\n' << pNote->str << std::endl);
switch (pNote->the_call)
{
case info_notify::other_info:
m_wndOutput.SetWindowInfo(*pNote);
break;
case info_notify::output_info:
m_wndOutput.SetWindowInfo(*pNote);
break;
case info_notify::layer:
{
auto pLayers = reinterpret_cast<sp_layer_set_type*>(lp);
assert(typeid(*pLayers) == typeid(sp_layer_set_type));
layer_tree_view.LoadLayerView(*pLayers);
break;
}
}//switch(...)
//switch( pNote->the_call )
//{
//case info_notify::output:
// if (pNote->bClear)
// m_wndOutput.ClearBuildWindow();
// m_wndOutput.SetBuildText(pNote->basic_info);
// break;
//case info_notify::other_info:
// if (pNote->bClear)
// m_wndOutput.ClearBuildWindow();
// m_wndOutput.SetOtherText(pNote->basic_info);
// break;
//case info_notify::layer:
// layer_tree_view.LoadLayerView( *reinterpret_cast< sp_layer_set_type* >( lp ) );
// break;
//}
LRESULT lres = 0;
return lres;
}
// ...........................................................................
//this can be used for about any tree, not just tiny, but testing.............
//From: AddTreeViewNode(...)
LRESULT CMainFrame::OnTinyWnd(WPARAM wp, LPARAM lp)
{
auto& tv = *(tree_view_struct*)(wp);
HTREEITEM ti = (HTREEITEM)tv.id;
CTreeCursor tc(ti ? ti : tinylib_yiew.GetRootItem(), tinylib_yiew.GetRootItem().GetTreeCtrl());
ti = tc.AddTail(tv.label, tv.icon_pos);
tv.id = (uint64_t)ti;
//SendMessageToDescendants(WM_COMMAND,0,1123);
return 0;
}
// ............................................................................
void CMainFrame::OnUpdateStatusText(CCmdUI *pCmdUI)
{
pCmdUI->Enable();
// should not use CView pointers..............................
//PCBView* pView= dynamic_cast< PCBView* >( GetActiveView( ) );
//ASSERT_VALID( pView );
//pCmdUI->SetText( pView->GetStatusInfo( ) );
pCmdUI->SetText(L"TESTING");
//TRACE( "in OnUpdateStatusText\n" );
}
// .......................................................................
IMPLEMENT_DYNCREATE(CMainFrame, CMDIFrameWndEx)
const int iMaxUserToolbars = 10;
const UINT uiFirstUserToolBarId = AFX_IDW_CONTROLBAR_FIRST + 40;
const UINT uiLastUserToolBarId = uiFirstUserToolBarId + iMaxUserToolbars - 1;
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWndEx)
ON_WM_CREATE()
ON_COMMAND(ID_VIEW_CUSTOMIZE, &CMainFrame::OnViewCustomize)
ON_REGISTERED_MESSAGE(AFX_WM_CREATETOOLBAR, &CMainFrame::OnToolbarCreateNew)
ON_COMMAND_RANGE(ID_VIEW_APPLOOK_WIN_2000, ID_VIEW_APPLOOK_WINDOWS_7, &CMainFrame::OnApplicationLook)
ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW_APPLOOK_WIN_2000, ID_VIEW_APPLOOK_WINDOWS_7, &CMainFrame::OnUpdateApplicationLook)
ON_MESSAGE(APP_INFO_NOTIFY, &CMainFrame::OnInfoNotify)
ON_WM_SETTINGCHANGE( )
ON_MESSAGE( CMD_TEST, OnDockableMsg )
ON_UPDATE_COMMAND_UI( ID_STATUSBAR_LABEL, &OnUpdateStatusText )
//add tiny lib to side view
ON_MESSAGE(ID_TINY_WND, &CMainFrame::OnTinyWnd)
END_MESSAGE_MAP()
static UINT indicators[] =
{
//ID_STATUSBAR_PANE1, //x,y coords
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
// ............................................................................
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
theApp.m_nAppLook = theApp.GetInt(_T("ApplicationLook"), ID_VIEW_APPLOOK_VS_2008);
}
// ............................................................................
CMainFrame::~CMainFrame()
{
//theApp.SaveState(dynamic_cast<CMDIFrameWndEx*>(this), L"TestState");
}
// ..........................................................................
LRESULT CMainFrame::OnDockableMsg(WPARAM wp, LPARAM lp)
{
if (GetActiveView())
GetActiveView()->SendMessage(VIEW_INFO_NOTIFY, wp, lp);
else
TRACE("No Active View for Dockable message\n");
return FALSE;
}
// ..........................................................................
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWndEx::OnCreate(lpCreateStruct) == -1)
return -1;
handle_to_main_window = GetSafeHwnd();
BOOL bNameValid;
// set the visual manager and style based on persisted value
OnApplicationLook(theApp.m_nAppLook);
if (!m_wndMenuBar.Create(this))
{
TRACE0("Failed to create menubar\n");
return -1; // fail to create
}
m_wndMenuBar.SetPaneStyle(m_wndMenuBar.GetPaneStyle() | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS | CBRS_FLYBY);
// prevent the menu bar from taking the focus on activation
CMFCPopupMenu::SetForceMenuFocus(FALSE);
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(theApp.m_bHiColorIcons ? IDR_MAINFRAME_256 : IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
CString strToolBarName;
bNameValid = strToolBarName.LoadString(IDS_TOOLBAR_STANDARD);
ASSERT(bNameValid);
m_wndToolBar.SetWindowText(strToolBarName);
CString strCustomize;
bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE);
ASSERT(bNameValid);
m_wndToolBar.EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize);
// Allow user-defined toolbars operations:
InitUserToolbars(NULL, uiFirstUserToolBarId, uiLastUserToolBarId);
//if( ! hRule.Create( this, 11023, 25 ) )
//{
// TRACE( "Failed to create status bar\n" );
// return -1; // fail to create
//}
//DockPane( &hRule );
//if( ! vRule.Create( this, 11024, 25, false ) )
//{
// TRACE( "Failed to create status bar\n" );
// return -1; // fail to create
//}
//DockPane( &vRule );
if( ! statusBar.Create( this ) )
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
statusBar.SetIndicators( indicators, sizeof(indicators) / sizeof(UINT) );
//statusBar.SetPaneStyle( statusBar.CommandToIndex( ID_STATUSBAR_PANE1 ), SBPS_NOBORDERS );
//statusBar.SetPaneTextColor( statusBar.CommandToIndex( ID_STATUSBAR_PANE1 ) );
// TODO: Delete these five lines if you don't want the toolbar and menubar to be dockable
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
DockPane(&m_wndToolBar);
// enable Visual Studio 2005 style docking window behavior
CDockingManager::SetDockingMode(DT_SMART);
// enable Visual Studio 2005 style docking window auto-hide behavior
EnableAutoHidePanes(CBRS_ALIGN_ANY);
// Load menu item image (not placed on any standard toolbars):
CMFCToolBar::AddToolBarForImageCollection(IDR_MENU_IMAGES, theApp.m_bHiColorIcons ? IDB_MENU_IMAGES_24 : 0);
// create docking windows
if (!CreateDockingWindows())
{
TRACE0("Failed to create docking windows\n");
return -1;
}
CDockablePane* pTabbedBar = NULL;
layer_tree_view.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&layer_tree_view);
m_wndFileView.EnableDocking(CBRS_ALIGN_ANY);
m_wndFileView.AttachToTabWnd(&layer_tree_view, DM_SHOW, TRUE, &pTabbedBar);
tinylib_yiew.EnableDocking(CBRS_ALIGN_ANY);
tinylib_yiew.AttachToTabWnd(&layer_tree_view, DM_SHOW, TRUE, &pTabbedBar);
//
//layer_tree_view.EnableDocking(CBRS_ALIGN_ANY);
//DockPane(&layer_tree_view);
////layer_tree_view.AttachToTabWnd(&m_wndFileView, DM_SHOW, TRUE, &pTabbedBar);
//tinylib_yiew.EnableDocking(CBRS_ALIGN_ANY);
//DockPane(&tinylib_yiew);
//tinylib_yiew.AttachToTabWnd(&layer_tree_view, DM_SHOW, TRUE, &pTabbedBar);
////
//m_wndFileView.EnableDocking(CBRS_ALIGN_ANY);
//m_wndFileView.AttachToTabWnd(&layer_tree_view, DM_SHOW, TRUE, &pTabbedBar);
//DockPane(&layer_tree_view);
//
m_wndOutput.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndOutput);
m_wndProperties.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndProperties);
//
gear_dlg.EnableDocking( CBRS_ALIGN_ANY );
DockPane( &gear_dlg );
// Enable toolbar and docking window menu replacement
EnablePaneMenu(TRUE, ID_VIEW_CUSTOMIZE, strCustomize, ID_VIEW_TOOLBAR);
// enable quick (Alt+drag) toolbar customization
CMFCToolBar::EnableQuickCustomization();
if (CMFCToolBar::GetUserImages() == NULL)
{
// load user-defined toolbar images
if (m_UserImages.Load(_T(".\\UserImages.bmp")))
{
CMFCToolBar::SetUserImages(&m_UserImages);
}
}
// enable menu personalization (most-recently used commands)
// TODO: define your own basic commands, ensuring that each pulldown menu has at least one basic command.
CList<UINT, UINT> lstBasicCommands;
lstBasicCommands.AddTail(ID_FILE_NEW);
lstBasicCommands.AddTail(ID_FILE_OPEN);
lstBasicCommands.AddTail(ID_FILE_SAVE);
lstBasicCommands.AddTail(ID_FILE_PRINT);
lstBasicCommands.AddTail(ID_APP_EXIT);
lstBasicCommands.AddTail(ID_EDIT_CUT);
lstBasicCommands.AddTail(ID_EDIT_PASTE);
lstBasicCommands.AddTail(ID_EDIT_UNDO);
lstBasicCommands.AddTail(ID_APP_ABOUT);
lstBasicCommands.AddTail(ID_VIEW_STATUS_BAR);
lstBasicCommands.AddTail(ID_VIEW_TOOLBAR);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2003);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_VS_2005);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_BLUE);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_SILVER);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_BLACK);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_AQUA);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_WINDOWS_7);
lstBasicCommands.AddTail(ID_SORTING_SORTALPHABETIC);
lstBasicCommands.AddTail(ID_SORTING_SORTBYTYPE);
lstBasicCommands.AddTail(ID_SORTING_SORTBYACCESS);
lstBasicCommands.AddTail(ID_SORTING_GROUPBYTYPE);
CMFCToolBar::SetBasicCommands(lstBasicCommands);
return 0;
}
// ..........................................................................
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIFrameWndEx::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
// ..........................................................................
BOOL CMainFrame::CreateDockingWindows()
{
BOOL bNameValid;
// Create Layer view
CString strLayerView;
bNameValid = strLayerView.LoadString(IDS_LAYER_VIEW);
ASSERT(bNameValid);
if (!layer_tree_view.Create(strLayerView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_CLASSVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
{
TRACE0("Failed to create Class View window\n");
return FALSE; // failed to create
}
// Create TinyLib view
CString strTinyLibView;
bNameValid = strTinyLibView.LoadString(IDS_TINY_LIB_VIEW);
ASSERT(bNameValid);
if (!tinylib_yiew.Create(strTinyLibView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_FILEVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
{
TRACE0("Failed to create Class View window\n");
return FALSE; // failed to create
}
// Create bxl file view
CString strBXLFileView;
bNameValid = strBXLFileView.LoadString(IDS_BXL_FILE_VIEW);
ASSERT(bNameValid);
if (!m_wndFileView.Create(strBXLFileView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_FILEVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
{
TRACE0("Failed to create File View window\n");
return FALSE; // failed to create
}
// Create output window
CString strOutputWnd;
bNameValid = strOutputWnd.LoadString(IDS_OUTPUT_WND);
ASSERT(bNameValid);
if (!m_wndOutput.Create(strOutputWnd, this, CRect(0, 0, 100, 100), TRUE, ID_VIEW_OUTPUTWND, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_BOTTOM | CBRS_FLOAT_MULTI))
{
TRACE0("Failed to create Output window\n");
return FALSE; // failed to create
}
// Create properties window
CString strPropertiesWnd;
bNameValid = strPropertiesWnd.LoadString(IDS_PROPERTIES_WND);
ASSERT(bNameValid);
if (!m_wndProperties.Create(strPropertiesWnd, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_PROPERTIESWND, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI))
{
TRACE0("Failed to create Properties window\n");
return FALSE; // failed to create
}
// Create gear dialog window
CString strGearDlgWnd;
bNameValid = strGearDlgWnd.LoadString(IDS_GEAR_DLG);
ASSERT(bNameValid);
if( ! gear_dlg.Create( strGearDlgWnd, this, TRUE, IDS_GEAR_DLG, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI, IDS_GEAR_DLG))
{
TRACE0("Failed to create Gear Dialog window\n");
return FALSE; // failed to create
}
SetDockingWindowIcons(theApp.m_bHiColorIcons);
return TRUE;
}
// ..........................................................................
void CMainFrame::SetDockingWindowIcons(BOOL bHiColorIcons)
{
HICON hClassViewIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_LAYER_VIEW_HC : IDI_LAYER_VIEW), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
layer_tree_view.SetIcon(hClassViewIcon, FALSE);
HICON hFileViewIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_FILE_VIEW_HC : IDI_FILE_VIEW), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
m_wndFileView.SetIcon(hFileViewIcon, FALSE);
HICON hOutputBarIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_OUTPUT_WND_HC : IDI_OUTPUT_WND), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
m_wndOutput.SetIcon(hOutputBarIcon, FALSE);
HICON hPropertiesBarIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_PROPERTIES_WND_HC : IDI_PROPERTIES_WND), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
m_wndProperties.SetIcon(hPropertiesBarIcon, FALSE);
HICON hGearDlgBarIcon = (HICON) ::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE(bHiColorIcons ? IDI_GEARS_WND_HC : IDI_PROPERTIES_WND), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), 0);
gear_dlg.SetIcon(hGearDlgBarIcon, FALSE);
}
// ..........................................................................
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CMDIFrameWndEx::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CMDIFrameWndEx::Dump(dc);
}
#endif //_DEBUG
// ..........................................................................
void CMainFrame::OnViewCustomize()
{
CMFCToolBarsCustomizeDialog* pDlgCust = new CMFCToolBarsCustomizeDialog(this, TRUE /* scan menus */);
pDlgCust->EnableUserDefinedToolbars();
pDlgCust->Create();
}
// ..........................................................................
BOOL CMainFrame::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle, CWnd* pParentWnd, CCreateContext* pContext)
{
// base class does the real work
if (!CMDIFrameWndEx::LoadFrame(nIDResource, dwDefaultStyle, pParentWnd, pContext))
{
return FALSE;
}
// enable customization button for all user toolbars
BOOL bNameValid;
CString strCustomize;
bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE);
ASSERT(bNameValid);
for (int i = 0; i < iMaxUserToolbars; i ++)
{
CMFCToolBar* pUserToolbar = GetUserToolBarByIndex(i);
if (pUserToolbar != NULL)
{
pUserToolbar->EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize);
}
}
return TRUE;
}
// ..........................................................................
LRESULT CMainFrame::OnToolbarCreateNew(WPARAM wp,LPARAM lp)
{
LRESULT lres = CMDIFrameWndEx::OnToolbarCreateNew(wp,lp);
if (lres == 0)
{
return 0;
}
CMFCToolBar* pUserToolbar = (CMFCToolBar*)lres;
ASSERT_VALID(pUserToolbar);
BOOL bNameValid;
CString strCustomize;
bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE);
ASSERT(bNameValid);
pUserToolbar->EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize);
return lres;
}
// ..........................................................................
void CMainFrame::OnApplicationLook(UINT id)
{
CWaitCursor wait;
theApp.m_nAppLook = id;
switch (theApp.m_nAppLook)
{
case ID_VIEW_APPLOOK_WIN_2000:
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManager));
break;
case ID_VIEW_APPLOOK_OFF_XP:
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOfficeXP));
break;
case ID_VIEW_APPLOOK_WIN_XP:
CMFCVisualManagerWindows::m_b3DTabsXPTheme = TRUE;
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
break;
case ID_VIEW_APPLOOK_OFF_2003:
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOffice2003));
CDockingManager::SetDockingMode(DT_SMART);
break;
case ID_VIEW_APPLOOK_VS_2005:
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerVS2005));
CDockingManager::SetDockingMode(DT_SMART);
break;
case ID_VIEW_APPLOOK_VS_2008:
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerVS2008));
CDockingManager::SetDockingMode(DT_SMART);
break;
case ID_VIEW_APPLOOK_WINDOWS_7:
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows7));
CDockingManager::SetDockingMode(DT_SMART);
break;
default:
switch (theApp.m_nAppLook)
{
case ID_VIEW_APPLOOK_OFF_2007_BLUE:
CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_LunaBlue);
break;
case ID_VIEW_APPLOOK_OFF_2007_BLACK:
CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_ObsidianBlack);
break;
case ID_VIEW_APPLOOK_OFF_2007_SILVER:
CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_Silver);
break;
case ID_VIEW_APPLOOK_OFF_2007_AQUA:
CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_Aqua);
break;
}
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOffice2007));
CDockingManager::SetDockingMode(DT_SMART);
}
RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_FRAME | RDW_ERASE);
theApp.WriteInt(_T("ApplicationLook"), theApp.m_nAppLook);
}
// ..........................................................................
void CMainFrame::OnUpdateApplicationLook(CCmdUI* pCmdUI)
{
pCmdUI->SetRadio(theApp.m_nAppLook == pCmdUI->m_nID);
}
// ..........................................................................
void CMainFrame::OnSettingChange(UINT uFlags, LPCTSTR lpszSection)
{
CMDIFrameWndEx::OnSettingChange(uFlags, lpszSection);
m_wndOutput.UpdateFonts();
}