source: dev/trunk/ab5.0/abdev/ProjectEditor/MdiTextEdit.cpp@ 475

Last change on this file since 475 was 475, checked in by dai_9181, 17 years ago

構成管理を変更中・・・(いったんコミット)

File size: 1.2 KB
Line 
1#include "stdafx.h"
2
3#include "common.h"
4
5CMdiTextEdit::CMdiTextEdit( MDIINFO *pMdiInfo ){
6 this->pMdiInfo = pMdiInfo;
7
8 isModified = false;
9
10 BaseNumOfUndoRedo = 0;
11
12 pTextEditUndoState = (TEXTEDIT_UNDOSTATE *)HeapAlloc( hHeap, HEAP_ZERO_MEMORY, sizeof( TEXTEDIT_UNDOSTATE ) );
13 pTextEditUndoState->NowPos = 0;
14}
15CMdiTextEdit::~CMdiTextEdit(){
16 for( int i=0; i<MAX_UNDONUM; i++ ){
17 if( pTextEditUndoState->Command[i] ){
18 TextEdit_DeleteUndoData( pTextEditUndoState, i );
19 }
20 }
21 HeapDefaultFree( pTextEditUndoState );
22}
23
24void CMdiTextEdit::Modify(){
25 //変更時
26 isModified = true;
27
28 //タブ文字列に変更を示すアスタリスクを付ける
29 pobj_MainTab->NofityModifyDocument( pMdiInfo->title );
30}
31void CMdiTextEdit::UnModify(){
32 //変更状態解除
33 isModified = false;
34
35 //アスタリスク表示を解除する
36 pobj_MainTab->NofityUnModifyDocument( pMdiInfo->title );
37
38 //アンドゥーリドゥーのベース番号を取得
39 BaseNumOfUndoRedo = pTextEditUndoState->NowPos;
40}
41bool CMdiTextEdit::IsModified(){
42 return isModified;
43}
44
45void CMdiTextEdit::NofityUndoRedoToModify(){
46 if( BaseNumOfUndoRedo == pTextEditUndoState->NowPos ){
47 //変更なし
48 if( IsModified() ){
49 UnModify();
50 }
51 }
52 else{
53 //変更あり
54 if( ! IsModified() ){
55 Modify();
56 }
57 }
58}
Note: See TracBrowser for help on using the repository browser.