Index: trunk/ab5.0/abdev/abdev/abdev.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/abdev.cpp	(revision 501)
+++ trunk/ab5.0/abdev/abdev/abdev.cpp	(revision 503)
@@ -1324,12 +1324,7 @@
 WNDPROC oldMainFrameWndProc;
 LRESULT CALLBACK WindowFunc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
-	int i,i2,WndNum;
-	char str[MAX_PATH],temporary[1024],temp2[MAX_PATH],*pTemp;
-	HWND hChild;
+	char str[MAX_PATH];
 	RECT rect;
 	POINT pos;
-	HDROP hDrop;
-
-	static COLORREF colorUser=RGB(255,255,255);
 
 	if(message==WM_COMMAND&&IS_FILEHISTORY_COMMAND(LOWORD(wParam))){
@@ -1349,141 +1344,4 @@
 	switch(message)
 	{
-		case WM_COMMAND:
-			switch(LOWORD(wParam)){
-
-
-				////////////////////////////////////////////////////
-				// メイン タブ コントロールのサブメニューコマンド
-				////////////////////////////////////////////////////
-
-
-				case IDM_USER_COLOR:
-					{
-						CHOOSECOLOR cc;
-						COLORREF CusColors[16]={
-							RGB(255,255,255),
-							RGB(0,0,0),
-							RGB(128,128,128),
-							RGB(192,192,192),
-							RGB(128,0,0),
-							RGB(255,0,0),
-							RGB(128,128,0),
-							RGB(255,255,0),
-							RGB(0,128,0),
-							RGB(0,255,0),
-							RGB(0,128,128),
-							RGB(0,255,255),
-							RGB(0,0,128),
-							RGB(0,0,255),
-							RGB(128,0,128),
-							RGB(255,0,255)};
-						cc.lStructSize=sizeof(CHOOSECOLOR);
-						cc.hwndOwner=hwnd;
-						cc.rgbResult=colorUser;
-						cc.lpCustColors=CusColors;
-						cc.Flags=CC_RGBINIT|CC_FULLOPEN;
-						if(!ChooseColor(&cc)){
-							return 0;
-						}
-						colorUser=cc.rgbResult;
-					}
-				case IDM_GRAY:
-				case IDM_WHITE:
-				case IDM_RED:
-				case IDM_GREEN:
-				case IDM_BLUE:
-				case IDM_YELLOW:
-					hChild=GetWindow(hClient,GW_CHILD);
-					WndNum=GetWndNum(hChild);
-
-					TC_ITEM tcItem;
-					tcItem.mask=TCIF_PARAM;
-					if(LOWORD(wParam)==IDM_GRAY)	tcItem.lParam=TABCOLOR_GRAY;
-					if(LOWORD(wParam)==IDM_WHITE)	tcItem.lParam=TABCOLOR_WHITE;
-					if(LOWORD(wParam)==IDM_RED)		tcItem.lParam=TABCOLOR_RED;
-					if(LOWORD(wParam)==IDM_GREEN)	tcItem.lParam=TABCOLOR_GREEN;
-					if(LOWORD(wParam)==IDM_BLUE)	tcItem.lParam=TABCOLOR_BLUE;
-					if(LOWORD(wParam)==IDM_YELLOW)	tcItem.lParam=TABCOLOR_YELLOW;
-					if(LOWORD(wParam)==IDM_USER_COLOR) tcItem.lParam=colorUser;
-					TabCtrl_SetItem(pobj_MainTab->hTab,
-						TabCtrl_GetCurSel(pobj_MainTab->hTab),
-						&tcItem);
-					InvalidateRect(pobj_MainTab->hTab,NULL,0);
-					return 0;
-
-
-
-				//////////////////////////////////
-				// SideWeb
-				//////////////////////////////////
-
-				case IDC_CLIP:
-					pobj_SideWeb->bShow=0;
-					ResizeOwnerWnd();
-					return 0;
-			}
-			break;
-		case WM_DROPFILES:
-			hDrop=(HDROP)wParam;
-
-			i2=DragQueryFile(hDrop,-1,0,0);
-			for(i=0;i<i2;i++){
-				DragQueryFile(hDrop,i,str,MAX_PATH);
-				OpenFileWithExtension(str);
-			}
-			DragFinish(hDrop);
-			return 0;
-		case WM_SHOWERROR:
-			//エラー部分を反転表示
-			DWORD AccBytes;
-			HANDLE fh;
-			sprintf(temporary,"%spgm.tmp",pj_editor_Dir);
-			fh=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
-			ReadFile(fh,temporary,MAX_PATH,&AccBytes,NULL);
-			CloseHandle(fh);
-			temporary[AccBytes]=0;
-			hChild=GetWindow(hClient,GW_CHILD);
-			while(hChild){
-				WndNum=GetWndNum(hChild);
-				if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
-					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) break;
-				}
-				hChild=GetNextWindow(hChild,GW_HWNDNEXT);
-			}
-			if(!hChild){
-				hChild=OpenFileWithExtension(temporary);
-				WndNum=GetWndNum(hChild);
-			}
-
-			if(WndNum==-1) return 0;
-
-			//ウィンドウを最前面に表示
-			BringWindowToTop(hChild);
-			UpdateWindow(hChild);
-
-			pTemp=MdiInfo[WndNum].pMdiTextEdit->buffer;
-
-			//行の先頭インデックスを取得（取得する行の番号はwParamで渡される）
-			for(i=0,i2=0;;i++){
-				if(i2>=(int)wParam) break;
-				if(pTemp[i]=='\0') break;
-				if(pTemp[i]=='\r'&&pTemp[i+1]=='\n'){
-					i++;
-					i2++;
-				}
-			}
-			pos.x=i;
-
-			//行の終端インデックスを取得
-			for(;;i++){
-				if(pTemp[i]=='\0') break;
-				if(pTemp[i]=='\r'&&pTemp[i+1]=='\n') break;
-			}
-			pos.y=i;
-
-			//行を選択する
-			TextEdit_SetSel(WndNum,pos.x,pos.y,TRUE);
-
-			return 0;
 
 #ifndef THETEXT
