[sword-svn] r207 - trunk/src/SwordReader_GUI

dtrotzjr at crosswire.org dtrotzjr at crosswire.org
Sun Feb 1 12:28:44 MST 2009


Author: dtrotzjr
Date: 2009-02-01 12:28:44 -0700 (Sun, 01 Feb 2009)
New Revision: 207

Added:
   trunk/src/SwordReader_GUI/SRAboutView.cpp
   trunk/src/SwordReader_GUI/SRAboutView.h
Modified:
   trunk/src/SwordReader_GUI/SRLexiWidget.cpp
   trunk/src/SwordReader_GUI/SRLexiWidget.h
   trunk/src/SwordReader_GUI/SRMainFrame.cpp
   trunk/src/SwordReader_GUI/SRTabbedViews.cpp
   trunk/src/SwordReader_GUI/SRTabbedViews.h
   trunk/src/SwordReader_GUI/SwordReaderResource.h
   trunk/src/SwordReader_GUI/SwordReader_GUI.vcproj
Log:
Added an "About" view.

Added: trunk/src/SwordReader_GUI/SRAboutView.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRAboutView.cpp	                        (rev 0)
+++ trunk/src/SwordReader_GUI/SRAboutView.cpp	2009-02-01 19:28:44 UTC (rev 207)
@@ -0,0 +1,36 @@
+#include "SRAboutView.h"
+#include "SwordReaderResource.h"
+
+
+SRAboutView::SRAboutView()
+{
+    m_wcsAbout  = "<html><body><b><font size=\"+0\">SwordReader</font></b> v";
+    m_wcsAbout += SR_VERSION_STRING;
+    m_wcsAbout += "<br>";
+    m_wcsAbout += "Built on: ";
+    m_wcsAbout += __DATE__;
+    m_wcsAbout += " at: ";
+    m_wcsAbout += __TIME__;
+    m_wcsAbout += "<br>";
+    m_wcsAbout += "  Bible software for Windows Mobile.<br>";
+    m_wcsAbout += "  http://www.swordreader.org<br>";
+    m_wcsAbout += "(c) 2006-2009 Copyright Crosswire Bible Society under terms of GNU GPL v2<br><br><br>";
+    m_wcsAbout += "<b>Credits:</b><br><br>";
+    m_wcsAbout += "Original concept and code by:<br>";
+    m_wcsAbout += "  Johan Gorter<br><br>";
+    m_wcsAbout += "Lead Developer:<br>";
+    m_wcsAbout += "  David Trotz Jr. dtrotzjr at crosswire.org<br><br>";
+    m_wcsAbout += "Code contributions made by:<br>";
+    m_wcsAbout += "  Barry Drake, Albert L. Sites Jr., ...<br><br>";
+    m_wcsAbout += "Testing contributions by:<br>";
+    m_wcsAbout += "  Barry Drake, Robin Randall, John Mitchell, ...<br><br>";
+
+
+
+    AddText(m_wcsAbout.w_str(), m_wcsAbout.length());
+}
+
+SRAboutView::~SRAboutView()
+{
+
+}
\ No newline at end of file

Added: trunk/src/SwordReader_GUI/SRAboutView.h
===================================================================
--- trunk/src/SwordReader_GUI/SRAboutView.h	                        (rev 0)
+++ trunk/src/SwordReader_GUI/SRAboutView.h	2009-02-01 19:28:44 UTC (rev 207)
@@ -0,0 +1,11 @@
+#pragma once
+#include "SRTextView.h"
+
+class SRAboutView : public SRTextView
+{
+public:
+    SRAboutView();
+    ~SRAboutView();
+private:
+    WCString m_wcsAbout;
+};
\ No newline at end of file

Modified: trunk/src/SwordReader_GUI/SRLexiWidget.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRLexiWidget.cpp	2009-02-01 17:51:01 UTC (rev 206)
+++ trunk/src/SwordReader_GUI/SRLexiWidget.cpp	2009-02-01 19:28:44 UTC (rev 207)
@@ -248,4 +248,13 @@
         }
     }
     return TRUE;
+}
+
+BOOL SRLexiWidget::OnPaint()
+{
+    PAINTSTRUCT ps;
+    HDC hdc = BeginPaint(m_hWnd, &ps);
+    FillRect(hdc, &ps.rcPaint,(HBRUSH)GetStockObject(WHITE_BRUSH));
+    EndPaint(m_hWnd, &ps);
+    return TRUE;
 }
\ No newline at end of file

