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.2 by sf-pippijn, Mon Oct 18 14:11:48 2010 UTC vs.
Revision 1.3 by sf-pippijn, Mon Oct 18 15:34:23 2010 UTC

16#include <cctype> 16#include <cctype>
17 17
18 18
19using ndk::edit; 19using ndk::edit;
20 20
21edit::edit (const std::string &str, panel *parent, bool accept) 21edit::edit (std::string const &str, panel *parent, bool accept)
22 : button (str, parent, accept) 22 : button (str, parent, accept)
23 , current_ (0) 23 , current_ (0)
24 , begin_ (0) 24 , begin_ (0)
25 , mode_ (normal) 25 , mode_ (normal)
26{ 26{
33{ 33{
34 button::resize (size, 1); 34 button::resize (size, 1);
35} 35}
36 36
37void 37void
38edit::set_text (const std::string &str) 38edit::set_text (std::string const &str)
39{ 39{
40 label::set_text (str); 40 label::set_text (str);
41 current_ = text_.length (); 41 current_ = text_.length ();
42 draw (); 42 draw ();
43} 43}
84 set_cursor (); /* and finally update cursor position */ 84 set_cursor (); /* and finally update cursor position */
85 ncurses::pen (*this).commit (); /* commit changes to the screen */ 85 ncurses::pen (*this).commit (); /* commit changes to the screen */
86} 86}
87 87
88ndk::event::result 88ndk::event::result
89edit::at_system (const event &ev) 89edit::at_system (event const &ev)
90{ 90{
91 event::result res = event::ignored; 91 event::result res = event::ignored;
92 92
93 if (!ev.sender_) 93 if (!ev.sender_)
94 { 94 {
106 } 106 }
107 return res; 107 return res;
108} 108}
109 109
110ndk::event::result 110ndk::event::result
111edit::at_keyboard (const keyboard &ev) 111edit::at_keyboard (keyboard const &ev)
112{ 112{
113 event::result res = event::ignored; 113 event::result res = event::ignored;
114 unsigned int pos = current_; 114 unsigned int pos = current_;
115 115
116 switch (ev.code ()) 116 switch (ev.code ())

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines