Changeset 647
- Timestamp:
- 11/19/06 23:32:53 (2 years ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
common/project.cpp (modified) (4 diffs)
-
win/LeoCAD.rc (modified) (1 diff)
-
win/System.cpp (modified) (1 diff)
-
win/resource.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/project.cpp
r646 r647 142 142 UpdateSelection(); 143 143 SystemUpdateTime(false, m_ActiveModel->m_CurFrame, 255); 144 SystemUpdateModelMenu(m_ModelList, m_ActiveModel); 144 145 145 146 for (int i = 0; i < m_ViewList.GetSize(); i++) … … 220 221 221 222 m_ActiveModel = NULL; 223 SystemUpdateModelMenu(m_ModelList, m_ActiveModel); 222 224 223 225 for (i = 0; i < LC_CONNECTIONS; i++) … … 324 326 m_ActiveModel = new lcModel("Main"); 325 327 m_ModelList.Add(m_ActiveModel); 328 SystemUpdateModelMenu(m_ModelList, m_ActiveModel); 326 329 327 330 for (i = 0; i < m_ViewList.GetSize (); i++) … … 4406 4409 case LC_MODEL_NEW: 4407 4410 { 4411 int Max = 0; 4412 4413 // Find out the number of the last model added. 4414 for (int i = 0; i < m_ModelList.GetSize(); i++) 4415 { 4416 int Num; 4417 4418 if (sscanf((char*)m_ModelList[i]->GetName(), "New Model %d", &Num) == 1) 4419 if (Num > Max) 4420 Max = Num; 4421 } 4422 4423 char Name[256]; 4424 sprintf(Name, "New Model %d", Max + 1); 4425 4426 // Create and add new model. 4427 lcModel* Model = new lcModel(Name); 4428 m_ModelList.Add(Model); 4429 m_ActiveModel = Model; 4430 4431 SetModifiedFlag(true); 4432 CheckPoint("Adding Model"); 4433 SystemUpdateModelMenu(m_ModelList, m_ActiveModel); 4434 UpdateAllViews(); 4408 4435 } break; 4409 4436 4410 4437 case LC_MODEL_DELETE: 4411 4438 { 4439 // Make sure we aren't deleting the last model. 4440 if (m_ModelList.GetSize() < 2) 4441 { 4442 SystemDoMessageBox("Projects must have at least 1 model.", LC_MB_OK | LC_MB_ICONINFORMATION); 4443 break; 4444 } 4445 4446 // Ask the user if he really wants to delete this model. 4447 char* Text = new char[m_ActiveModel->GetName().GetLength() + 100]; 4448 sprintf(Text, "Are you sure you want to delete the model \"%s\"?", (char*)m_ActiveModel->GetName()); 4449 4450 if (SystemDoMessageBox(Text, LC_MB_YESNO | LC_MB_ICONQUESTION) == LC_YES) 4451 { 4452 m_ModelList.RemovePointer(m_ActiveModel); 4453 delete m_ActiveModel; 4454 m_ActiveModel = m_ModelList[0]; 4455 4456 SetModifiedFlag(true); 4457 CheckPoint("Deleting Model"); 4458 SystemUpdateModelMenu(m_ModelList, m_ActiveModel); 4459 } 4460 4461 delete[] Text; 4412 4462 } break; 4413 4463 -
trunk/win/LeoCAD.rc
r646 r647 932 932 END 933 933 934 IDD_GROUP DIALOG 0, 0, 170, 45934 IDD_GROUP DIALOGEX 0, 0, 170, 45 935 935 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 936 936 CAPTION "Group Name" 937 FONT 8, "MS Sans Serif" 937 FONT 8, "MS Sans Serif", 0, 0, 0x0 938 938 BEGIN 939 939 EDITTEXT IDC_GRPDLG_NAME,15,17,90,10,ES_AUTOHSCROLL -
trunk/win/System.cpp
r646 r647 881 881 return; 882 882 883 if (ModelList.GetSize() > 1) 884 Menu->EnableMenuItem(ID_MODEL_DELETE, MF_BYCOMMAND | MF_ENABLED); 885 else 886 Menu->EnableMenuItem(ID_MODEL_DELETE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED); 887 883 888 // Delete existing entries. 884 889 for (int i = 1; i < LC_MODEL_MENU_MAX; i++) -
trunk/win/resource.h
r646 r647 70 70 #define IDC_PAN_ALL 169 71 71 #define IDD_GROUP 170 72 #define IDD_NAME 170 72 73 #define IDB_HELP 172 73 74 #define IDB_HOME 173