Index: trunk/ab5.0/abdev/abdev/include/MainFrame.h
===================================================================
--- trunk/ab5.0/abdev/abdev/include/MainFrame.h	(revision 501)
+++ trunk/ab5.0/abdev/abdev/include/MainFrame.h	(revision 503)
@@ -54,4 +54,10 @@
 	LRESULT OnNotify( int idCtrl, LPNMHDR pnmh );
 
+	// ファイルがドロップされた
+	void OnDropFiles( HDROP hDropInfo );
+
+	// ソースコード表示メッセージ
+	::LRESULT OnShowSourceLine( ::UINT msg, ::WPARAM wParam, ::LPARAM lParam, ::BOOL& handled );
+
 	// 「新規作成」メニューがクリックされた
 	void OnCmdNew( UINT uNotifyCode, int nID, CWindow wndCtl );
@@ -224,4 +230,7 @@
 	// タブの「ファイルを削除」メニューがクリックされた
 	void OnCmdDeleteFile( UINT uNotifyCode, int nID, CWindow wndCtl );
+
+	// タブの「タブの色」メニューがクリックされた
+	void OnCmdColor( UINT uNotifyCode, int nID, CWindow wndCtl );
 
 private:
@@ -238,6 +247,7 @@
 		MSG_WM_MEASUREITEM( OnMeasureItem )
 		MSG_WM_DRAWITEM( OnDrawItem )
-
 		MSG_WM_NOTIFY( OnNotify );
+		MSG_WM_DROPFILES( OnDropFiles )
+		MESSAGE_HANDLER( WM_SHOWERROR, OnShowSourceLine )
 
 		COMMAND_ID_HANDLER_EX( IDM_NEW, OnCmdNew )
@@ -335,4 +345,11 @@
 		COMMAND_ID_HANDLER_EX( IDM_FOLDER_OPEN, OnCmdFolderOpen )
 		COMMAND_ID_HANDLER_EX( IDM_DELETE_FILE, OnCmdDeleteFile )
+		COMMAND_ID_HANDLER_EX( IDM_USER_COLOR, OnCmdColor )
+		COMMAND_ID_HANDLER_EX( IDM_GRAY, OnCmdColor )
+		COMMAND_ID_HANDLER_EX( IDM_WHITE, OnCmdColor )
+		COMMAND_ID_HANDLER_EX( IDM_RED, OnCmdColor )
+		COMMAND_ID_HANDLER_EX( IDM_GREEN, OnCmdColor )
+		COMMAND_ID_HANDLER_EX( IDM_BLUE, OnCmdColor )
+		COMMAND_ID_HANDLER_EX( IDM_YELLOW, OnCmdColor )
 	END_MSG_MAP()
 };
Index: trunk/ab5.0/abdev/abdev/src/MainFrame.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/src/MainFrame.cpp	(revision 501)
+++ trunk/ab5.0/abdev/abdev/src/MainFrame.cpp	(revision 503)
@@ -349,4 +349,75 @@
 		}
 	}
