[sword-svn] r182 - in trunk/src/SwordReader_GUI: . SRFramework

dtrotzjr at www.crosswire.org dtrotzjr at www.crosswire.org
Sun Sep 21 19:39:41 MST 2008


Author: dtrotzjr
Date: 2008-09-21 19:39:40 -0700 (Sun, 21 Sep 2008)
New Revision: 182

Modified:
   trunk/src/SwordReader_GUI/SRFind.cpp
   trunk/src/SwordReader_GUI/SRFind.h
   trunk/src/SwordReader_GUI/SRFramework/SRRadioButton.cpp
   trunk/src/SwordReader_GUI/SRFramework/SRRadioButton.h
Log:
SRRadioButton is now complete and 97% of all WinCE API calls are wrapped in SRFramework.

Modified: trunk/src/SwordReader_GUI/SRFind.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRFind.cpp	2008-09-22 01:57:20 UTC (rev 181)
+++ trunk/src/SwordReader_GUI/SRFind.cpp	2008-09-22 02:39:40 UTC (rev 182)
@@ -80,25 +80,25 @@
         m_wRangeMode = SR_FIND_RANGE_BIBLE;
         break;
     case IDC_RAD_TESTAMENT:
-        ::SendMessage(m_hRadRangeBible,BM_SETCHECK,BST_UNCHECKED,0);
-        ::SendMessage(m_hRadRangeTestament,BM_SETCHECK,BST_CHECKED,0);
-        ::SendMessage(m_hRadRangeBook,BM_SETCHECK,BST_UNCHECKED,0);
+        m_pRadRangeBible->Uncheck();
+        m_pRadRangeTestament->Check();
+        m_pRadRangeBook->Uncheck();
         m_wRangeMode = SR_FIND_RANGE_TESTAMENT;
         break;
     case IDC_RAD_BOOK:
-        ::SendMessage(m_hRadRangeBible,BM_SETCHECK,BST_UNCHECKED,0);
-        ::SendMessage(m_hRadRangeTestament,BM_SETCHECK,BST_UNCHECKED,0);
-        ::SendMessage(m_hRadRangeBook,BM_SETCHECK,BST_CHECKED,0);
+        m_pRadRangeBible->Uncheck();
+        m_pRadRangeTestament->Uncheck();
+        m_pRadRangeBook->Check();
         m_wRangeMode = SR_FIND_RANGE_BOOK;
         break;
     case IDC_RAD_MWORD:
-        ::SendMessage(m_hRadMethodMultiword,BM_SETCHECK,BST_CHECKED,0);
-        ::SendMessage(m_hRadMethodExactphrase,BM_SETCHECK,BST_UNCHECKED,0);
+        m_pRadMethodMultiword->Check();
+        m_pRadMethodExactphrase->Uncheck();
         m_wMethodMode = SR_FIND_METHOD_MWORD;
         break;
     case IDC_RAD_EPHRASE:
-        ::SendMessage(m_hRadMethodMultiword,BM_SETCHECK,BST_UNCHECKED,0);
-        ::SendMessage(m_hRadMethodExactphrase,BM_SETCHECK,BST_CHECKED,0);
+        m_pRadMethodMultiword->Uncheck();
+        m_pRadMethodExactphrase->Check();
         m_wMethodMode = SR_FIND_METHOD_EPHRASE;
         break;
     case IDC_LST_RESULTS:
@@ -168,49 +168,34 @@
     m_pButtonSearch->Show();
 
 	// Radio Buttons
-	m_hRadRangeBible = CreateWindow(_T("button"), L"Whole bible", 
-		WS_CHILD | BS_RADIOBUTTON,
-		0,0,0,0,
-        hWnd, (HMENU)(IDC_RAD_BIBLE), SRApp::GetInstanceHandle(), NULL);
-    if(!m_hRadRangeBible)
+    m_pRadRangeBible = new SRRadioButton();
+    if(!m_pRadRangeBible || !m_pRadRangeBible->Create(this, "Whole Bible", nullRECT, IDC_RAD_BIBLE))
         return FALSE;
