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 ... [relea


From: Udo Giacomozzi
Subject: [Gnash-commit] gnash ChangeLog server/edit_text_character.cpp ... [release_0_7_2]
Date: Sat, 04 Nov 2006 13:42:31 +0000

CVSROOT:        /cvsroot/gnash
Module name:    gnash
Branch:         release_0_7_2
Changes by:     Udo Giacomozzi <udog>   06/11/04 13:42:31

Modified files:
        .              : ChangeLog 
        server         : edit_text_character.cpp 
        server/parser  : edit_text_character_def.h 

Log message:
        don't catch mouse events when text field is not selectable

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.1412.2.74&r2=1.1412.2.75
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.22&r2=1.22.2.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/edit_text_character_def.h?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.7.2.1&r2=1.7.2.2

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.1412.2.74
retrieving revision 1.1412.2.75
diff -u -b -r1.1412.2.74 -r1.1412.2.75
--- ChangeLog   4 Nov 2006 12:43:50 -0000       1.1412.2.74
+++ ChangeLog   4 Nov 2006 13:42:31 -0000       1.1412.2.75
@@ -2,6 +2,10 @@
 
         * backend/render_handler_agg.cpp: removed compatibility include as
         it is not enough anyway; optimized screen and mask clearing
+        * server/parser/edit_text_character_def.h: added read method for
+        m_no-select
+        * server/edit_text_character.cpp: don't catch mouse events when
+        text feld is not selectable
 
 2006-11-04 Markus Gothe <address@hidden>
 

Index: server/edit_text_character.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.22
retrieving revision 1.22.2.1
diff -u -b -r1.22 -r1.22.2.1
--- server/edit_text_character.cpp      23 Oct 2006 19:03:46 -0000      1.22
+++ server/edit_text_character.cpp      4 Nov 2006 13:42:31 -0000       1.22.2.1
@@ -3,7 +3,7 @@
 // This source code has been donated to the Public Domain.  Do
 // whatever you want with it.
 
-/* $Id: edit_text_character.cpp,v 1.22 2006/10/23 19:03:46 strk Exp $ */
+/* $Id: edit_text_character.cpp,v 1.22.2.1 2006/11/04 13:42:31 udog Exp $ */
 
 #include "utf8.h"
 #include "log.h"
@@ -165,7 +165,7 @@
   }
 
 
-bool edit_text_character::on_event(event_id id)
+bool edit_text_character::on_event(const event_id& id)
 {
        if (m_def->get_readonly() == true)
        {
@@ -180,7 +180,7 @@
                        {
                                get_root()->add_keypress_listener(this);
                                m_has_focus = true;
-                               m_cursor = m_text.size();
+                               m_cursor = _text.size();
                                format_text();
                        }
                        break;
@@ -200,12 +200,12 @@
 
                case event_id::KEY_PRESS:
                {
-                       std::string s(m_text.c_str());
+                       std::string s(_text);
                        std::string c;
                        c = (char) id.m_key_code;
 
-                       // may be m_text is changed in ActionScript
-                       m_cursor = imin(m_cursor, m_text.size());
+                       // may be _text is changed in ActionScript
+                       m_cursor = imin(m_cursor, _text.size());
 
                        switch (c[0])
                        {
@@ -239,7 +239,7 @@
                                case key::END:
                                case key::PGDN:
                                case key::DOWN:
-                                       m_cursor = m_text.size();
+                                       m_cursor = _text.size();
                                        format_text();
                                        break;
 
@@ -249,7 +249,7 @@
                                        break;
 
                                case key::RIGHT:
-                                       m_cursor = m_cursor < m_text.size() ? 
m_cursor + 1 : m_text.size();
+                                       m_cursor = m_cursor < _text.size() ? 
m_cursor + 1 : _text.size();
                                        format_text();
                                        break;
 
@@ -276,6 +276,12 @@
                return NULL;
        }
 
+       if (m_def->get_no_select())
+       {
+         // not selectable, so don't catch mouse events!
+         return NULL;
+  }
+
        matrix  m = get_matrix();
                
        point   p;
@@ -290,20 +296,23 @@
 }
 
 void
-edit_text_character::set_text_value(const char* new_text)
+edit_text_character::set_text_value(const char* new_text_cstr)
 {
-       if (m_text == new_text)
+       std::string new_text;
+       if ( new_text_cstr ) new_text = new_text_cstr;
+
+       if (_text == new_text)
        {
                return;
        }
 
        set_invalidated();
 
-       m_text = new_text;
+       _text = new_text;
        if (m_def->get_max_length() > 0
-           && m_text.length() > m_def->get_max_length() )
+           && _text.length() > m_def->get_max_length() )
        {
-               m_text.resize(m_def->get_max_length());
+               _text.resize(m_def->get_max_length());
        }
 
        format_text();
@@ -397,7 +406,7 @@
        case M_TEXT:
                //if (name == "text")
        {
-               val->set_tu_string(m_text);
+               val->set_string(_text.c_str());
                return true;
        }
        case M_VISIBLE:
@@ -608,7 +617,8 @@
        m_xcursor = x;
        m_ycursor = y;
 
-       const char*     text = &m_text[0];
+       assert(! _text.empty() );
+       const char*     text = &_text[0]; 
        while (uint32_t code = utf8::decode_next_unicode_character(&text))
        {
 // @@ try to truncate overflow text??
@@ -822,7 +832,7 @@
        // If the variable string contains a path, we extract
        // the appropriate target from it and update the variable
        // name
-       tu_string path, var;
+       std::string path, var;
        if ( as_environment::parse_path(varname, path, var) )
        {
                // find target for the path component

Index: server/parser/edit_text_character_def.h
===================================================================
RCS file: /cvsroot/gnash/gnash/server/parser/edit_text_character_def.h,v
retrieving revision 1.7.2.1
retrieving revision 1.7.2.2
diff -u -b -r1.7.2.1 -r1.7.2.2
--- server/parser/edit_text_character_def.h     30 Oct 2006 14:28:54 -0000      
1.7.2.1
+++ server/parser/edit_text_character_def.h     4 Nov 2006 13:42:31 -0000       
1.7.2.2
@@ -197,6 +197,11 @@
                return m_readonly;
        }
        
+       bool get_no_select() const 
+       {
+         return m_no_select;
+  }
+       
        const rect&     get_bound() const {
          // I know it's stupid to have an alias that's nearly the same name but
     // get_bound() is required by the base class and get_bounds() was already




reply via email to

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