summaryrefslogtreecommitdiff
path: root/win/System.cpp
diff options
context:
space:
mode:
authorleo2002-10-11 03:24:04 +0000
committerleo2002-10-11 03:24:04 +0000
commit9a634aa5dfbb1ef9f9b77d0b3785443c79a438e6 (patch)
tree1e0927fbdca9592df390d2ee5148a5d92e506a17 /win/System.cpp
parentd6b225e0c68375063632203830d14085cacfc2d0 (diff)
Set default author when starting a new project.
git-svn-id: http://svn.leocad.org/trunk@310 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win/System.cpp')
-rw-r--r--win/System.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/win/System.cpp b/win/System.cpp
index c2ccbf9..9c4ce14 100644
--- a/win/System.cpp
+++ b/win/System.cpp
@@ -49,9 +49,15 @@ static void ShowLastError()
static CMenu* GetMainMenu(int nIndex)
{
CWnd* pFrame = AfxGetMainWnd();
+
if (pFrame == NULL)
return NULL;
+
CMenu* pMenu = pFrame->GetMenu();
+
+ if (pMenu == NULL)
+ return NULL;
+
return pMenu->GetSubMenu(nIndex);
}
@@ -679,9 +685,11 @@ void SystemUpdatePaste(bool enable)
CToolBar* pBar = (CToolBar*)pFrame->GetControlBar(AFX_IDW_TOOLBAR);
CToolBarCtrl* pCtrl = &pBar->GetToolBarCtrl();
- pMenu->EnableMenuItem(ID_EDIT_PASTE, MF_BYCOMMAND |
- (enable ? MF_ENABLED : (MF_DISABLED | MF_GRAYED)));
- pCtrl->EnableButton(ID_EDIT_PASTE, enable ? TRUE : FALSE);
+ if (pMenu != NULL)
+ pMenu->EnableMenuItem(ID_EDIT_PASTE, MF_BYCOMMAND | (enable ? MF_ENABLED : (MF_DISABLED | MF_GRAYED)));
+
+ if (pCtrl)
+ pCtrl->EnableButton(ID_EDIT_PASTE, enable ? TRUE : FALSE);
}
void SystemUpdatePlay(bool play, bool stop)
@@ -1263,7 +1271,7 @@ bool SystemDoDialog(int nMode, void* param)
CPreferencesSheet ps;
LC_PREFERENCESDLG_OPTS* opts = (LC_PREFERENCESDLG_OPTS*)param;
- ps.m_PageGeneral.SetOptions(opts->nSaveInterval, opts->nMouse, opts->strPath);
+ ps.m_PageGeneral.SetOptions(opts->nSaveInterval, opts->nMouse, opts->strPath, opts->strUser);
ps.m_PageDetail.SetOptions(opts->nDetail, opts->fLineWidth);
ps.m_PageDrawing.SetOptions(opts->nSnap, opts->nAngleSnap, opts->nGridSize);
ps.m_PageScene.SetOptions(opts->nScene, opts->fDensity, opts->strBackground, opts->fBackground, opts->fFog, opts->fAmbient, opts->fGrad1, opts->fGrad2);
@@ -1271,7 +1279,7 @@ bool SystemDoDialog(int nMode, void* param)
if (ps.DoModal() == IDOK)
{
- ps.m_PageGeneral.GetOptions(&opts->nSaveInterval, &opts->nMouse, opts->strPath);
+ ps.m_PageGeneral.GetOptions(&opts->nSaveInterval, &opts->nMouse, opts->strPath, opts->strUser);
ps.m_PageDetail.GetOptions(&opts->nDetail, &opts->fLineWidth);
ps.m_PageDrawing.GetOptions(&opts->nSnap, &opts->nAngleSnap, &opts->nGridSize);
ps.m_PageScene.GetOptions(&opts->nScene, &opts->fDensity, opts->strBackground, opts->fBackground, opts->fFog, opts->fAmbient, opts->fGrad1, opts->fGrad2);