gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp ...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/edit_text_character.cpp ...
Date: Thu, 18 Oct 2007 16:28:45 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/10/18 16:28:45

Modified files:
        .              : ChangeLog 
        server         : edit_text_character.cpp edit_text_character.h 

Log message:
                * server/edit_text_character.{cpp,h}: fix an invalidated bounds
                  problem on set/kill focus.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4635&r2=1.4636
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.127&r2=1.128
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.h?cvsroot=gnash&r1=1.57&r2=1.58

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4635
retrieving revision 1.4636
diff -u -b -r1.4635 -r1.4636
--- ChangeLog   18 Oct 2007 15:56:54 -0000      1.4635
+++ ChangeLog   18 Oct 2007 16:28:45 -0000      1.4636
@@ -1,3 +1,8 @@
+2007-10-18 Sandro Santilli <address@hidden>
+
+       * server/edit_text_character.{cpp,h}: fix an invalidated bounds
+         problem on set/kill focus.
+
 2007-10-18 Tomas Groth Christensen <address@hidden>
 
        * 
libmedia/VideoDecoder.h,libmedia/gst/VideoDecoder{Ffmpeg.Gst}.{h,cpp}: 

Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -b -r1.127 -r1.128
--- server/edit_text_character.cpp      18 Oct 2007 13:51:33 -0000      1.127
+++ server/edit_text_character.cpp      18 Oct 2007 16:28:45 -0000      1.128
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: edit_text_character.cpp,v 1.127 2007/10/18 13:51:33 strk Exp $ */
+/* $Id: edit_text_character.cpp,v 1.128 2007/10/18 16:28:45 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -575,30 +575,13 @@
        {
                case event_id::SETFOCUS:
                {
-                       if (m_has_focus == false)
-                       {
-#ifdef NEW_KEY_LISTENER_LIST_DESIGN
-                               
_vm.getRoot().add_key_listener(KeyListener(this, KeyListener::ON_CLIP_DEF));
-#else
-                               _vm.getRoot().add_key_listener(this);
-#endif
-                               m_has_focus = true;
-                               m_cursor = _text.size();
-                               format_text();
-                       }
+                       setFocus();
                        break;
                }
 
                case event_id::KILLFOCUS:
                {
-                       if (m_has_focus == true)
-                       {
-                               movie_root& root = _vm.getRoot();
-                               root.setFocus(NULL);
-                               root.remove_key_listener(this);
-                               m_has_focus = false;
-                               format_text();
-                       }
+                       killFocus();
                        break;
                }
 
@@ -2079,6 +2062,40 @@
        callMethod(key, env);
 }
 
+void
+edit_text_character::setFocus()
+{
+       if ( m_has_focus ) return; // nothing to do
+
+       set_invalidated();
+
+       m_has_focus = true;
+
+#ifdef NEW_KEY_LISTENER_LIST_DESIGN
+       _vm.getRoot().add_key_listener(KeyListener(this, 
KeyListener::ON_CLIP_DEF));
+#else
+       _vm.getRoot().add_key_listener(this);
+#endif
+
+       m_cursor = _text.size();
+       format_text();
+}
+
+void
+edit_text_character::killFocus()
+{
+       if ( ! m_has_focus ) return; // nothing to do
+
+       set_invalidated();
+
+       m_has_focus = false;
+
+       movie_root& root = _vm.getRoot();
+       root.setFocus(NULL);
+       root.remove_key_listener(this);
+       format_text(); // is this needed ?
+}
+
 } // namespace gnash
 
 

Index: server/edit_text_character.h
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- server/edit_text_character.h        18 Oct 2007 14:13:04 -0000      1.57
+++ server/edit_text_character.h        18 Oct 2007 16:28:45 -0000      1.58
@@ -280,6 +280,12 @@
 
 private:
 
+       /// Set focus 
+       void setFocus();
+
+       /// Kill focus 
+       void killFocus();
+
        /// Call this function when willing to invoke the onChanged event 
handler
        void onChanged();
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]