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

dtrotzjr at crosswire.org dtrotzjr at crosswire.org
Sat Jan 31 17:16:22 MST 2009


Author: dtrotzjr
Date: 2009-01-31 17:16:21 -0700 (Sat, 31 Jan 2009)
New Revision: 203

Modified:
   trunk/src/SwordReader_GUI/SRCommWidget.cpp
   trunk/src/SwordReader_GUI/SRCommWidget.h
   trunk/src/SwordReader_GUI/SRMainFrame.cpp
   trunk/src/SwordReader_GUI/SRSubWindow.cpp
   trunk/src/SwordReader_GUI/SRTabbedViews.cpp
   trunk/src/SwordReader_GUI/SRTabbedViews.h
Log:
Bible references work from commentaries now, but whole chapters are loaded in the pop-up and not just the single verses.

Modified: trunk/src/SwordReader_GUI/SRCommWidget.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRCommWidget.cpp	2009-01-31 23:43:33 UTC (rev 202)
+++ trunk/src/SwordReader_GUI/SRCommWidget.cpp	2009-02-01 00:16:21 UTC (rev 203)
@@ -82,9 +82,24 @@
     }
 }
 
+VOID SRCommWidget::ShowBibleRef(const WCString &key)
+{
+    if(!m_viewBibleRef)
+        return;
+    m_viewBibleRef->SetKey(key.c_str());
+    if(!m_fBibleRefVisible){
+        ShowBibleRefSubWindow();
+    }
+}
     
 VOID SRCommWidget::HideSubWindow(SRSubWindow *pSubWnd)
 {
     SRModuleWidget::HideSubWindow(pSubWnd);
     m_fBibleRefVisible = FALSE;
+}
+
+VOID SRCommWidget::SetBibleRefModule(SWModule *pModule)
+{
+    if(m_viewBibleRef)
+        m_viewBibleRef->SetModule(pModule);
 }
\ No newline at end of file

Modified: trunk/src/SwordReader_GUI/SRCommWidget.h
===================================================================
--- trunk/src/SwordReader_GUI/SRCommWidget.h	2009-01-31 23:43:33 UTC (rev 202)
+++ trunk/src/SwordReader_GUI/SRCommWidget.h	2009-02-01 00:16:21 UTC (rev 203)
@@ -12,12 +12,11 @@
     ~SRCommWidget();
     BOOL        Init();
     VOID        Show();
-    //VOID        ShowBibleRef(const WCString &note);
+    VOID        ShowBibleRef(const WCString &note);
     VOID        HideSubWindow(SRSubWindow *pSubWnd);
     VOID        ShowBibleRef(SWModule *pModule, const WCString &key);
-
     VOID        ShowBibleRefSubWindow();
-    
+    VOID        SetBibleRefModule(SWModule *pModule);
     VOID        SetSwordReady();
     
     BOOL        OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);

Modified: trunk/src/SwordReader_GUI/SRMainFrame.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRMainFrame.cpp	2009-01-31 23:43:33 UTC (rev 202)
+++ trunk/src/SwordReader_GUI/SRMainFrame.cpp	2009-02-01 00:16:21 UTC (rev 203)
@@ -411,7 +411,13 @@
             m_tabViews->ShowGreekMorph(wcsValue);
         if(wcsType.contains("Hebrew")) 
             m_tabViews->ShowHebrewMorph(wcsValue);
-    }else if(wcsURL.contains("scriptRef")){
+    }else if(wcsURL.contains("showRef")){
+        WCString wcsModule = url.getParameterValue("module"); // Ignored for now...
+		WCString wcsValue = url.getParameterValue("value");
+		WCString wcsType = url.getParameterValue("type");
+        if(wcsType == "scripRef"){
+            m_tabViews->ShowScriptRef(wcsValue);
+        }
         return TRUE;
     }
     return TRUE;

Modified: trunk/src/SwordReader_GUI/SRSubWindow.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRSubWindow.cpp	2009-01-31 23:43:33 UTC (rev 202)
+++ trunk/src/SwordReader_GUI/SRSubWindow.cpp	2009-02-01 00:16:21 UTC (rev 203)
@@ -1,6 +1,6 @@
 #include "SRFramework\SRApp.h"
 #include "SRSubWindow.h"
-#include "SRWidgetView.h"
+#include "SRModuleWidget.h"
 
 #include "resource.h"
 
@@ -114,7 +114,7 @@
     GetClientRect(m_hWnd, &clientRect);
 
     if(xPos > clientRect.right - 20 && yPos < clientRect.bottom){
-        SRWidgetView *parent = dynamic_cast<SRWidgetView*>(m_pParentWnd);
+        SRModuleWidget *parent = dynamic_cast<SRModuleWidget*>(m_pParentWnd);
         if(parent)
             parent->HideSubWindow(this);
         return TRUE;

Modified: trunk/src/SwordReader_GUI/SRTabbedViews.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRTabbedViews.cpp	2009-01-31 23:43:33 UTC (rev 202)
+++ trunk/src/SwordReader_GUI/SRTabbedViews.cpp	2009-02-01 00:16:21 UTC (rev 203)
@@ -95,9 +95,10 @@
     m_viewBible->Show();
     m_viewBible->Init();
     
-    m_viewComm = new SRModuleView(CommView);
+    m_viewComm = new SRCommWidget();
     if(!m_viewComm || !m_viewComm->Create(this, clientRect))
         return FALSE;
+    m_viewComm->Init();
     m_viewComm->Hide();
 
     m_viewDict = new SRLexiWidget();
@@ -175,6 +176,8 @@
 {
     if(m_viewBible)
         m_viewBible->SetModule(pModule);
+    if(m_viewComm)
+        m_viewComm->SetBibleRefModule(pModule);
 }
 
 const SWModule *SRTabbedViews::GetCommModule()
@@ -547,4 +550,10 @@
 {   
     if(m_viewBible)
         m_viewBible->ShowBibleNote(note);
-};
\ No newline at end of file
+}
+
+VOID SRTabbedViews::ShowScriptRef(const WCString &ref)
+{
+    if(m_viewComm)
+        m_viewComm->ShowBibleRef(ref);
+}
\ No newline at end of file

Modified: trunk/src/SwordReader_GUI/SRTabbedViews.h
===================================================================
--- trunk/src/SwordReader_GUI/SRTabbedViews.h	2009-01-31 23:43:33 UTC (rev 202)
+++ trunk/src/SwordReader_GUI/SRTabbedViews.h	2009-02-01 00:16:21 UTC (rev 203)
@@ -2,6 +2,7 @@
 #include "SRFramework/SRWnd.h"
 #include "SRFramework/SRTabCtrl.h"
 #include "SRBibleWidget.h"
+#include "SRCommWidget.h"
 #include "SRModuleView.h"
 #include "SRLexiWidget.h"
 
@@ -69,6 +70,7 @@
     VOID ShowGreekMorph(const WCString &key);
     VOID ShowHebrewMorph(const WCString &key);
     VOID ShowBibleNote(const WCString &note);
+    VOID ShowScriptRef(const WCString &ref);
 
     //VOID HyperLinkClicked();
     
@@ -85,7 +87,7 @@
     static BOOL s_fRegistered;
     
     SRBibleWidget *m_viewBible;
-    SRModuleView  *m_viewComm;
+    SRCommWidget  *m_viewComm;
     SRLexiWidget  *m_viewDict;
     VerseKey      m_keyLinked;
 };




More information about the sword-cvs mailing list