ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/dclient/src/backend/ndk/edit.cpp
(Generate patch)

Comparing deliantra/dclient/src/backend/ndk/edit.cpp (file contents):
Revision 1.6 by sf-pippijn, Sun Oct 24 20:31:50 2010 UTC vs.
Revision 1.8 by sf-pippijn, Fri Jan 21 21:54:01 2011 UTC

76 break; 76 break;
77 default: 77 default:
78 break; 78 break;
79 } 79 }
80 80
81 if (begin_ > out.length ())
82 begin_ = out.length ();
83
81 label::draw (out, begin_); /* and draw */ 84 label::draw (out, begin_); /* and draw */
82 set_cursor (); /* and finally update cursor position */ 85 set_cursor (); /* and finally update cursor position */
83 pen (*this).commit (); /* commit changes to the screen */ 86 pen (*this).commit (); /* commit changes to the screen */
84} 87}
85 88
86ndk::event::result 89ndk::event::result
87edit::at_system (event const &ev) 90edit::at_system (event const &ev)
88{ 91{
136 { 139 {
137 erase (pos); 140 erase (pos);
138 draw (); /* we always need full redraw */ 141 draw (); /* we always need full redraw */
139 res = event::accepted; 142 res = event::accepted;
140 } 143 }
144 break;
145 case key::ctrl_u:
146 if (pos)
147 {
148 /* delete all characters up to the current */
149 text_ = text_.substr (pos, text_.length () - pos);
150 current_ = 0;
151 recalibrate (); // TODO: ? draw () : set_cursor (); // or always draw?
152 draw ();
153 pos = 0;
154 }
155 res = event::accepted;
141 break; 156 break;
142 case key::home: 157 case key::home:
143 begin_ = 0; 158 begin_ = 0;
144 current_ = 0; 159 current_ = 0;
145 draw (); 160 draw ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines