X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fentry.cpp;h=0e1414ce74339b7fd98e67a9f0354f18df1375a3;hb=d88af5a7898020e4493fef8ec0cb9e88666b66df;hp=ec6bba702983081fa0de856911da0484a3b50953;hpb=c1faa54a3218b53757b8b55de0ff8aa64412253b;p=libs%2Fgltk.git diff --git a/source/entry.cpp b/source/entry.cpp index ec6bba7..0e1414c 100644 --- a/source/entry.cpp +++ b/source/entry.cpp @@ -126,7 +126,7 @@ void Entry::render_special(const Part &part) const slider->render(); } -void Entry::key_press(unsigned key, unsigned, wchar_t ch) +void Entry::key_press(unsigned key, unsigned) { if(key==Input::KEY_LEFT) { @@ -181,9 +181,13 @@ void Entry::key_press(unsigned key, unsigned, wchar_t ch) else signal_enter.emit(); } - else if(ch>=' ') +} + +void Entry::character(wchar_t ch) +{ + if(ch>=' ') { - text.insert(edit_pos, Codecs::encode(Codecs::ustring(1, ch))); + text.insert(edit_pos, StringCodec::encode(StringCodec::ustring(1, ch))); ++edit_pos; } }