Changeset 492 in dev for trunk/ab5.0/abdev
- Timestamp:
- Apr 17, 2008, 1:37:40 AM (17 years ago)
- Location:
- trunk/ab5.0/abdev/abdev
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/abdev/Common.h
r484 r492 1 #pragma once 2 1 3 #define OEMRESOURCE 2 4 #define _CRT_SECURE_NO_DEPRECATE //セキュリティ警告を出さない -
trunk/ab5.0/abdev/abdev/abdev.cpp
r489 r492 1399 1399 RECT rect; 1400 1400 POINT pos; 1401 LPTOOLTIPTEXT TipText;1402 LPNMHDR lpnmhdr;1403 NMPGCALCSIZE *lpCalcSize;1404 NMPGSCROLL *lpScroll;1405 1401 HDROP hDrop; 1406 1402 HGLOBAL hGlobal; … … 1425 1421 } 1426 1422 1427 switch(message){ 1428 case WM_TIMER: 1429 //Pro版は自動バックアップ及び復元機能を有効にする 1430 _beginthread(backup,0,0); 1431 1432 #ifndef THETEXT 1433 if(wParam==ID_DEBUGSAFTY){ 1434 //BasicCompiler.exeが強制終了しているかどうかを検証 1435 pobj_Debugger->SaftyCheck(); 1436 } 1437 #endif 1438 1439 return 0; 1440 1441 1442 case WM_DRAWCLIPBOARD: 1443 ResetState_EditMenu(); 1444 return 0; 1445 1446 case WM_MENUSELECT: 1447 MenuAdvice(wParam); 1448 return 0; 1449 case WM_INITMENU: 1450 pobj_nv->pobj_History->ResetFileMenu(pobj_FileHistoryMenu,1); 1451 #ifndef THETEXT 1452 pobj_nv->pobj_ProjectHistory->ResetFileMenu(pobj_ProjectHistoryMenu,0); 1453 #endif 1454 return 0; 1455 case WM_MEASUREITEM: 1456 LPMEASUREITEMSTRUCT lpMI; 1457 lpMI = (LPMEASUREITEMSTRUCT)lParam; 1458 if(lpMI->CtlType==ODT_MENU){ 1459 SIZE size; 1460 CMenuItemData *pobj_MenuItemData; 1461 pobj_MenuItemData=(CMenuItemData *)lpMI->itemData; 1462 if(pobj_MenuItemData->pobj_ThisMenu->hMenu==pobj_MainMenu->hMenu){ 1463 //メインメニューの親アイテム 1464 pobj_MainMenu->GetItemSize(pobj_MenuItemData->item_index,&size); 1465 lpMI->itemWidth = size.cx; 1466 lpMI->itemHeight = size.cy; 1467 } 1468 else{ 1469 //メインメニューにぶらさがるサブメニュー 1470 pobj_MenuItemData->pobj_ThisMenu->GetItemSize(pobj_MenuItemData->item_index,&size); 1471 lpMI->itemWidth = size.cx; 1472 lpMI->itemHeight = size.cy; 1473 } 1474 } 1475 return 0; 1476 1477 case WM_DRAWITEM: 1478 { 1479 DRAWITEMSTRUCT *pdis = (DRAWITEMSTRUCT *)lParam; 1480 1481 if(pdis->CtlType==ODT_MENU){ 1482 if(!pobj_MainMenu) return 0; 1483 1484 CMenuItemData *pobj_MenuItemData; 1485 pobj_MenuItemData=(CMenuItemData *)pdis->itemData; 1486 if(pobj_MainMenu->hMenu==pobj_MenuItemData->pobj_ThisMenu->hMenu){ 1487 //メインメニューの親アイテム 1488 pobj_MainMenu->OwnerDrawMenu(pdis->hDC, 1489 &pdis->rcItem, 1490 (pdis->itemState&ODS_SELECTED)!=0, 1491 pobj_MenuItemData->item_index); 1492 } 1493 else{ 1494 //メインメニューにぶらさがるサブメニュー 1495 pobj_MainMenu->OwnerDrawSubMenu(pobj_MenuItemData->pobj_ThisMenu->hMenu, 1496 pdis->hDC, 1497 &pdis->rcItem, 1498 (pdis->itemState&ODS_SELECTED)!=0, 1499 pobj_MenuItemData->item_index); 1500 } 1501 } 1502 1503 return 0; 1504 } 1505 1506 case WM_NOTIFY: 1507 if(!lParam) return 0; 1508 TipText=(LPTOOLTIPTEXT)lParam; 1509 if(TipText->hdr.code==TTN_NEEDTEXT) ShowToolTipText(TipText); 1510 lpnmhdr=(LPNMHDR)lParam; 1511 1512 extern HWND hStandardToolbarPager; 1513 extern HWND hDebuggerToolbarPager; 1514 if(pobj_Rebar){ 1515 //レバーオブジェクトが存在するとき 1516 if(lpnmhdr->hwndFrom==pobj_Rebar->hRebar&&lpnmhdr->code==RBN_HEIGHTCHANGE){ 1517 ResizeOwnerWnd(); 1518 return 0; 1519 } 1520 } 1521 if(lpnmhdr->hwndFrom==hStandardToolbarPager){ 1522 if(lpnmhdr->code==PGN_CALCSIZE){ 1523 lpCalcSize=(LPNMPGCALCSIZE)lParam; 1524 if(lpCalcSize->dwFlag==PGF_CALCWIDTH) 1525 lpCalcSize->iWidth=BMPNUM_STANDARDTOOLBAR*23+SEPNUM_STANDARDTOOLBAR*8; 1526 } 1527 else if(lpnmhdr->code==PGN_SCROLL){ 1528 lpScroll=(LPNMPGSCROLL)lParam; 1529 lpScroll->iScroll=20; 1530 } 1531 } 1532 else if(lpnmhdr->hwndFrom==hDebuggerToolbarPager){ 1533 if(lpnmhdr->code==PGN_CALCSIZE){ 1534 lpCalcSize=(LPNMPGCALCSIZE)lParam; 1535 if(lpCalcSize->dwFlag==PGF_CALCWIDTH) 1536 lpCalcSize->iWidth=BMPNUM_DEBUGGERTOOLBAR*23+SEPNUM_DEBUGGERTOOLBAR*8; 1537 } 1538 else if(lpnmhdr->code==PGN_SCROLL){ 1539 lpScroll=(LPNMPGSCROLL)lParam; 1540 lpScroll->iScroll=20; 1541 } 1542 } 1543 1544 NMHDR *hdr; 1545 hdr=(NMHDR *)lParam; 1546 if(pobj_MainTab){ 1547 if(hdr->hwndFrom==pobj_MainTab->hTab){ 1548 if(hdr->code==TCN_SELCHANGE) 1549 pobj_MainTab->SelChangeEvent(); 1550 1551 if(hdr->code==NM_RCLICK){ 1552 1553 TCHITTESTINFO tcHitTest; 1554 GetCursorPos(&tcHitTest.pt); 1555 ScreenToClient(pobj_MainTab->hTab,&tcHitTest.pt); 1556 i=TabCtrl_HitTest(pobj_MainTab->hTab,&tcHitTest); 1557 if(i==-1) return 0; 1558 1559 TabCtrl_SetCurSel(pobj_MainTab->hTab,i); 1560 1561 pobj_MainTab->SelChangeEvent(); 1562 1563 1564 ///////////////////// 1565 // メニューを表示 1566 ///////////////////// 1567 1568 hChild=GetWindow(hClient,GW_CHILD); 1569 WndNum=GetWndNum(hChild); 1570 1571 //保存コマンドの文字列をセット 1572 MENUITEMINFO mii; 1573 mii.cbSize=sizeof(MENUITEMINFO); 1574 mii.fMask=MIIM_TYPE; 1575 mii.dwTypeData=temporary; 1576 mii.fType=MFT_STRING; 1577 if(MdiInfo[WndNum].path[0]){ 1578 _splitpath(MdiInfo[WndNum].path,NULL,NULL,temporary,temp2); 1579 lstrcat(temporary,temp2); 1580 lstrcat(temporary," を保存(&S)"); 1581 } 1582 else{ 1583 lstrcpy(temporary,"保存(&S)"); 1584 } 1585 SetMenuItemInfo(hTabMenu,IDM_SAVE,FALSE,&mii); 1586 1587 /*「絶対パスをコピー」「フォルダを開く」「ファイルを削除」 1588 コマンドを場合によって無効化にする */ 1589 if(MdiInfo[WndNum].path[0]){ 1590 EnableMenuItem(hTabMenu,IDM_PATH_COPY,MF_BYCOMMAND|MF_ENABLED); 1591 EnableMenuItem(hTabMenu,IDM_FOLDER_OPEN,MF_BYCOMMAND|MF_ENABLED); 1592 EnableMenuItem(hTabMenu,IDM_DELETE_FILE,MF_BYCOMMAND|MF_ENABLED); 1593 } 1594 else{ 1595 EnableMenuItem(hTabMenu,IDM_PATH_COPY,MF_BYCOMMAND|MF_GRAYED); 1596 EnableMenuItem(hTabMenu,IDM_FOLDER_OPEN,MF_BYCOMMAND|MF_GRAYED); 1597 EnableMenuItem(hTabMenu,IDM_DELETE_FILE,MF_BYCOMMAND|MF_GRAYED); 1598 } 1599 1600 POINT MousePos; 1601 GetCursorPos(&MousePos); 1602 TrackPopupMenu(hTabMenu,TPM_LEFTALIGN|TPM_RIGHTBUTTON,MousePos.x,MousePos.y,0,hOwner,NULL); 1603 } 1604 } 1605 } 1606 if(pobj_SideWeb){ 1607 if(hdr->hwndFrom==pobj_SideWeb->hTab&&hdr->code==TCN_SELCHANGE){ 1608 pobj_SideWeb->SelChangeEvent(); 1609 } 1610 } 1611 1612 return 0; 1423 switch(message) 1424 { 1613 1425 case WM_COMMAND: 1614 1426 switch(LOWORD(wParam)){ -
trunk/ab5.0/abdev/abdev/include/MainFrame.h
r489 r492 12 12 public: 13 13 14 // 生成された 14 15 ::LRESULT OnCreate( ::UINT msg, ::WPARAM wParam, ::LPARAM lParam, ::BOOL& handled ); 16 17 // 「閉じる」ボタンがクリックされた 15 18 ::LRESULT OnClose( ::UINT msg, ::WPARAM wParam, ::LPARAM lParam, ::BOOL& handled ); 19 20 // リサイズされた 16 21 void OnSize(UINT nType, CSize size); 22 23 // 破棄された 17 24 ::LRESULT OnDestroy( ::UINT msg, ::WPARAM wParam, ::LPARAM lParam, ::BOOL& handled ); 25 26 // タイマーイベント 27 void OnTimer( UINT_PTR id ); 28 29 // クリップボード内のデータが変更した 30 void OnDrawClipboard(); 31 32 // メニューが選択された 33 void OnMenuSelect( UINT nItemID, UINT nFlags, CMenu menu ); 34 35 // メニューがアクティブになる直前に送られる 36 void OnInitMenu( CMenu menu ); 37 38 // メニューアイテムのサイズが要求された 39 void OnMeasureItem( int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct ); 40 41 // メニューアイテムの描画が要求された 42 void OnDrawItem( int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct ); 43 44 // 拡張コントロールからメッセージが通知された 45 LRESULT OnNotify( int idCtrl, LPNMHDR pnmh ); 18 46 19 47 private: … … 23 51 MESSAGE_HANDLER( WM_CLOSE, OnClose ) 24 52 MESSAGE_HANDLER( WM_DESTROY, OnDestroy ) 53 MSG_WM_TIMER( OnTimer ) 54 MSG_WM_DRAWCLIPBOARD( OnDrawClipboard ) 55 MSG_WM_MENUSELECT( OnMenuSelect ) 56 MSG_WM_INITMENU( OnInitMenu ) 57 MSG_WM_MEASUREITEM( OnMeasureItem ) 58 MSG_WM_DRAWITEM( OnDrawItem ) 59 60 MSG_WM_NOTIFY( OnNotify ); 25 61 END_MSG_MAP() 26 62 }; -
trunk/ab5.0/abdev/abdev/src/MainFrame.cpp
r489 r492 65 65 return 0; 66 66 } 67 68 void backup(void *dummy); 69 void MainFrame::OnTimer( UINT_PTR id ) 70 { 71 switch( id ) 72 { 73 case ID_TIMER_BACKUP: 74 _beginthread( backup, 0, 0 ); 75 break; 76 77 #ifndef THETEXT 78 case ID_DEBUGSAFTY: 79 { 80 //BasicCompiler.exeが強制終了しているかどうかを検証 81 extern CDebugger *pobj_Debugger; 82 pobj_Debugger->SaftyCheck(); 83 break; 84 } 85 #endif 86 } 87 } 88 89 void ResetState_EditMenu(void); 90 void MainFrame::OnDrawClipboard() 91 { 92 ResetState_EditMenu(); 93 } 94 95 void MenuAdvice(WPARAM msg); 96 void MainFrame::OnMenuSelect( UINT nItemID, UINT nFlags, CMenu menu ) 97 { 98 MenuAdvice( nItemID ); 99 } 100 101 void MainFrame::OnInitMenu( CMenu menu ) 102 { 103 extern CNonVolatile *pobj_nv; 104 extern CSubMenuEx *pobj_FileHistoryMenu; 105 pobj_nv->pobj_History->ResetFileMenu(pobj_FileHistoryMenu,1); 106 #ifndef THETEXT 107 extern CSubMenuEx *pobj_ProjectHistoryMenu; 108 pobj_nv->pobj_ProjectHistory->ResetFileMenu(pobj_ProjectHistoryMenu,0); 109 #endif 110 } 111 112 void MainFrame::OnMeasureItem( int nIDCtl, LPMEASUREITEMSTRUCT lpMI ) 113 { 114 if(lpMI->CtlType==ODT_MENU){ 115 SIZE size; 116 CMenuItemData *pobj_MenuItemData; 117 pobj_MenuItemData=(CMenuItemData *)lpMI->itemData; 118 if(pobj_MenuItemData->pobj_ThisMenu->hMenu==pobj_MainMenu->hMenu){ 119 //メインメニューの親アイテム 120 pobj_MainMenu->GetItemSize(pobj_MenuItemData->item_index,&size); 121 lpMI->itemWidth = size.cx; 122 lpMI->itemHeight = size.cy; 123 } 124 else{ 125 //メインメニューにぶらさがるサブメニュー 126 pobj_MenuItemData->pobj_ThisMenu->GetItemSize(pobj_MenuItemData->item_index,&size); 127 lpMI->itemWidth = size.cx; 128 lpMI->itemHeight = size.cy; 129 } 130 } 131 } 132 133 void MainFrame::OnDrawItem( int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct ) 134 { 135 if(lpDrawItemStruct->CtlType==ODT_MENU){ 136 if(!pobj_MainMenu) return; 137 138 CMenuItemData *pobj_MenuItemData; 139 pobj_MenuItemData=(CMenuItemData *)lpDrawItemStruct->itemData; 140 if(pobj_MainMenu->hMenu==pobj_MenuItemData->pobj_ThisMenu->hMenu){ 141 //メインメニューの親アイテム 142 pobj_MainMenu->OwnerDrawMenu(lpDrawItemStruct->hDC, 143 &lpDrawItemStruct->rcItem, 144 (lpDrawItemStruct->itemState&ODS_SELECTED)!=0, 145 pobj_MenuItemData->item_index); 146 } 147 else{ 148 //メインメニューにぶらさがるサブメニュー 149 pobj_MainMenu->OwnerDrawSubMenu(pobj_MenuItemData->pobj_ThisMenu->hMenu, 150 lpDrawItemStruct->hDC, 151 &lpDrawItemStruct->rcItem, 152 (lpDrawItemStruct->itemState&ODS_SELECTED)!=0, 153 pobj_MenuItemData->item_index); 154 } 155 } 156 } 157 158 LRESULT MainFrame::OnNotify( int idCtrl, LPNMHDR pnmh ) 159 { 160 NMPGCALCSIZE *lpCalcSize; 161 NMPGSCROLL *lpScroll; 162 163 if(!pnmh) return 0; 164 LPTOOLTIPTEXT TipText=(LPTOOLTIPTEXT)pnmh; 165 if(TipText->hdr.code==TTN_NEEDTEXT) ShowToolTipText(TipText); 166 167 extern HWND hStandardToolbarPager; 168 extern HWND hDebuggerToolbarPager; 169 if(pobj_Rebar){ 170 //レバーオブジェクトが存在するとき 171 if(pnmh->hwndFrom==pobj_Rebar->hRebar&&pnmh->code==RBN_HEIGHTCHANGE){ 172 ResizeOwnerWnd(); 173 return 0; 174 } 175 } 176 if(pnmh->hwndFrom==hStandardToolbarPager){ 177 if(pnmh->code==PGN_CALCSIZE){ 178 lpCalcSize=(LPNMPGCALCSIZE)pnmh; 179 if(lpCalcSize->dwFlag==PGF_CALCWIDTH) 180 lpCalcSize->iWidth=BMPNUM_STANDARDTOOLBAR*23+SEPNUM_STANDARDTOOLBAR*8; 181 } 182 else if(pnmh->code==PGN_SCROLL){ 183 lpScroll=(LPNMPGSCROLL)pnmh; 184 lpScroll->iScroll=20; 185 } 186 } 187 else if(pnmh->hwndFrom==hDebuggerToolbarPager){ 188 if(pnmh->code==PGN_CALCSIZE){ 189 lpCalcSize=(LPNMPGCALCSIZE)pnmh; 190 if(lpCalcSize->dwFlag==PGF_CALCWIDTH) 191 lpCalcSize->iWidth=BMPNUM_DEBUGGERTOOLBAR*23+SEPNUM_DEBUGGERTOOLBAR*8; 192 } 193 else if(pnmh->code==PGN_SCROLL){ 194 lpScroll=(LPNMPGSCROLL)pnmh; 195 lpScroll->iScroll=20; 196 } 197 } 198 199 if(pobj_MainTab){ 200 if(pnmh->hwndFrom==pobj_MainTab->hTab){ 201 if(pnmh->code==TCN_SELCHANGE) 202 pobj_MainTab->SelChangeEvent(); 203 204 if(pnmh->code==NM_RCLICK){ 205 206 TCHITTESTINFO tcHitTest; 207 GetCursorPos(&tcHitTest.pt); 208 ::ScreenToClient(pobj_MainTab->hTab,&tcHitTest.pt); 209 int index = TabCtrl_HitTest(pobj_MainTab->hTab,&tcHitTest); 210 if( index == -1 ) return 0; 211 212 TabCtrl_SetCurSel(pobj_MainTab->hTab,index); 213 214 pobj_MainTab->SelChangeEvent(); 215 216 217 ///////////////////// 218 // メニューを表示 219 ///////////////////// 220 221 HWND hChild=::GetWindow(hClient,GW_CHILD); 222 int WndNum=GetWndNum(hChild); 223 224 //保存コマンドの文字列をセット 225 char temporary[1024], temp2[1024]; 226 MENUITEMINFO mii; 227 mii.cbSize=sizeof(MENUITEMINFO); 228 mii.fMask=MIIM_TYPE; 229 mii.dwTypeData=temporary; 230 mii.fType=MFT_STRING; 231 if(MdiInfo[WndNum].path[0]){ 232 _splitpath(MdiInfo[WndNum].path,NULL,NULL,temporary,temp2); 233 lstrcat(temporary,temp2); 234 lstrcat(temporary," を保存(&S)"); 235 } 236 else{ 237 lstrcpy(temporary,"保存(&S)"); 238 } 239 extern HMENU hTabMenu; 240 SetMenuItemInfo(hTabMenu,IDM_SAVE,FALSE,&mii); 241 242 /*「絶対パスをコピー」「フォルダを開く」「ファイルを削除」 243 コマンドを場合によって無効化にする */ 244 if(MdiInfo[WndNum].path[0]){ 245 EnableMenuItem(hTabMenu,IDM_PATH_COPY,MF_BYCOMMAND|MF_ENABLED); 246 EnableMenuItem(hTabMenu,IDM_FOLDER_OPEN,MF_BYCOMMAND|MF_ENABLED); 247 EnableMenuItem(hTabMenu,IDM_DELETE_FILE,MF_BYCOMMAND|MF_ENABLED); 248 } 249 else{ 250 EnableMenuItem(hTabMenu,IDM_PATH_COPY,MF_BYCOMMAND|MF_GRAYED); 251 EnableMenuItem(hTabMenu,IDM_FOLDER_OPEN,MF_BYCOMMAND|MF_GRAYED); 252 EnableMenuItem(hTabMenu,IDM_DELETE_FILE,MF_BYCOMMAND|MF_GRAYED); 253 } 254 255 POINT MousePos; 256 GetCursorPos(&MousePos); 257 TrackPopupMenu(hTabMenu,TPM_LEFTALIGN|TPM_RIGHTBUTTON,MousePos.x,MousePos.y,0,hOwner,NULL); 258 } 259 } 260 } 261 if(pobj_SideWeb){ 262 if(pnmh->hwndFrom==pobj_SideWeb->hTab&&pnmh->code==TCN_SELCHANGE){ 263 pobj_SideWeb->SelChangeEvent(); 264 } 265 } 266 267 return 0; 268 } -
trunk/ab5.0/abdev/abdev/stdafx.h
r491 r492 20 20 21 21 #include <atlbase.h> 22 #include <atlcom.h> // ATL COM 共通用ヘッダファイル23 #include <atlhost.h> // ATL コンテナ機能サポート用ヘッダファイル22 #include <atlcom.h> // ATL COMハ用wb_t@C 23 #include <atlhost.h> // ATL Rei@\T|[gpwb_t@C 24 24 #include <atlapp.h> 25 #include <atlframe.h> // ATL コンテナ機能サポート用ヘッダファイル25 #include <atlframe.h> // ATL Rei@\T|[gpwb_t@C 26 26 #include <atlcrack.h> 27 27 #include <atlmisc.h> … … 47 47 #include <MainFrame.h> 48 48 #include <Program.h> 49 50 #include "../res/resource.h" 51 52 #include "Common.h"
Note:
See TracChangeset
for help on using the changeset viewer.