[Top][All Lists]
[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 18:54:33 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/10/18 18:54:33
Modified files:
. : ChangeLog
server : edit_text_character.cpp edit_text_character.h
Log message:
* server/edit_text_character.{cpp,h}: send onSetFocus and
onKillFocus
events.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4636&r2=1.4637
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.128&r2=1.129
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.h?cvsroot=gnash&r1=1.58&r2=1.59
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4636
retrieving revision 1.4637
diff -u -b -r1.4636 -r1.4637
--- ChangeLog 18 Oct 2007 16:28:45 -0000 1.4636
+++ ChangeLog 18 Oct 2007 18:54:32 -0000 1.4637
@@ -1,5 +1,10 @@
2007-10-18 Sandro Santilli <address@hidden>
+ * server/edit_text_character.{cpp,h}: send onSetFocus and onKillFocus
+ events.
+
+2007-10-18 Sandro Santilli <address@hidden>
+
* server/edit_text_character.{cpp,h}: fix an invalidated bounds
problem on set/kill focus.
Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -b -r1.128 -r1.129
--- server/edit_text_character.cpp 18 Oct 2007 16:28:45 -0000 1.128
+++ server/edit_text_character.cpp 18 Oct 2007 18:54:33 -0000 1.129
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: edit_text_character.cpp,v 1.128 2007/10/18 16:28:45 strk Exp $ */
+/* $Id: edit_text_character.cpp,v 1.129 2007/10/18 18:54:33 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -2063,6 +2063,24 @@
}
void
+edit_text_character::onSetFocus()
+{
+ string_table& st = _vm.getStringTable();
+ string_table::key key = st.find(PROPNAME("onSetFocus"));
+ as_environment& env =
const_cast<edit_text_character*>(this)->get_environment();
+ callMethod(key, env);
+}
+
+void
+edit_text_character::onKillFocus()
+{
+ string_table& st = _vm.getStringTable();
+ string_table::key key = st.find(PROPNAME("onKillFocus"));
+ as_environment& env =
const_cast<edit_text_character*>(this)->get_environment();
+ callMethod(key, env);
+}
+
+void
edit_text_character::setFocus()
{
if ( m_has_focus ) return; // nothing to do
@@ -2079,6 +2097,8 @@
m_cursor = _text.size();
format_text();
+
+ onSetFocus();
}
void
@@ -2094,6 +2114,8 @@
root.setFocus(NULL);
root.remove_key_listener(this);
format_text(); // is this needed ?
+
+ onKillFocus();
}
} // namespace gnash
Index: server/edit_text_character.h
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.h,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- server/edit_text_character.h 18 Oct 2007 16:28:45 -0000 1.58
+++ server/edit_text_character.h 18 Oct 2007 18:54:33 -0000 1.59
@@ -289,6 +289,12 @@
/// Call this function when willing to invoke the onChanged event
handler
void onChanged();
+ /// Call this function when willing to invoke the onSetFocus event
handler
+ void onSetFocus();
+
+ /// Call this function when willing to invoke the onKillFocus event
handler
+ void onKillFocus();
+
/// The actual text
std::string _text;