Index: ProjectEditor/Caret.cpp
===================================================================
--- ProjectEditor/Caret.cpp	(revision 3)
+++ ProjectEditor/Caret.cpp	(revision 24)
@@ -123,10 +123,10 @@
 
 	pCharRange->cpMin=GetBufferIndexFromCaretPos(
-		MdiInfo[WndNum].pmti->buffer,
-		MdiInfo[WndNum].pmti->StartCaretPos.x,
-		MdiInfo[WndNum].pmti->StartCaretPos.y);
-
-	if(MdiInfo[WndNum].pmti->StartCaretPos.x==MdiInfo[WndNum].pmti->EndCaretPos.x&&
-		MdiInfo[WndNum].pmti->StartCaretPos.y==MdiInfo[WndNum].pmti->EndCaretPos.y){
+		MdiInfo[WndNum].pMdiTextEdit->buffer,
+		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+
+	if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
+		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y){
 		//選択されていないとき
 		pCharRange->cpMax=pCharRange->cpMin;
@@ -134,7 +134,7 @@
 	else{
 		pCharRange->cpMax=GetBufferIndexFromCaretPos(
-			MdiInfo[WndNum].pmti->buffer,
-			MdiInfo[WndNum].pmti->EndCaretPos.x,
-			MdiInfo[WndNum].pmti->EndCaretPos.y);
+			MdiInfo[WndNum].pMdiTextEdit->buffer,
+			MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x,
+			MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y);
 	}
 
@@ -150,5 +150,5 @@
 
 	memcpy(buffer,
-		MdiInfo[WndNum].pmti->buffer+pCharRange->cpMin,
+		MdiInfo[WndNum].pMdiTextEdit->buffer+pCharRange->cpMin,
 		pCharRange->cpMax-pCharRange->cpMin);
 	buffer[pCharRange->cpMax-pCharRange->cpMin]=0;
@@ -159,5 +159,5 @@
 
 	HWND hEdit;
-	hEdit=MdiInfo[WndNum].pmti->hEdit;
+	hEdit=MdiInfo[WndNum].pMdiTextEdit->hEdit;
 
 	//垂直スクロールバーの位置
@@ -195,12 +195,12 @@
 
 	GetCaretPosFromBufferIndex(
-		MdiInfo[WndNum].pmti->buffer,
+		MdiInfo[WndNum].pMdiTextEdit->buffer,
 		StartIndex,
-		&MdiInfo[WndNum].pmti->StartCaretPos);
+		&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
 
 	GetCaretPosFromBufferIndex(
-		MdiInfo[WndNum].pmti->buffer,
+		MdiInfo[WndNum].pMdiTextEdit->buffer,
 		EndIndex,
-		&MdiInfo[WndNum].pmti->EndCaretPos);
+		&MdiInfo[WndNum].pMdiTextEdit->EndCaretPos);
 
 	HWND hEdit;
@@ -222,10 +222,10 @@
 	int iStartPos;
 	iStartPos=code_pos;
-	while(MdiInfo[WndNum].pmti->buffer[iStartPos]!='\n'&&iStartPos>0) iStartPos--;
-	if(MdiInfo[WndNum].pmti->buffer[iStartPos]=='\n') iStartPos++;
+	while(MdiInfo[WndNum].pMdiTextEdit->buffer[iStartPos]!='\n'&&iStartPos>0) iStartPos--;
+	if(MdiInfo[WndNum].pMdiTextEdit->buffer[iStartPos]=='\n') iStartPos++;
 
 	int iEndPos;
 	iEndPos=code_pos;
-	while(MdiInfo[WndNum].pmti->buffer[iEndPos]!='\r'&&MdiInfo[WndNum].pmti->buffer[iEndPos]!='\0') iEndPos++;
+	while(MdiInfo[WndNum].pMdiTextEdit->buffer[iEndPos]!='\r'&&MdiInfo[WndNum].pMdiTextEdit->buffer[iEndPos]!='\0') iEndPos++;
 
 	TextEdit_SetSel(WndNum,iStartPos,iEndPos,bShowCenter);
@@ -239,15 +239,15 @@
 	GetCaretPos(&OldPos);
 
-	x=MdiInfo[WndNum].pmti->StartCaretPos.x;
-	y=MdiInfo[WndNum].pmti->StartCaretPos.y;
+	x=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x;
+	y=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y;
 	GetScrollBaseCaretPos(WndNum,&x,&y);
 
 	//エディタ画面左端のコントロールタブ
 	int iControlTabSpace;
-	iControlTabSpace=MdiInfo[WndNum].pmti->iWidth_ControlTabSpace;
+	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
 
 	//コントロールタブ上にカーソルがきたときに、非表示にする