+
+	return 0;
+}
+
+void MainFrame::OnDropFiles( HDROP hDropInfo )
+{
+	int max = DragQueryFile(hDropInfo,-1,0,0);
+	for(int i=0;i<max;i++){
+		char temporary[1024];
+		DragQueryFile(hDropInfo,i,temporary,MAX_PATH);
+		OpenFileWithExtension(temporary);
+	}
+	DragFinish(hDropInfo);
+}
+
+::LRESULT MainFrame::OnShowSourceLine( ::UINT msg, ::WPARAM wParam, ::LPARAM lParam, ::BOOL& handled )
+{
+	char temporary[1024];
+
+	//エラー部分を反転表示
+	DWORD AccBytes;
+	HANDLE fh;
+	sprintf(temporary,"%spgm.tmp",pj_editor_Dir);
+	fh=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	ReadFile(fh,temporary,MAX_PATH,&AccBytes,NULL);
+	CloseHandle(fh);
+	temporary[AccBytes]=0;
+	HWND hChild=::GetWindow(hClient,GW_CHILD);
+	int WndNum = -1;
+	while(hChild){
+		WndNum=GetWndNum(hChild);
+		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+			if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) break;
+		}
+		hChild=::GetNextWindow(hChild,GW_HWNDNEXT);
+	}
+	if(!hChild){
+		hChild=OpenFileWithExtension(temporary);
+		WndNum=GetWndNum(hChild);
+	}
+
+	if(WndNum==-1) return 0;
+
+	//ウィンドウを最前面に表示
+	::BringWindowToTop(hChild);
+	::UpdateWindow(hChild);
+
+	char *pTemp=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+	//行の先頭インデックスを取得（取得する行の番号はwParamで渡される）
+	int i,i2;
+	for(i=0,i2=0;;i++){
+		if(i2>=(int)wParam) break;
+		if(pTemp[i]=='\0') break;
+		if(pTemp[i]=='\r'&&pTemp[i+1]=='\n'){
+			i++;
+			i2++;
+		}
+	}
+	POINT pos;
+	pos.x=i;
+
+	//行の終端インデックスを取得
+	for(;;i++){
+		if(pTemp[i]=='\0') break;
+		if(pTemp[i]=='\r'&&pTemp[i+1]=='\n') break;
+	}
+	pos.y=i;
+
+	//行を選択する
+	TextEdit_SetSel(WndNum,pos.x,pos.y,TRUE);
 
 	return 0;
@@ -1366,2 +1437,68 @@
 	SendMessage(MdiInfo[WndNum].hwnd,WM_CLOSE,0,0);
 }
+
+void MainFrame::OnCmdColor( UINT uNotifyCode, int nID, CWindow wndCtl )
+{
+	static COLORREF colorUser=RGB(255,255,255);
+
+	switch( nID )
+	{
+	case IDM_USER_COLOR:
+		{
+			CHOOSECOLOR cc;
+			COLORREF CusColors[16]={
+				RGB(255,255,255),
+				RGB(0,0,0),
+				RGB(128,128,128),
+				RGB(192,192,192),
+				RGB(128,0,0),
+				RGB(255,0,0),
+				RGB(128,128,0),
+				RGB(255,255,0),
+				RGB(0,128,0),
+				RGB(0,255,0),
+				RGB(0,128,128),
+				RGB(0,255,255),
+				RGB(0,0,128),
+				RGB(0,0,255),
+				RGB(128,0,128),
+				RGB(255,0,255)};
+			cc.lStructSize=sizeof(CHOOSECOLOR);
+			cc.hwndOwner=m_hWnd;
+			cc.rgbResult=colorUser;
+			cc.lpCustColors=CusColors;
+			cc.Flags=CC_RGBINIT|CC_FULLOPEN;
+			if(!ChooseColor(&cc)){
+				return;
+			}
+			colorUser=cc.rgbResult;
+		}
+	case IDM_GRAY:
+	case IDM_WHITE:
+	case IDM_RED:
+	case IDM_GREEN:
+	case IDM_BLUE:
+	case IDM_YELLOW:
+		{
+			HWND hChild=::GetWindow(hClient,GW_CHILD);
+			int WndNum=GetWndNum(hChild);
+
+			TC_ITEM tcItem;
+			tcItem.mask=TCIF_PARAM;
+			if(nID==IDM_GRAY)	tcItem.lParam=TABCOLOR_GRAY;
+			if(nID==IDM_WHITE)	tcItem.lParam=TABCOLOR_WHITE;
+			if(nID==IDM_RED)		tcItem.lParam=TABCOLOR_RED;
+			if(nID==IDM_GREEN)	tcItem.lParam=TABCOLOR_GREEN;
+			if(nID==IDM_BLUE)	tcItem.lParam=TABCOLOR_BLUE;
+			if(nID==IDM_YELLOW)	tcItem.lParam=TABCOLOR_YELLOW;
+			if(nID==IDM_USER_COLOR) tcItem.lParam=colorUser;
+			TabCtrl_SetItem(pobj_MainTab->hTab,
+				TabCtrl_GetCurSel(pobj_MainTab->hTab),
+				&tcItem);
+			::InvalidateRect(pobj_MainTab->hTab,NULL,0);
+			break;
+		}
+	default:
+		throw;
+	}
+}
Index: trunk/ab5.0/abdev/abdev/stdafx.h
===================================================================
--- trunk/ab5.0/abdev/abdev/stdafx.h	(revision 501)
+++ trunk/ab5.0/abdev/abdev/stdafx.h	(revision 503)
@@ -44,4 +44,6 @@
 #endif
 
+#include "Common.h"
+
 #include <WindowComponents/BaseWindow.h>
 #include <WindowComponents/MdiChild.h>
@@ -53,4 +55,2 @@
 #include <MainFrame.h>
 #include <Program.h>
-
-#include "Common.h"
