Index: trunk/ab5.0/abdev/abdev/RadToolsAndPropertyProc.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/RadToolsAndPropertyProc.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/RadToolsAndPropertyProc.cpp	(revision 625)
@@ -100,5 +100,4 @@
 }
 BOOL CALLBACK RadToolButtonsProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,WndNum;
 	HWND hParent;
@@ -198,5 +197,4 @@
 }
 LRESULT CALLBACK RadToolsWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern HFONT hStatusFont;
 	int i;
@@ -352,5 +350,4 @@
 	extern HANDLE hHeap;
 	extern HWND hClient,hOwner;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i3;
 	char temporary[MAX_PATH],temp2[MAX_PATH];
@@ -361,14 +358,7 @@
 				i=GetWndNum(GetWindow(hClient,GW_CHILD));
 				ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[i].path);
-				sprintf(temporary,"h%s",pWindowInfo->GetName().c_str());
-				sprintf(temp2,"%sProc",pWindowInfo->GetName().c_str());
-				if( pWindowInfo->GetHandleName() == temporary &&
-					lstrcmp(temp2,pWindowInfo->CallBackName)==0){
-					SendDlgItemMessage(hwnd,IDC_AUTOSET,BM_SETCHECK,BST_CHECKED,0);
-					SendMessage(hwnd,WM_COMMAND,IDC_AUTOSET,0);
-				}
 				SetDlgItemText(hwnd,IDC_WINDOWNAME,pWindowInfo->GetName().c_str());
-				SetDlgItemText(hwnd,IDC_WINDOWHANDLE,pWindowInfo->GetHandleName().c_str());
-				SetDlgItemText(hwnd,IDC_WINDOWPROC,pWindowInfo->CallBackName);
+				SetDlgItemText(hwnd,IDC_WINDOWHANDLE,( "h" + pWindowInfo->GetName() ).c_str());
+				SetDlgItemText(hwnd,IDC_WINDOWPROC,( pWindowInfo->GetName() + "Proc" ).c_str());
 				break;
 			}
@@ -402,16 +392,6 @@
 						names.name = temporary;
 
-						i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWHANDLE))+1;
-						GetDlgItemText(hwnd,IDC_WINDOWHANDLE,temporary,i3);
-						names.HandleName = temporary;
-
-						i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWPROC))+1;
-						names.CallBackName=(char *)HeapAlloc(hHeap,0,i3);
-						GetDlgItemText(hwnd,IDC_WINDOWPROC,names.CallBackName,i3);
-
-						if( names.name == pWindowInfo->GetName() &&
-							pWindowInfo->GetHandleName() == names.HandleName &&
-							lstrcmp(names.CallBackName,pWindowInfo->CallBackName)==0){
-							HeapDefaultFree(names.CallBackName);
+						if( names.name == pWindowInfo->GetName() )
+						{
 							SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
 							return 1;
@@ -423,17 +403,8 @@
 						//変更情報を更新
 						NoticeNames.name=pWindowInfo->GetName();
-						NoticeNames.HandleName=pWindowInfo->GetHandleName();
-						NoticeNames.CallBackName=pWindowInfo->CallBackName;
 						Rad_NoticeChanging(i,RAD_UNDO_NAME,SELECT_WINDOW,(DWORD)&NoticeNames);
 
 						pWindowInfo->SetName( names.name );
-						GlobalFree(MdiInfo[i].path);
-						MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,names.name.size()+1);
-						lstrcpy(MdiInfo[i].path,names.name.c_str());
-
-						pWindowInfo->SetHandleName( names.HandleName );
-
-						HeapDefaultFree(pWindowInfo->CallBackName);
-						pWindowInfo->CallBackName=names.CallBackName;
+						MdiInfo[i].path = names.name;
 
 						EndDialog(hwnd,1);
@@ -444,10 +415,5 @@
 					return 1;
 				case IDC_WINDOWNAME:
-					if(HIWORD(wParam)==EN_CHANGE) SendMessage(hwnd,WM_COMMAND,IDC_AUTOSET,0);
-					return 1;
-				case IDC_AUTOSET:
-					if(SendDlgItemMessage(hwnd,IDC_AUTOSET,BM_GETCHECK,0,0)){
-						SendDlgItemMessage(hwnd,IDC_WINDOWHANDLE,EM_SETREADONLY,1,0);
-						SendDlgItemMessage(hwnd,IDC_WINDOWPROC,EM_SETREADONLY,1,0);
+					{
 						GetDlgItemText(hwnd,IDC_WINDOWNAME,temporary,MAX_PATH);
 						if(temporary[0]){
@@ -462,8 +428,4 @@
 						}
 					}
-					else{
-						SendDlgItemMessage(hwnd,IDC_WINDOWHANDLE,EM_SETREADONLY,0,0);
-						SendDlgItemMessage(hwnd,IDC_WINDOWPROC,EM_SETREADONLY,0,0);
-					}
 					return 1;
 			}
@@ -473,5 +435,4 @@
 }
 BOOL CALLBACK DlgRadProperty_Window_ExStyle(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 
@@ -544,5 +505,4 @@
 BOOL CALLBACK RadProperty_WindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i3,i4;
 	static BOOL bInitial;
@@ -568,6 +528,6 @@
 					SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_ADDSTRING,0,(long)resourceItem.idName.c_str());
 				}
