Ejemplo n.º 1
0
/*!
	コマンドコードによる処理振り分け

	@param nCommand コマンドコード
	@param lparam1 parameter1(内容はコマンドコードによって変わります)
	@param lparam2 parameter2(内容はコマンドコードによって変わります)
	@param lparam3 parameter3(内容はコマンドコードによって変わります)
	@param lparam4 parameter4(内容はコマンドコードによって変わります)
*/
BOOL CViewCommander::HandleCommand(
	EFunctionCode	nCommand,
	bool			bRedraw,
	LPARAM			lparam1,
	LPARAM			lparam2,
	LPARAM			lparam3,
	LPARAM			lparam4
)
{
	BOOL	bRet = TRUE;
	bool	bRepeat = false;
	int		nFuncID;

	//	May. 19, 2006 genta 上位16bitに送信元の識別子が入るように変更したので
	//	下位16ビットのみを取り出す
	//	Jul.  7, 2007 genta 定数と比較するためにシフトしないで使う
	int nCommandFrom = nCommand & ~0xffff;
	nCommand = (EFunctionCode)LOWORD( nCommand );


	if( m_pCommanderView->m_nAutoScrollMode && F_AUTOSCROLL != nCommand ){
		m_pCommanderView->AutoScrollExit();
	}
	m_pCommanderView->GetCaret().m_bClearStatus = true;
	// -------------------------------------
	//	Jan. 10, 2005 genta
	//	Call message translators
	// -------------------------------------
	m_pCommanderView->TranslateCommand_grep( nCommand, bRedraw, lparam1, lparam2, lparam3, lparam4 );
	m_pCommanderView->TranslateCommand_isearch( nCommand, bRedraw, lparam1, lparam2, lparam3, lparam4 );

	// 2013.09.23 novice 機能が利用可能か調べる
	if( !IsFuncEnable( GetDocument(), &GetDllShareData(), nCommand ) ){
		return TRUE;
	}

	++GetDocument()->m_nCommandExecNum;		/* コマンド実行回数 */
//	if( nCommand != F_COPY ){
		/* 辞書Tipを消す */
		m_pCommanderView->m_cTipWnd.Hide();
		m_pCommanderView->m_dwTipTimer = ::GetTickCount();	/* 辞書Tip起動タイマー */
//	}
	/* 印刷プレビューモードか */
//@@@ 2002.01.14 YAZAKI 印刷プレビューをCPrintPreviewに独立させたことによる変更
	if( GetEditWindow()->m_pPrintPreview && F_PRINT_PREVIEW != nCommand ){
		ErrorBeep();
		return -1;
	}
	/* キーリピート状態 */
	if( m_bPrevCommand == nCommand ){
		bRepeat = true;
	}
	m_bPrevCommand = nCommand;
	if( GetDllShareData().m_sFlags.m_bRecordingKeyMacro &&									/* キーボードマクロの記録中 */
		GetDllShareData().m_sFlags.m_hwndRecordingKeyMacro == GetMainWindow() &&	/* キーボードマクロを記録中のウィンドウ */
		( nCommandFrom & FA_NONRECORD ) != FA_NONRECORD	/* 2007.07.07 genta 記録抑制フラグ off */
	){
		/* キーリピート状態をなくする */
		bRepeat = false;
		/* キーマクロに記録可能な機能かどうかを調べる */
		//@@@ 2002.2.2 YAZAKI マクロをCSMacroMgrに統一
		//F_EXECEXTMACROコマンドはファイルを選択した後にマクロ文が確定するため個別に記録する。
		if( CSMacroMgr::CanFuncIsKeyMacro( nCommand ) &&
			nCommand != F_EXECEXTMACRO	//F_EXECEXTMACROは個別で記録します
		){
			/* キーマクロのバッファにデータ追加 */
			//@@@ 2002.1.24 m_CKeyMacroMgrをCEditDocへ移動
			LPARAM lparams[] = {lparam1, lparam2, lparam3, lparam4};
			m_pcSMacroMgr->Append( STAND_KEYMACRO, nCommand, lparams, m_pCommanderView );
		}
	}

	//	2007.07.07 genta マクロ実行中フラグの設定
	//	マクロからのコマンドかどうかはnCommandFromでわかるが
	//	nCommandFromを引数で浸透させるのが大変なので,従来のフラグにも値をコピーする
	m_pCommanderView->m_bExecutingKeyMacro = ( nCommandFrom & FA_FROMMACRO ) ? true : false;

	/* キーボードマクロの実行中 */
	if( m_pCommanderView->m_bExecutingKeyMacro ){
		/* キーリピート状態をなくする */
		bRepeat = false;
	}

	//	From Here Sep. 29, 2001 genta マクロの実行機能追加
	if( F_USERMACRO_0 <= nCommand && nCommand < F_USERMACRO_0 + MAX_CUSTMACRO ){
		//@@@ 2002.2.2 YAZAKI マクロをCSMacroMgrに統一(インターフェースの変更)
		if( !m_pcSMacroMgr->Exec( nCommand - F_USERMACRO_0, G_AppInstance(), m_pCommanderView,
			nCommandFrom & FA_NONRECORD )){
			InfoMessage(
				this->m_pCommanderView->m_hwndParent,
				LS(STR_ERR_MACRO1),
				nCommand - F_USERMACRO_0,
				m_pcSMacroMgr->GetFile( nCommand - F_USERMACRO_0 )
			);
		}
		return TRUE;
	}
	//	To Here Sep. 29, 2001 genta マクロの実行機能追加

	// -------------------------------------
	//	Jan. 10, 2005 genta
	//	Call mode basis message handler
	// -------------------------------------
	m_pCommanderView->PreprocessCommand_hokan(nCommand);
	if( m_pCommanderView->ProcessCommand_isearch( nCommand, bRedraw, lparam1, lparam2, lparam3, lparam4 ))
		return TRUE;

	// -------------------------------------
	//	Jan. 10, 2005 genta コメント
	//	ここより前ではUndoバッファの準備ができていないので
	//	文書の操作を行ってはいけない
	//@@@ 2002.2.2 YAZAKI HandleCommand内でHandleCommandを呼び出せない問題に対処(何か副作用がある?)
	if( NULL == GetOpeBlk() ){	/* 操作ブロック */
		SetOpeBlk(new COpeBlk);
	}
	GetOpeBlk()->AddRef();	//参照カウンタ増加

	//	Jan. 10, 2005 genta コメント
	//	ここより後ではswitchの後ろでUndoを正しく登録するため,
	//	途中で処理の打ち切りを行ってはいけない
	// -------------------------------------

	switch( nCommand ){
	case F_WCHAR:	/* 文字入力 */
		{
			Command_WCHAR( (wchar_t)lparam1 );
		}
		break;

	/* ファイル操作系 */
	case F_FILENEW:				Command_FILENEW();break;			/* 新規作成 */
	case F_FILENEW_NEWWINDOW:	Command_FILENEW_NEWWINDOW();break;
	//	Oct. 2, 2001 genta マクロ用機能拡張
	case F_FILEOPEN:			Command_FILEOPEN((const WCHAR*)lparam1);break;			/* ファイルを開く */
	case F_FILEOPEN2:			Command_FILEOPEN((const WCHAR*)lparam1, (ECodeType)lparam2, lparam3 != 0, (const WCHAR*)lparam4);break;	//ファイルを開く2
	case F_FILEOPEN_DROPDOWN:	Command_FILEOPEN((const WCHAR*)lparam1);break;			/* ファイルを開く(ドロップダウン) */	//@@@ 2002.06.15 MIK
	case F_FILESAVE:			bRet = Command_FILESAVE();break;	/* 上書き保存 */
	case F_FILESAVEAS_DIALOG:	bRet = Command_FILESAVEAS_DIALOG((const WCHAR*)lparam1, (ECodeType)lparam2, (EEolType)lparam3);break;	/* 名前を付けて保存 */
	case F_FILESAVEAS:			bRet = Command_FILESAVEAS((const WCHAR*)lparam1,(EEolType)lparam3);break;	/* 名前を付けて保存 */
	case F_FILESAVEALL:			bRet = Command_FILESAVEALL();break;	/* 全ての編集ウィンドウで上書き保存 */ // Jan. 23, 2005 genta
	case F_FILESAVE_QUIET:		bRet = Command_FILESAVE(false,false); break;	/* 静かに上書き保存 */ // Jan. 24, 2005 genta
	case F_FILESAVECLOSE:
		//	Feb. 28, 2004 genta 保存&閉じる
		//	保存が不要なら単に閉じる
		{	// Command_FILESAVE()とは別に保存不要をチェック	//### Command_FILESAVE() は実際に保存した場合だけ true を返すようになった(仕様変更?)
			if( !GetDllShareData().m_Common.m_sFile.m_bEnableUnmodifiedOverwrite && !GetDocument()->m_cDocEditor.IsModified() ){
				Command_WINCLOSE();
				break;
			}
		}
		if( Command_FILESAVE( false, true )){
			Command_WINCLOSE();
		}
		break;
	case F_FILECLOSE:										//閉じて(無題)	//Oct. 17, 2000 jepro 「ファイルを閉じる」というキャプションを変更
		Command_FILECLOSE();
		break;
	case F_FILECLOSE_OPEN:	/* 閉じて開く */
		Command_FILECLOSE_OPEN();
		break;
	case F_FILE_REOPEN:				Command_FILE_REOPEN( GetDocument()->GetDocumentEncoding(), lparam1!=0 );break;//	Dec. 4, 2002 genta
	case F_FILE_REOPEN_SJIS:		Command_FILE_REOPEN( CODE_SJIS, lparam1!=0 );break;		//SJISで開き直す
	case F_FILE_REOPEN_JIS:			Command_FILE_REOPEN( CODE_JIS, lparam1!=0 );break;		//JISで開き直す
	case F_FILE_REOPEN_EUC:			Command_FILE_REOPEN( CODE_EUC, lparam1!=0 );break;		//EUCで開き直す
	case F_FILE_REOPEN_LATIN1:		Command_FILE_REOPEN( CODE_LATIN1, lparam1!=0 );break;	//Latin1で開きなおす	// 2010/3/20 Uchi
	case F_FILE_REOPEN_UNICODE:		Command_FILE_REOPEN( CODE_UNICODE, lparam1!=0 );break;	//Unicodeで開き直す
	case F_FILE_REOPEN_UNICODEBE: 	Command_FILE_REOPEN( CODE_UNICODEBE, lparam1!=0 );break;	//UnicodeBEで開き直す
	case F_FILE_REOPEN_UTF8:		Command_FILE_REOPEN( CODE_UTF8, lparam1!=0 );break;		//UTF-8で開き直す
	case F_FILE_REOPEN_CESU8:		Command_FILE_REOPEN( CODE_CESU8, lparam1!=0 );break;	//CESU-8で開きなおす
	case F_FILE_REOPEN_UTF7:		Command_FILE_REOPEN( CODE_UTF7, lparam1!=0 );break;		//UTF-7で開き直す
	case F_PRINT:				Command_PRINT();break;					/* 印刷 */
	case F_PRINT_PREVIEW:		Command_PRINT_PREVIEW();break;			/* 印刷プレビュー */
	case F_PRINT_PAGESETUP:		Command_PRINT_PAGESETUP();break;		/* 印刷ページ設定 */	//Sept. 14, 2000 jepro 「印刷のページレイアウトの設定」から変更
	case F_OPEN_HfromtoC:		bRet = Command_OPEN_HfromtoC( (BOOL)lparam1 );break;	/* 同名のC/C++ヘッダ(ソース)を開く */	//Feb. 7, 2001 JEPRO 追加
//	case F_OPEN_HHPP:			bRet = Command_OPEN_HHPP( (BOOL)lparam1, TRUE );break;		/* 同名のC/C++ヘッダファイルを開く */	//Feb. 9, 2001 jepro「.cまたは.cppと同名の.hを開く」から変更		del 2008/6/23 Uchi
//	case F_OPEN_CCPP:			bRet = Command_OPEN_CCPP( (BOOL)lparam1, TRUE );break;		/* 同名のC/C++ソースファイルを開く */	//Feb. 9, 2001 jepro「.hと同名の.c(なければ.cpp)を開く」から変更	del 2008/6/23 Uchi
	case F_ACTIVATE_SQLPLUS:	Command_ACTIVATE_SQLPLUS();break;		/* Oracle SQL*Plusをアクティブ表示 */
	case F_PLSQL_COMPILE_ON_SQLPLUS:									/* Oracle SQL*Plusで実行 */
		Command_PLSQL_COMPILE_ON_SQLPLUS();
		break;
	case F_BROWSE:				Command_BROWSE();break;				/* ブラウズ */
	case F_VIEWMODE:			Command_VIEWMODE();break;			/* ビューモード */
	case F_PROPERTY_FILE:		Command_PROPERTY_FILE();break;		/* ファイルのプロパティ */
	case F_OPEN_FOLDER_IN_EXPLORER:		Command_OPEN_FOLDER_IN_EXPLORER();break;	/* ファイルの場所を開く */
	case F_OPEN_COMMAND_PROMPT:				Command_OPEN_COMMAND_PROMPT(FALSE);break;		/* コマンドプロンプトを開く */
	case F_OPEN_COMMAND_PROMPT_AS_ADMIN:	Command_OPEN_COMMAND_PROMPT(TRUE);break;		/* 管理者としてコマンドプロンプトを開く */
	case F_OPEN_POWERSHELL:				Command_OPEN_POWERSHELL(FALSE);break;		/* PowerShellを開く */
	case F_OPEN_POWERSHELL_AS_ADMIN:	Command_OPEN_POWERSHELL(TRUE);break;		/* 管理者としてPowerShellを開く */
	case F_PROFILEMGR:			Command_PROFILEMGR();break;			// プロファイルマネージャ
	case F_EXITALLEDITORS:		Command_EXITALLEDITORS();break;		/* 編集の全終了 */	// 2007.02.13 ryoji 追加
	case F_EXITALL:				Command_EXITALL();break;			/* サクラエディタの全終了 */	//Dec. 26, 2000 JEPRO 追加
	case F_PUTFILE:				Command_PUTFILE((LPCWSTR)lparam1, (ECodeType)lparam2, (int)lparam3);break;	/* 作業中ファイルの一時出力 */ //maru 2006.12.10
	case F_INSFILE:				Command_INSFILE((LPCWSTR)lparam1, (ECodeType)lparam2, (int)lparam3);break;	/* キャレット位置にファイル挿入 */ //maru 2006.12.10

	/* 編集系 */
	case F_UNDO:				Command_UNDO();break;				/* 元に戻す(Undo) */
	case F_REDO:				Command_REDO();break;				/* やり直し(Redo) */
	case F_DELETE:				Command_DELETE(); break;			//削除
	case F_DELETE_BACK:			Command_DELETE_BACK(); break;		//カーソル前を削除
	case F_WordDeleteToStart:	Command_WordDeleteToStart(); break;	//単語の左端まで削除
	case F_WordDeleteToEnd:		Command_WordDeleteToEnd(); break;	//単語の右端まで削除
	case F_WordDelete:			Command_WordDelete(); break;		//単語削除
	case F_WordCut:				Command_WordCut(); break;			//単語切り取り
	case F_LineCutToStart:		Command_LineCutToStart(); break;	//行頭まで切り取り(改行単位)
	case F_LineCutToEnd:		Command_LineCutToEnd(); break;		//行末まで切り取り(改行単位)
	case F_LineDeleteToStart:	Command_LineDeleteToStart(); break;	//行頭まで削除(改行単位)
	case F_LineDeleteToEnd:		Command_LineDeleteToEnd(); break;	//行末まで削除(改行単位)
	case F_CUT_LINE:			Command_CUT_LINE();break;			//行切り取り(折り返し単位)
	case F_DELETE_LINE:			Command_DELETE_LINE();break;		//行削除(折り返し単位)
	case F_DUPLICATELINE:		Command_DUPLICATELINE();break;		//行の二重化(折り返し単位)
	case F_INDENT_TAB:			Command_INDENT( WCODE::TAB, INDENT_TAB );break;	//TABインデント
	case F_UNINDENT_TAB:		Command_UNINDENT( WCODE::TAB );break;		//逆TABインデント
	case F_INDENT_SPACE:		Command_INDENT( WCODE::SPACE, INDENT_SPACE );break;	//SPACEインデント
	case F_UNINDENT_SPACE:			Command_UNINDENT( WCODE::SPACE );break;	//逆SPACEインデント
//	case F_WORDSREFERENCE:			Command_WORDSREFERENCE();break;		/* 単語リファレンス */
	case F_LTRIM:					Command_TRIM(TRUE);break;			// 2001.12.03 hor
	case F_RTRIM:					Command_TRIM(FALSE);break;			// 2001.12.03 hor
	case F_SORT_ASC:				Command_SORT(TRUE);break;			// 2001.12.06 hor
	case F_SORT_DESC:				Command_SORT(FALSE);break;			// 2001.12.06 hor
	case F_MERGE:					Command_MERGE();break;				// 2001.12.06 hor
	case F_RECONVERT:				Command_Reconvert();break;			/* メニューからの再変換対応 minfu 2002.04.09 */ 

	/* カーソル移動系 */
	case F_IME_CHAR:		Command_IME_CHAR( (WORD)lparam1 ); break;					//全角文字入力
	case F_MOVECURSOR:			Command_MOVECURSOR(CLogicPoint(CLogicInt((int)lparam2), CLogicInt((int)lparam1)), (int)lparam3); break;
	case F_MOVECURSORLAYOUT:	Command_MOVECURSORLAYOUT(CLayoutPoint(CLayoutInt((int)lparam2), CLayoutInt((int)lparam1)), (int)lparam3); break;
	case F_UP:				Command_UP( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, bRepeat ); break;				//カーソル上移動
	case F_DOWN:			Command_DOWN( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, bRepeat ); break;			//カーソル下移動
	case F_LEFT:			Command_LEFT( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, bRepeat ); break;			//カーソル左移動
	case F_RIGHT:			Command_RIGHT( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, false, bRepeat ); break;	//カーソル右移動
	case F_UP2:				Command_UP2( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;						//カーソル上移動(2行づつ)
	case F_DOWN2:			Command_DOWN2( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;					//カーソル下移動(2行づつ)
	case F_WORDLEFT:		Command_WORDLEFT( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;				/* 単語の左端に移動 */
	case F_WORDRIGHT:		Command_WORDRIGHT( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;				/* 単語の右端に移動 */
	//	0ct. 29, 2001 genta マクロ向け機能拡張
	case F_GOLINETOP:		Command_GOLINETOP( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, lparam1  ); break;		//行頭に移動(折り返し単位/改行単位)
	case F_GOLINEEND:		Command_GOLINEEND( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, 0, lparam1 ); break;		//行末に移動(折り返し単位)
//	case F_ROLLDOWN:		Command_ROLLDOWN( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;				//スクロールダウン
//	case F_ROLLUP:			Command_ROLLUP( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;					//スクロールアップ
	case F_HalfPageUp:		Command_HalfPageUp( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, CLayoutYInt(lparam1) ); break;				//半ページアップ	//Oct. 6, 2000 JEPRO 名称をPC-AT互換機系に変更(ROLL→PAGE) //Oct. 10, 2000 JEPRO 名称変更
	case F_HalfPageDown:	Command_HalfPageDown( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, CLayoutYInt(lparam1) ); break;			//半ページダウン	//Oct. 6, 2000 JEPRO 名称をPC-AT互換機系に変更(ROLL→PAGE) //Oct. 10, 2000 JEPRO 名称変更
	case F_1PageUp:			Command_1PageUp( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, CLayoutYInt(lparam1) ); break;					//1ページアップ	//Oct. 10, 2000 JEPRO 従来のページアップを半ページアップと名称変更し1ページアップを追加
	case F_1PageDown:		Command_1PageDown( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, CLayoutYInt(lparam1) ); break;				//1ページダウン	//Oct. 10, 2000 JEPRO 従来のページダウンを半ページダウンと名称変更し1ページダウンを追加
	case F_GOFILETOP:		Command_GOFILETOP( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;				//ファイルの先頭に移動
	case F_GOFILEEND:		Command_GOFILEEND( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;				//ファイルの最後に移動
	case F_CURLINECENTER:	Command_CURLINECENTER(); break;								/* カーソル行をウィンドウ中央へ */
	case F_JUMPHIST_PREV:	Command_JUMPHIST_PREV(); break;								//移動履歴: 前へ
	case F_JUMPHIST_NEXT:	Command_JUMPHIST_NEXT(); break;								//移動履歴: 次へ
	case F_JUMPHIST_SET:	Command_JUMPHIST_SET(); break;								//現在位置を移動履歴に登録
	case F_WndScrollDown:	Command_WndScrollDown(); break;								//テキストを1行下へスクロール	// 2001/06/20 asa-o
	case F_WndScrollUp:		Command_WndScrollUp(); break;								//テキストを1行上へスクロール	// 2001/06/20 asa-o
	case F_GONEXTPARAGRAPH:	Command_GONEXTPARAGRAPH( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;			//次の段落へ進む
	case F_GOPREVPARAGRAPH:	Command_GOPREVPARAGRAPH( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;			//前の段落へ戻る
	case F_AUTOSCROLL:	Command_AUTOSCROLL(); break;	//オートスクロール
	case F_WHEELUP:			Command_WHEELUP(lparam1); break;
	case F_WHEELDOWN:		Command_WHEELDOWN(lparam1); break;
	case F_WHEELLEFT:		Command_WHEELLEFT(lparam1); break;
	case F_WHEELRIGHT:		Command_WHEELRIGHT(lparam1); break;
	case F_WHEELPAGEUP:		Command_WHEELPAGEUP(lparam1); break;
	case F_WHEELPAGEDOWN:	Command_WHEELPAGEDOWN(lparam1); break;
	case F_WHEELPAGELEFT:	Command_WHEELPAGELEFT(lparam1); break;
	case F_WHEELPAGERIGHT:	Command_WHEELPAGERIGHT(lparam1); break;
	case F_MODIFYLINE_NEXT:	Command_MODIFYLINE_NEXT( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;	// 次の変更行へ
	case F_MODIFYLINE_PREV:	Command_MODIFYLINE_PREV( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;	// 前の変更行へ

	/* 選択系 */
	case F_SELECTWORD:		Command_SELECTWORD();break;						//現在位置の単語選択
	case F_SELECTALL:		Command_SELECTALL();break;						//すべて選択
	case F_SELECTLINE:		Command_SELECTLINE( lparam1 );break;			//1行選択	// 2007.10.13 nasukoji
	case F_BEGIN_SEL:		Command_BEGIN_SELECT();break;					/* 範囲選択開始 */
	case F_UP_SEL:			Command_UP( true, bRepeat, lparam1 ); break;	//(範囲選択)カーソル上移動
	case F_DOWN_SEL:		Command_DOWN( true, bRepeat ); break;			//(範囲選択)カーソル下移動
	case F_LEFT_SEL:		Command_LEFT( true, bRepeat ); break;			//(範囲選択)カーソル左移動
	case F_RIGHT_SEL:		Command_RIGHT( true, false, bRepeat ); break;	//(範囲選択)カーソル右移動
	case F_UP2_SEL:			Command_UP2( true ); break;						//(範囲選択)カーソル上移動(2行ごと)
	case F_DOWN2_SEL:		Command_DOWN2( true );break;					//(範囲選択)カーソル下移動(2行ごと)
	case F_WORDLEFT_SEL:	Command_WORDLEFT( true );break;					//(範囲選択)単語の左端に移動
	case F_WORDRIGHT_SEL:	Command_WORDRIGHT( true );break;				//(範囲選択)単語の右端に移動
	case F_GOLINETOP_SEL:	Command_GOLINETOP( true, lparam1 );break;		//(範囲選択)行頭に移動(折り返し単位/改行単位)
	case F_GOLINEEND_SEL:	Command_GOLINEEND( true, 0, lparam1 );break;	//(範囲選択)行末に移動(折り返し単位)
//	case F_ROLLDOWN_SEL:	Command_ROLLDOWN( TRUE ); break;				//(範囲選択)スクロールダウン
//	case F_ROLLUP_SEL:		Command_ROLLUP( TRUE ); break;					//(範囲選択)スクロールアップ
	case F_HalfPageUp_Sel:	Command_HalfPageUp( true, CLayoutYInt(lparam1) ); break;				//(範囲選択)半ページアップ
	case F_HalfPageDown_Sel:Command_HalfPageDown( true, CLayoutYInt(lparam1) ); break;			//(範囲選択)半ページダウン
	case F_1PageUp_Sel:		Command_1PageUp( true, CLayoutYInt(lparam1) ); break;					//(範囲選択)1ページアップ
	case F_1PageDown_Sel:	Command_1PageDown( true, CLayoutYInt(lparam1) ); break;				//(範囲選択)1ページダウン
	case F_GOFILETOP_SEL:	Command_GOFILETOP( true );break;				//(範囲選択)ファイルの先頭に移動
	case F_GOFILEEND_SEL:	Command_GOFILEEND( true );break;				//(範囲選択)ファイルの最後に移動
	case F_GONEXTPARAGRAPH_SEL:	Command_GONEXTPARAGRAPH( true ); break;			//次の段落へ進む
	case F_GOPREVPARAGRAPH_SEL:	Command_GOPREVPARAGRAPH( true ); break;			//前の段落へ戻る
	case F_MODIFYLINE_NEXT_SEL:	Command_MODIFYLINE_NEXT( true ); break;			//(範囲選択)次の変更行へ
	case F_MODIFYLINE_PREV_SEL:	Command_MODIFYLINE_PREV( true ); break;			//(範囲選択)前の変更行へ

	/* 矩形選択系 */
//	case F_BOXSELALL:		Command_BOXSELECTALL();break;		//矩形ですべて選択
	case F_BEGIN_BOX:		Command_BEGIN_BOXSELECT( true );break;	/* 矩形範囲選択開始 */
	case F_UP_BOX:			Sub_BoxSelectLock(lparam1); this->Command_UP( true, bRepeat ); break;		//(矩形選択)カーソル上移動
	case F_DOWN_BOX:		Sub_BoxSelectLock(lparam1); this->Command_DOWN( true, bRepeat ); break;		//(矩形選択)カーソル下移動
	case F_LEFT_BOX:		Sub_BoxSelectLock(lparam1); this->Command_LEFT( true, bRepeat ); break;		//(矩形選択)カーソル左移動
	case F_RIGHT_BOX:		Sub_BoxSelectLock(lparam1); this->Command_RIGHT( true, false, bRepeat ); break;	//(矩形選択)カーソル右移動
	case F_UP2_BOX:			Sub_BoxSelectLock(lparam1); this->Command_UP2( true ); break;				//(矩形選択)カーソル上移動(2行ごと)
	case F_DOWN2_BOX:		Sub_BoxSelectLock(lparam1); this->Command_DOWN2( true );break;				//(矩形選択)カーソル下移動(2行ごと)
	case F_WORDLEFT_BOX:	Sub_BoxSelectLock(lparam1); this->Command_WORDLEFT( true );break;			//(矩形選択)単語の左端に移動
	case F_WORDRIGHT_BOX:	Sub_BoxSelectLock(lparam1); this->Command_WORDRIGHT( true );break;			//(矩形選択)単語の右端に移動
	case F_GOLOGICALLINETOP_BOX:Sub_BoxSelectLock(lparam2); this->Command_GOLINETOP( true, 8 | lparam1 );break;	//(矩形選択)行頭に移動(改行単位)
//	case F_GOLOGICALLINEEND_BOX:Sub_BoxSelectLock(lparam2); this->Command_GOLINEEND( true, 0, 8 | lparam1 );break;	//(矩形選択)行末に移動(改行単位)
	case F_GOLINETOP_BOX:	Sub_BoxSelectLock(lparam2); this->Command_GOLINETOP( true, lparam1 );break;	//(矩形選択)行頭に移動(折り返し単位/改行単位)
	case F_GOLINEEND_BOX:	Sub_BoxSelectLock(lparam2); this->Command_GOLINEEND( true, 0, lparam1 );break;	//(矩形選択)行末に移動(折り返し単位/改行単位)
	case F_HalfPageUp_BOX:	Sub_BoxSelectLock(lparam2); this->Command_HalfPageUp( true, CLayoutYInt(lparam1) ); break;		//(矩形選択)半ページアップ
	case F_HalfPageDown_BOX:Sub_BoxSelectLock(lparam2); this->Command_HalfPageDown( true, CLayoutYInt(lparam1) ); break;		//(矩形選択)半ページダウン
	case F_1PageUp_BOX:		Sub_BoxSelectLock(lparam2); this->Command_1PageUp( true, CLayoutYInt(lparam1) ); break;			//(矩形選択)1ページアップ
	case F_1PageDown_BOX:	Sub_BoxSelectLock(lparam2); this->Command_1PageDown( true, CLayoutYInt(lparam1) ); break;			//(矩形選択)1ページダウン
	case F_GOFILETOP_BOX:	Sub_BoxSelectLock(lparam1); this->Command_GOFILETOP( true );break;			//(矩形選択)ファイルの先頭に移動
	case F_GOFILEEND_BOX:	Sub_BoxSelectLock(lparam1); this->Command_GOFILEEND( true );break;			//(矩形選択)ファイルの最後に移動

	/* クリップボード系 */
	case F_CUT:						Command_CUT();break;					//切り取り(選択範囲をクリップボードにコピーして削除)
	case F_COPY:					Command_COPY( false, GetDllShareData().m_Common.m_sEdit.m_bAddCRLFWhenCopy );break;			//コピー(選択範囲をクリップボードにコピー)
	case F_COPY_ADDCRLF:			Command_COPY( false, true );break;		//折り返し位置に改行をつけてコピー(選択範囲をクリップボードにコピー)
	case F_COPY_CRLF:				Command_COPY( false, GetDllShareData().m_Common.m_sEdit.m_bAddCRLFWhenCopy, EOL_CRLF );break;	//CRLF改行でコピー(選択範囲をクリップボードにコピー)
	case F_PASTE:					Command_PASTE( (int)lparam1 );break;				//貼り付け(クリップボードから貼り付け)
	case F_PASTEBOX:				Command_PASTEBOX( (int)lparam1 );break;				//矩形貼り付け(クリップボードから矩形貼り付け)
	case F_INSBOXTEXT:				Command_INSBOXTEXT((const wchar_t*)lparam1, (int)lparam2 );break;				//矩形テキスト挿入
	case F_INSTEXT_W:				Command_INSTEXT( bRedraw, (const wchar_t*)lparam1, (CLogicInt)lparam2, lparam3!=FALSE );break;/* テキストを貼り付け */ // 2004.05.14 Moca 長さを示す引数追加
	case F_ADDTAIL_W:				Command_ADDTAIL( (const wchar_t*)lparam1, (int)lparam2 );break;	/* 最後にテキストを追加 */
	case F_COPYFNAME:				Command_COPYFILENAME();break;			//このファイル名をクリップボードにコピー / /2002/2/3 aroka
	case F_COPYPATH:				Command_COPYPATH();break;				//このファイルのパス名をクリップボードにコピー
	case F_COPYTAG:					Command_COPYTAG();break;				//このファイルのパス名とカーソル位置をコピー	//Sept. 15, 2000 jepro 上と同じ説明になっていたのを修正
	case F_COPYLINES:				Command_COPYLINES();break;				//選択範囲内全行コピー
	case F_COPYLINESASPASSAGE:		Command_COPYLINESASPASSAGE();break;		//選択範囲内全行引用符付きコピー
	case F_COPYLINESWITHLINENUMBER:	Command_COPYLINESWITHLINENUMBER();break;//選択範囲内全行行番号付きコピー
	case F_COPY_COLOR_HTML:				Command_COPY_COLOR_HTML();break;	//選択範囲内色付きHTMLコピー
	case F_COPY_COLOR_HTML_LINENUMBER:	Command_COPY_COLOR_HTML_LINENUMBER();break;	//選択範囲内行番号色付きHTMLコピー

	case F_CREATEKEYBINDLIST:		Command_CREATEKEYBINDLIST();break;		//キー割り当て一覧をコピー //Sept. 15, 2000 JEPRO 追加 //Dec. 25, 2000 復活

	/* 挿入系 */
	case F_INS_DATE:				Command_INS_DATE();break;	//日付挿入
	case F_INS_TIME:				Command_INS_TIME();break;	//時刻挿入
    case F_CTRL_CODE_DIALOG:		Command_CtrlCode_Dialog();break;	/* コントロールコードの入力(ダイアログ) */	//@@@ 2002.06.02 MIK
    case F_CTRL_CODE:				Command_WCHAR( (wchar_t)lparam1, false );break;

	/* 変換 */
	case F_TOLOWER:					Command_TOLOWER();break;				/* 小文字 */
	case F_TOUPPER:					Command_TOUPPER();break;				/* 大文字 */
	case F_TOHANKAKU:				Command_TOHANKAKU();break;				/* 全角→半角 */
	case F_TOHANKATA:				Command_TOHANKATA();break;				/* 全角カタカナ→半角カタカナ */	//Aug. 29, 2002 ai
	case F_TOZENEI:					Command_TOZENEI();break;				/* 全角→半角 */					//July. 30, 2001 Misaka
	case F_TOHANEI:					Command_TOHANEI();break;				/* 半角→全角 */
	case F_TOZENKAKUKATA:			Command_TOZENKAKUKATA();break;			/* 半角+全ひら→全角・カタカナ */	//Sept. 17, 2000 jepro 説明を「半角→全角カタカナ」から変更
	case F_TOZENKAKUHIRA:			Command_TOZENKAKUHIRA();break;			/* 半角+全カタ→全角・ひらがな */	//Sept. 17, 2000 jepro 説明を「半角→全角ひらがな」から変更
	case F_HANKATATOZENKATA:	Command_HANKATATOZENKAKUKATA();break;	/* 半角カタカナ→全角カタカナ */
	case F_HANKATATOZENHIRA:	Command_HANKATATOZENKAKUHIRA();break;	/* 半角カタカナ→全角ひらがな */
	case F_TABTOSPACE:				Command_TABTOSPACE();break;				/* TAB→空白 */
	case F_SPACETOTAB:				Command_SPACETOTAB();break;				/* 空白→TAB */  //---- Stonee, 2001/05/27
	case F_CODECNV_AUTO2SJIS:		Command_CODECNV_AUTO2SJIS();break;		/* 自動判別→SJISコード変換 */
	case F_CODECNV_EMAIL:			Command_CODECNV_EMAIL();break;			/* E-Mail(JIS→SJIS)コード変換 */
	case F_CODECNV_EUC2SJIS:		Command_CODECNV_EUC2SJIS();break;		/* EUC→SJISコード変換 */
	case F_CODECNV_UNICODE2SJIS:	Command_CODECNV_UNICODE2SJIS();break;	/* Unicode→SJISコード変換 */
	case F_CODECNV_UNICODEBE2SJIS:	Command_CODECNV_UNICODEBE2SJIS();break;	/* UnicodeBE→SJISコード変換 */
	case F_CODECNV_UTF82SJIS:		Command_CODECNV_UTF82SJIS();break;		/* UTF-8→SJISコード変換 */
	case F_CODECNV_UTF72SJIS:		Command_CODECNV_UTF72SJIS();break;		/* UTF-7→SJISコード変換 */
	case F_CODECNV_SJIS2JIS:		Command_CODECNV_SJIS2JIS();break;		/* SJIS→JISコード変換 */
	case F_CODECNV_SJIS2EUC:		Command_CODECNV_SJIS2EUC();break;		/* SJIS→EUCコード変換 */
	case F_CODECNV_SJIS2UTF8:		Command_CODECNV_SJIS2UTF8();break;		/* SJIS→UTF-8コード変換 */
	case F_CODECNV_SJIS2UTF7:		Command_CODECNV_SJIS2UTF7();break;		/* SJIS→UTF-7コード変換 */
	case F_BASE64DECODE:			Command_BASE64DECODE();break;			/* Base64デコードして保存 */
	case F_UUDECODE:				Command_UUDECODE();break;				/* uudecodeして保存 */	//Oct. 17, 2000 jepro 説明を「選択部分をUUENCODEデコード」から変更

	/* 検索系 */
	case F_SEARCH_DIALOG:		Command_SEARCH_DIALOG();break;												//検索(単語検索ダイアログ)
	case F_SEARCH_BOX:			Command_SEARCH_BOX();break;		// Jan. 13, 2003 MIK					//検索(ボックス)	// 2006.06.04 yukihane Command_SEARCH_BOX()
	case F_SEARCH_NEXT:			Command_SEARCH_NEXT( true, bRedraw, false, (HWND)lparam1, (const WCHAR*)lparam2 );break;	//次を検索
	case F_SEARCH_PREV:			Command_SEARCH_PREV( bRedraw, (HWND)lparam1 );break;						//前を検索
	case F_REPLACE_DIALOG:	//置換(置換ダイアログ)
		Command_REPLACE_DIALOG();	//@@@ 2002.2.2 YAZAKI ダイアログ呼び出しと、実行を分離
		break;
	case F_REPLACE:				Command_REPLACE( (HWND)lparam1 );break;			//置換実行 @@@ 2002.2.2 YAZAKI
	case F_REPLACE_ALL:			Command_REPLACE_ALL();break;		//すべて置換実行(通常) 2002.2.8 hor 2006.04.02 かろと
	case F_SEARCH_CLEARMARK:	Command_SEARCH_CLEARMARK();break;	//検索マークのクリア
	case F_GREP_DIALOG:	//Grepダイアログの表示
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		Command_GREP_DIALOG();
		return bRet;
	case F_GREP:			Command_GREP();break;							//Grep
	case F_GREP_REPLACE_DLG:	//Grep置換ダイアログの表示
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		Command_GREP_REPLACE_DLG();
		return bRet;
	case F_GREP_REPLACE:	Command_GREP_REPLACE();break;							//Grep置換
	case F_JUMP_DIALOG:		Command_JUMP_DIALOG();break;					//指定行ヘジャンプダイアログの表示
	case F_JUMP:			Command_JUMP();break;							//指定行ヘジャンプ
	case F_OUTLINE:			bRet = Command_FUNCLIST( (int)lparam1, OUTLINE_DEFAULT );break;	//アウトライン解析
	case F_OUTLINE_TOGGLE:	bRet = Command_FUNCLIST( SHOW_TOGGLE, OUTLINE_DEFAULT );break;	//アウトライン解析(toggle) // 20060201 aroka
	case F_FILETREE:		bRet = Command_FUNCLIST( (BOOL)lparam1 ,OUTLINE_FILETREE );break;	//ファイルツリー
	case F_TAGJUMP:			Command_TAGJUMP(lparam1 != 0);break;			/* タグジャンプ機能 */ //	Apr. 03, 2003 genta 引数追加
	case F_TAGJUMP_CLOSE:	Command_TAGJUMP(true);break;					/* タグジャンプ(元ウィンドウClose) *///	Apr. 03, 2003 genta
	case F_TAGJUMPBACK:		Command_TAGJUMPBACK();break;					/* タグジャンプバック機能 */
	case F_TAGS_MAKE:		Command_TagsMake();break;						//タグファイルの作成	//@@@ 2003.04.13 MIK
	case F_DIRECT_TAGJUMP:	Command_TagJumpByTagsFileMsg( true );break;				/* ダイレクトタグジャンプ機能 */	//@@@ 2003.04.15 MIK
	case F_TAGJUMP_KEYWORD:	Command_TagJumpByTagsFileKeyword( (const wchar_t*)lparam1 );break;	/* @@ 2005.03.31 MIK キーワードを指定してダイレクトタグジャンプ機能 */
	case F_COMPARE:			Command_COMPARE();break;						/* ファイル内容比較 */
	case F_DIFF_DIALOG:		Command_Diff_Dialog();break;					/* DIFF差分表示(ダイアログ) */	//@@@ 2002.05.25 MIK
	case F_DIFF:			Command_Diff( (const WCHAR*)lparam1, (int)lparam2 );break;		/* DIFF差分表示 */	//@@@ 2002.05.25 MIK	// 2005.10.03 maru
	case F_DIFF_NEXT:		Command_Diff_Next();break;						/* DIFF差分表示(次へ) */		//@@@ 2002.05.25 MIK
	case F_DIFF_PREV:		Command_Diff_Prev();break;						/* DIFF差分表示(前へ) */		//@@@ 2002.05.25 MIK
	case F_DIFF_RESET:		Command_Diff_Reset();break;						/* DIFF差分表示(全解除) */		//@@@ 2002.05.25 MIK
	case F_BRACKETPAIR:		Command_BRACKETPAIR();	break;					//対括弧の検索
// From Here 2001.12.03 hor
	case F_BOOKMARK_SET:	Command_BOOKMARK_SET();break;					/* ブックマーク設定・解除 */
	case F_BOOKMARK_NEXT:	Command_BOOKMARK_NEXT();break;					/* 次のブックマークへ */
	case F_BOOKMARK_PREV:	Command_BOOKMARK_PREV();break;					/* 前のブックマークへ */
	case F_BOOKMARK_RESET:	Command_BOOKMARK_RESET();break;					/* ブックマークの全解除 */
	case F_BOOKMARK_VIEW:	bRet = Command_FUNCLIST( (BOOL)lparam1 ,OUTLINE_BOOKMARK );break;	//アウトライン解析
// To Here 2001.12.03 hor
	case F_BOOKMARK_PATTERN:Command_BOOKMARK_PATTERN();break;				// 2002.01.16 hor 指定パターンに一致する行をマーク
	case F_JUMP_SRCHSTARTPOS:	Command_JUMP_SRCHSTARTPOS();break;			// 検索開始位置へ戻る 02/06/26 ai
	case F_FUNCLIST_NEXT:	Command_FUNCLIST_NEXT();break;					// 次の関数リストマーク	2014.01.05
	case F_FUNCLIST_PREV:	Command_FUNCLIST_PREV();break;					// 前の関数リストマーク	2014.01.05


	/* モード切り替え系 */
	case F_CHGMOD_INS:		Command_CHGMOD_INS();break;		//挿入/上書きモード切り替え
	case F_CHG_CHARSET:		Command_CHG_CHARSET( (ECodeType)lparam1, lparam2 != 0 );break;	//文字コードセット指定	2010/6/14 Uchi
	// From Here 2003.06.23 Moca
	// F_CHGMOD_EOL_xxx はマクロに記録されないが、F_CHGMOD_EOLはマクロに記録されるので、マクロ関数を統合できるという手はず
	case F_CHGMOD_EOL_CRLF:	HandleCommand( F_CHGMOD_EOL, bRedraw, EOL_CRLF, 0, 0, 0 );break;	//入力する改行コードをCRLFに設定
	case F_CHGMOD_EOL_LF:	HandleCommand( F_CHGMOD_EOL, bRedraw, EOL_LF, 0, 0, 0 );break;	//入力する改行コードをLFに設定
	case F_CHGMOD_EOL_CR:	HandleCommand( F_CHGMOD_EOL, bRedraw, EOL_CR, 0, 0, 0 );break;	//入力する改行コードをCRに設定
	// 2006.09.03 Moca F_CHGMOD_EOLで break 忘れの修正
	case F_CHGMOD_EOL:		Command_CHGMOD_EOL( (EEolType)lparam1 );break;	//入力する改行コードを設定
	// To Here 2003.06.23 Moca
	case F_CANCEL_MODE:		Command_CANCEL_MODE();break;	//各種モードの取り消し

	/* 設定系 */
	case F_SHOWTOOLBAR:		Command_SHOWTOOLBAR();break;	/* ツールバーの表示/非表示 */
	case F_SHOWFUNCKEY:		Command_SHOWFUNCKEY();break;	/* ファンクションキーの表示/非表示 */
	case F_SHOWTAB:			Command_SHOWTAB();break;		/* タブの表示/非表示 */	//@@@ 2003.06.10 MIK
	case F_SHOWSTATUSBAR:	Command_SHOWSTATUSBAR();break;	/* ステータスバーの表示/非表示 */
	case F_SHOWMINIMAP:		Command_SHOWMINIMAP();break;	// ミニマップの表示/非表示
	case F_TYPE_LIST:		Command_TYPE_LIST();break;		/* タイプ別設定一覧 */
	case F_CHANGETYPE:		Command_CHANGETYPE((int)lparam1);break;		// タイプ別設定一時適用
	case F_OPTION_TYPE:		Command_OPTION_TYPE();break;	/* タイプ別設定 */
	case F_OPTION:			Command_OPTION();break;			/* 共通設定 */
	case F_FONT:			Command_FONT();break;			/* フォント設定 */
	case F_SETFONTSIZE:		Command_SETFONTSIZE((int)lparam1, (int)lparam2, (int)lparam3);break;	/* フォントサイズ設定 */
	case F_SETFONTSIZEUP:	HandleCommand( F_SETFONTSIZE, bRedraw, 0, 1, 2, 0);break;	/* フォントサイズ拡大 */
	case F_SETFONTSIZEDOWN:	HandleCommand( F_SETFONTSIZE, bRedraw, 0, -1, 2, 0);break;	/* フォントサイズ縮小 */
	case F_WRAPWINDOWWIDTH:	Command_WRAPWINDOWWIDTH();break;/* 現在のウィンドウ幅で折り返し */	//Oct. 7, 2000 JEPRO WRAPWINDIWWIDTH を WRAPWINDOWWIDTH に変更
	case F_FAVORITE:		Command_Favorite();break;		//履歴の管理	//@@@ 2003.04.08 MIK
	//	Jan. 29, 2005 genta 引用符の設定
	case F_SET_QUOTESTRING:	Command_SET_QUOTESTRING((const WCHAR*)lparam1);	break;
	case F_TMPWRAPNOWRAP:	HandleCommand( F_TEXTWRAPMETHOD, bRedraw, WRAP_NO_TEXT_WRAP, 0, 0, 0 );break;	// 折り返さない(一時設定)			// 2008.05.30 nasukoji
	case F_TMPWRAPSETTING:	HandleCommand( F_TEXTWRAPMETHOD, bRedraw, WRAP_SETTING_WIDTH, 0, 0, 0 );break;	// 指定桁で折り返す(一時設定)		// 2008.05.30 nasukoji
	case F_TMPWRAPWINDOW:	HandleCommand( F_TEXTWRAPMETHOD, bRedraw, WRAP_WINDOW_WIDTH, 0, 0, 0 );break;	// 右端で折り返す(一時設定)		// 2008.05.30 nasukoji
	case F_TEXTWRAPMETHOD:	Command_TEXTWRAPMETHOD( (int)lparam1 );break;		// テキストの折り返し方法		// 2008.05.30 nasukoji
	case F_SELECT_COUNT_MODE:	Command_SELECT_COUNT_MODE( (int)lparam1 );break;	// 文字カウントの方法		// 2009.07.06 syat

	/* マクロ系 */
	case F_RECKEYMACRO:		Command_RECKEYMACRO();break;	/* キーマクロの記録開始/終了 */
	case F_SAVEKEYMACRO:	Command_SAVEKEYMACRO();break;	/* キーマクロの保存 */
	case F_LOADKEYMACRO:	Command_LOADKEYMACRO();break;	/* キーマクロの読み込み */
	case F_EXECKEYMACRO:									/* キーマクロの実行 */
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		Command_EXECKEYMACRO(); return bRet;
	case F_EXECEXTMACRO:
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		/* 名前を指定してマクロ実行 */
		Command_EXECEXTMACRO( (const WCHAR*)lparam1, (const WCHAR*)lparam2 );
		return bRet;
	//	From Here Sept. 20, 2000 JEPRO 名称CMMANDをCOMMANDに変更
	//	case F_EXECCMMAND:		Command_EXECCMMAND();break;	/* 外部コマンド実行 */
	case F_EXECMD_DIALOG:
		//Command_EXECCOMMAND_DIALOG((const char*)lparam1);	/* 外部コマンド実行 */
		Command_EXECCOMMAND_DIALOG();	/* 外部コマンド実行 */	//	引数つかってないみたいなので
		break;
	//	To Here Sept. 20, 2000
	case F_EXECMD:
		//Command_EXECCOMMAND((const char*)lparam1);
		Command_EXECCOMMAND((LPCWSTR)lparam1, (int)lparam2, (LPCWSTR)lparam3);	//	2006.12.03 maru 引数の拡張のため
		break;

	/* カスタムメニュー */
	case F_MENU_RBUTTON:	/* 右クリックメニュー */
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		Command_MENU_RBUTTON();
		return bRet;
	case F_CUSTMENU_1:  /* カスタムメニュー1 */
	case F_CUSTMENU_2:  /* カスタムメニュー2 */
	case F_CUSTMENU_3:  /* カスタムメニュー3 */
	case F_CUSTMENU_4:  /* カスタムメニュー4 */
	case F_CUSTMENU_5:  /* カスタムメニュー5 */
	case F_CUSTMENU_6:  /* カスタムメニュー6 */
	case F_CUSTMENU_7:  /* カスタムメニュー7 */
	case F_CUSTMENU_8:  /* カスタムメニュー8 */
	case F_CUSTMENU_9:  /* カスタムメニュー9 */
	case F_CUSTMENU_10: /* カスタムメニュー10 */
	case F_CUSTMENU_11: /* カスタムメニュー11 */
	case F_CUSTMENU_12: /* カスタムメニュー12 */
	case F_CUSTMENU_13: /* カスタムメニュー13 */
	case F_CUSTMENU_14: /* カスタムメニュー14 */
	case F_CUSTMENU_15: /* カスタムメニュー15 */
	case F_CUSTMENU_16: /* カスタムメニュー16 */
	case F_CUSTMENU_17: /* カスタムメニュー17 */
	case F_CUSTMENU_18: /* カスタムメニュー18 */
	case F_CUSTMENU_19: /* カスタムメニュー19 */
	case F_CUSTMENU_20: /* カスタムメニュー20 */
	case F_CUSTMENU_21: /* カスタムメニュー21 */
	case F_CUSTMENU_22: /* カスタムメニュー22 */
	case F_CUSTMENU_23: /* カスタムメニュー23 */
	case F_CUSTMENU_24: /* カスタムメニュー24 */
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		nFuncID = Command_CUSTMENU( nCommand - F_CUSTMENU_1 + 1 );
		if( 0 != nFuncID ){
			/* コマンドコードによる処理振り分け */
//			HandleCommand( nFuncID, true, 0, 0, 0, 0 );
			::PostMessageCmd( GetMainWindow(), WM_COMMAND, MAKELONG( nFuncID, 0 ), (LPARAM)NULL );
		}
		return bRet;

	/* ウィンドウ系 */
	case F_SPLIT_V:			Command_SPLIT_V();break;	/* 上下に分割 */	//Sept. 17, 2000 jepro 説明の「縦」を「上下に」に変更
	case F_SPLIT_H:			Command_SPLIT_H();break;	/* 左右に分割 */	//Sept. 17, 2000 jepro 説明の「横」を「左右に」に変更
	case F_SPLIT_VH:		Command_SPLIT_VH();break;	/* 縦横に分割 */	//Sept. 17, 2000 jepro 説明に「に」を追加
	case F_WINCLOSE:		Command_WINCLOSE();break;	//ウィンドウを閉じる
	case F_WIN_CLOSEALL:	/* すべてのウィンドウを閉じる */	//Oct. 7, 2000 jepro 「編集ウィンドウの全終了」を左記のように変更
		//Oct. 17, 2000 JEPRO 名前を変更(F_FILECLOSEALL→F_WIN_CLOSEALL)
		Command_FILECLOSEALL();
		break;
	case F_BIND_WINDOW:		Command_BIND_WINDOW();break;	//結合して表示 2004.07.14 Kazika 新規追加
	case F_CASCADE:			Command_CASCADE();break;		//重ねて表示
	case F_TILE_V:			Command_TILE_V();break;			//上下に並べて表示
	case F_TILE_H:			Command_TILE_H();break;			//左右に並べて表示
	case F_MAXIMIZE_V:		Command_MAXIMIZE_V();break;		//縦方向に最大化
	case F_MAXIMIZE_H:		Command_MAXIMIZE_H();break;		//横方向に最大化 //2001.02.10 by MIK
	case F_MINIMIZE_ALL:	Command_MINIMIZE_ALL();break;	/* すべて最小化 */	//	Sept. 17, 2000 jepro 説明の「全て」を「すべて」に統一
	case F_REDRAW:			Command_REDRAW();break;			/* 再描画 */
	case F_WIN_OUTPUT:		Command_WIN_OUTPUT();break;		//アウトプットウィンドウ表示
	case F_TRACEOUT:		Command_TRACEOUT((const wchar_t*)lparam1, (int)lparam2, (int)lparam3);break;		//マクロ用アウトプットウィンドウに表示 maru 2006.04.26
	case F_TOPMOST:			Command_WINTOPMOST( lparam1 );break;	//常に手前に表示 Moca
	case F_WINLIST:			Command_WINLIST( nCommandFrom );break;		/* ウィンドウ一覧ポップアップ表示処理 */	// 2006.03.23 fon // 2006.05.19 genta 引数追加
	case F_DLGWINLIST:		Command_DLGWINLIST();break;		// ウィンドウ一覧表示
	case F_GROUPCLOSE:		Command_GROUPCLOSE();break;		/* グループを閉じる */		// 2007.06.20 ryoji 追加
	case F_NEXTGROUP:		Command_NEXTGROUP();break;		/* 次のグループ */			// 2007.06.20 ryoji 追加
	case F_PREVGROUP:		Command_PREVGROUP();break;		/* 前のグループ */			// 2007.06.20 ryoji 追加
	case F_TAB_MOVERIGHT:	Command_TAB_MOVERIGHT();break;	/* タブを右に移動 */		// 2007.06.20 ryoji 追加
	case F_TAB_MOVELEFT:	Command_TAB_MOVELEFT();break;	/* タブを左に移動 */		// 2007.06.20 ryoji 追加
	case F_TAB_SEPARATE:	Command_TAB_SEPARATE();break;	/* 新規グループ */			// 2007.06.20 ryoji 追加
	case F_TAB_JOINTNEXT:	Command_TAB_JOINTNEXT();break;	/* 次のグループに移動 */	// 2007.06.20 ryoji 追加
	case F_TAB_JOINTPREV:	Command_TAB_JOINTPREV();break;	/* 前のグループに移動 */	// 2007.06.20 ryoji 追加
	case F_TAB_CLOSEOTHER:	Command_TAB_CLOSEOTHER();break;	/* このタブ以外を閉じる */	// 2008.11.22 syat 追加
	case F_TAB_CLOSELEFT:	Command_TAB_CLOSELEFT();break;	/* 左をすべて閉じる */		// 2008.11.22 syat 追加
	case F_TAB_CLOSERIGHT:	Command_TAB_CLOSERIGHT();break;	/* 右をすべて閉じる */		// 2008.11.22 syat 追加

	/* 支援 */
	case F_HOKAN:			Command_HOKAN();break;			//入力補完
	case F_HELP_CONTENTS:	Command_HELP_CONTENTS();break;	/* ヘルプ目次 */				//Nov. 25, 2000 JEPRO 追加
	case F_HELP_SEARCH:		Command_HELP_SEARCH();break;	/* ヘルプトキーワード検索 */	//Nov. 25, 2000 JEPRO 追加
	case F_TOGGLE_KEY_SEARCH:	Command_ToggleKeySearch((int)lparam1);break;	/* キャレット位置の単語を辞書検索する機能ON-OFF */	// 2006.03.24 fon
	case F_MENU_ALLFUNC:									/* コマンド一覧 */
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		Command_MENU_ALLFUNC();return bRet;
	case F_EXTHELP1:	Command_EXTHELP1();break;		/* 外部ヘルプ1 */
	case F_EXTHTMLHELP:	/* 外部HTMLヘルプ */
		//	Jul. 5, 2002 genta
		Command_EXTHTMLHELP( (const WCHAR*)lparam1, (const WCHAR*)lparam2 );
		break;
	case F_ABOUT:	Command_ABOUT();break;				/* バージョン情報 */	//Dec. 24, 2000 JEPRO 追加

	/* その他 */

	case F_0: break; // F_0でプラグインが実行されるバグ対策	// ← rev1886 の問題は呼び元で対策したが安全弁として残す

	default:
		//プラグインコマンドを実行する
		{
			m_pCommanderView->SetUndoBuffer( true ); // 2013.05.01 追加。再帰対応

			CPlug::Array plugs;
			CJackManager::getInstance()->GetUsablePlug( PP_COMMAND, nCommand, &plugs );

			if( plugs.size() > 0 ){
				assert_warning( 1 == plugs.size() );
				//インタフェースオブジェクト準備
				CWSHIfObj::List params;
				//プラグイン呼び出し
				( *plugs.begin() )->Invoke( m_pCommanderView, params );

				return bRet;
			}
		}

	}

	/* アンドゥバッファの処理 */
	m_pCommanderView->SetUndoBuffer( true );

	return bRet;
}
Ejemplo n.º 2
0
int CEdit::MsgProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
    switch (msg)
    {
    case WM_INITDIALOG:
        break;
    case WM_PAINT:
        {
            PAINTSTRUCT ps;
            BeginPaint(hWnd,&ps);
            Redraw();
            EndPaint(hWnd,&ps);
        }
        break;
    case WM_LBUTTONUP:
        lbutton=false;
        HandleMouse(LOWORD(lParam),HIWORD(lParam),wParam);        
        PostMessage(hWnd,WM_PAINT,0,0);
        break;
    case WM_LBUTTONDOWN:
        lbutton=true;
        HandleMouse(LOWORD(lParam),HIWORD(lParam),wParam);
        PostMessage(hWnd,WM_PAINT,0,0);
        break;
    case WM_RBUTTONUP:
        rbutton=false;
        HandleMouse(LOWORD(lParam),HIWORD(lParam),wParam);
        PostMessage(hWnd,WM_PAINT,0,0);
        break;
    case WM_RBUTTONDOWN:
        rbutton=true;
        HandleMouse(LOWORD(lParam),HIWORD(lParam),wParam);
        PostMessage(hWnd,WM_PAINT,0,0);
        break;  
    case WM_MOUSEMOVE:
        HandleMouse(LOWORD(lParam),HIWORD(lParam),wParam);
        break;
    case WM_VSCROLL:
        if((HWND)lParam == GetDlgItem(hWnd, IDC_LUMINABAR))
        {
            switch(LOWORD(wParam))
            {
            case SB_TOP:
                nLumina=0;
                break;
            case SB_BOTTOM:
                nLumina=255;
                break;
            case SB_LINEUP:
                if (nLumina)
                    nLumina--;
                break;
            case SB_LINEDOWN:
                if (nLumina<255)
                    nLumina++;
                break;
            case SB_PAGEUP:
                nLumina-=10;
                if (nLumina<0)      nLumina=0;
                break;
            case SB_PAGEDOWN:
                nLumina+=10;
                if (nLumina>255)    nLumina=255;
                break;
            case SB_THUMBPOSITION:
            case SB_THUMBTRACK:
                nLumina=HIWORD(wParam);
                break;
            }
            UpdateLumina((HWND)lParam);
        } 
        else if ((HWND)lParam == GetDlgItem(hWnd, IDC_ALPHABAR))
        {
            switch(LOWORD(wParam))
            {
            case SB_TOP:
                nAlpha=0;
                break;
            case SB_BOTTOM:
                nAlpha=255;
                break;
            case SB_LINEUP:
                if (nAlpha)
                    nAlpha--;
                break;
            case SB_LINEDOWN:
                if (nAlpha<255)
                    nAlpha++;
                break;
            case SB_PAGEUP:
                nAlpha-=10;
                if (nAlpha<0)       nAlpha=0;
                break;
            case SB_PAGEDOWN:
                nAlpha+=10;
                if (nAlpha>255)     nAlpha=255;
                break;
            case SB_THUMBPOSITION:
            case SB_THUMBTRACK:
                nAlpha=HIWORD(wParam);
                break;
            }
            UpdateAlpha((HWND)lParam);
        }
        PostMessage(hWnd,WM_PAINT,0,0);
        break;
        
    case WM_COMMAND:
        switch(LOWORD(wParam))
        {
        case ID_TILEED_NEXT:    GoNext();                           break;
        case ID_TILEED_PREV:    GoPrev();                           break;
            
        case ID_TILEED_UNDO:    Undo();                             break;
        case ID_TILEED_REDO:    Redo();                             break;
            
        case ID_TILEED_CLEAR:   curimage.Clear(nCurcolour[1]);      break;
        case ID_TILEED_ROTATE:  curimage.Rotate();                  break;
        case ID_TILEED_FLIP:    curimage.Flip();                    break;
        case ID_TILEED_MIRROR:  curimage.Mirror();                  break;
        case ID_TILEED_EXIT:    PostMessage(hWnd, WM_CLOSE, 0, 0);  break;
        default:
            return HandleCommand(hWnd,wParam);                                                                                // unknown message?  Pass it down to the derived class
        }
        
        PostMessage(hWnd,WM_PAINT,0,0);
        break;
    case WM_CLOSE:
        EndDialog(hWnd,0);
        break;
    }
    return 0;
}
Ejemplo n.º 3
0
cPluginManager::CommandResult cPluginManager::ExecuteCommand(cPlayer & a_Player, const AString & a_Command)
{
	return HandleCommand(a_Player, a_Command, true);
}
Ejemplo n.º 4
0
bool cPluginManager::ForceExecuteCommand(cPlayer * a_Player, const AString & a_Command)
{
	return HandleCommand(a_Player, a_Command, false);
}
Ejemplo n.º 5
0
void CModule::OnModCommand(const CString& sCommand) {
	HandleCommand(sCommand);
}
Ejemplo n.º 6
0
WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
    WXLRESULT rc = 0;
    bool processed = false;

    switch ( message )
    {
        case WM_CLOSE:
            // if we can't close, tell the system that we processed the
            // message - otherwise it would close us
            processed = !Close();
            break;

        case WM_SIZE:
            processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
            break;

        case WM_COMMAND:
            {
                WORD id, cmd;
                WXHWND hwnd;
                UnpackCommand((WXWPARAM)wParam, (WXLPARAM)lParam,
                              &id, &hwnd, &cmd);

                HandleCommand(id, cmd, (WXHWND)hwnd);

                // don't pass WM_COMMAND to the base class whether we processed
                // it or not because we did generate an event for it (our
                // HandleCommand() calls the base class version) and we must
                // not do it again or the handlers which skip the event would
                // be called twice
                processed = true;
            }
            break;

#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
#if wxUSE_MENUS
        case WM_INITMENUPOPUP:
            processed = HandleInitMenuPopup((WXHMENU) wParam);
            break;

        case WM_MENUSELECT:
            {
                WXWORD item, flags;
                WXHMENU hmenu;
                UnpackMenuSelect(wParam, lParam, &item, &flags, &hmenu);

                processed = HandleMenuSelect(item, flags, hmenu);
            }
            break;

        case WM_EXITMENULOOP:
            processed = HandleMenuLoop(wxEVT_MENU_CLOSE, (WXWORD)wParam);
            break;
#endif // wxUSE_MENUS

        case WM_QUERYDRAGICON:
            {
                const wxIcon& icon = GetIcon();
                HICON hIcon = icon.IsOk() ? GetHiconOf(icon)
                                        : (HICON)GetDefaultIcon();
                rc = (WXLRESULT)hIcon;
                processed = rc != 0;
            }
            break;
#endif // !__WXMICROWIN__
    }

    if ( !processed )
        rc = wxFrameBase::MSWWindowProc(message, wParam, lParam);

    return rc;
}
Ejemplo n.º 7
0
WXLRESULT wxMDIChildFrame::MSWWindowProc(WXUINT message,
                                    WXWPARAM wParam,
                                    WXLPARAM lParam)
{
    WXLRESULT rc = 0;
    bool processed = false;

    switch ( message )
    {
        case WM_COMMAND:
            {
                WORD id, cmd;
                WXHWND hwnd;
                UnpackCommand((WXWPARAM)wParam, (WXLPARAM)lParam,
                              &id, &hwnd, &cmd);

                processed = HandleCommand(id, cmd, (WXHWND)hwnd);
            }
            break;

        case WM_GETMINMAXINFO:
            processed = HandleGetMinMaxInfo((MINMAXINFO *)lParam);
            break;

        case WM_MDIACTIVATE:
            {
                WXWORD act;
                WXHWND hwndAct, hwndDeact;
                UnpackMDIActivate(wParam, lParam, &act, &hwndAct, &hwndDeact);

                processed = HandleMDIActivate(act, hwndAct, hwndDeact);
            }
            // fall through

        case WM_MOVE:
            // must pass WM_MOVE to DefMDIChildProc() to recalculate MDI client
            // scrollbars if necessary

            // fall through

        case WM_SIZE:
            // must pass WM_SIZE to DefMDIChildProc(), otherwise many weird
            // things happen
            MSWDefWindowProc(message, wParam, lParam);
            break;

        case WM_SYSCOMMAND:
            // DefMDIChildProc handles SC_{NEXT/PREV}WINDOW here, so pass it
            // the message (the base class version does not)
            return MSWDefWindowProc(message, wParam, lParam);

        case WM_WINDOWPOSCHANGING:
            processed = HandleWindowPosChanging((LPWINDOWPOS)lParam);
            break;
    }

    if ( !processed )
        rc = wxFrame::MSWWindowProc(message, wParam, lParam);

    return rc;
}
Ejemplo n.º 8
0
MRESULT wxFrame::OS2WindowProc( WXUINT uMessage,
                                WXWPARAM wParam,
                                WXLPARAM lParam )
{
    MRESULT mRc = 0L;
    bool    bProcessed = false;

    switch (uMessage)
    {
        case WM_CLOSE:
            //
            // If we can't close, tell the system that we processed the
            // message - otherwise it would close us
            //
            bProcessed = !Close();
            break;

        case WM_PAINT:
            bProcessed = HandlePaint();
            mRc = (MRESULT)FALSE;
            break;

         case WM_ERASEBACKGROUND:
            //
            // Returning TRUE to requests PM to paint the window background
            // in SYSCLR_WINDOW. We capture this here because the PS returned
            // in Frames is the PS for the whole frame, which we can't really
            // use at all. If you want to paint a different background, do it
            // in an OnPaint using a wxPaintDC.
            //
            mRc = (MRESULT)(TRUE);
            break;

      case WM_COMMAND:
            {
                WORD                wId;
                WORD                wCmd;
                WXHWND              hWnd;

                UnpackCommand( (WXWPARAM)wParam
                              ,(WXLPARAM)lParam
                              ,&wId
                              ,&hWnd
                              ,&wCmd
                             );

                bProcessed = HandleCommand( wId
                                           ,wCmd
                                           ,(WXHWND)hWnd
                                          );
            }
            break;

        case WM_MENUSELECT:
            {
                WXWORD              wItem;
                WXWORD              wFlags;
                WXHMENU             hMenu;

                UnpackMenuSelect( wParam
                                 ,lParam
                                 ,&wItem
                                 ,&wFlags
                                 ,&hMenu
                                );
                bProcessed = HandleMenuSelect( wItem
                                              ,wFlags
                                              ,hMenu
                                             );
                mRc = (MRESULT)TRUE;
            }
            break;

        case WM_SIZE:
            {
                SHORT               nScxnew = SHORT1FROMMP(lParam); // New horizontal size.
                SHORT               nScynew = SHORT2FROMMP(lParam); // New vertical size.

                lParam = MRFROM2SHORT( nScxnew - 20
                                      ,nScynew - 30
                                     );
            }
            bProcessed = HandleSize(LOWORD(lParam), HIWORD(lParam), (WXUINT)wParam);
            mRc = (MRESULT)FALSE;
            break;

        case CM_QUERYDRAGIMAGE:
            {
                const wxIcon&           vIcon = GetIcon();
                HPOINTER                hIcon;

                if (vIcon.IsOk())
                    hIcon = (HPOINTER)::WinSendMsg(GetHWND(), WM_QUERYICON, 0L, 0L);
                else
                    hIcon = (HPOINTER)m_hDefaultIcon;
                mRc = (MRESULT)hIcon;
                bProcessed = mRc != 0;
            }
            break;
    }

    if (!bProcessed )
        mRc = wxWindow::OS2WindowProc( uMessage
                                      ,wParam
                                      ,lParam
                                     );
    return (MRESULT)mRc;
} // wxFrame::OS2WindowProc
Ejemplo n.º 9
0
void HandleRequest() {
    char* token;
    short keep_processing = 1;
    int offset;

    DebugPrint("Received request %s" _C_ recv_buffer);
    token = FirstToken();
    while (token != 0 && keep_processing) {
        switch (to_request(token)) {
            case ACTIVITY:
                HandleActivity();
                break;
            case COMMAND: // COMMAND
                HandleCommand();
                break;
            case EXIT: // EXIT
                HandleQuit();
                break;
            case GET: // GET
                HandleGet();
                break;
            case KILL:
                HandleKill();
                break;
            case LISPGET: // LISPGET {STATE | GAMEINFO | MAPINFO}
                HandleLispGet();
                break;
            case MAP: // Load new map
                if (HandleNewMap()) {
                    LastPausedCycle = 0;
                    keep_processing = 0;
                }
                break;
            case PING: // PING
                HandlePing();
                break;
            case QUIT: // QUIT
                HandleQuit();
                break;
            case RESTART: // RESTART / RESET
                HandleRestart();
                LastPausedCycle = 0;
                keep_processing = 0;
                break;
            case SPEED: // SPEED
                HandleSpeed();
                break;
            case TRANSITION: // TRANSITION
                HandleTransition();
                keep_processing = 0;
                break;
            case VIDEO: // VIDEO
                HandleVideo();
                break;
            case WRITE:
                HandleWrite();
                break;
            case CYCLE:
                HandleGetCycle();
                break;
            case Z:
                HandleRandomSeed();
                break;
            default:
                SendResponseMessage("Unknown command.\n", 3);
        }
        token = NextToken();
    }

    // Bring pending commands to the front of recv_buffer
    if (token != 0) {
        offset = token + strlen(token) - temp_buffer;
        temp_buffer[offset] = recv_buffer[offset];
        strcpy(recv_buffer, token);
    } else
        memset(recv_buffer, 0, RECV_BUFFER_SIZE); // Clear the command buffer
}
Ejemplo n.º 10
0
WXLRESULT wxMDIParentFrame::MSWWindowProc(WXUINT message,
                                     WXWPARAM wParam,
                                     WXLPARAM lParam)
{
    WXLRESULT rc = 0;
    bool processed = false;

    switch ( message )
    {
        case WM_ACTIVATE:
            {
                WXWORD state, minimized;
                WXHWND hwnd;
                UnpackActivate(wParam, lParam, &state, &minimized, &hwnd);

                processed = HandleActivate(state, minimized != 0, hwnd);
            }
            break;

        case WM_COMMAND:
            {
                WXWORD id, cmd;
                WXHWND hwnd;
                UnpackCommand(wParam, lParam, &id, &hwnd, &cmd);

                (void)HandleCommand(id, cmd, hwnd);

                // even if the frame didn't process it, there is no need to try it
                // once again (i.e. call wxFrame::HandleCommand()) - we just did it,
                // so pretend we processed the message anyhow
                processed = true;
            }

            // always pass this message DefFrameProc(), otherwise MDI menu
            // commands (and sys commands - more surprisingly!) won't work
            MSWDefWindowProc(message, wParam, lParam);
            break;

        case WM_CREATE:
            m_clientWindow = OnCreateClient();
            // Uses own style for client style
            if ( !m_clientWindow->CreateClient(this, GetWindowStyleFlag()) )
            {
                wxLogMessage(_("Failed to create MDI parent frame."));

                rc = -1;
            }

            processed = true;
            break;

        case WM_ERASEBKGND:
            processed = true;

            // we erase background ourselves
            rc = true;
            break;

        case WM_MENUSELECT:
            {
                WXWORD item, flags;
                WXHMENU hmenu;
                UnpackMenuSelect(wParam, lParam, &item, &flags, &hmenu);

                if ( m_parentFrameActive )
                {
                    processed = HandleMenuSelect(item, flags, hmenu);
                }
                else if (m_currentChild)
                {
                    processed = m_currentChild->
                        HandleMenuSelect(item, flags, hmenu);
                }
            }
            break;

        case WM_SIZE:
            // though we don't (usually) resize the MDI client to exactly fit the
            // client area we need to pass this one to DefFrameProc to allow the children to show
            break;
    }

    if ( !processed )
        rc = wxFrame::MSWWindowProc(message, wParam, lParam);

    return rc;
}
Ejemplo n.º 11
0
Archivo: frame.cpp Proyecto: EdgarTx/wx
WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
    WXLRESULT rc = 0;
    bool processed = false;

    switch ( message )
    {
        case WM_CLOSE:
            // if we can't close, tell the system that we processed the
            // message - otherwise it would close us
            processed = !Close();
            break;

        case WM_SIZE:
            processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
            break;

        case WM_COMMAND:
            {
                WORD id, cmd;
                WXHWND hwnd;
                UnpackCommand((WXWPARAM)wParam, (WXLPARAM)lParam,
                              &id, &hwnd, &cmd);

                processed = HandleCommand(id, cmd, (WXHWND)hwnd);
            }
            break;

        case WM_PAINT:
            processed = HandlePaint();
            break;

        case WM_INITMENUPOPUP:
            processed = HandleInitMenuPopup((WXHMENU) wParam);
            break;

#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
        case WM_MENUSELECT:
            {
                WXWORD item, flags;
                WXHMENU hmenu;
                UnpackMenuSelect(wParam, lParam, &item, &flags, &hmenu);

                processed = HandleMenuSelect(item, flags, hmenu);
            }
            break;

        case WM_EXITMENULOOP:
            processed = HandleMenuLoop(wxEVT_MENU_CLOSE, (WXWORD)wParam);
            break;

        case WM_QUERYDRAGICON:
            {
                const wxIcon& icon = GetIcon();
                HICON hIcon = icon.Ok() ? GetHiconOf(icon)
                                        : (HICON)GetDefaultIcon();
                rc = (long)hIcon;
                processed = rc != 0;
            }
            break;
#endif // !__WXMICROWIN__
    }

    if ( !processed )
        rc = wxFrameBase::MSWWindowProc(message, wParam, lParam);

    return rc;
}
Ejemplo n.º 12
0
LRESULT AutoIt_App::WndProcHandler (HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
	static UINT s_uTaskbarRestart;				// Holds taskbar recreate message

	// What window is the message for? (note, g_hWnd may be NULL during startup WM_CREATE)
	if (hWnd == g_hWnd || g_hWnd == NULL)
	{
		//
		// Main window messages
		//

		switch (iMsg)
		{
			// Window initial creation
			case WM_CREATE:
				AUT_DEBUGMSG("==> AutoIt_App::WndProc, g_hWnd: WM_CREATE\n")

				// Start the main timer used for flashing the "pause" icon
				SetTimer(hWnd, AUT_MAIN_TIMER_ID, AUT_MAIN_TIMER_DELAY, NULL);

				// Register a message so we know if explorer crashes and we have to redraw taskbar
				s_uTaskbarRestart = RegisterWindowMessage("TaskbarCreated");

				return 0;

			// Some form of timer has been triggered - check it out
			case WM_TIMER:
				HandleTimer(hWnd, wParam, lParam);

				return 0;

			// Menu command received
			case WM_COMMAND:
				if (HandleCommand(hWnd, iMsg, wParam, lParam) == true)
					 return 0;                              // completely handled
				break;

			// Window close clicked, if this returns 0 then user will be prevented from closing
			case WM_CLOSE:
				AUT_DEBUGMSG("==> AutoIt_App::WndProc, g_hWnd: WM_CLOSE\n")

				// Notify the script that close was requested but DON'T allow the system to continue
				// with the defaut WM_CLOSE - we will call DestroyWindow() ourselves from the script
				g_bTrayExitClicked = true;
				g_bKillWorkerThreads = true;			// Ask worker threads to stop (otherwise the script
														// may be blocked - e.g InetGet on a big download)
				//break;
				return 0;

				// Window is being destroyed
			case WM_DESTROY:
				AUT_DEBUGMSG("==> AutoIt_App::WndProc, g_hWnd: WM_DESTROY\n")

				KillTimer(hWnd, AUT_MAIN_TIMER_ID);		// Remove any timers in use
				DestroyTrayIcon();						// Remove tray icon if present
				PostQuitMessage(0);						// Tell the message loop to stop
				return 0;

			// Window is getting focus
			case WM_SETFOCUS:
				SetFocus(g_hWndEdit);                         // Put focus on the main edit window
				return 0;

			// Window has been resized in some way
			case WM_SIZE:
				MoveWindow(g_hWndEdit, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
				return 0;

			// Popup menu accessed
			case AUT_WM_NOTIFYICON:
				NotifyIcon(hWnd, iMsg, wParam, lParam);
				return 0;

			case WM_HOTKEY:                                        // Ignore when paused
				if (!g_bScriptPaused)
				{
					 g_HotKeyQueue[g_HotKeyNext++] = wParam;     // Store the hotkey ID pressed
					 if (g_HotKeyNext >= AUT_HOTKEYQUEUESIZE)
						  g_HotKeyNext = 0;
				}

				//MessageBox(NULL, "", "Hotkey pressed", MB_OK);
				break;

			default:
				// If the icon was visible and explorer crashed then redraw
				if(iMsg == s_uTaskbarRestart && g_bTrayIcon == true)
				{
					AUT_DEBUGMSG("==> AutoIt_App::WndProc, g_hWnd: TaskbarRestart received - redrawing trayicon\n")
					DestroyTrayIcon();
					CreateTrayIcon();
				}
				break;

		} // end main switch

	}

	// If not handled, return the default
	return DefWindowProc(hWnd, iMsg, wParam, lParam);

} // WndProcHandler()
Ejemplo n.º 13
0
void TaskStart ( void *data )
{
	PWINDOWS ptr = GetActiveWindow();
	UBYTE  i;
	char   sCmd[MAX_X];
	WORD   key;
	WORD   index, pos = 0x00;

	data = data;                                           /* Prevent compiler warning                 */

	OS_ENTER_CRITICAL();
	PC_VectSet(0x08, OSTickISR);                           /* Install uC/OS-II's clock tick ISR        */
	PC_SetTickRate(OS_TICKS_PER_SEC);                      /* Reprogram tick rate                      */
	OS_EXIT_CRITICAL();

    PC_DispChar(0, 0, ' ', 0x00);               
	PC_DispStr (8, 16, "Determining  CPU's capacity ...", DISP_FGND_WHITE);
	CreateWindow (0, StartY, MAX_X, EndY, DISP_FGND_WHITE, DISP_BGND_BLUE, "[ Prompt Window ]");
	CreateTaskWindows();
	OSStatInit();                                          /* Initialize uC/OS-II's statistics         */

	for (i = 0; i < N_TASKS; i ++)
	{                                                      /* Create N_TASKS identical tasks           */
		TaskData[i] = '0' + i;                             /* Each task will display its own letter    */
		OSTaskCreate(Task, (void *)&TaskData[i], (void *)&TaskStk[i][TASK_STK_SIZE - 1], i + 1);
	}

	DisplayTitle();

	ClearWindow();
	memset(sCmd, 0x00, MAX_X);
	DisplayPrompt();
	for (;;)
	{
		DisplayStatus();                                   // display status of tasks

		if (PC_GetKey(&key) == TRUE)
		{                                                  /* See if key has been pressed              */
			if (key == 0x1B)
			{                                              /* Yes, see if it's the ESCAPE key          */
				PC_DOSReturn();                            /* Return to DOS                            */
			}
			else if (key == 0x08)                           // backspace
			{
				pos --;
				pos = pos <= 0x00 ? 0x00 : pos;
				sCmd[pos] = '\0';
				PC_DispChar(ptr->cx + pos + strlen(sCmdPrompt), ptr->cy, ' ', ptr->color);
				DisplayCursor(ptr->cx + pos + strlen(sCmdPrompt), ptr->cy);
			}
			else if (key == 0x0d || key == 0x0a)                           // enter
			{
				if (pos)
				{
					index = ParseCommand(sCmd);
					HandleCommand(index);
				}
				memset(sCmd, 0x00, MAX_X);
				pos = 0x00;
				ptr->cy ++;
				if (ptr->cy == ptr->ey - 1)
					ClearWindow();
				DisplayPrompt();
			}
			else if ((key >= '0' && key <= '9') ||
				(key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z'))
			{
				if (pos < MAX_X)
				{
					sCmd[pos] = (char)key;
					PC_DispChar(ptr->cx + pos + strlen(sCmdPrompt), ptr->cy, key, ptr->color);
	                DisplayCursor (ptr->cx + pos + strlen(sCmdPrompt) + 1, ptr->cy);
				}
				pos ++;
			}

		}
		OSTimeDlyHMSM(0, 0, 0, 200);                         /* Wait 200 ms                          */
	}
}
Ejemplo n.º 14
0
void __stdcall ReceivedMsgServer(DWORD dwConnectionIndex,char* pMsg,DWORD dwLength)
{
	EXCEPTION_POINTERS* pException = NULL;//020508 lsw
	__try	//020508 lsw
	{

		BYTE bID;
		bID = (BYTE)pMsg[0];

		if (dwConnectionIndex == 0)
		{
	#ifdef __ON_DEBUG
	//		_asm int 3;
	#endif
			return;
		}

		if( bID == (BYTE)PTCL_NOTIFY_SERVER_UP )
		{
			if( g_pServerTable->OnRecvServerUpMsg(dwConnectionIndex, *(WORD*)(pMsg+1)) )
			{
	#ifdef __ON_DEBUG
	//			_asm int 3;
	#endif
			}
			return;
		}

		LP_SERVER_DATA pSender = g_pServerTable->GetConnectedServerData( dwConnectionIndex );

		if( !pSender ) return;

		switch (bID)
		{
		// -------------
		// 기본패킷 
		// -------------
		// 전용
		case PTCL_ORDER_SET_SERVER_LIST:
		case PTCL_ORDER_CONNECT_TO_SERVERS:
		case PTCL_ORDER_SET_DB_DEMON:
		case PTCL_ORDER_TO_REPORT_SERVER_DATAS:
		case PTCL_NOTIFY_YOU_ARE_CERTIFIED:

		//공통
		case PTCL_ORDER_DESTROY_SERVER:
		case PTCL_NOTIFY_SERVER_STATUS:
		case PTCL_SERVER_TRY_TO_CHECK_CONNECTION:
		case PTCL_SERVER_CONNECTION_OK:
		case PTCL_ORDER_TO_REPORT_SERVER_STATUS:
			{
				if( !g_pServerTable->OnRecvNegotiationMsgs( pSender, bID, pMsg+1, dwLength-1 ) )
				{
					MyLog( LOG_FATAL, "OnRecvNegotiationMsg() Failed :: (pSender(%d), bId(%d), MsgLength(%d))", pSender->wPort, bID, dwLength );
	#ifdef __ON_DEBUG
	//				_asm int 3;
	#endif
				}
			}
			break;
		case PTCL_AGENT_TO_DB_REMOVE_USER_FROM_LOGIN_TABLE:
			{
				char id[20];
				memset(id,0,20);
				memcpy(id,pMsg+4+1,20);
				if(LocalMgr.IsAbleNation(TAIWAN|CHINA|HONGKONG))//021007 lsw
				{
					//2001/02/24 zhh
					if(dwLength>1+4+ID_LENGTH+2+15)
					{
					char in[15],out[15];
					memset(in,0,15);
					memset(out,0,15);
					memcpy(out,pMsg+1+4+ID_LENGTH+2, 15);
					memcpy(in ,pMsg+1+4+ID_LENGTH+2+15, 15);

					//2001/08/30 zhh
					char IP[20]={0,};
					memcpy(IP ,pMsg+1+4+ID_LENGTH+2+15+15, 20);


					//2001/02/19 zhh
					for(int i=0;i<14;i++)
					{
						if(out[i]==' ')	out[i]='0';
						if( in[i]==' ')	 in[i]='0';
					}
					// acer5
					if(ConQ && out[0]!=0 && in[0]!=0)
						ConQ->AskCheckLogoutWithIP(id,in,out,IP);
					}
				}

				//001218 zhh
				int ret = onepass.DeleteUsedID_SQL_ForPay(NULL,id,0);
				if( ret != 1 )
				{
					MyLog( LOG_NORMAL, "<zoung>%d %s close ret = %d(1 = success)", dwConnectionIndex, id, ret);
				}
			}
			break;
		case PTCL_AGENT_TO_DB_REQUEST_REMOVE_USER:
			{
				ClearUserCN(dwConnectionIndex,pMsg,dwLength);
			}
			break;
		case PTCL_AGENT_TO_DB:
		case PTCL_MAP_TO_DB:
			{
				DWORD dwUniqID;
				t_packet raja_packet;
				memset(&raja_packet,0,sizeof(t_packet));
				memcpy(&dwUniqID, pMsg+1, 4);
				memcpy(raja_packet.h.data, pMsg+1+4, HEADER_SIZE);
				memcpy(raja_packet.u.data, pMsg+1+4+HEADER_SIZE, raja_packet.h.header.size);
			
				DWORD cn = GetUserCN( pSender, dwUniqID, raja_packet.h.header.type );
				//if( cn == -1 ) break;
				///////////////////////////////////////////////////////////////////////////
				
				connections[cn].dwUserID = dwUniqID;
				connections[cn].dwConIndex = dwConnectionIndex;

				//sprintf(txt,"cn: %d USERID %d Index %d",cn, dwUniqID,dwConnectionIndex);
				//WriteText(txt);

				HandleCommand( connections, dwConnectionIndex, &raja_packet ,dwUniqID,cn );
			}
			break;





		// Added by chan78 at 2000/12/17
		case PTCL_ORDER_TO_CLEAR_PAY_TABLE:
			{
				onepass.DeleteUsedID_SQL_ForPay(NULL," ", (int)*(WORD*)(pMsg+1));
			}
			break;
		// Added by chan78 at 2001/03/16
		// -----------------------------
		case PTCL_MANAGER_QUERY:
			{
				if( !OnRecvMsgFromManager( (LP_MANAGER_PACKET)pMsg, dwLength ) )
				{
					MyLog( LOG_FATAL, "PTCL_MANAGER_ANSWER :: OnRecvMsgFromManager() has return false(%d)", pSender->wPort );
					break;
				}
			}
			break;
		// Added by chan78 at 2001/03/16
		case PTCL_MANAGER_ANSWER:
			{
				// 있을 수 없다.
				MyLog( LOG_FATAL, "PTCL_MANAGER_ANSWER :: has received!!!(%d)", pSender->wPort );
				g_pServerTable->DestroyServer( FINISH_TYPE_UNKNOWN_ERROR);
			}
			break;
		// -----------------------------

		// Added by KBS 011012
		case PTCL_RM_FROM_PROXY:
			{
				RMProc(dwConnectionIndex, pMsg, dwLength);
			}
			break;
		//

		default:
			{
				MyLog( LOG_FATAL, "Unknown bID(%d) Received. From %s(wPort:%d) Size(%d) ConnectionID(%d)", bID, GetTypedServerText(pSender->dwServerType), pSender->wPort, dwLength, dwConnectionIndex);
	#ifdef __ON_DEBUG
	//			_asm int 3;
	#endif
			}
			break;
			
		}
	}
	__except(pException = GetExceptionInformation())//020508 lsw
	{
		//acer7
		DumpException( pException, "Exception Raised on HadleCommand()", pMsg, dwLength );
		ProcessEnd(FINISH_TYPE_UNKNOWN_ERROR);
	}
Ejemplo n.º 15
0
Archivo: qa.c Proyecto: mingpen/OpenNT
/*----------------------------------------------------------------------------*\
|   AppWndProc( hwnd, uiMessage, wParam, lParam )                              |
|                                                                              |
|   Description:                                                               |
|       The window proc for the app's main (tiled) window.  This processes all |
|       of the parent window's messages.                                       |
|                                                                              |
\*----------------------------------------------------------------------------*/
LONG FAR PASCAL _export AppWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
    PAINTSTRUCT ps;
    HDC hdc;
    BOOL f;
  
    switch (msg)
    {
        case WM_CREATE:
            hwndA = CreateWindowEx(WS_EX_CLIENTEDGE,ANIMATE_CLASS, NULL,
//              ACS_CENTER |
                ACS_TRANSPARENT |
                WS_VISIBLE | WS_CHILD | WS_BORDER,
                10, 10, 500, 200, hwnd, (HMENU)42, hInstApp, NULL);
	    break;

	case WM_SIZE:
            //if (hwndC = GetWindow(hwnd, GW_CHILD))
            //    MoveWindow(hwndC, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
	    break;

        case WM_ACTIVATEAPP:
	    fAppActive = (BOOL)wParam;
            break;

        case WM_TIMER:
            break;

        case WM_ERASEBKGND:
            break;

        case WM_INITMENU:
	    EnableMenuSz((HMENU)wParam, TEXT("Edit.Paste"), IsClipboardFormatAvailable(CF_TEXT));
            break;

        case WM_COMMAND:
            //
            //  the animate control will notify us when play start or stops.
            //
            if (LOWORD(wParam) == 42)
            {
                if (GET_WM_COMMAND_CMD(wParam, lParam) == ACN_STOP)
                    AppSetText(TEXT("(stopped)"));
                else if (GET_WM_COMMAND_CMD(wParam, lParam) == ACN_START)
                    AppSetText(TEXT("(playing)"));
                else
                    AppSetText(NULL);
            }
            return HandleCommand(hwnd,msg,wParam,lParam);

	case WM_DESTROY:
	    hAccelApp = NULL;
            PostQuitMessage(0);
	    break;

        case WM_CLOSE:
	    break;

        case WM_PALETTECHANGED:
	    if ((HWND)wParam == hwnd)
		break;

	    // fall through to WM_QUERYNEWPALETTE

	case WM_QUERYNEWPALETTE:
	    hdc = GetDC(hwnd);

	    if (hpalApp)
		SelectPalette(hdc, hpalApp, FALSE);

	    f = RealizePalette(hdc);
	    ReleaseDC(hwnd,hdc);

	    if (f)
		InvalidateRect(hwnd,NULL,TRUE);

	    return f;

        case WM_PAINT:
	    hdc = BeginPaint(hwnd,&ps);
	    AppPaint (hwnd,hdc);
            EndPaint(hwnd,&ps);
            return 0L;
    }
    return DefWindowProc(hwnd,msg,wParam,lParam);
}
Ejemplo n.º 16
0
WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
    WXLRESULT rc = 0;
    bool processed = false;

    switch ( message )
    {
#ifdef __WXWINCE__
        // react to pressing the OK button in the title
        case WM_COMMAND:
        {
            switch ( LOWORD(wParam) )
            {
#ifdef __POCKETPC__
                case IDOK:
                    processed = DoOK();
                    if (!processed)
                        processed = !Close();
#endif
#ifdef __SMARTPHONE__
                case IDM_LEFT:
                case IDM_RIGHT:
                    processed = HandleCommand( LOWORD(wParam) , 0 , NULL );
                    break;
#endif // __SMARTPHONE__
            }
            break;
        }
#endif
        case WM_CLOSE:
            // if we can't close, tell the system that we processed the
            // message - otherwise it would close us
            processed = !Close();
            break;

        case WM_SIZE:
            // the Windows dialogs unfortunately are not meant to be resizeable
            // at all and their standard class doesn't include CS_[VH]REDRAW
            // styles which means that the window is not refreshed properly
            // after the resize and no amount of WS_CLIPCHILDREN/SIBLINGS can
            // help with it - so we have to refresh it manually which certainly
            // creates flicker but at least doesn't show garbage on the screen
            rc = wxWindow::MSWWindowProc(message, wParam, lParam);
            processed = true;
            if ( HasFlag(wxFULL_REPAINT_ON_RESIZE) )
            {
                ::InvalidateRect(GetHwnd(), NULL, false /* erase bg */);
            }
            break;

#ifndef __WXMICROWIN__
        case WM_SETCURSOR:
            // we want to override the busy cursor for modal dialogs:
            // typically, wxBeginBusyCursor() is called and then a modal dialog
            // is shown, but the modal dialog shouldn't have hourglass cursor
            if ( IsModal() && wxIsBusy() )
            {
                // set our cursor for all windows (but see below)
                wxCursor cursor = m_cursor;
                if ( !cursor.Ok() )
                    cursor = wxCURSOR_ARROW;

                ::SetCursor(GetHcursorOf(cursor));

                // in any case, stop here and don't let wxWindow process this
                // message (it would set the busy cursor)
                processed = true;

                // but return false to tell the child window (if the event
                // comes from one of them and not from ourselves) that it can
                // set its own cursor if it has one: thus, standard controls
                // (e.g. text ctrl) still have correct cursors in a dialog
                // invoked while wxIsBusy()
                rc = false;
            }
            break;
#endif // __WXMICROWIN__
    }

    if ( !processed )
        rc = wxWindow::MSWWindowProc(message, wParam, lParam);

    return rc;
}
Ejemplo n.º 17
0
/*
================
rvGEWorkspace::HandleMessage

Handles window messages to the workspace
================
*/
void rvGEWorkspace::HandleMessage ( UINT msg, WPARAM wParam, LPARAM lParam )
{
	switch ( msg )
	{
		case WM_CLOSE:
		{

			if ( IsModified ( ) )
			{
				if ( IDYES == gApp.MessageBox ( va("Save changes to the document \"%s\" before closing?", GetFilename() ), MB_YESNO|MB_ICONQUESTION ) )
				{
					SendMessage ( mApplication->GetMDIFrame(), WM_COMMAND, MAKELONG(ID_GUIED_FILE_SAVE,0), 0 );
				}
			}


			GetApplication ( )->GetNavigator().SetWorkspace(NULL);
			GetApplication ( )->GetTransformer().SetWorkspace(NULL);
			GetApplication ( )->GetProperties().SetWorkspace(NULL);
			break;
		}

		case WM_CAPTURECHANGED:
			if ( (HWND)lParam != mWnd )
			{
				mDragScroll = false;
				mDragType	= rvGESelectionMgr::HT_NONE;
			}
			break;

		case WM_SETCURSOR:
		{
			POINT point;
			idVec2 cursor;
			GetCursorPos ( &point );
			cursor.Set ( point.x, point.y );
			WindowToWorkspace ( cursor );
			if ( mDragType == rvGESelectionMgr::HT_NONE )
			{
				UpdateCursor ( cursor.x, cursor.y );
			}
			else
			{
				UpdateCursor ( mDragType );
			}
			break;
		}

		case WM_MOUSEWHEEL:
			if ( (short)HIWORD(wParam) > 0 )
			{
				ZoomIn ( );
			}
			else if ( (short)HIWORD(wParam) < 0 )
			{
				ZoomOut ( );
			}
			break;

		case WM_MOUSEMOVE:
			HandleMouseMove ( wParam, lParam );
			break;

		case WM_MBUTTONDOWN:
			HandleMButtonDown ( wParam, lParam );
			break;

		case WM_MBUTTONUP:
			HandleMButtonUp ( wParam, lParam );
			break;

		case WM_LBUTTONDOWN:
			HandleLButtonDown ( wParam, lParam );
			break;

		case WM_LBUTTONUP:
			HandleLButtonUp ( wParam, lParam );
			break;

		case WM_LBUTTONDBLCLK:
			HandleLButtonDblClk ( wParam, lParam );
			break;

		case WM_INITMENUPOPUP:
			SendMessage ( mApplication->GetMDIFrame(), msg, wParam, lParam );
			break;

		case WM_COMMAND:
			HandleCommand ( wParam, lParam );
			break;

		case WM_RBUTTONDOWN:
			HandleRButtonDown ( wParam, lParam );
			break;

		case WM_SIZE:
			UpdateScrollbars();
			break;

		case WM_VSCROLL:
			HandleScroll ( SB_VERT, wParam, lParam );
			break;

		case WM_HSCROLL:
			HandleScroll ( SB_HORZ, wParam, lParam );
			break;

		case WM_KEYDOWN:
			HandleKeyDown ( wParam, lParam );
			break;
	}
}
Ejemplo n.º 18
0
void CTryData4Dlg::OnTimer(UINT nIDEvent) 
{
	static bool bTwice = false;
	if(m_currPage == 0)	//is quiting
		return;
	if(bTwice)
		return;
	bTwice = true;
	SWISTATUS ss;
	CDHtmlDialog::OnTimer(nIDEvent);
	if (nIDEvent == 1)
	{
		CString status;
		m_CheckTicks++;
		if(m_CheckTicks == 1){
			status.Format("正在进行License检查");
			SetElementText(_T("checking"),status.AllocSysString());
			}
		if(m_CheckTicks == 2){	
			if(!CheckLicense())
			{
				MessageBox("本软件无法在本机上使用,请联系供应商");
				m_currPage = 0;
				::AfxGetMainWnd()->PostMessage(WM_CLOSE,1,0);
			}
			status.Format("正在连接控制板");
			SetElementText(_T("checking"),status.AllocSysString());
			}
		if(m_CheckTicks == 3){
			if(!m_Switch.Open(SPORT_SWITCH))
			{
				MessageBox("连接控制板失败","电阻校验",MB_OK);
				m_currPage = 0;
				::AfxGetMainWnd()->PostMessage(WM_CLOSE,1,0);
			}
		
			status.Format("正在连接纳伏计");
			SetElementText(_T("checking"),status.AllocSysString());
			}
		if(m_CheckTicks == 4){
			if(!m_Navmeter.Open(SPORT_NAVMETER))
			{
				MessageBox("连接纳伏计失败","电阻校验",MB_OK);
				m_currPage = 0;
				::AfxGetMainWnd()->PostMessage(WM_CLOSE,1,0);
			}

			status.Format("正在连接数据库");
			SetElementText(_T("checking"),status.AllocSysString());
		}
		if(m_CheckTicks == 5){
			if(!SqlInit(g_Path+_T("\\Data\\test.mdb")))
			{
				MessageBox("连接数据库失败","电阻校验",MB_OK);
				m_currPage = 0;
				::AfxGetMainWnd()->PostMessage(WM_CLOSE,1,0);
			}
			status.Format("正在装载程序");
			SetElementText(_T("checking"),status.AllocSysString());
		}
		if(m_CheckTicks == 6){
			if(!m_Program.InstallScheme(PathQuery2(CLSGROUP,IDTYPE)))
			{
				MessageBox("程序装载失败","电阻校验",MB_OK);
				m_currPage = 0;
				::AfxGetMainWnd()->PostMessage(WM_CLOSE,1,0);
			}
		}
		if(m_CheckTicks == 7){
			m_currPage = INDEX;		Handler("init",m_sRegSel,m_sRegLst,true);
//			m_currPage = CONFIG;	Handler("init",m_sConfSel,m_sConfLst,true);
//			m_currPage = DATA;		Handler("init",m_sDataSel,m_sDataLst,true);
//			m_currPage = JIAOHE;	Handler("init",m_sJhSel,m_sJhLst,true);
			KillTimer(1);
			m_currPage = INDEX;
			m_cmdStep = CMD_LOADHTML;
			//create the chart dialog
			m_pChartDlg = new CChartDlg(this);
			m_pChartDlg->Create(IDD_DIALOG2,this);
			m_pChartDlg->ShowWindow(SW_HIDE);
			//create the wait dialog
			m_pWaitDlg = new CWaitDialog(this);
			m_pWaitDlg->Create(IDD_DIALOG3,this);
			m_pWaitDlg->ShowWindow(SW_HIDE);

			SetTimer(2,30,NULL);
		}
	}	
	
	if(nIDEvent == 2)
	{
		if(m_cmdStep == CMD_INITHTML){
			IHTMLElement* newElement;
			if((m_currPage == INDEX) && (S_OK == GetElement("idvals",&newElement)))
			{
				m_sRegvals = this->GetAttribute(newElement,m_elemTypes[1]);
				Handler("init",m_sRegSel,m_sRegLst);
			}
			if((m_currPage == CONFIG) && (S_OK == GetElement("idvals",&newElement)))
			{
				m_sConfigvals = this->GetAttribute(newElement,m_elemTypes[1]);
				Handler("init",m_sConfSel,m_sConfLst);
			}
			if((m_currPage == JIAOHE) && (S_OK == GetElement("idvals",&newElement)))
			{

				m_sJhvals = this->GetAttribute(newElement,m_elemTypes[1]);
				Handler("init",m_sJhSel,m_sJhLst);
			}
			if((m_currPage == DATA) && (S_OK == GetElement("idvals",&newElement)))
			{
				if(g_TesterConf.m_Ps.iTimes == 0) //come to the data page directly from reg page 
				{
					m_currPage = CONFIG;
					m_sConfigvals = CString(",cklt9,rstdlt9,alphalt9,betalt9,cklt8,rstdlt8,alphalt8,betalt8,cklt1,rstdlt1,alphalt1,betalt1,cklt2,rstdlt2,alphalt2,betalt2,cklt3,rstdlt3,alphalt3,betalt3,cklt4,rstdlt4,alphalt4,betalt4,cklt5,rstdlt5,alphalt5,betalt5,cklt6,rstdlt6,alphalt6,betalt6,cklt7,rstdlt7,alphalt7,betalt7,confdxcl,zdpselect,lcselect,confcysj,confcycs,confwd,");
					Handler("init",m_sConfSel,m_sConfLst,true);


					m_currPage = JIAOHE;
					m_sJhvals = CString(",jhsel19,jhsel18,jhsel17,jhsel16,jhsel15,jhsel14,jhsel13,jhsel12,jhsel11,jhsel10,jhsel9,jhsel8,jhsel7,jhsel6,jhsel5,jhsel4,jhsel3,jhsel2,jhsel1,jhsel0,");
					Handler("init",m_sJhSel,m_sJhLst,true);
					m_sJhvals.Empty();

					m_currPage = DATA;
				}

				m_sDatavals = this->GetAttribute(newElement,m_elemTypes[1]);
				Handler("init",m_sDataSel,m_sDataLst);
				if(m_sDataLst.IsEmpty() || (m_sDataLst == " ,"))
				{
						InternalRoutines('9');//update value to page
				}
				Handler("update",m_sDataSel,m_sDataLst);
				
			}
			if(m_currPage == REPORT)
			{
				Handler("init",m_sReportSel,m_sReportLst);
			}
			m_cmdStep = CMD_IDLEHTML;
		}
		if((m_cmdStep == CMD_CONTHTML)||(m_cmdStep == CMD_CONTHTML2)){
			int group = -1;
			switch(m_currPage)
			{
			case JIAOHE:	group=IDJH;break;
			case DATA:		group=IDTEST;break;
			default: break;
			}
			if(group >= 0)
			{
				CStdioFile csf;
				if(csf.Open(g_Path+CString(PathQuery2(CLSJS,group)),CFile::modeRead))
				{
					CString content(""),line;
					while(csf.ReadString(line))
					{
						content += line;
					}
					csf.Close();
					SetElementHtml("cont",content.AllocSysString());
				}
			}
			if(m_cmdStep == CMD_CONTHTML2)
				m_cmdStep = CMD_INITHTML;
			else
				m_cmdStep = CMD_CONTHTML2;
		}
		if(m_cmdStep == CMD_LOADHTML && m_currPage > 0){
			LoadFromResource(m_currPage);
			m_cmdStep = CMD_CONTHTML;
		}
				CString str;
				CTime t = CTime::GetCurrentTime();
				str = t.Format("%H:%M:%S");
				SetElementText("curtime",str.AllocSysString());
		
		if(m_State == SUSPEND)			m_State = IDLE;
		if(m_State == BEERROR)			m_State = SUSPEND;

		if((m_State == IDLE)||(m_State == BEERROR))
		{
			if(m_CheckTicks++ > CHECKWAIT)
			{
				m_CheckTicks = 0;
#if 1
				SWISTATUS ss = m_Switch.GetSwitchStatus();
				while(ss.bOl1)
				{
					MessageBox("发生过载","电阻校验",MB_OK);
					ss = m_Switch.GetSwitchStatus();
				}

				CString str;
				str.Format("外标准[%s],被测[%s]",ss.bKN[0]?"接通":"未接",ss.bRn?"接通":"未接");
				SetElementText("swistatus",str.AllocSysString());
#endif;
			}
		}
		if(m_State == RUNNING)
		{
			char type;
			CString line;
//			m_State = SUSPEND;
				while((m_Program.m_iStackDepth > 0) )
				{
					if(m_Program.NextLine(type,line))//loop until some pausable command
					{
						if((type == 'z') || (type == 'd') || (type == 'w'))
						{
							HandleCommand(type,line);
							continue;
						}
						break;
					}
					
					 
				}
			    if(m_Program.m_iStackDepth <= 0)
				{
					Abort();
				}else{
					if(!HandleCommand(type,line))
					{
						m_State = BEERRO;
						Abort();
					}
				}
		}
	}
	bTwice = false;
	return;

}
Ejemplo n.º 19
0
void PageLayout (bool shownumber, bool helphack)
{
    int     i,oldfontcolor;
    char    ch;

    oldfontcolor = fontcolor;

    fontcolor = 0;

    //
    // clear the screen
    //
    int clearx = 0, cleary = 0, clearw = 320, clearh = 200;
    MenuToRealCoords(clearx, cleary, clearw, clearh, MENU_CENTER);
    VWB_DrawFill(backgroundFlat, clearx, cleary, clearx+clearw, cleary+clearh);
    VWB_DrawGraphic(TexMan("TOPWINDW"), 0, 0, MENU_CENTER);
    VWB_DrawGraphic(TexMan("LFTWINDW"), 0, 8, MENU_CENTER);
    VWB_DrawGraphic(TexMan("RGTWINDW"), 312, 8, MENU_CENTER);
    VWB_DrawGraphic(TexMan("BOTWINDW"), 8, 176, MENU_CENTER);

    for (i=0; i<TEXTROWS; i++)
    {
        leftmargin[i] = LEFTMARGIN;
        rightmargin[i] = SCREENPIXWIDTH-RIGHTMARGIN;
    }

    px = LEFTMARGIN;
    py = TOPMARGIN;
    rowon = 0;
    layoutdone = false;

    //
    // make sure we are starting layout text (^P first command)
    // [BL] Why? How about assuming ^P?
    //
    while (*text <= 32)
        text++;

    if (*text == '^' && toupper(*(text+1)) == 'P')
    {
        ++text;
        while (*text++ != '\n')
            ;
    }


    //
    // process text stream
    //
    do
    {
        ch = *text;

        if (ch == '^')
            HandleCommand (helphack);
        else if(ch == '\0')
        {
            // Simulate ^E if one does not exist.
            layoutdone = true;
        }
        else if (ch == 9)
        {
            px = (px+8)&0xf8;
            text++;
        }
        else if (ch <= 32)
            HandleCtrls ();
        else
            HandleWord ();

    } while (!layoutdone);

    pagenum++;

    if (shownumber)
    {
        FString str;
        str.Format("pg %d of %d", pagenum, numpages);
        px = 213;
        py = 183;

        VWB_DrawPropString (SmallFont, str, gameinfo.FontColors[GameInfo::PAGEINDEX]);
    }

    fontcolor = oldfontcolor;
}
Ejemplo n.º 20
0
void ReadModule::readCommands() {
  while (true) {
    HandleCommand();
  }
}
Ejemplo n.º 21
0
/********************************************************************
* Function: 	int main()
*
* Precondition: None.
*
* Input: 		None.
*
* Output:		None.
*
* Side Effects:	Enables 32-bit Timer2/3.  Enables UART.
*
* Overview: 	Initialization of program and main loop.
*
* Note:		 	None.
********************************************************************/
int main()
{
    DWORD_VAL delay;

    //Setup bootloader entry delay
    sourceAddr.Val = DELAY_TIME_ADDR;	//bootloader timer address
    delay.Val = ReadLatch(sourceAddr.word.HW, sourceAddr.word.LW); //read BL timeout

    //Setup user reset vector
    sourceAddr.Val = USER_PROG_RESET;
    userReset.Val = ReadLatch(sourceAddr.word.HW, sourceAddr.word.LW);

    //Prevent bootloader lockout - if no user reset vector, reset to BL start
    if(userReset.Val == 0xFFFFFF) {
        userReset.Val = BOOT_ADDR_LOW;
    }
    userResetRead = 0;


    //If timeout is zero, check reset state.
    if(delay.v[0] == 0) {

        //If device is returning from reset, BL is disabled call user code
        //otherwise assume the BL was called from use code and enter BL
        if(RCON & 0xFED3) {
            //If bootloader disabled, go to user code
            ResetDevice(userReset.Val);
        } else {
            delay.Val = 0xFF;
        }
    }


    T2CONbits.TON = 0;
    T2CONbits.T32 = 1; // Setup Timer 2/3 as 32 bit timer incrementing every clock
    IFS0bits.T3IF = 0; // Clear the Timer3 Interrupt Flag
    IEC0bits.T3IE = 0; // Disable Timer3 Interrupt Service Routine

    //Enable timer if not in always-BL mode
    if((delay.Val & 0x000000FF) != 0xFF) {
        //Convert seconds into timer count value
        delay.Val = ((DWORD)(FCY)) * ((DWORD)(delay.v[0]));

        PR3 = delay.word.HW; //setup timer timeout value
        PR2 = delay.word.LW;

        TMR2 = 0;
        TMR3 = 0;
        T2CONbits.TON=1;  //enable timer
    }


    //config AN pins as Digital I/O
    AD1PCFG = 0xFFFF;

    //If using a part with PPS, map the UART I/O
#ifdef DEV_HAS_PPS
    ioMap();
#endif


    //Configure UART pins to be digital I/O.
#ifdef UTX_ANA
    UTX_ANA = 1;
#endif
#ifdef URX_ANA
    URX_ANA = 1;
#endif


    // SETUP UART COMMS: No parity, one stop bit, autobaud, polled
    UxMODEbits.UARTEN = 1;		//enable uart
#ifdef USE_AUTOBAUD
    UxMODEbits.ABAUD = 1;		//use autobaud
#else
    UxBRG = BAUDRATEREG;
#endif
#ifdef USE_HI_SPEED_BRG
    UxMODEbits.BRGH = 1;	//use high speed mode
#endif
    UxSTA = 0x0400;  //Enable TX

    while(1) {

#ifdef USE_RUNAWAY_PROTECT
        writeKey1 = 0xFFFF;	// Modify keys to ensure proper program flow
        writeKey2 = 0x5555;
#endif

        GetCommand();		//Get full AN851 command from UART

#ifdef USE_RUNAWAY_PROTECT
        writeKey1 += 10;	// Modify keys to ensure proper program flow
        writeKey2 += 42;
#endif

        HandleCommand();	//Handle the command

        PutResponse(responseBytes);		//Respond to sent command

    }//end while(1)

}//end main(void)
/**
* Message handler for the console.
*
* @author Rian Drake.
*/
bool CRuntimeShaderConsole::Message(WPARAM _wParam, DWORD _uiMsg)
{
    m_bTyping = true;

    switch (_wParam)
    {
    case WM_KEYDOWN:
        if (m_bVisible)
        {
            switch (_uiMsg)
            {
            case VK_BACK:
                if (m_uiCursorAbsolute)
                {
                    if(m_uiCursorRelative)
                    {
                        m_vecCommands[m_uiHistoryAbsolute].erase(m_uiCursorAbsolute - 1, 1);
                    }
                    else if(m_vecCommands[m_uiHistoryAbsolute].size())
                    {
                        m_vecCommands[m_uiHistoryAbsolute].pop_back();
                    }
                }

                break;

            case VK_LCONTROL:
            case VK_SHIFT:
            case VK_CAPITAL:
                HandleModifier(_wParam, _uiMsg);
                break;
            case VK_RETURN:
                m_bFirstCommand = true;
                HandleCommand();
                break;
            case VK_UP:
            case VK_DOWN:
            case VK_LEFT:
            case VK_RIGHT:
                HandleHistoryCommand(_uiMsg);
                break;

            case VK_SPACE:
                HandleCharacter(' ');
                break;
            case VK_OEM_PERIOD:
                m_eModifier & KM_SHIFT ? HandleCharacter('>') : HandleCharacter('.');
                break;
            case VK_OEM_COMMA:
                m_eModifier & KM_SHIFT ? HandleCharacter('<') : HandleCharacter(',');
                break;
            case VK_OEM_MINUS:
                m_eModifier & KM_SHIFT ? HandleCharacter('_') : HandleCharacter('-');
                break;
            case VK_OEM_PLUS:
                m_eModifier & KM_SHIFT ? HandleCharacter('+') : HandleCharacter('=');
                break;
            case VK_OEM_1:
                m_eModifier & KM_SHIFT ? HandleCharacter(':') : HandleCharacter(';');
                break;
            case VK_OEM_2:
                m_eModifier & KM_SHIFT ? HandleCharacter('?') : HandleCharacter('/');
                break;
            case VK_OEM_3:
                m_bVisible = false;
                break;
            case VK_OEM_4:
                m_eModifier & KM_SHIFT ? HandleCharacter('{') : HandleCharacter('[');
                break;
            case VK_OEM_5:
                m_eModifier & KM_SHIFT ? HandleCharacter('|') : HandleCharacter('\\');
                break;
            case VK_OEM_6:
                m_eModifier & KM_SHIFT ? HandleCharacter('}') : HandleCharacter(']');
                break;
            case VK_OEM_7:
                m_eModifier & KM_SHIFT ? HandleCharacter('\"') : HandleCharacter('\'');
                break;
            default:
                HandleCharacter(_uiMsg);
                break;
            }
        }
        else if (_uiMsg == VK_OEM_3)
        {
            m_bVisible = true;
        }
        break;

    case WM_KEYUP:
        switch (_uiMsg)
        {
        case VK_LCONTROL:
        case VK_SHIFT:
            HandleModifier(_wParam, _uiMsg);
            break;
        }
        break;

    default:
        break;
    }

    UpdateAbsolutePositions();

    return FreezeInput();
}
Ejemplo n.º 23
0
extern "C" __declspec(dllexport) void ProcessConsoleCommand(PCommand command, TArgument *arguments, int count, PReply reply)
{
	HandleCommand(command, arguments, count, reply);
}
Ejemplo n.º 24
0
bool cPluginManager::CallHookChat(cPlayer & a_Player, AString & a_Message)
{
	// Check if the message contains a command, execute it:
	switch (HandleCommand(a_Player, a_Message, true))
	{
		case crExecuted:
		{
			// The command has executed successfully
			return true;
		}
		
		case crBlocked:
		{
			// The command was blocked by a plugin using HOOK_EXECUTE_COMMAND
			// The plugin has most likely sent a message to the player already
			return true;
		}
		
		case crError:
		{
			// An error in the plugin has prevented the command from executing. Report the error to the player:
			a_Player.SendMessageFailure(Printf("Something went wrong while executing command \"%s\"", a_Message.c_str()));
			return true;
		}
		
		case crNoPermission:
		{
			// The player is not allowed to execute this command
			a_Player.SendMessageFailure(Printf("Forbidden command; insufficient privileges: \"%s\"", a_Message.c_str()));
			return true;
		}

		case crUnknownCommand:
		{
			// This was not a known command, keep processing as a message
			break;
		}
	}

	// Check if the message is a command (starts with a slash). If it is, we know that it wasn't recognised:
	if (!a_Message.empty() && (a_Message[0] == '/'))
	{
		AStringVector Split(StringSplit(a_Message, " "));
		ASSERT(!Split.empty());  // This should not happen - we know there's at least one char in the message so the split needs to be at least one item long
		a_Player.SendMessageInfo(Printf("Unknown command: \"%s\"", a_Message.c_str()));
		LOGINFO("Player %s issued an unknown command: \"%s\"", a_Player.GetName().c_str(), a_Message.c_str());
		return true;  // Cancel sending
	}

	FIND_HOOK(HOOK_CHAT);
	VERIFY_HOOK;

	for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
	{
		if ((*itr)->OnChat(a_Player, a_Message))
		{
			return true;
		}
	}

	return false;
}
Ejemplo n.º 25
0
void PageLayout(boolean shownumber)
{
	int		i,oldfontcolor;
	signed char	ch;

	oldfontcolor = fontcolor;

	fontcolor = 0;

//
// clear the screen
//
	VW_Bar(0,0,320,200,BACKCOLOR);
	VWB_DrawPic(0,0,H_TOPWINDOWPIC);
	VWB_DrawPic(0,8,H_LEFTWINDOWPIC);
	VWB_DrawPic(312,8,H_RIGHTWINDOWPIC);
	VWB_DrawPic(8,176,H_BOTTOMINFOPIC);


	for (i=0;i<TEXTROWS;i++)
	{
		leftmargin[i] = LEFTMARGIN;
		rightmargin[i] = SCREENPIXWIDTH-RIGHTMARGIN;
	}

	px = LEFTMARGIN;
	py = TOPMARGIN;
	rowon = 0;
	layoutdone = false;

//
// make sure we are starting layout text (^P first command)
//
	while (*text <= 32)
		text++;

	if (*text != '^' || toupper(*++text) != 'P')
		Quit ("PageLayout: Text not headed with ^P");

	while (*text++ != '\n')
	;


//
// process text stream
//
	do
	{
		ch = *text;

		if (ch == '^')
			HandleCommand ();
		else
		if (ch == 9)
		{
		 px = (px+8)&0xf8;
		 text++;
		}
		else if (ch <= 32)
			HandleCtrls ();
		else
			HandleWord ();

	} while (!layoutdone);

	pagenum++;

	if (shownumber)
	{
		strcpy (str,"pg ");
		itoa (pagenum,str2,10);
		strcat (str,str2);
		strcat (str," of ");
		py = 183;
		px = 213;
		itoa (numpages,str2,10);
		strcat (str,str2);
		fontcolor = 0x4f; 			   //12^BACKCOLOR;

		VW_DrawPropString (str);
	}

	fontcolor = oldfontcolor;
}
Ejemplo n.º 26
0
/*
================
rvGEApp::HandleCommand

Handles the WM_COMMAND message
================
*/
int rvGEApp::HandleCommand ( WPARAM wParam, LPARAM lParam )
{
    HWND		   active;
    rvGEWorkspace* workspace = GetActiveWorkspace ( &active );

    // The recent file list needs to be handled specially
    if ( LOWORD(wParam) >= ID_GUIED_FILE_MRU1 && LOWORD(wParam) < ID_GUIED_FILE_MRU1 + rvGEOptions::MAX_MRU_SIZE )
    {
        OpenFile ( mOptions.GetRecentFile ( mOptions.GetRecentFileCount() - (LOWORD(wParam)-ID_GUIED_FILE_MRU1) - 1 ) );
        return 0;
    }

    switch ( LOWORD ( wParam ) )
    {
    case ID_GUIED_SOURCECONTROL_CHECKIN:
        assert ( workspace );
        HandleCommandSave ( workspace, workspace->GetFilename ( ) );
        workspace->CheckIn ( );
        break;

    case ID_GUIED_SOURCECONTROL_CHECKOUT:
        assert ( workspace );
        workspace->CheckOut ( );
        break;

    case ID_GUIED_SOURCECONTROL_UNDOCHECKOUT:
        assert ( workspace );
        if ( IDYES == MessageBox ( va("Are you sure you want to undo the checkout of the file '%s'?",workspace->GetFilename()), MB_YESNO|MB_ICONQUESTION) )
        {
            workspace->UndoCheckout ( );
        }
        break;

    case ID_GUIED_TOOLS_RELOADMATERIALS:
        SetCursor ( LoadCursor ( NULL, MAKEINTRESOURCE(IDC_WAIT) ) );
        cmdSystem->BufferCommandText( CMD_EXEC_NOW, "reloadImages\n" );
        cmdSystem->BufferCommandText( CMD_EXEC_NOW, "reloadMaterials\n" );
        SetCursor ( LoadCursor ( NULL, MAKEINTRESOURCE(IDC_ARROW) ) );
        break;

    case ID_GUIED_EDIT_COPY:
        assert ( workspace );
        workspace->Copy  ( );
        break;

    case ID_GUIED_EDIT_PASTE:
        assert ( workspace );
        workspace->Paste  ( );
        break;

    case ID_GUIED_HELP_ABOUT:
        DialogBox ( GetInstance(), MAKEINTRESOURCE(IDD_GUIED_ABOUT), mMDIFrame, AboutDlg_WndProc );
        break;

    case ID_GUIED_TOOLS_VIEWER:
    {
        if ( mViewer )
        {
            break;
        }

        mViewer = new rvGEViewer;
        if ( !mViewer->Create ( mMDIFrame ) )
        {
            delete mViewer;
            mViewer = NULL;
        }

        if ( workspace )
        {
            if ( !workspace->IsModified () || HandleCommand ( MAKELONG(ID_GUIED_FILE_SAVE,0), 0 ) )
            {
                mViewer->OpenFile ( workspace->GetFilename ( ) );
            }
        }

        SetActiveWindow ( mViewer->GetWindow ( ) );
        break;
    }

    case ID_GUIED_ITEM_MAKESAMESIZEWIDTH:
        assert ( workspace );
        workspace->MakeSelectedSameSize ( true, false );
        break;

    case ID_GUIED_ITEM_MAKESAMESIZEBOTH:
        assert ( workspace );
        workspace->MakeSelectedSameSize ( true, true );
        break;

    case ID_GUIED_ITEM_MAKESAMESIZEHEIGHT:
        assert ( workspace );
        workspace->MakeSelectedSameSize ( false, true );
        break;

    case ID_GUIED_ITEM_ALIGNLEFTS:
        assert ( workspace );
        workspace->AlignSelected ( rvGEWorkspace::ALIGN_LEFTS );
        break;

    case ID_GUIED_ITEM_ALIGNCENTERS:
        assert ( workspace );
        workspace->AlignSelected ( rvGEWorkspace::ALIGN_CENTERS );
        break;

    case ID_GUIED_ITEM_ALIGNRIGHTS:
        assert ( workspace );
        workspace->AlignSelected ( rvGEWorkspace::ALIGN_RIGHTS );
        break;

    case ID_GUIED_ITEM_ALIGNTOPS:
        assert ( workspace );
        workspace->AlignSelected ( rvGEWorkspace::ALIGN_TOPS );
        break;

    case ID_GUIED_ITEM_ALIGNMIDDLES:
        assert ( workspace );
        workspace->AlignSelected ( rvGEWorkspace::ALIGN_MIDDLES );
        break;

    case ID_GUIED_ITEM_ALIGNBOTTOMS:
        assert ( workspace );
        workspace->AlignSelected ( rvGEWorkspace::ALIGN_BOTTOMS );
        break;

    case ID_GUIED_ITEM_ARRANGESENDBACKWARD:
        assert ( workspace );
        workspace->SendSelectedBackward ( );
        break;

    case ID_GUIED_ITEM_ARRANGESENDTOBACK:
        assert ( workspace );
        workspace->SendSelectedToBack( );
        break;

    case ID_GUIED_ITEM_ARRANGEBRINGFORWARD:
        assert ( workspace );
        workspace->BringSelectedForward ( );
        break;

    case ID_GUIED_ITEM_ARRANGEBRINGTOFRONT:
        assert ( workspace );
        workspace->BringSelectedToFront ( );
        break;

    case ID_GUIED_ITEM_ARRANGEMAKECHILD:
        assert ( workspace );
        workspace->MakeSelectedAChild ( );
        break;

    case ID_GUIED_ITEM_PROPERTIES:
        assert ( workspace );
        workspace->EditSelectedProperties ( );
        break;

    case ID_GUIED_ITEM_SCRIPTS:
        assert ( workspace );
        workspace->EditSelectedScripts ( );
        break;

    case ID_GUIED_ITEM_NEWWINDOWDEF:
        assert ( workspace );
        workspace->AddWindow ( rvGEWindowWrapper::WT_NORMAL );
        break;

    case ID_GUIED_ITEM_NEWEDITDEF:
        assert ( workspace );
        workspace->AddWindow ( rvGEWindowWrapper::WT_EDIT );
        break;

    case ID_GUIED_ITEM_NEWHTMLDEF:
        assert ( workspace );
        workspace->AddWindow ( rvGEWindowWrapper::WT_HTML );
        break;

    case ID_GUIED_ITEM_NEWCHOICEDEF:
        assert ( workspace );
        workspace->AddWindow ( rvGEWindowWrapper::WT_CHOICE );
        break;

    case ID_GUIED_ITEM_NEWSLIDERDEF:
        assert ( workspace );
        workspace->AddWindow ( rvGEWindowWrapper::WT_SLIDER );
        break;

    case ID_GUIED_ITEM_NEWLISTDEF:
        assert ( workspace );
        workspace->AddWindow ( rvGEWindowWrapper::WT_LIST );
        break;

    case ID_GUIED_ITEM_NEWBINDDEF:
        assert ( workspace );
        workspace->AddWindow ( rvGEWindowWrapper::WT_BIND );
        break;

    case ID_GUIED_ITEM_NEWRENDERDEF:
        assert ( workspace );
        workspace->AddWindow ( rvGEWindowWrapper::WT_RENDER );
        break;

    case ID_GUIED_WINDOW_TILE:
        SendMessage ( mMDIClient, WM_MDITILE, 0, 0 );
        break;

    case ID_GUIED_WINDOW_CASCADE:
        SendMessage ( mMDIClient, WM_MDICASCADE, 0, 0 );
        break;

    case ID_GUIED_VIEW_STATUSBAR:
    {
        RECT rWindow;

        mStatusBar.Show ( mOptions.GetStatusBarVisible()?false:true );

        GetWindowRect ( mMDIFrame, &rWindow );
        SendMessage ( mMDIFrame, WM_SIZE, 0, MAKELONG ( rWindow.right-rWindow.left, rWindow.bottom-rWindow.top ) );
        break;
    }

    case ID_GUIED_WINDOW_SHOWNAVIGATOR:
        mNavigator.Show ( mOptions.GetNavigatorVisible()?false:true );
        break;

    case ID_GUIED_WINDOW_SHOWPROPERTIES:
        mProperties.Show ( mOptions.GetPropertiesVisible()?false:true );
        break;

    case ID_GUIED_WINDOW_SHOWTRANSFORMER:
        mTransformer.Show ( mOptions.GetTransformerVisible()?false:true  );
        break;

    case ID_GUIED_EDIT_DELETE:
        assert ( workspace );
        workspace->DeleteSelected ( );
        break;

    case ID_GUIED_VIEW_HIDESELECTED:
        assert ( workspace );
        workspace->HideSelected ( );
        break;

    case ID_GUIED_VIEW_UNHIDESELECTED:
        assert ( workspace );
        workspace->UnhideSelected ( );
        break;

    case ID_GUIED_VIEW_SHOWHIDDEN:
        assert ( workspace );
        workspace->ShowHidden ( );
        break;

    case ID_GUIED_EDIT_UNDO:
        assert ( workspace );
        workspace->GetModifierStack().Undo ( );
        mNavigator.Update ( );
        mTransformer.Update ( );
        break;

    case ID_GUIED_EDIT_REDO:
        assert ( workspace );
        workspace->GetModifierStack().Redo ( );
        mNavigator.Update ( );
        mTransformer.Update ( );
        break;

    case ID_GUIED_VIEW_OPTIONS:
        GEOptionsDlg_DoModal ( mMDIFrame );
        break;

    case ID_GUIED_VIEW_SHOWGRID:
        mOptions.SetGridVisible ( mOptions.GetGridVisible()?false:true );
        break;

    case ID_GUIED_VIEW_SNAPTOGRID:
        mOptions.SetGridSnap ( mOptions.GetGridSnap ()?false:true );
        break;

    case ID_GUIED_VIEW_ZOOMIN:
        assert ( workspace );
        workspace->ZoomIn ( );
        break;

    case ID_GUIED_VIEW_ZOOMOUT:
        assert ( workspace );
        workspace->ZoomOut ( );
        break;

    case ID_GUIED_FILE_EXIT:
        DestroyWindow ( mMDIFrame );
        break;

    case ID_GUIED_FILE_CLOSE:
        if ( active )
        {
            assert ( workspace );
            SendMessage ( active, WM_CLOSE, 0, 0 );
        }
        break;

    case ID_GUIED_FILE_NEW:
        NewFile ( );
        break;

    case ID_GUIED_FILE_SAVE:
        assert ( workspace );
        HandleCommandSave ( workspace, workspace->GetFilename ( ) );
        break;

    case ID_GUIED_FILE_SAVEAS:
        assert ( workspace );
        HandleCommandSave ( workspace, NULL );
        break;

    case ID_GUIED_FILE_OPEN:
    {
        OPENFILENAME ofn;
        char		 szFile[MAX_PATH] = "";

        // Initialize OPENFILENAME
        ZeroMemory(&ofn, sizeof(OPENFILENAME));
        ofn.lStructSize = sizeof(OPENFILENAME);
        ofn.hwndOwner = mMDIFrame;
        ofn.lpstrFile = szFile;
        ofn.nMaxFile = sizeof(szFile);
        ofn.lpstrFilter = "GUI Files\0*.GUI\0All Files\0*.*\0";
        ofn.nFilterIndex = 1;
        ofn.lpstrFileTitle = NULL;
        ofn.nMaxFileTitle = 0;
        ofn.lpstrInitialDir = NULL;
        ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;

        // Display the Open dialog box.
        if (GetOpenFileName(&ofn)==TRUE)
        {
            OpenFile ( ofn.lpstrFile );
        }
        break;
    }
    }

    return -1;
}
Ejemplo n.º 27
0
void ImageDisplayModule::readCommands() {
  while (true) {
    HandleCommand();
  }
}