[GME-commit] GMESRC/GME/Console ScriptEdit.cpp,1.5,1.6 ScriptEdit.h,1.5,1.6

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu Sep 21 22:12:44 CDT 2006


Update of /project/gme-repository/GMESRC/GME/Console
In directory escher:/tmp/cvs-serv31593

Modified Files:
	ScriptEdit.cpp ScriptEdit.h 
Log Message:
Fix.


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: ScriptEdit.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Console/ScriptEdit.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ScriptEdit.cpp	23 Aug 2006 18:44:03 -0000	1.5
--- ScriptEdit.cpp	21 Sep 2006 21:12:42 -0000	1.6
***************
*** 20,24 ****
  END_MESSAGE_MAP()
  
! 
  CScriptEdit::CScriptEdit()
  {
--- 20,24 ----
  END_MESSAGE_MAP()
  
! /*static*/ const char* CScriptEdit::defPrompt = ">";
  CScriptEdit::CScriptEdit()
  {
***************
*** 40,44 ****
  		COMTHROW(m_host->InitEngine((void*)m_console, engine));
  		this->LimitText( 256);     // modify in accordance with GetLine( ..., 256) in OnKeyUp()
! 		this->SetWindowText( ">"); // to attract user attention
  	}
  	catch(hresult_exception &e) 
--- 40,44 ----
  		COMTHROW(m_host->InitEngine((void*)m_console, engine));
  		this->LimitText( 256);     // modify in accordance with GetLine( ..., 256) in OnKeyUp()
! 		this->SetWindowText( defPrompt); // to attract user attention
  	}
  	catch(hresult_exception &e) 
***************
*** 168,176 ****
  void CScriptEdit::OnEnKillfocus()
  {
! 	this->SetWindowText( ">"); // to attract user attention
  }
  
  void CScriptEdit::OnEnSetfocus()
  {
! 	this->SetWindowText( ""); // when it has start typing remove '>'
  }
--- 168,186 ----
  void CScriptEdit::OnEnKillfocus()
  {
! 	CString buff;
! 	this->GetWindowText( buff);
! 	if( buff.IsEmpty()) // if no user written command while leaving field
! 	{
! 		this->SetWindowText( defPrompt); // to attract user attention
! 	}
  }
  
  void CScriptEdit::OnEnSetfocus()
  {
! 	CString buff;
! 	this->GetWindowText( buff);
! 	if( buff == defPrompt) // if found the default prompt
! 	{
! 		this->SetWindowText( ""); // when it has start typing remove '>'
! 	}
  }

Index: ScriptEdit.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Console/ScriptEdit.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ScriptEdit.h	23 Aug 2006 18:37:52 -0000	1.5
--- ScriptEdit.h	21 Sep 2006 21:12:42 -0000	1.6
***************
*** 27,32 ****
  	void SetGMEApp(IDispatch *disp);
  	void SetGMEProj(IDispatch *dsp);
! 
  protected:
  	CConsoleCtrl *m_console;
  	IScriptHostPtr m_host;
--- 27,34 ----
  	void SetGMEApp(IDispatch *disp);
  	void SetGMEProj(IDispatch *dsp);
! 	
  protected:
+ 	static const char* defPrompt;
+ 
  	CConsoleCtrl *m_console;
  	IScriptHostPtr m_host;



More information about the GME-commit mailing list