[dasher: 1/27] Win32 fixes



commit 4148d078491f66e4836fd911831542a29bff0b93
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Tue Aug 10 16:39:02 2010 +0100

    Win32 fixes
    
    Implement GetAllContext using old code from speak-all;
    Rename BP_PAUSE_OUTSIDE to BP_STOP_OUTSIDE;
    Remove calls/ControlEvent-handlers to old speak(int what) method
    Remove ActionSpeech.{h,cpp} from project file
    Correct type parameter error in DasherInterfaceBase

 Src/DasherCore/DasherInterfaceBase.cpp |    2 +-
 Src/Win32/Dasher.cpp                   |    7 +++++++
 Src/Win32/Dasher.h                     |    2 ++
 Src/Win32/DasherWindow.cpp             |   12 ------------
 Src/Win32/Dasher_vc80.vcproj           |   24 ------------------------
 Src/Win32/Widgets/ControlPage.cpp      |    3 +--
 6 files changed, 11 insertions(+), 39 deletions(-)
---
diff --git a/Src/DasherCore/DasherInterfaceBase.cpp b/Src/DasherCore/DasherInterfaceBase.cpp
index cd535b1..32c76d4 100644
--- a/Src/DasherCore/DasherInterfaceBase.cpp
+++ b/Src/DasherCore/DasherInterfaceBase.cpp
@@ -1143,7 +1143,7 @@ void CDasherInterfaceBase::SetOffset(int iOffset) {
   if(m_pDasherModel)
     m_pDasherModel->SetOffset(iOffset, m_pDasherView);
   //ACL TODO FIXME check that CTL_MOVE, etc., eventually come here?
-  for (set<TextAction *,bool(*)(TextAction *,TextAction *)>::iterator it = m_vTextActions.begin(); it!=m_vTextActions.end(); it++) {
+  for (set<TextAction *>::iterator it = m_vTextActions.begin(); it!=m_vTextActions.end(); it++) {
     (*it)->NotifyOffset(iOffset);
   }
 }
diff --git a/Src/Win32/Dasher.cpp b/Src/Win32/Dasher.cpp
index cd678e6..570d0e8 100644
--- a/Src/Win32/Dasher.cpp
+++ b/Src/Win32/Dasher.cpp
@@ -354,3 +354,10 @@ void CDasher::CopyToClipboard(const string &strText) {
     CloseClipboard();
   }
 }
+
+std::string CDasher::GetAllContext() {
+	int speechlength = m_pEdit->GetWindowTextLength();
+	LPTSTR allspeech = new TCHAR[speechlength + 1];
+	m_pEdit->GetWindowText(allspeech, speechlength + 1);
+    return allspeech;
+}
\ No newline at end of file
diff --git a/Src/Win32/Dasher.h b/Src/Win32/Dasher.h
index b57a5c0..ba93a1d 100644
--- a/Src/Win32/Dasher.h
+++ b/Src/Win32/Dasher.h
@@ -49,6 +49,8 @@ public:
   virtual void WriteTrainFile(const std::string &strNewText);
   void Main(); 
 
+  virtual std::string GetAllContext();
+
 #ifndef _WIN32_WCE
   //on WinCE, do not support speech - so use defaults from CDasherInterfaceBase 
   bool SupportsSpeech();
diff --git a/Src/Win32/DasherWindow.cpp b/Src/Win32/DasherWindow.cpp
index a156742..ca19489 100644
--- a/Src/Win32/DasherWindow.cpp
+++ b/Src/Win32/DasherWindow.cpp
@@ -302,18 +302,6 @@ void CDasherWindow::HandleControlEvent(int iID) {
     if(m_pEdit)
       m_pEdit->Delete(EDIT_BACKWARDS, EDIT_FILE);
     break;
-  case Dasher::CControlManager::CTL_USER+1: // Speak all
-    if(m_pEdit)
-      m_pEdit->speak(1);
-    break;
-  case Dasher::CControlManager::CTL_USER+2: // Speak new
-    if(m_pEdit)
-      m_pEdit->speak(2);
-    break;
-  case Dasher::CControlManager::CTL_USER+3: // Repeat speech
-    if(m_pEdit)
-      m_pEdit->speak(3);
-    break;
   }
 }
 
diff --git a/Src/Win32/Dasher_vc80.vcproj b/Src/Win32/Dasher_vc80.vcproj
index 985471a..972e1ae 100644
--- a/Src/Win32/Dasher_vc80.vcproj
+++ b/Src/Win32/Dasher_vc80.vcproj
@@ -957,30 +957,6 @@
 			Name="Actions"
 			>
 			<File
-				RelativePath=".\ActionSpeech.cpp"
-				>
-				<FileConfiguration
-					Name="Mobile Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath=".\ActionSpeech.h"
-				>
-				<FileConfiguration
-					Name="Mobile Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCustomBuildTool"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
 				RelativePath=".\DasherAction.h"
 				>
 			</File>
diff --git a/Src/Win32/Widgets/ControlPage.cpp b/Src/Win32/Widgets/ControlPage.cpp
index a53505e..5c54af6 100644
--- a/Src/Win32/Widgets/ControlPage.cpp
+++ b/Src/Win32/Widgets/ControlPage.cpp
@@ -33,9 +33,8 @@ struct menuentry {
 // List of menu items that will be displayed in the General Preferences
 static menuentry menutable[] = {
   {BP_START_MOUSE, IDC_LEFT},
-  {BP_START_SPACE, IDC_SPACE},
   {BP_STOP_IDLE, IDC_STOPIDLE},
-  {BP_PAUSE_OUTSIDE, IDC_WINDOWPAUSE},
+  {BP_STOP_OUTSIDE, IDC_WINDOWPAUSE},
   {BP_AUTO_SPEEDCONTROL, IDC_AUTOSPEED},
   {BP_AUTOCALIBRATE, IDC_AUTOCALIBRATE}
 };



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]