-				if(pWindowInfo->type==WNDTYPE_MODALDLG||
-					pWindowInfo->type==WNDTYPE_MODELESSDLG){
+				if( pWindowInfo->IsModalDlg() || pWindowInfo->IsModelessDlg() )
+				{
 					SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,0,0);
 					EnableWindow(GetDlgItem(hwnd,IDC_BGCOLOR),0);
@@ -688,14 +648,19 @@
 				//////////
 				//タイプ
-				switch(pWindowInfo->type){
-					case WNDTYPE_DEFAULT:
-						SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_SETCHECK,BST_CHECKED,0);
-						break;
-					case WNDTYPE_MODALDLG:
-						SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_SETCHECK,BST_CHECKED,0);
-						break;
-					case WNDTYPE_MODELESSDLG:
-						SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_SETCHECK,BST_CHECKED,0);
-						break;
+				if( pWindowInfo->IsDefaultWindow() )
+				{
+					SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_SETCHECK,BST_CHECKED,0);
+				}
+				else if( pWindowInfo->IsModalDlg() )
+				{
+					SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_SETCHECK,BST_CHECKED,0);
+				}
+				else if( pWindowInfo->IsModelessDlg() )
+				{
+					SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_SETCHECK,BST_CHECKED,0);
+				}
+				else
+				{
+					throw;
 				}
 
@@ -1115,12 +1080,18 @@
 
 						//変更情報
-						Rad_NoticeChanging(i,RAD_UNDO_TYPE,SELECT_WINDOW,pWindowInfo->type);
+						Rad_NoticeChanging(i,RAD_UNDO_TYPE,SELECT_WINDOW,(DWORD)pWindowInfo->GetType());
 
 						if(SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_GETCHECK,0,0))
-							pWindowInfo->type=WNDTYPE_DEFAULT;
+						{
+							pWindowInfo->SetType( ActiveBasic::PM::WindowType::Default );
+						}
 						else if(SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_GETCHECK,0,0))
-							pWindowInfo->type=WNDTYPE_MODALDLG;
+						{
+							pWindowInfo->SetType( ActiveBasic::PM::WindowType::ModalDlg );
+						}
 						else if(SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_GETCHECK,0,0))
-							pWindowInfo->type=WNDTYPE_MODELESSDLG;
+						{
+							pWindowInfo->SetType( ActiveBasic::PM::WindowType::ModelessDlg );
+						}
 						return 1;
 					}
@@ -1134,5 +1105,4 @@
 BOOL CALLBACK DlgRadProperty_Item_RenameCaption(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i3;
 	char *temporary;
@@ -1267,5 +1237,4 @@
 	extern HANDLE hHeap;
 	extern HWND hClient,hOwner;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i3;
 	char *temporary;
@@ -1323,5 +1292,4 @@
 BOOL DefaultItemStyles(HWND hwnd,int WndNum,int WndInfoNum,WPARAM wParam){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 
 	ActiveBasic::PM::WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum];
@@ -1389,5 +1357,4 @@
 }
 BOOL CALLBACK DlgRadProperty_Item_ExStyle(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 
@@ -1451,5 +1418,4 @@
 
 BOOL CALLBACK RadProperty_ButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -1673,5 +1639,4 @@
 // CHECKBOX プロパティ
 BOOL CALLBACK RadProperty_CheckBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -1964,5 +1929,4 @@
 }
 BOOL CALLBACK RadProperty_ComboBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -2232,5 +2196,4 @@
 }
 BOOL CALLBACK RadProperty_EditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -2518,5 +2481,4 @@
 
 BOOL CALLBACK RadProperty_GroupBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -2670,5 +2632,4 @@
 BOOL CALLBACK RadProperty_ImageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	char temporary[MAX_PATH];
@@ -3066,5 +3027,4 @@
 // LISTVIEW プロパティ
 BOOL CALLBACK RadProperty_ListViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -3358,5 +3318,4 @@
 }
 BOOL CALLBACK RadProperty_ListBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -3616,5 +3575,4 @@
 // PROGRESSBAR プロパティ
 BOOL CALLBACK RadProperty_ProgressBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	static BOOL bInitial;
@@ -3701,5 +3659,4 @@
 
 BOOL CALLBACK RadProperty_RadioButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -3935,5 +3892,4 @@
 
 BOOL CALLBACK RadProperty_ScrollBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -4020,5 +3976,4 @@
 
 BOOL CALLBACK RadProperty_StaticProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -4151,5 +4106,4 @@
 // TRACKBAR プロパティ
 BOOL CALLBACK RadProperty_TrackBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -4304,5 +4258,4 @@
 // TREEVIEW プロパティ
 BOOL CALLBACK RadProperty_TreeViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2;
 	static BOOL bInitial;
@@ -4516,5 +4469,4 @@
 // UPDOWN プロパティ
 BOOL CALLBACK RadProperty_UpDownProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3;
 	static BOOL bInitial;
@@ -4689,5 +4641,4 @@
 
 LRESULT CALLBACK RadPropertyWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	RECT rect;
