[rkward-cvs] SF.net SVN: rkward: [1552] trunk/rkward/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Mar 8 10:22:51 UTC 2007


Revision: 1552
          http://svn.sourceforge.net/rkward/?rev=1552&view=rev
Author:   tfry
Date:     2007-03-08 02:22:50 -0800 (Thu, 08 Mar 2007)

Log Message:
-----------
Some focus improvements

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rembedinternal.cpp
    trunk/rkward/rkward/rbackend/rembedinternal.h
    trunk/rkward/rkward/rbackend/rthread.h
    trunk/rkward/rkward/rkward.cpp
    trunk/rkward/rkward/robjectbrowser.cpp
    trunk/rkward/rkward/windows/rkhelpsearchwindow.cpp
    trunk/rkward/rkward/windows/rkmdiwindow.cpp
    trunk/rkward/rkward/windows/rkmdiwindow.h

Modified: trunk/rkward/rkward/rbackend/rembedinternal.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rembedinternal.cpp	2007-03-08 07:50:58 UTC (rev 1551)
+++ trunk/rkward/rkward/rbackend/rembedinternal.cpp	2007-03-08 10:22:50 UTC (rev 1552)
@@ -2,7 +2,7 @@
                           rembedinternal  -  description
                              -------------------
     begin                : Sun Jul 25 2004
-    copyright            : (C) 2004 by Thomas Friedrichsmeier
+    copyright            : (C) 2004, 2005, 2006, 2007 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 

Modified: trunk/rkward/rkward/rbackend/rembedinternal.h
===================================================================
--- trunk/rkward/rkward/rbackend/rembedinternal.h	2007-03-08 07:50:58 UTC (rev 1551)
+++ trunk/rkward/rkward/rbackend/rembedinternal.h	2007-03-08 10:22:50 UTC (rev 1552)
@@ -2,7 +2,7 @@
                           rembedinternal  -  description
                              -------------------
     begin                : Sun Jul 25 2004
-    copyright            : (C) 2004 by Thomas Friedrichsmeier
+    copyright            : (C) 2004, 2005, 2006, 2007 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -168,7 +168,7 @@
 private:
 // can't declare this as part of the class, as it would confuse REmbed
 //	SEXPREC *runCommandInternalBase (const char *command, bool *error);
-	QTextCodec *current_locale_codec;
+	QTextCodec *current_locale_codec;		// steal from QTextCodec::setupLocaleMapper to initialize
 };
  
 #endif

Modified: trunk/rkward/rkward/rbackend/rthread.h
===================================================================
--- trunk/rkward/rkward/rbackend/rthread.h	2007-03-08 07:50:58 UTC (rev 1551)
+++ trunk/rkward/rkward/rbackend/rthread.h	2007-03-08 10:22:50 UTC (rev 1552)
@@ -2,7 +2,7 @@
                           rthread  -  description
                              -------------------
     begin                : Mon Aug 2 2004
-    copyright            : (C) 2004, 2006 by Thomas Friedrichsmeier
+    copyright            : (C) 2004, 2006, 2007 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 

Modified: trunk/rkward/rkward/rkward.cpp
===================================================================
--- trunk/rkward/rkward/rkward.cpp	2007-03-08 07:50:58 UTC (rev 1551)
+++ trunk/rkward/rkward/rkward.cpp	2007-03-08 10:22:50 UTC (rev 1552)
@@ -580,12 +580,13 @@
 	RK_TRACE (APP);
 	RK_ASSERT (tool_window);
 
-	if (tool_window->hasFocus ()) {
+	if (tool_window->isActive ()) {
 		tool_window->close (false);
-		setFocus ();
+		setFocus ();	// in case there is no active document window, focus the main window
 		activateDocumentView ();
+	} else {
+		tool_window->activate ();
 	}
-	else tool_window->activate ();
 }
 
 void RKWardMainWindow::showHelpSearch () {

Modified: trunk/rkward/rkward/robjectbrowser.cpp
===================================================================
--- trunk/rkward/rkward/robjectbrowser.cpp	2007-03-08 07:50:58 UTC (rev 1551)
+++ trunk/rkward/rkward/robjectbrowser.cpp	2007-03-08 10:22:50 UTC (rev 1552)
@@ -86,6 +86,7 @@
 void RObjectBrowser::focusInEvent (QFocusEvent *e) {
 	RK_TRACE (APP);
 
+	list_view->setFocus ();
 	if (e->reason () != QFocusEvent::Mouse) {
 		list_view->setObjectCurrent (RObjectList::getGlobalEnv (), true);
 	}

Modified: trunk/rkward/rkward/windows/rkhelpsearchwindow.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkhelpsearchwindow.cpp	2007-03-08 07:50:58 UTC (rev 1551)
+++ trunk/rkward/rkward/windows/rkhelpsearchwindow.cpp	2007-03-08 10:22:50 UTC (rev 1552)
@@ -113,6 +113,7 @@
 void RKHelpSearchWindow::focusInEvent (QFocusEvent *e) {
 	RK_TRACE (APP);
 
+	RKMDIWindow::focusInEvent (e);
 	if (e->reason () != QFocusEvent::Mouse) {
 		field->setFocus ();
 	}

Modified: trunk/rkward/rkward/windows/rkmdiwindow.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkmdiwindow.cpp	2007-03-08 07:50:58 UTC (rev 1551)
+++ trunk/rkward/rkward/windows/rkmdiwindow.cpp	2007-03-08 10:22:50 UTC (rev 1552)
@@ -146,7 +146,7 @@
 
 	QFrame::paintEvent (e);
 
-	if (active) {
+	if (isActive ()) {
 		QPainter paint (this);
 		paint.setPen (QColor (255, 0, 0));
 		paint.drawLine (0, 0, 0, height ()-1);

Modified: trunk/rkward/rkward/windows/rkmdiwindow.h
===================================================================
--- trunk/rkward/rkward/windows/rkmdiwindow.h	2007-03-08 07:50:58 UTC (rev 1551)
+++ trunk/rkward/rkward/windows/rkmdiwindow.h	2007-03-08 10:22:50 UTC (rev 1552)
@@ -87,6 +87,8 @@
 /** For tool windows only (and perhaps for KDE3 only): set the wrapper widget that should be shown/raised on activation */
 	void setToolWrapper (KMdiToolViewAccessor *wrapper_widget) { wrapper = wrapper_widget; };
 	bool eventFilter (QObject *watched, QEvent *e);
+/** Whether the window is active. This seems to be more reliable than hasFocus () */
+	bool isActive () { return active; };
 signals:
 /** This signal is emitted, whenever the window caption was changed.
 @param RKMDIWindow* a pointer to this window */


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list