Modified: trunk/src/SwordReader_GUI/SRLexiWidget.h
===================================================================
--- trunk/src/SwordReader_GUI/SRLexiWidget.h	2009-02-01 17:51:01 UTC (rev 206)
+++ trunk/src/SwordReader_GUI/SRLexiWidget.h	2009-02-01 19:28:44 UTC (rev 207)
@@ -27,6 +27,7 @@
     BOOL            OnCommand(WORD wNotifyCode, WORD wID, HWND hWndCtl);
 
     BOOL            OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
+    BOOL            OnPaint();
     WCString        GetWindowTitle();
 private:
     static BOOL s_fRegistered;

Modified: trunk/src/SwordReader_GUI/SRMainFrame.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRMainFrame.cpp	2009-02-01 17:51:01 UTC (rev 206)
+++ trunk/src/SwordReader_GUI/SRMainFrame.cpp	2009-02-01 19:28:44 UTC (rev 207)
@@ -279,7 +279,8 @@
             ::SendMessage (m_hWnd, WM_CLOSE, 0, 0);
             break;
         case MENU_ABOUT:
-            ::MessageBox(0, L"Sword reader program for Pocket PC ver. 1.0.1\n\nsee: http://www.crosswire.org/sword/swordreader/\n\nGUI by Johan Gorter, 2004\nNow being maintained by B. Drake, Robin Randall and David Trotz\nProverbs 16:3", L"About", MB_OK);
+            //::MessageBox(0, L"Sword reader program for Pocket PC ver. 1.0.1\n\nsee: http://www.crosswire.org/sword/swordreader/\n\nGUI by Johan Gorter, 2004\nNow being maintained by B. Drake, Robin Randall and David Trotz\nProverbs 16:3", L"About", MB_OK);
+            m_tabViews->ManualChangeCurrentTab(SR_TAB_ABOUT);
             break;
         case MENU_SHUTDOWN:
             ::SendMessage(m_hWnd, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), (LPARAM)m_hWnd);

Modified: trunk/src/SwordReader_GUI/SRTabbedViews.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRTabbedViews.cpp	2009-02-01 17:51:01 UTC (rev 206)
+++ trunk/src/SwordReader_GUI/SRTabbedViews.cpp	2009-02-01 19:28:44 UTC (rev 207)
@@ -5,6 +5,10 @@
 BOOL SRTabbedViews::s_fRegistered = false;
 
 SRTabbedViews::SRTabbedViews(void)
+:m_viewBible(NULL)
+,m_viewComm(NULL)
+,m_viewDict(NULL)
+,m_viewAbout(NULL)
 {
     m_wcsClassName = "SRTabbedViews";
     m_wcsWindowName = "";
@@ -21,6 +25,8 @@
         delete m_viewComm;
     if(m_viewDict)
         delete m_viewDict;
+    if(m_viewAbout)
+        delete m_viewAbout;
 }
 
 BOOL SRTabbedViews::Create(SRWnd *pParentWnd, RECT bounds)
@@ -107,12 +113,19 @@
     m_viewDict->Init();
     m_viewDict->Hide();
 
+    m_viewAbout = new SRAboutView();
+    if(!m_viewAbout || !m_viewAbout->Create(this, clientRect))
+        return FALSE;
+    m_viewAbout->Hide();
+
     // Create the tab control
     if(!m_tabs.Create(this, clientRect, WS_CHILD | WS_VISIBLE | TCS_BOTTOM | TCS_FOCUSNEVER))
         return FALSE;
     if(!InitTabs())
         return FALSE;
 
+
+
     // Adjust the windows for the tabs...
     m_tabs.GetItemRect(0, &tab_rect);
     tab_rect.bottom += 2;
@@ -131,6 +144,7 @@
     m_viewBible->MoveWindow(&views_rect, TRUE);
     m_viewComm->MoveWindow(&views_rect, TRUE);
     m_viewDict->MoveWindow(&views_rect, TRUE);
+    m_viewAbout->MoveWindow(&views_rect, TRUE);
 
     return TRUE;
 }
@@ -145,9 +159,6 @@
     SRTextView *view = dynamic_cast<SRTextView*>(GetCurrentView());
     if(view)
         return view->UpdateWindow();
-    SRLexiWidget *lexi = dynamic_cast<SRLexiWidget*>(GetCurrentView());
-    //if(lexi)
-    //    return lexi->UpdateWindow();
     return FALSE;
 }
 
@@ -429,6 +440,7 @@
         SwitchToCurrentView();
         if(m_pParentWnd)
             m_pParentWnd->SetFocus(); // Give focus back to the parent.
+        m_tabs.RefreshWindow(); // Make sure the tabs reflect the current switch.
         break;
     default:
         return FALSE;
@@ -446,6 +458,8 @@
         }
         if(m_viewDict)
             m_viewDict->Hide();
