Changeset 612 in dev for trunk/ab5.0/abdev/abdev/WindowControl.cpp
- Timestamp:
- May 18, 2008, 7:15:49 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/abdev/WindowControl.cpp
r609 r612 15 15 int GetWndInfoNum(char *name){ 16 16 extern PROJECTINFO ProjectInfo; 17 int i; 18 for(i=0;i<ProjectInfo.windowInfos.size();i++){ 17 for( int i=0;i<static_cast<int>(ProjectInfo.windowInfos.size());i++){ 19 18 if(lstrcmpi(name,ProjectInfo.windowInfos[i].name)==0) return i; 20 19 } … … 24 23 { 25 24 extern PROJECTINFO ProjectInfo; 26 int i; 27 for( int i=0;i<ProjectInfo.windowInfos.size();i++) 25 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 28 26 { 29 if(lstrcmpi(name, ProjectInfo.windowInfos[i].name)==0) return &ProjectInfo.windowInfos[i];27 if(lstrcmpi(name,windowInfo.name)==0) return &windowInfo; 30 28 } 31 29 return NULL; … … 1008 1006 1009 1007 ppNames=(char **)HeapAlloc(hHeap,0,1); 1010 for(i=0,i4=1000,i5=0;i<ProjectInfo.windowInfos.size();i++){ 1011 for(i3=0;i3<ProjectInfo.windowInfos[i].NumberOfChildWindows;i3++){ 1008 i4=1000; 1009 i5=0; 1010 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 1011 { 1012 for(i3=0;i3<windowInfo.NumberOfChildWindows;i3++){ 1012 1013 1013 1014 //重複チェック 1014 1015 for(i6=0,sw1=0;i6<i5;i6++){ 1015 if(lstrcmpi(ppNames[i6], ProjectInfo.windowInfos[i].pChildInfo[i3].IdName)==0){1016 if(lstrcmpi(ppNames[i6],windowInfo.pChildInfo[i3].IdName)==0){ 1016 1017 sw1=1; 1017 1018 break; … … 1021 1022 1022 1023 ppNames=(char **)HeapReAlloc(hHeap,0,ppNames,sizeof(char *)*(i5+1)); 1023 ppNames[i5]= ProjectInfo.windowInfos[i].pChildInfo[i3].IdName;1024 ppNames[i5]=windowInfo.pChildInfo[i3].IdName; 1024 1025 i5++; 1025 1026 1026 sprintf(buffer+i2,"Const %s=%d\r\n", ProjectInfo.windowInfos[i].pChildInfo[i3].IdName,i4);1027 sprintf(buffer+i2,"Const %s=%d\r\n",windowInfo.pChildInfo[i3].IdName,i4); 1027 1028 i2+=lstrlen(buffer+i2); 1028 1029 i4++; … … 1044 1045 1045 1046 //ハンドル変数を定義 1046 for(i=0;i<ProjectInfo.windowInfos.size();i++){ 1047 sprintf(buffer+i2,"Dim %s As HWND\r\n",ProjectInfo.windowInfos[i].HandleName); 1048 i2+=lstrlen(buffer+i2); 1049 sprintf(buffer+i2,"Dim hFont_%s As HFONT\r\n",ProjectInfo.windowInfos[i].name); 1047 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 1048 { 1049 sprintf(buffer+i2,"Dim %s As HWND\r\n",windowInfo.HandleName); 1050 i2+=lstrlen(buffer+i2); 1051 sprintf(buffer+i2,"Dim hFont_%s As HFONT\r\n",windowInfo.name); 1050 1052 i2+=lstrlen(buffer+i2); 1051 1053 sprintf(buffer+i2,"hFont_%s=CreateFont(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\"%s\")\r\n", 1052 ProjectInfo.windowInfos[i].name,1053 ProjectInfo.windowInfos[i].LogFont.lfHeight,1054 ProjectInfo.windowInfos[i].LogFont.lfWidth,1055 ProjectInfo.windowInfos[i].LogFont.lfEscapement,1056 ProjectInfo.windowInfos[i].LogFont.lfOrientation,1057 ProjectInfo.windowInfos[i].LogFont.lfWeight,1058 ProjectInfo.windowInfos[i].LogFont.lfItalic,1059 ProjectInfo.windowInfos[i].LogFont.lfUnderline,1060 ProjectInfo.windowInfos[i].LogFont.lfStrikeOut,1061 ProjectInfo.windowInfos[i].LogFont.lfCharSet,1062 ProjectInfo.windowInfos[i].LogFont.lfOutPrecision,1063 ProjectInfo.windowInfos[i].LogFont.lfClipPrecision,1064 ProjectInfo.windowInfos[i].LogFont.lfQuality,1065 ProjectInfo.windowInfos[i].LogFont.lfPitchAndFamily,1066 ProjectInfo.windowInfos[i].LogFont.lfFaceName);1054 windowInfo.name, 1055 windowInfo.LogFont.lfHeight, 1056 windowInfo.LogFont.lfWidth, 1057 windowInfo.LogFont.lfEscapement, 1058 windowInfo.LogFont.lfOrientation, 1059 windowInfo.LogFont.lfWeight, 1060 windowInfo.LogFont.lfItalic, 1061 windowInfo.LogFont.lfUnderline, 1062 windowInfo.LogFont.lfStrikeOut, 1063 windowInfo.LogFont.lfCharSet, 1064 windowInfo.LogFont.lfOutPrecision, 1065 windowInfo.LogFont.lfClipPrecision, 1066 windowInfo.LogFont.lfQuality, 1067 windowInfo.LogFont.lfPitchAndFamily, 1068 windowInfo.LogFont.lfFaceName); 1067 1069 i2+=lstrlen(buffer+i2); 1068 1070 … … 1078 1080 lstrcpy(buffer+i2,"h3DFaceBrush=CreateSolidBrush(GetSysColor(COLOR_3DFACE))\r\n"); 1079 1081 i2+=lstrlen(buffer+i2); 1080 for(i=0;i<ProjectInfo.windowInfos.size();i++){ 1081 if(ProjectInfo.windowInfos[i].bgColor<=0&& 1082 ProjectInfo.windowInfos[i].bgColor!=-(int)RGB(255,255,255)&& 1083 ProjectInfo.windowInfos[i].bgColor!=-(int)RGB(0,0,0)){ 1082 i=0; 1083 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 1084 { 1085 if(windowInfo.bgColor<=0&& 1086 windowInfo.bgColor!=-(int)RGB(255,255,255)&& 1087 windowInfo.bgColor!=-(int)RGB(0,0,0)){ 1084 1088 sprintf(buffer+i2,"Dim _RadSys_hBackBrush%d As HBRUSH\r\n",i); 1085 1089 i2+=lstrlen(buffer+i2); 1086 sprintf(buffer+i2,"_RadSys_hBackBrush%d=CreateSolidBrush(%d)\r\n",i,- ProjectInfo.windowInfos[i].bgColor);1090 sprintf(buffer+i2,"_RadSys_hBackBrush%d=CreateSolidBrush(%d)\r\n",i,-windowInfo.bgColor); 1087 1091 i2+=lstrlen(buffer+i2); 1088 1092 } 1089 if( ProjectInfo.windowInfos[i].bgColor>=0x1000){1093 if(windowInfo.bgColor>=0x1000){ 1090 1094 sprintf(buffer+i2,"Dim _RadSys_hBackBrush%d As HBRUSH\r\n",i); 1091 1095 i2+=lstrlen(buffer+i2); 1092 1096 sprintf(buffer+i2,"_RadSys_hBackBrush%d=CreatePatternBrush(LoadImage(GetModuleHandle(0),%s,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE or LR_SHARED))\r\n", 1093 1097 i, 1094 ProjectInfo.res.pBitmapResInfo[ ProjectInfo.windowInfos[i].bgColor-0x1000].IdName);1098 ProjectInfo.res.pBitmapResInfo[windowInfo.bgColor-0x1000].IdName); 1095 1099 i2+=lstrlen(buffer+i2); 1096 1100 } 1101 1102 i++; 1097 1103 } 1098 1104 … … 1101 1107 1102 1108 //イメージ ボックス用の変数を定義 1103 for(i=0;i<ProjectInfo.windowInfos.size();i++){ 1104 for(i3=0;i3<ProjectInfo.windowInfos[i].NumberOfChildWindows;i3++){ 1105 if(ProjectInfo.windowInfos[i].pChildInfo[i3].Control==CT_IMAGEBOX){ 1106 if((ProjectInfo.windowInfos[i].pChildInfo[i3].style&0x000F)==SS_ICON|| 1107 (ProjectInfo.windowInfos[i].pChildInfo[i3].style&0x000F)==SS_BITMAP){ 1108 sprintf(buffer+i2,"Dim hImage_%s_%s As HANDLE\r\n",ProjectInfo.windowInfos[i].name,ProjectInfo.windowInfos[i].pChildInfo[i3].IdName); 1109 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 1110 { 1111 for(i3=0;i3<windowInfo.NumberOfChildWindows;i3++){ 1112 if(windowInfo.pChildInfo[i3].Control==CT_IMAGEBOX){ 1113 if((windowInfo.pChildInfo[i3].style&0x000F)==SS_ICON|| 1114 (windowInfo.pChildInfo[i3].style&0x000F)==SS_BITMAP){ 1115 sprintf(buffer+i2,"Dim hImage_%s_%s As HANDLE\r\n",windowInfo.name,windowInfo.pChildInfo[i3].IdName); 1109 1116 i2+=lstrlen(buffer+i2); 1110 1117 … … 1154 1161 } 1155 1162 1156 for(i=0;i<ProjectInfo.windowInfos.size();i++){ 1163 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 1164 { 1157 1165 //フォントハンドル解放 1158 sprintf(buffer+i2,"\tDeleteObject(hFont_%s)\r\n", ProjectInfo.windowInfos[i].name);1166 sprintf(buffer+i2,"\tDeleteObject(hFont_%s)\r\n",windowInfo.name); 1159 1167 i2+=lstrlen(buffer+i2); 1160 1168 … … 1168 1176 lstrcpy(buffer+i2,"\tDeleteObject(h3DFaceBrush)\r\n"); 1169 1177 i2+=lstrlen(buffer+i2); 1170 for(i=0;i<ProjectInfo.windowInfos.size();i++){ 1171 if(ProjectInfo.windowInfos[i].bgColor<=0&& 1172 ProjectInfo.windowInfos[i].bgColor!=-(int)RGB(255,255,255)&& 1173 ProjectInfo.windowInfos[i].bgColor!=-(int)RGB(0,0,0)){ 1178 i=0; 1179 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 1180 { 1181 if(windowInfo.bgColor<=0&& 1182 windowInfo.bgColor!=-(int)RGB(255,255,255)&& 1183 windowInfo.bgColor!=-(int)RGB(0,0,0)){ 1174 1184 sprintf(buffer+i2,"\tDeleteObject(_RadSys_hBackBrush%d)\r\n",i); 1175 1185 i2+=lstrlen(buffer+i2); 1176 1186 } 1187 i++; 1177 1188 } 1178 1189 … … 1184 1195 1185 1196 1186 for(i=0;i<ProjectInfo.windowInfos.size();i++){ 1197 i=0; 1198 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 1199 { 1187 1200 if(i!=0){ 1188 1201 lstrcpy(buffer+i2,"\r\n"); … … 1197 1210 ppNames=GetProcedureNamesOfMessageCall(i,&pItemEventInfo,&i3,&bAvailUserProc[i]); 1198 1211 1199 sprintf(buffer+i2,"Function EventCall_%s(hWnd As HWND, message As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT\r\n", ProjectInfo.windowInfos[i].name);1212 sprintf(buffer+i2,"Function EventCall_%s(hWnd As HWND, message As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT\r\n",windowInfo.name); 1200 1213 i2+=lstrlen(buffer+i2); 1201 1214 … … 1235 1248 i2+=lstrlen(buffer+i2); 1236 1249 if(sw4){ 1237 sprintf(buffer+i2,"\t\t\t%s_Notify(ByVal (lParam As *NMHDR))\r\n", ProjectInfo.windowInfos[i].name);1250 sprintf(buffer+i2,"\t\t\t%s_Notify(ByVal (lParam As *NMHDR))\r\n",windowInfo.name); 1238 1251 i2+=lstrlen(buffer+i2); 1239 1252 } … … 1245 1258 i2+=lstrlen(buffer+i2); 1246 1259 1247 if(GetNotifyCommandByItemMessage(& ProjectInfo.windowInfos[i],pItemEventInfo,buffer+i2,"\t\t\t\t")){1260 if(GetNotifyCommandByItemMessage(&windowInfo,pItemEventInfo,buffer+i2,"\t\t\t\t")){ 1248 1261 i2+=lstrlen(buffer+i2); 1249 1262 … … 1261 1274 lstrcpy(buffer+i2,"\t\tCase WM_NOTIFY\r\n"); 1262 1275 i2+=lstrlen(buffer+i2); 1263 sprintf(buffer+i2,"\t\t\t%s_Notify(ByVal (lParam As *NMHDR))\r\n", ProjectInfo.windowInfos[i].name);1276 sprintf(buffer+i2,"\t\t\t%s_Notify(ByVal (lParam As *NMHDR))\r\n",windowInfo.name); 1264 1277 i2+=lstrlen(buffer+i2); 1265 1278 } … … 1273 1286 1274 1287 //pItemEventInfoのIdName、EventNameメンバのメモリ解放はこの関数内で行う 1275 GetCommandByItemMessage(& ProjectInfo.windowInfos[i],pItemEventInfo,buffer+i2,"\t\t\t\t");1288 GetCommandByItemMessage(&windowInfo,pItemEventInfo,buffer+i2,"\t\t\t\t"); 1276 1289 i2+=lstrlen(buffer+i2); 1277 1290 … … 1284 1297 lstrcpy(buffer+i2,"\t\tCase Else\r\n"); 1285 1298 i2+=lstrlen(buffer+i2); 1286 sprintf(buffer+i2,"\t\t\tEventCall_%s=DefWindowProc(hWnd,message,wParam,lParam)\r\n", ProjectInfo.windowInfos[i].name);1299 sprintf(buffer+i2,"\t\t\tEventCall_%s=DefWindowProc(hWnd,message,wParam,lParam)\r\n",windowInfo.name); 1287 1300 i2+=lstrlen(buffer+i2); 1288 1301 lstrcpy(buffer+i2,"\t\t\tExit Function\r\n"); … … 1292 1305 i2+=lstrlen(buffer+i2); 1293 1306 1294 sprintf(buffer+i2,"\tEventCall_%s=0\r\n", ProjectInfo.windowInfos[i].name);1307 sprintf(buffer+i2,"\tEventCall_%s=0\r\n",windowInfo.name); 1295 1308 i2+=lstrlen(buffer+i2); 1296 1309 lstrcpy(buffer+i2,"End Function\r\n"); … … 1301 1314 buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size); 1302 1315 } 1316 1317 i++; 1303 1318 } 1304 1319 … … 1344 1359 lstrcpy(buffer+i2,"\tDim hDlg As HWND\r\n"); 1345 1360 i2+=lstrlen(buffer+i2); 1346 for(i=0,sw1=0;i<ProjectInfo.windowInfos.size();i++){ 1347 if(ProjectInfo.windowInfos[i].type==WNDTYPE_MODALDLG){ 1361 sw1=0; 1362 i=0; 1363 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 1364 { 1365 if(windowInfo.type==WNDTYPE_MODALDLG){ 1348 1366 if(sw1==0){ 1349 sprintf(buffer+i2,"\tIf lstrcmp(TemplateName,\"%s\")=0 Then\r\n", ProjectInfo.windowInfos[i].name);1367 sprintf(buffer+i2,"\tIf lstrcmp(TemplateName,\"%s\")=0 Then\r\n",windowInfo.name); 1350 1368 i2+=lstrlen(buffer+i2); 1351 1369 sw1=1; 1352 1370 } 1353 1371 else{ 1354 sprintf(buffer+i2,"\tElseIf lstrcmp(TemplateName,\"%s\")=0 Then\r\n", ProjectInfo.windowInfos[i].name);1372 sprintf(buffer+i2,"\tElseIf lstrcmp(TemplateName,\"%s\")=0 Then\r\n",windowInfo.name); 1355 1373 i2+=lstrlen(buffer+i2); 1356 1374 } 1357 1375 sprintf(buffer+i2,"\t\t%s=CreateWindowEx(&H%08x,\"NORMALDLG\",\"%s\",&H%08x,%d,%d,%d,%d,hOwnerWnd,%d As HMENU,GetModuleHandle(0),0)\r\n", 1358 ProjectInfo.windowInfos[i].HandleName,1359 ProjectInfo.windowInfos[i].ExStyle,1360 ProjectInfo.windowInfos[i].caption,1361 ProjectInfo.windowInfos[i].style,1362 ProjectInfo.windowInfos[i].pos.x,1363 ProjectInfo.windowInfos[i].pos.y,1364 ProjectInfo.windowInfos[i].size.cx,1365 ProjectInfo.windowInfos[i].size.cy,1366 ProjectInfo.windowInfos[i].id);1376 windowInfo.HandleName, 1377 windowInfo.ExStyle, 1378 windowInfo.caption, 1379 windowInfo.style, 1380 windowInfo.pos.x, 1381 windowInfo.pos.y, 1382 windowInfo.size.cx, 1383 windowInfo.size.cy, 1384 windowInfo.id); 1367 1385 i2+=lstrlen(buffer+i2); 1368 1386 sprintf(buffer+i2,"\t\thDlg=%s\r\n", 1369 ProjectInfo.windowInfos[i].HandleName);1387 windowInfo.HandleName); 1370 1388 i2+=lstrlen(buffer+i2); 1371 1389 if(bAvailUserProc[i]){ 1372 1390 sprintf(buffer+i2,"\t\tSetWindowLongPtr(%s,GWLP_WNDPROC,AddressOf(%s) As LONG_PTR)\r\n", 1373 ProjectInfo.windowInfos[i].HandleName,1374 ProjectInfo.windowInfos[i].CallBackName);1391 windowInfo.HandleName, 1392 windowInfo.CallBackName); 1375 1393 } 1376 1394 else{ 1377 1395 sprintf(buffer+i2,"\t\tSetWindowLongPtr(%s,GWLP_WNDPROC,AddressOf(EventCall_%s) As LONG_PTR)\r\n", 1378 ProjectInfo.windowInfos[i].HandleName,1379 ProjectInfo.windowInfos[i].name);1380 } 1381 i2+=lstrlen(buffer+i2); 1382 sprintf(buffer+i2,"\t\tSendMessage(%s,WM_INITDIALOG,0,0)\r\n", ProjectInfo.windowInfos[i].HandleName);1383 i2+=lstrlen(buffer+i2); 1384 if( ProjectInfo.windowInfos[i].IconResName){1385 sprintf(buffer+i2,"\t\tSendMessage(%s,WM_SETICON,ICON_SMALL,LoadIcon(GetModuleHandle(0),MAKEINTRESOURCE(%s)) As LPARAM)\r\n", ProjectInfo.windowInfos[i].HandleName,ProjectInfo.windowInfos[i].IconResName);1396 windowInfo.HandleName, 1397 windowInfo.name); 1398 } 1399 i2+=lstrlen(buffer+i2); 1400 sprintf(buffer+i2,"\t\tSendMessage(%s,WM_INITDIALOG,0,0)\r\n",windowInfo.HandleName); 1401 i2+=lstrlen(buffer+i2); 1402 if(windowInfo.IconResName){ 1403 sprintf(buffer+i2,"\t\tSendMessage(%s,WM_SETICON,ICON_SMALL,LoadIcon(GetModuleHandle(0),MAKEINTRESOURCE(%s)) As LPARAM)\r\n",windowInfo.HandleName,windowInfo.IconResName); 1386 1404 i2+=lstrlen(buffer+i2); 1387 1405 } 1388 sprintf(buffer+i2,"\t\tShowWindow(%s,SW_SHOW)\r\n", ProjectInfo.windowInfos[i].HandleName);1406 sprintf(buffer+i2,"\t\tShowWindow(%s,SW_SHOW)\r\n",windowInfo.HandleName); 1389 1407 i2+=lstrlen(buffer+i2); 1390 1408 } … … 1393 1411 buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size); 1394 1412 } 1413 i++; 1395 1414 } 1396 1415 if(sw1){ … … 1440 1459 lstrcpy(buffer+i2,"\r\nFunction CreateDialog(hOwnerWnd As HWND, TemplateName As LPSTR) As HWND\r\n"); 1441 1460 i2+=lstrlen(buffer+i2); 1442 for(i=0;i<ProjectInfo.windowInfos.size();i++){ 1443 if(ProjectInfo.windowInfos[i].type==WNDTYPE_MODELESSDLG){ 1444 sprintf(buffer+i2,"\tIf lstrcmp(TemplateName,\"%s\")=0 Then\r\n",ProjectInfo.windowInfos[i].name); 1461 i=0; 1462 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 1463 { 1464 if(windowInfo.type==WNDTYPE_MODELESSDLG){ 1465 sprintf(buffer+i2,"\tIf lstrcmp(TemplateName,\"%s\")=0 Then\r\n",windowInfo.name); 1445 1466 i2+=lstrlen(buffer+i2); 1446 1467 1447 1468 sprintf(buffer+i2,"\t\t%s=CreateWindowEx(&H%08x,\"NORMALDLG\",\"%s\",&H%08x,%d,%d,%d,%d,hOwnerWnd,%d As HMENU,GetModuleHandle(0),0)\r\n", 1448 ProjectInfo.windowInfos[i].HandleName,1449 ProjectInfo.windowInfos[i].ExStyle,1450 ProjectInfo.windowInfos[i].caption,1451 ProjectInfo.windowInfos[i].style,1452 ProjectInfo.windowInfos[i].pos.x,1453 ProjectInfo.windowInfos[i].pos.y,1454 ProjectInfo.windowInfos[i].size.cx,1455 ProjectInfo.windowInfos[i].size.cy,1456 ProjectInfo.windowInfos[i].id);1457 i2+=lstrlen(buffer+i2); 1458 sprintf(buffer+i2,"\t\tCreateDialog=%s\r\n", ProjectInfo.windowInfos[i].HandleName);1469 windowInfo.HandleName, 1470 windowInfo.ExStyle, 1471 windowInfo.caption, 1472 windowInfo.style, 1473 windowInfo.pos.x, 1474 windowInfo.pos.y, 1475 windowInfo.size.cx, 1476 windowInfo.size.cy, 1477 windowInfo.id); 1478 i2+=lstrlen(buffer+i2); 1479 sprintf(buffer+i2,"\t\tCreateDialog=%s\r\n",windowInfo.HandleName); 1459 1480 i2+=lstrlen(buffer+i2); 1460 1481 if(bAvailUserProc[i]){ 1461 1482 sprintf(buffer+i2,"\t\tSetWindowLongPtr(%s,GWLP_WNDPROC,AddressOf(%s) As LONG_PTR)\r\n", 1462 ProjectInfo.windowInfos[i].HandleName,1463 ProjectInfo.windowInfos[i].CallBackName);1483 windowInfo.HandleName, 1484 windowInfo.CallBackName); 1464 1485 } 1465 1486 else{ 1466 1487 sprintf(buffer+i2,"\t\tSetWindowLongPtr(%s,GWLP_WNDPROC,AddressOf(EventCall_%s) As LONG_PTR)\r\n", 1467 ProjectInfo.windowInfos[i].HandleName,1468 ProjectInfo.windowInfos[i].name);1469 } 1470 i2+=lstrlen(buffer+i2); 1471 sprintf(buffer+i2,"\t\tSendMessage(%s,WM_INITDIALOG,0,0)\r\n", ProjectInfo.windowInfos[i].HandleName);1472 i2+=lstrlen(buffer+i2); 1473 if( ProjectInfo.windowInfos[i].IconResName){1474 sprintf(buffer+i2,"\t\tSendMessage(%s,WM_SETICON,ICON_SMALL,LoadIcon(GetModuleHandle(0),MAKEINTRESOURCE(%s)) As LPARAM)\r\n", ProjectInfo.windowInfos[i].HandleName,ProjectInfo.windowInfos[i].IconResName);1488 windowInfo.HandleName, 1489 windowInfo.name); 1490 } 1491 i2+=lstrlen(buffer+i2); 1492 sprintf(buffer+i2,"\t\tSendMessage(%s,WM_INITDIALOG,0,0)\r\n",windowInfo.HandleName); 1493 i2+=lstrlen(buffer+i2); 1494 if(windowInfo.IconResName){ 1495 sprintf(buffer+i2,"\t\tSendMessage(%s,WM_SETICON,ICON_SMALL,LoadIcon(GetModuleHandle(0),MAKEINTRESOURCE(%s)) As LPARAM)\r\n",windowInfo.HandleName,windowInfo.IconResName); 1475 1496 i2+=lstrlen(buffer+i2); 1476 1497 } 1477 sprintf(buffer+i2,"\tEnd If\r\n", ProjectInfo.windowInfos[i].name);1498 sprintf(buffer+i2,"\tEnd If\r\n",windowInfo.name); 1478 1499 i2+=lstrlen(buffer+i2); 1479 1500 } … … 1482 1503 buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size); 1483 1504 } 1505 i++; 1484 1506 } 1485 1507 lstrcpy(buffer+i2,"End Function\r\n"); … … 1510 1532 i2+=lstrlen(buffer+i2); 1511 1533 1512 for(i=0;i<ProjectInfo.windowInfos.size();i++){ 1513 if(ProjectInfo.windowInfos[i].type==WNDTYPE_DEFAULT){ 1534 i=0; 1535 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 1536 { 1537 if(windowInfo.type==WNDTYPE_DEFAULT){ 1514 1538 ////////////////////// 1515 1539 //通常ウィンドウ作成 … … 1518 1542 i2+=2; 1519 1543 1520 if( ProjectInfo.windowInfos[i].IconResName==0){1544 if(windowInfo.IconResName==0){ 1521 1545 lstrcpy(buffer+i2,"_RadSys_wcl.hIcon=LoadIcon(NULL,MAKEINTRESOURCE(IDI_APPLICATION))\r\n"); 1522 1546 i2+=lstrlen(buffer+i2); … … 1525 1549 } 1526 1550 else{ 1527 sprintf(buffer+i2,"_RadSys_wcl.hIcon=LoadIcon(_RadSys_wcl.hInstance,MAKEINTRESOURCE(%s))\r\n", ProjectInfo.windowInfos[i].IconResName);1551 sprintf(buffer+i2,"_RadSys_wcl.hIcon=LoadIcon(_RadSys_wcl.hInstance,MAKEINTRESOURCE(%s))\r\n",windowInfo.IconResName); 1528 1552 i2+=lstrlen(buffer+i2); 1529 sprintf(buffer+i2,"_RadSys_wcl.hIconSm=LoadIcon(_RadSys_wcl.hInstance,MAKEINTRESOURCE(%s))\r\n", ProjectInfo.windowInfos[i].IconResName);1553 sprintf(buffer+i2,"_RadSys_wcl.hIconSm=LoadIcon(_RadSys_wcl.hInstance,MAKEINTRESOURCE(%s))\r\n",windowInfo.IconResName); 1530 1554 i2+=lstrlen(buffer+i2); 1531 1555 } … … 1534 1558 i2+=lstrlen(buffer+i2); 1535 1559 if(bAvailUserProc[i]) 1536 sprintf(buffer+i2,"_RadSys_wcl.lpfnWndProc=AddressOf(%s)\r\n", ProjectInfo.windowInfos[i].CallBackName);1537 else sprintf(buffer+i2,"_RadSys_wcl.lpfnWndProc=AddressOf(EventCall_%s)\r\n", ProjectInfo.windowInfos[i].name);1538 i2+=lstrlen(buffer+i2); 1539 if( ProjectInfo.windowInfos[i].bgColor==COLOR_3DFACE)1560 sprintf(buffer+i2,"_RadSys_wcl.lpfnWndProc=AddressOf(%s)\r\n",windowInfo.CallBackName); 1561 else sprintf(buffer+i2,"_RadSys_wcl.lpfnWndProc=AddressOf(EventCall_%s)\r\n",windowInfo.name); 1562 i2+=lstrlen(buffer+i2); 1563 if(windowInfo.bgColor==COLOR_3DFACE) 1540 1564 lstrcpy(buffer+i2,"_RadSys_wcl.hbrBackground=h3DFaceBrush\r\n"); 1541 else if( ProjectInfo.windowInfos[i].bgColor==-(int)RGB(255,255,255))1565 else if(windowInfo.bgColor==-(int)RGB(255,255,255)) 1542 1566 lstrcpy(buffer+i2,"_RadSys_wcl.hbrBackground=GetStockObject(WHITE_BRUSH)\r\n"); 1543 else if( ProjectInfo.windowInfos[i].bgColor==-(int)RGB(0,0,0))1567 else if(windowInfo.bgColor==-(int)RGB(0,0,0)) 1544 1568 lstrcpy(buffer+i2,"_RadSys_wcl.hbrBackground=GetStockObject(BLACK_BRUSH)\r\n"); 1545 else if( ProjectInfo.windowInfos[i].bgColor<=0||1546 ProjectInfo.windowInfos[i].bgColor>=0x1000){1569 else if(windowInfo.bgColor<=0|| 1570 windowInfo.bgColor>=0x1000){ 1547 1571 //色指定またはビットマップ 1548 1572 sprintf(buffer+i2,"_RadSys_wcl.hbrBackground=_RadSys_hBackBrush%d\r\n",i); … … 1552 1576 i2+=lstrlen(buffer+i2); 1553 1577 sprintf(buffer+i2,"CreateWindowEx(&H%08x,\"%s%d\",\"%s\",&H%08x,%d,%d,%d,%d,0,0,GetModuleHandle(0),0)\r\n", 1554 ProjectInfo.windowInfos[i].ExStyle,1555 ProjectInfo.windowInfos[i].ClassName,i,1556 ProjectInfo.windowInfos[i].caption,1557 ProjectInfo.windowInfos[i].style,1558 ProjectInfo.windowInfos[i].pos.x,1559 ProjectInfo.windowInfos[i].pos.y,1560 ProjectInfo.windowInfos[i].size.cx,1561 ProjectInfo.windowInfos[i].size.cy);1578 windowInfo.ExStyle, 1579 windowInfo.ClassName,i, 1580 windowInfo.caption, 1581 windowInfo.style, 1582 windowInfo.pos.x, 1583 windowInfo.pos.y, 1584 windowInfo.size.cx, 1585 windowInfo.size.cy); 1562 1586 i2+=lstrlen(buffer+i2); 1563 1587 } … … 1567 1591 buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size); 1568 1592 } 1593 1594 i++; 1569 1595 } 1570 1596 … … 1612 1638 size=2; 1613 1639 buffer=(char *)HeapAlloc(hHeap,0,GENERAL_SIZE*size); 1614 for(i=0,i2=0;i<windowInfos.size();i++){ 1615 sprintf(buffer+i2,"WINDOW:%s\r\n",windowInfos[i].name); 1616 i2+=lstrlen(buffer+i2); 1617 sprintf(buffer+i2," HANDLE = %s\r\n",windowInfos[i].HandleName); 1618 i2+=lstrlen(buffer+i2); 1619 sprintf(buffer+i2," POINT = %d,%d\r\n",windowInfos[i].pos.x,windowInfos[i].pos.y); 1620 i2+=lstrlen(buffer+i2); 1621 sprintf(buffer+i2," SIZE = %d,%d\r\n",windowInfos[i].size.cx,windowInfos[i].size.cy); 1622 i2+=lstrlen(buffer+i2); 1623 sprintf(buffer+i2," CAPTION = \"%s\"\r\n",windowInfos[i].caption); 1624 i2+=lstrlen(buffer+i2); 1625 sprintf(buffer+i2," STYLE = &H%08x\r\n",windowInfos[i].style); 1626 i2+=lstrlen(buffer+i2); 1627 sprintf(buffer+i2," EXSTYLE = &H%08x\r\n",windowInfos[i].ExStyle); 1628 i2+=lstrlen(buffer+i2); 1629 if(windowInfos[i].MenuID){ 1630 sprintf(buffer+i2," MENUID = %s\r\n",windowInfos[i].MenuID); 1631 i2+=lstrlen(buffer+i2); 1632 } 1633 sprintf(buffer+i2," ID = %d\r\n",windowInfos[i].id); 1634 i2+=lstrlen(buffer+i2); 1635 sprintf(buffer+i2," BGCOLOR = %d\r\n",windowInfos[i].bgColor); 1640 i2=0; 1641 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 1642 { 1643 sprintf(buffer+i2,"WINDOW:%s\r\n",windowInfo.name); 1644 i2+=lstrlen(buffer+i2); 1645 sprintf(buffer+i2," HANDLE = %s\r\n",windowInfo.HandleName); 1646 i2+=lstrlen(buffer+i2); 1647 sprintf(buffer+i2," POINT = %d,%d\r\n",windowInfo.pos.x,windowInfo.pos.y); 1648 i2+=lstrlen(buffer+i2); 1649 sprintf(buffer+i2," SIZE = %d,%d\r\n",windowInfo.size.cx,windowInfo.size.cy); 1650 i2+=lstrlen(buffer+i2); 1651 sprintf(buffer+i2," CAPTION = \"%s\"\r\n",windowInfo.caption); 1652 i2+=lstrlen(buffer+i2); 1653 sprintf(buffer+i2," STYLE = &H%08x\r\n",windowInfo.style); 1654 i2+=lstrlen(buffer+i2); 1655 sprintf(buffer+i2," EXSTYLE = &H%08x\r\n",windowInfo.ExStyle); 1656 i2+=lstrlen(buffer+i2); 1657 if(windowInfo.MenuID){ 1658 sprintf(buffer+i2," MENUID = %s\r\n",windowInfo.MenuID); 1659 i2+=lstrlen(buffer+i2); 1660 } 1661 sprintf(buffer+i2," ID = %d\r\n",windowInfo.id); 1662 i2+=lstrlen(buffer+i2); 1663 sprintf(buffer+i2," BGCOLOR = %d\r\n",windowInfo.bgColor); 1636 1664 i2+=lstrlen(buffer+i2); 1637 1665 sprintf(buffer+i2," FONT = %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\"%s\"\r\n", 1638 windowInfo s[i].LogFont.lfHeight,1639 windowInfo s[i].LogFont.lfWidth,1640 windowInfo s[i].LogFont.lfEscapement,1641 windowInfo s[i].LogFont.lfOrientation,1642 windowInfo s[i].LogFont.lfWeight,1643 windowInfo s[i].LogFont.lfItalic,1644 windowInfo s[i].LogFont.lfUnderline,1645 windowInfo s[i].LogFont.lfStrikeOut,1646 windowInfo s[i].LogFont.lfCharSet,1647 windowInfo s[i].LogFont.lfOutPrecision,1648 windowInfo s[i].LogFont.lfClipPrecision,1649 windowInfo s[i].LogFont.lfQuality,1650 windowInfo s[i].LogFont.lfPitchAndFamily,1651 windowInfo s[i].LogFont.lfFaceName);1652 i2+=lstrlen(buffer+i2); 1653 if(windowInfo s[i].IconResName){1654 sprintf(buffer+i2," ICONID = %s\r\n",windowInfo s[i].IconResName);1655 i2+=lstrlen(buffer+i2); 1656 } 1657 sprintf(buffer+i2," CLASS = \"%s\"\r\n",windowInfo s[i].ClassName);1658 i2+=lstrlen(buffer+i2); 1659 sprintf(buffer+i2," CALLBACK = %s\r\n",windowInfo s[i].CallBackName);1660 i2+=lstrlen(buffer+i2); 1661 sprintf(buffer+i2," TYPE = %d\r\n",windowInfo s[i].type);1662 i2+=lstrlen(buffer+i2); 1663 sprintf(buffer+i2," FILEPATH = %s\r\n",windowInfo s[i].filepath);1664 i2+=lstrlen(buffer+i2); 1665 for(i3=0;i3<windowInfo s[i].NumberOfChildWindows;i3++){1666 temporary=SetCaptionSequence(windowInfo s[i].pChildInfo[i3].caption);1666 windowInfo.LogFont.lfHeight, 1667 windowInfo.LogFont.lfWidth, 1668 windowInfo.LogFont.lfEscapement, 1669 windowInfo.LogFont.lfOrientation, 1670 windowInfo.LogFont.lfWeight, 1671 windowInfo.LogFont.lfItalic, 1672 windowInfo.LogFont.lfUnderline, 1673 windowInfo.LogFont.lfStrikeOut, 1674 windowInfo.LogFont.lfCharSet, 1675 windowInfo.LogFont.lfOutPrecision, 1676 windowInfo.LogFont.lfClipPrecision, 1677 windowInfo.LogFont.lfQuality, 1678 windowInfo.LogFont.lfPitchAndFamily, 1679 windowInfo.LogFont.lfFaceName); 1680 i2+=lstrlen(buffer+i2); 1681 if(windowInfo.IconResName){ 1682 sprintf(buffer+i2," ICONID = %s\r\n",windowInfo.IconResName); 1683 i2+=lstrlen(buffer+i2); 1684 } 1685 sprintf(buffer+i2," CLASS = \"%s\"\r\n",windowInfo.ClassName); 1686 i2+=lstrlen(buffer+i2); 1687 sprintf(buffer+i2," CALLBACK = %s\r\n",windowInfo.CallBackName); 1688 i2+=lstrlen(buffer+i2); 1689 sprintf(buffer+i2," TYPE = %d\r\n",windowInfo.type); 1690 i2+=lstrlen(buffer+i2); 1691 sprintf(buffer+i2," FILEPATH = %s\r\n",windowInfo.filepath); 1692 i2+=lstrlen(buffer+i2); 1693 for(i3=0;i3<windowInfo.NumberOfChildWindows;i3++){ 1694 temporary=SetCaptionSequence(windowInfo.pChildInfo[i3].caption); 1667 1695 sprintf(buffer+i2," ITEM = %s,%d,%d,%d,%d,\"%s\",&H%08x,&H%08x,%d", 1668 windowInfo s[i].pChildInfo[i3].IdName,1669 windowInfo s[i].pChildInfo[i3].pos.x,windowInfos[i].pChildInfo[i3].pos.y,1670 windowInfo s[i].pChildInfo[i3].size.cx,windowInfos[i].pChildInfo[i3].size.cy,1696 windowInfo.pChildInfo[i3].IdName, 1697 windowInfo.pChildInfo[i3].pos.x,windowInfo.pChildInfo[i3].pos.y, 1698 windowInfo.pChildInfo[i3].size.cx,windowInfo.pChildInfo[i3].size.cy, 1671 1699 temporary, 1672 windowInfo s[i].pChildInfo[i3].style,1673 windowInfo s[i].pChildInfo[i3].ExStyle,1674 windowInfo s[i].pChildInfo[i3].Control1700 windowInfo.pChildInfo[i3].style, 1701 windowInfo.pChildInfo[i3].ExStyle, 1702 windowInfo.pChildInfo[i3].Control 1675 1703 ); 1676 1704 i2+=lstrlen(buffer+i2); 1677 1705 HeapDefaultFree(temporary); 1678 if(windowInfo s[i].pChildInfo[i3].Control==CT_IMAGEBOX){1679 sprintf(buffer+i2,",%d,\"%s\"",windowInfo s[i].pChildInfo[i3].ImageCtrlInfo.type,windowInfos[i].pChildInfo[i3].ImageCtrlInfo.path);1706 if(windowInfo.pChildInfo[i3].Control==CT_IMAGEBOX){ 1707 sprintf(buffer+i2,",%d,\"%s\"",windowInfo.pChildInfo[i3].ImageCtrlInfo.type,windowInfo.pChildInfo[i3].ImageCtrlInfo.path); 1680 1708 i2+=lstrlen(buffer+i2); 1681 1709 } … … 1687 1715 } 1688 1716 } 1689 sprintf(buffer+i2,"END\r\n",windowInfo s[i].name);1717 sprintf(buffer+i2,"END\r\n",windowInfo.name); 1690 1718 i2+=lstrlen(buffer+i2); 1691 1719 if(i2-GENERAL_SIZE<GENERAL_SIZE){ … … 2146 2174 extern HANDLE hHeap; 2147 2175 extern PROJECTINFO ProjectInfo; 2148 int i;2149 2176 char temporary[MAX_PATH],temp2[1024],*pTemp; 2150 2177 … … 2158 2185 return; 2159 2186 } 2160 for(i=0;i<ProjectInfo.windowInfos.size();i++){ 2161 if(lstrcmpi(NewWindow.name,ProjectInfo.windowInfos[i].name)==0){ 2187 BOOST_FOREACH( WINDOW_INFO &windowInfo, ProjectInfo.windowInfos ) 2188 { 2189 if(lstrcmpi(NewWindow.name,windowInfo.name)==0){ 2162 2190 //"\"%s\" ウィンドウは既にプロジェクト内に存在します。" 2163 sprintf(temporary,STRING_DUPLICATIONERROR_WINDOW_IN_PROJECT, ProjectInfo.windowInfos[i].name);2191 sprintf(temporary,STRING_DUPLICATIONERROR_WINDOW_IN_PROJECT,windowInfo.name); 2164 2192 MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION); 2165 2193 return; 2166 2194 } 2167 if(lstrcmpi(NewWindow.HandleName, ProjectInfo.windowInfos[i].HandleName)==0){2195 if(lstrcmpi(NewWindow.HandleName,windowInfo.HandleName)==0){ 2168 2196 //"\"%s\" ハンドルは既にプロジェクト内に存在します。" 2169 sprintf(temporary,STRING_DUPLICATIONERROR_HANDLE_IN_PROJECT, ProjectInfo.windowInfos[i].HandleName);2197 sprintf(temporary,STRING_DUPLICATIONERROR_HANDLE_IN_PROJECT,windowInfo.HandleName); 2170 2198 MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION); 2171 2199 return; 2172 2200 } 2173 if(lstrcmpi(NewWindow.CallBackName, ProjectInfo.windowInfos[i].CallBackName)==0){2201 if(lstrcmpi(NewWindow.CallBackName,windowInfo.CallBackName)==0){ 2174 2202 //"\"%s\" プロシージャは既にプロジェクト内に存在します。" 2175 sprintf(temporary,STRING_DUPLICATIONERROR_PROC_IN_PROJECT, ProjectInfo.windowInfos[i].CallBackName);2203 sprintf(temporary,STRING_DUPLICATIONERROR_PROC_IN_PROJECT,windowInfo.CallBackName); 2176 2204 MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION); 2177 2205 return; … … 2301 2329 ProjectInfo.ModifyOfMaterial=1; 2302 2330 2303 NewRadWindow( ProjectInfo.windowInfos.size()-1);2331 NewRadWindow( ProjectInfo.windowInfos.back() ); 2304 2332 } 2305 2333 void Project_Window_Delete(int WndInfoNum){
Note:
See TracChangeset
for help on using the changeset viewer.