-    ::SendMessage(m_hRadRangeBible,BM_SETCHECK,BST_CHECKED,0);
+    m_pRadRangeBible->Show();
+    m_pRadRangeBible->Check();
     m_wRangeMode = SR_FIND_RANGE_BIBLE;
-    ShowWindow(m_hRadRangeBible, SW_SHOW);
+    
+    m_pRadRangeTestament = new SRRadioButton();
+    if(!m_pRadRangeTestament || !m_pRadRangeTestament->Create(this, "This Testament", nullRECT, IDC_RAD_TESTAMENT))
+        return FALSE;
+    m_pRadRangeTestament->Show();
 
-	m_hRadRangeTestament = CreateWindow(_T("button"), L"This testament", 
-		WS_CHILD | BS_RADIOBUTTON,
-		0,0,0,0,
-		hWnd, (HMENU)(IDC_RAD_TESTAMENT), SRApp::GetInstanceHandle(), NULL);
-    if(!m_hRadRangeTestament)
+    m_pRadRangeBook = new SRRadioButton();
+    if(!m_pRadRangeBook || !m_pRadRangeBook->Create(this, "This Book", nullRECT, IDC_RAD_BOOK))
         return FALSE;
-    ShowWindow(m_hRadRangeTestament, SW_SHOW);
-	
-    m_hRadRangeBook = CreateWindow(_T("button"), L"This book", 
-		WS_CHILD | BS_RADIOBUTTON,
-		0,0,0,0,
-        hWnd, (HMENU)(IDC_RAD_BOOK), SRApp::GetInstanceHandle(), NULL);
-    if(!m_hRadRangeBook)
-        return FALSE;
-    ShowWindow(m_hRadRangeBook, SW_SHOW);
+    m_pRadRangeBook->Show();
 
-	m_hRadMethodMultiword = CreateWindow(_T("button"), L"Multi-word", 
-		WS_CHILD | BS_RADIOBUTTON,
-		0,0,0,0,
-		hWnd, (HMENU)(IDC_RAD_MWORD), SRApp::GetInstanceHandle(), NULL);
-    if(!m_hRadMethodMultiword)
+    m_pRadMethodMultiword = new SRRadioButton();
+    if(!m_pRadMethodMultiword || !m_pRadMethodMultiword->Create(this, "Multi-word", nullRECT, IDC_RAD_MWORD))
         return FALSE;
-    ::SendMessage(m_hRadMethodMultiword,BM_SETCHECK,BST_CHECKED,0);
+    m_pRadMethodMultiword->Show();
+    m_pRadMethodMultiword->Check();
     m_wMethodMode = SR_FIND_METHOD_MWORD;
-    ShowWindow(m_hRadMethodMultiword, SW_SHOW);
 
-	m_hRadMethodExactphrase = CreateWindow(_T("button"), L"Exact phrase", 
-		WS_CHILD | BS_RADIOBUTTON,
-		0,0,0,0, 
-		hWnd, (HMENU)(IDC_RAD_EPHRASE),SRApp::GetInstanceHandle(), NULL);
-    if(!m_hRadMethodExactphrase)
+    m_pRadMethodExactphrase = new SRRadioButton();
+    if(!m_pRadMethodExactphrase || !m_pRadMethodExactphrase->Create(this, "Exact Phrase", nullRECT, IDC_RAD_EPHRASE))
         return FALSE;
-    ShowWindow(m_hRadMethodExactphrase, SW_SHOW);
+    m_pRadMethodExactphrase->Show();
 
     m_pListBoxResults = new SRListBox();
     if(!m_pListBoxResults || !m_pListBoxResults->Create(this, nullRECT, IDC_LST_RESULTS))
@@ -267,11 +252,11 @@
 
     m_pEdtQuery->MoveWindow(col0,row0,queryW, btnH, TRUE);
     m_pButtonSearch->MoveWindow(col0 + queryW + pad, row0, searchBtnW, btnH, TRUE);