+        if(m_viewAbout)
+            m_viewAbout->Hide();
         if(m_viewBible){
             m_viewBible->SetKey(m_keyLinked);
             m_viewBible->Show();
@@ -457,22 +471,33 @@
         }
         if(m_viewDict)
             m_viewDict->Hide();
+        if(m_viewAbout)
+            m_viewAbout->Hide();
         if(m_viewComm){
             m_viewComm->SetKey(m_keyLinked);
             m_viewComm->Show();
         }
         return SR_TAB_COMM;
     case SR_TAB_DICT:
-        if(m_viewBible){
+        if(m_viewBible)
             m_viewBible->Hide();
-        }
-        if(m_viewComm){
+        if(m_viewComm)
             m_viewComm->Hide();
-        }
-        if(m_viewDict){
+        if(m_viewAbout)
+            m_viewAbout->Hide();
+        if(m_viewDict)
             m_viewDict->Show();
-        }
         return SR_TAB_DICT;
+    case SR_TAB_ABOUT:
+        if(m_viewBible)
+            m_viewBible->Hide();
+        if(m_viewComm)
+            m_viewComm->Hide();
+        if(m_viewDict)
+            m_viewDict->Hide();
+        if(m_viewAbout)
+            m_viewAbout->Show();
+        return SR_TAB_ABOUT;
     }
     return -1;
 }

Modified: trunk/src/SwordReader_GUI/SRTabbedViews.h
===================================================================
--- trunk/src/SwordReader_GUI/SRTabbedViews.h	2009-02-01 17:51:01 UTC (rev 206)
+++ trunk/src/SwordReader_GUI/SRTabbedViews.h	2009-02-01 19:28:44 UTC (rev 207)
@@ -5,11 +5,8 @@
 #include "SRCommWidget.h"
 #include "SRModuleView.h"
 #include "SRLexiWidget.h"
+#include "SRAboutView.h"
 
-#define SR_TAB_BIBLE 0
-#define SR_TAB_COMM  1
-#define SR_TAB_DICT  2
-#define SR_TAB_ABOUT 3
 
 using namespace SRFramework;
 using namespace sword;
@@ -89,5 +86,6 @@
     SRBibleWidget *m_viewBible;
     SRCommWidget  *m_viewComm;
     SRLexiWidget  *m_viewDict;
+    SRAboutView    *m_viewAbout;
     VerseKey      m_keyLinked;
 };

Modified: trunk/src/SwordReader_GUI/SwordReaderResource.h
===================================================================
--- trunk/src/SwordReader_GUI/SwordReaderResource.h	2009-02-01 17:51:01 UTC (rev 206)
+++ trunk/src/SwordReader_GUI/SwordReaderResource.h	2009-02-01 19:28:44 UTC (rev 207)
@@ -18,7 +18,10 @@
  9) More to come...
 
  *****************************************************************************/
+#include "SRFramework/WCString.h"
 
+const SRFramework::WCString SR_VERSION_STRING = "1.9 alpha 3";
+
 struct ltstr
 {
   bool operator()(const char* s1, const char* s2) const
@@ -74,6 +77,13 @@
 #define BUTTON_NT_FOREGROUND    0x00008888
 
 #define SR_STATUS_BAR_HEIGHT    12
+
+// Main view tabs
+#define SR_TAB_BIBLE 0
+#define SR_TAB_COMM  1
+#define SR_TAB_DICT  2
+#define SR_TAB_ABOUT 3
+
 #ifdef LOGSTUFF
     #define _LG_(id, txt, type) \
     { \

Modified: trunk/src/SwordReader_GUI/SwordReader_GUI.vcproj
===================================================================
--- trunk/src/SwordReader_GUI/SwordReader_GUI.vcproj	2009-02-01 17:51:01 UTC (rev 206)
+++ trunk/src/SwordReader_GUI/SwordReader_GUI.vcproj	2009-02-01 19:28:44 UTC (rev 207)
@@ -866,6 +866,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\SRAboutView.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\SRBibleWidget.cpp"
 				>
 			</File>
@@ -1003,6 +1007,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\SRAboutView.h"
+				>
+			</File>
+			<File
 				RelativePath=".\SRBibleWidget.h"
 				>
 			</File>
@@ -1144,11 +1152,11 @@
 			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
 			>
 			<File
-				RelativePath=".\BibleReader.ICO"
+				RelativePath="..\gui\BibleReader.ICO"
 				>
 			</File>
 			<File
-				RelativePath="..\gui\BibleReader.ICO"
+				RelativePath=".\BibleReader.ICO"
 				>
 			</File>
 			<File




More information about the sword-cvs mailing list