-	if(OldPos.x>=iControlTabSpace&&x<0) HideCaret(MdiInfo[WndNum].pmti->hEdit);
-	else if(OldPos.x<iControlTabSpace&&x>=0) ShowCaret(MdiInfo[WndNum].pmti->hEdit);
+	if(OldPos.x>=iControlTabSpace&&x<0) HideCaret(MdiInfo[WndNum].pMdiTextEdit->hEdit);
+	else if(OldPos.x<iControlTabSpace&&x>=0) ShowCaret(MdiInfo[WndNum].pMdiTextEdit->hEdit);
 
 	SetCaretPos(
@@ -263,12 +263,12 @@
 	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
 		int start,end;
-		if(MdiInfo[WndNum].pmti->StartCaretPos.x==MdiInfo[WndNum].pmti->EndCaretPos.x&&
-			MdiInfo[WndNum].pmti->StartCaretPos.y==MdiInfo[WndNum].pmti->EndCaretPos.y){
+		if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y){
 			//文字列を選択中でないとき
 
 			int sw=0;
 			if(bInputAndReset){
-				if(MdiInfo[WndNum].pmti->StartCaretPos.x>1){
-					MdiInfo[WndNum].pmti->StartCaretPos.x-=2;
+				if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x>1){
+					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x-=2;
 					sw=1;
 				}
@@ -276,29 +276,29 @@
 
 			TextEdit_GetWordCaret(
-				MdiInfo[WndNum].pmti->hEdit,
+				MdiInfo[WndNum].pMdiTextEdit->hEdit,
 				WndNum,
-				&MdiInfo[WndNum].pmti->StartCaretPos,
+				&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos,
 				&start,&end,
 				WORDCARET_BEFORE);
 
-			if(sw) MdiInfo[WndNum].pmti->StartCaretPos.x+=2;
+			if(sw) MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x+=2;
 
 			//半角文字列を選択時の全角とのズレを修正
 			POINT pos;
-			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pmti->buffer,start,&pos);
-			start=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pmti->buffer,pos.x,pos.y);
-			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pmti->buffer,end,&pos);
-			end=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pmti->buffer,pos.x,pos.y);
+			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,start,&pos);
+			start=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,pos.x,pos.y);
+			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,end,&pos);
+			end=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,pos.x,pos.y);
 		}
 		else{
 			//文字列を選択中のとき
 			start=GetBufferIndexFromCaretPos(
-				MdiInfo[WndNum].pmti->buffer,
-				MdiInfo[WndNum].pmti->StartCaretPos.x,
-				MdiInfo[WndNum].pmti->StartCaretPos.y);
+				MdiInfo[WndNum].pMdiTextEdit->buffer,
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
 			end=GetBufferIndexFromCaretPos(
-				MdiInfo[WndNum].pmti->buffer,
-				MdiInfo[WndNum].pmti->EndCaretPos.x,
-				MdiInfo[WndNum].pmti->EndCaretPos.y);
+				MdiInfo[WndNum].pMdiTextEdit->buffer,
+				MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x,
+				MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y);
 		}
 
@@ -315,5 +315,5 @@
 		if(length<0) length=0;
 		pTemp=(char *)HeapAlloc(hHeap,0,length+1024);
-		memcpy(pTemp,MdiInfo[WndNum].pmti->buffer+start,length);
+		memcpy(pTemp,MdiInfo[WndNum].pMdiTextEdit->buffer+start,length);
 		pTemp[length]=0;
 
@@ -359,7 +359,7 @@
 		char *pTemp,temporary[VN_SIZE];
 
