Changeset 493 in dev
- Timestamp:
- Apr 17, 2008, 2:01:48 AM (17 years ago)
- Location:
- trunk/ab5.0/abdev/abdev
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/abdev/abdev.cpp
r492 r493 988 988 return hChild; 989 989 } 990 void CreateNewFile(void){991 992 #ifdef THETEXT993 NewTextEditWindow(NULL,WNDTYPE_TEXT);994 return;995 #else996 int FileType;997 BOOL bAddToProject;998 char temporary[MAX_PATH];999 1000 FileType=DialogBox(hResInst,MAKEINTRESOURCE(IDD_NEWFILE),hOwner,(DLGPROC)DlgNewFile);1001 if(FileType==-1) return;1002 1003 if(FileType&0x00008000){1004 bAddToProject=1;1005 FileType&=0x0FFF;1006 lstrcpy(temporary,NewFileName);1007 if(!strstr(temporary,".")) lstrcat(temporary,".ab");1008 GetFullPath(temporary,ProjectInfo.dir);1009 }1010 else bAddToProject=0;1011 1012 switch(FileType){1013 case FT_BASICPROGRAM: //Basicプログラム1014 case FT_SUBPROGRAM:1015 if(bAddToProject){1016 WriteBuffer(temporary,0,0);1017 NewTextEditWindow(temporary,WNDTYPE_BASIC);1018 Project_File_Insert(temporary);1019 }1020 else NewTextEditWindow(NULL,WNDTYPE_BASIC);1021 break;1022 1023 case FT_PROJECT:1024 DlgNewProjectWizard(hOwner);1025 break;1026 1027 case FT_TEXT:1028 NewTextEditWindow(NULL,WNDTYPE_TEXT);1029 break;1030 1031 case FT_HTML:1032 NewTextEditWindow(NULL,WNDTYPE_HTML);1033 break;1034 1035 case FT_ICON:1036 NewIconEditWindow(NULL);1037 break;1038 }1039 #endif1040 }1041 990 void CloseDocWindow(int WndNum){ 1042 991 int i2,i3; … … 1425 1374 case WM_COMMAND: 1426 1375 switch(LOWORD(wParam)){ 1427 case IDM_NEW:1428 CreateNewFile();1429 return 0;1430 case IDM_OPEN:1431 //"ファイルを指定してください"1432 if(!GetFilePathDialog(hwnd,str,DefFileFilter,STRING_FILEOPENTITLE_DEFAULT,TRUE)) return 0;1433 1434 OpenFileWithExtension(str);1435 return 0;1436 case IDM_CLOSE:1437 hChild=GetWindow(hClient,GW_CHILD);1438 if(IsWindow(hChild)) SendMessage(hChild,WM_CLOSE,0,0);1439 return 0;1440 1376 #ifndef THETEXT 1441 1377 case IDM_PROJECT_OPEN: -
trunk/ab5.0/abdev/abdev/include/MainFrame.h
r492 r493 45 45 LRESULT OnNotify( int idCtrl, LPNMHDR pnmh ); 46 46 47 // 「新規作成」メニューがクリックされた 48 void OnCmdNew( UINT uNotifyCode, int nID, CWindow wndCtl ); 49 50 // 「開く」メニューがクリックされた 51 void OnCmdOpen( UINT uNotifyCode, int nID, CWindow wndCtl ); 52 53 // 「閉じる」メニューがクリックされた 54 void OnCmdClose( UINT uNotifyCode, int nID, CWindow wndCtl ); 55 47 56 private: 48 57 // メッセージマップ … … 59 68 60 69 MSG_WM_NOTIFY( OnNotify ); 70 71 COMMAND_ID_HANDLER_EX( IDM_NEW, OnCmdNew ) 72 COMMAND_ID_HANDLER_EX( IDM_OPEN, OnCmdOpen ) 73 COMMAND_ID_HANDLER_EX( IDM_CLOSE, OnCmdClose ) 61 74 END_MSG_MAP() 62 75 }; -
trunk/ab5.0/abdev/abdev/src/MainFrame.cpp
r492 r493 267 267 return 0; 268 268 } 269 270 void MainFrame::OnCmdNew( UINT uNotifyCode, int nID, CWindow wndCtl ) 271 { 272 273 #ifdef THETEXT 274 NewTextEditWindow(NULL,WNDTYPE_TEXT); 275 return; 276 #else 277 int FileType; 278 BOOL bAddToProject; 279 char temporary[MAX_PATH]; 280 281 FileType=DialogBox(hResInst,MAKEINTRESOURCE(IDD_NEWFILE),hOwner,(DLGPROC)DlgNewFile); 282 if(FileType==-1) return; 283 284 if(FileType&0x00008000){ 285 bAddToProject=1; 286 FileType&=0x0FFF; 287 extern char NewFileName[MAX_PATH]; 288 lstrcpy(temporary,NewFileName); 289 if(!strstr(temporary,".")) lstrcat(temporary,".ab"); 290 GetFullPath(temporary,ProjectInfo.dir); 291 } 292 else bAddToProject=0; 293 294 switch(FileType){ 295 case FT_BASICPROGRAM: //Basicプログラム 296 case FT_SUBPROGRAM: 297 if(bAddToProject){ 298 WriteBuffer(temporary,0,0); 299 NewTextEditWindow(temporary,WNDTYPE_BASIC); 300 Project_File_Insert(temporary); 301 } 302 else NewTextEditWindow(NULL,WNDTYPE_BASIC); 303 break; 304 305 case FT_PROJECT: 306 DlgNewProjectWizard(hOwner); 307 break; 308 309 case FT_TEXT: 310 NewTextEditWindow(NULL,WNDTYPE_TEXT); 311 break; 312 313 case FT_HTML: 314 NewTextEditWindow(NULL,WNDTYPE_HTML); 315 break; 316 317 case FT_ICON: 318 NewIconEditWindow(NULL); 319 break; 320 } 321 #endif 322 } 323 324 void MainFrame::OnCmdOpen( UINT uNotifyCode, int nID, CWindow wndCtl ) 325 { 326 //"ファイルを指定してください" 327 extern LPSTR DefFileFilter; 328 char temporary[1024]; 329 if(!GetFilePathDialog(m_hWnd,temporary,DefFileFilter,STRING_FILEOPENTITLE_DEFAULT,TRUE)) return; 330 331 OpenFileWithExtension( temporary ); 332 } 333 334 void MainFrame::OnCmdClose( UINT uNotifyCode, int nID, CWindow wndCtl ) 335 { 336 HWND hChild=::GetWindow(hClient,GW_CHILD); 337 if(::IsWindow(hChild)) SendMessage(hChild,WM_CLOSE,0,0); 338 } -
trunk/ab5.0/abdev/abdev/stdafx.h
r492 r493 38 38 #include <abdev/ab_common/Environment.h> 39 39 40 #include "../res/resource.h" 41 40 42 #include <WindowComponents/BaseWindow.h> 41 43 #include <WindowComponents/MdiChild.h> … … 48 50 #include <Program.h> 49 51 50 #include "../res/resource.h"51 52 52 #include "Common.h"
Note:
See TracChangeset
for help on using the changeset viewer.