-    ::MoveWindow(m_hRadRangeBible,col0,row1,textW,btnH,TRUE);
-    ::MoveWindow(m_hRadRangeTestament,col0,row2,textW,btnH,TRUE);
-    ::MoveWindow(m_hRadRangeBook,col0,row3,textW,btnH,TRUE);
-    ::MoveWindow(m_hRadMethodMultiword,col1,row1,textW,btnH,TRUE);
-    ::MoveWindow(m_hRadMethodExactphrase,col1,row2,textW,btnH,TRUE);
+    m_pRadRangeBible->MoveWindow(col0,row1,textW,btnH,TRUE);
+    m_pRadRangeTestament->MoveWindow(col0,row2,textW,btnH,TRUE);
+    m_pRadRangeBook->MoveWindow(col0,row3,textW,btnH,TRUE);
+    m_pRadMethodMultiword->MoveWindow(col1,row1,textW,btnH,TRUE);
+    m_pRadMethodExactphrase->MoveWindow(col1,row2,textW,btnH,TRUE);
     m_pListBoxResults->MoveWindow(margin, row4, listW, listH, TRUE);
 	m_pProgressBar->MoveWindow(col0 + listW + pad,row4,progW,btnH,TRUE);
     m_pButtonGoTo->MoveWindow(col0 + listW + pad + progW + pad,row4, gotoBtnW,btnH,TRUE);

Modified: trunk/src/SwordReader_GUI/SRFind.h
===================================================================
--- trunk/src/SwordReader_GUI/SRFind.h	2008-09-22 01:57:20 UTC (rev 181)
+++ trunk/src/SwordReader_GUI/SRFind.h	2008-09-22 02:39:40 UTC (rev 182)
@@ -3,6 +3,7 @@
 #include "SRFramework/SRWnd.h"
 #include "SRFramework/SREdit.h"
 #include "SRFramework/SRButton.h"
+#include "SRFramework/SRRadioButton.h"
 #include "SRFramework/SRListBox.h"
 #include "SRFramework/SRProgress.h"
 #include <vector>

Modified: trunk/src/SwordReader_GUI/SRFramework/SRRadioButton.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRFramework/SRRadioButton.cpp	2008-09-22 01:57:20 UTC (rev 181)
+++ trunk/src/SwordReader_GUI/SRFramework/SRRadioButton.cpp	2008-09-22 02:39:40 UTC (rev 182)
@@ -23,10 +23,11 @@
 
 }
 
-BOOL SRRadioButton::Create(SRWnd *pParentWnd, RECT bounds, INT nChildID, DWORD dwStyle)
+BOOL SRRadioButton::Create(SRWnd *pParentWnd, const WCString &wcsLabel, RECT bounds, INT nChildID, DWORD dwStyle)
 {
     if(!Register())
         return FALSE;
+    m_wcsWindowName = wcsLabel;
     if(!SRWnd::Create(m_wcsClassName,m_wcsWindowName, dwStyle, bounds, pParentWnd, (HMENU)nChildID, m_hInstance))
         return FALSE;
     

Modified: trunk/src/SwordReader_GUI/SRFramework/SRRadioButton.h
===================================================================
--- trunk/src/SwordReader_GUI/SRFramework/SRRadioButton.h	2008-09-22 01:57:20 UTC (rev 181)
+++ trunk/src/SwordReader_GUI/SRFramework/SRRadioButton.h	2008-09-22 02:39:40 UTC (rev 182)
@@ -9,7 +9,7 @@
     public:
         SRRadioButton(VOID);
         virtual ~SRRadioButton(VOID);
-        BOOL Create(SRWnd *pParentWnd, RECT bounds, INT nChildID = NULL, DWORD dwStyle = WS_CHILD | BS_RADIOBUTTON);
+        BOOL Create(SRWnd *pParentWnd, const WCString &wcsLabel, RECT bounds, INT nChildID = NULL, DWORD dwStyle = WS_CHILD | BS_RADIOBUTTON);
         // Does not need to be registered the call to InitCommonControlsEx 
         // does that for us. 
         BOOL Register() { return TRUE; } 




More information about the sword-cvs mailing list