-		i=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pmti->buffer,
-			MdiInfo[WndNum].pmti->StartCaretPos.x,
-			MdiInfo[WndNum].pmti->StartCaretPos.y);
+		i=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
 
 		if(i<ComplementWndInfo.iPos||ComplementWndInfo.iPos+ComplementWndInfo.iLength<i){
@@ -384,5 +384,5 @@
 			pTemp=(char *)HeapAlloc(hHeap,0,ComplementWndInfo.iLength+1);
 			memcpy(pTemp,
-				MdiInfo[WndNum].pmti->buffer+ComplementWndInfo.iPos,
+				MdiInfo[WndNum].pMdiTextEdit->buffer+ComplementWndInfo.iPos,
 				ComplementWndInfo.iLength);
 			pTemp[ComplementWndInfo.iLength]=0;
@@ -437,5 +437,5 @@
 			pTemp=(char *)HeapAlloc(hHeap,0,ComplementWndInfo.iLength+1);
 			memcpy(pTemp,
-				MdiInfo[WndNum].pmti->buffer+ComplementWndInfo.iPos,
+				MdiInfo[WndNum].pMdiTextEdit->buffer+ComplementWndInfo.iPos,
 				ComplementWndInfo.iLength);
 			pTemp[ComplementWndInfo.iLength]=0;
@@ -468,8 +468,8 @@
 
 	HWND hEdit;
-	hEdit=MdiInfo[WndNum].pmti->hEdit;
-
-	x=MdiInfo[WndNum].pmti->StartCaretPos.x;
-	y=MdiInfo[WndNum].pmti->StartCaretPos.y;
+	hEdit=MdiInfo[WndNum].pMdiTextEdit->hEdit;
+
+	x=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x;
+	y=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y;
 	GetScrollBaseCaretPos(WndNum,&x,&y);
 
@@ -544,5 +544,5 @@
 	if(loose_y<0) loose_y=0;
 
-	pBuf=MdiInfo[WndNum].pmti->buffer;
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
 
 	// 行の確認
@@ -668,5 +668,5 @@
 
 	POINT *pCaretPos;
-	pCaretPos=&MdiInfo[WndNum].pmti->StartCaretPos;
+	pCaretPos=&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
 
 	if(pCaretPos->x==0&&pCaretPos->y==0){
@@ -675,5 +675,5 @@
 	}
 
-	pBuf=MdiInfo[WndNum].pmti->buffer;
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
 
 	i=GetBufferIndexFromCaretPos(pBuf,
@@ -721,5 +721,5 @@
 	char *pBuf;
 
-	pBuf=MdiInfo[WndNum].pmti->buffer;
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
 
 	i=GetBufferIndexFromCaretPos(pBuf,
@@ -779,11 +779,11 @@
 
 	//上下のキャレット移動時には、左右方向の位置を保持する
-	if(MdiInfo[WndNum].pmti->Temp_UpDown_CaretXPos==-1)
-		MdiInfo[WndNum].pmti->Temp_UpDown_CaretXPos=pCaretPos->x;
+	if(MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
 
 	pCaretPos->y--;
 
 	CaretPos_LooseToNatural(WndNum,
-		MdiInfo[WndNum].pmti->Temp_UpDown_CaretXPos,
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos,
 		pCaretPos->y,
 		pCaretPos);
@@ -796,11 +796,11 @@
 
 	//上下のキャレット移動時には、左右方向の位置を保持する
-	if(MdiInfo[WndNum].pmti->Temp_UpDown_CaretXPos==-1)
-		MdiInfo[WndNum].pmti->Temp_UpDown_CaretXPos=pCaretPos->x;
+	if(MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
 
 	pCaretPos->y++;
 
 	CaretPos_LooseToNatural(WndNum,
-		MdiInfo[WndNum].pmti->Temp_UpDown_CaretXPos,
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos,
 		pCaretPos->y,
 		pCaretPos);
@@ -818,16 +818,16 @@
 
 	//上下のキャレット移動時には、左右方向の位置を保持する
-	if(MdiInfo[WndNum].pmti->Temp_UpDown_CaretXPos==-1)
-		MdiInfo[WndNum].pmti->Temp_UpDown_CaretXPos=pCaretPos->x;
+	if(MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
 
 	SCROLLINFO si;
 	si.cbSize=sizeof(SCROLLINFO);
 	si.fMask=SIF_PAGE;
-	GetScrollInfo(MdiInfo[WndNum].pmti->hEdit,SB_VERT,&si);
+	GetScrollInfo(MdiInfo[WndNum].pMdiTextEdit->hEdit,SB_VERT,&si);
 	pCaretPos->y-=si.nPage;
 	if(pCaretPos->y<0) pCaretPos->y=0;
 
 	CaretPos_LooseToNatural(WndNum,
-		MdiInfo[WndNum].pmti->Temp_UpDown_CaretXPos,
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos,
 		pCaretPos->y,
 		pCaretPos);
@@ -840,15 +840,15 @@
 
 	//上下のキャレット移動時には、左右方向の位置を保持する
-	if(MdiInfo[WndNum].pmti->Temp_UpDown_CaretXPos==-1)
-		MdiInfo[WndNum].pmti->Temp_UpDown_CaretXPos=pCaretPos->x;
+	if(MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
 
 	SCROLLINFO si;
 	si.cbSize=sizeof(SCROLLINFO);
 	si.fMask=SIF_PAGE;
-	GetScrollInfo(MdiInfo[WndNum].pmti->hEdit,SB_VERT,&si);
+	GetScrollInfo(MdiInfo[WndNum].pMdiTextEdit->hEdit,SB_VERT,&si);
 	pCaretPos->y+=si.nPage;
 
 	CaretPos_LooseToNatural(WndNum,
-		MdiInfo[WndNum].pmti->Temp_UpDown_CaretXPos,
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos,
 		pCaretPos->y,
 		pCaretPos);
