X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Finput.cpp;h=d56cc1b0c5b42e9b11410612e8d3d3fc70396faf;hb=ae0600f7c3df5b6ef46992b1423888dd0e9a5026;hp=1b1864687ca33d1e6da0aab22d98b1dbd639a3a4;hpb=6c61179fe09af2f5366d50f10aadbf5f83438087;p=r2c2.git diff --git a/source/designer/input.cpp b/source/designer/input.cpp index 1b18646..d56cc1b 100644 --- a/source/designer/input.cpp +++ b/source/designer/input.cpp @@ -1,26 +1,33 @@ -#include +/* $Id$ + +This file is part of the MSP Märklin suite +Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa +Distributed under the GPL +*/ + #include #include +#include #include "designer.h" #include "input.h" using namespace std; using namespace Msp; -Input::Input(Designer &d, const string &t, const string &e): +::Input::Input(Designer &d, const string &t, const string &e): designer(d), title(t), text(e), pos(text.size()) { } -void Input::key_press(unsigned key, unsigned, wchar_t ch) +void ::Input::key_press(unsigned key, unsigned, wchar_t ch) { - if(key==SDLK_RETURN) + if(key==Msp::Input::KEY_ENTER) signal_accept.emit(); - else if(key==SDLK_ESCAPE) + else if(key==Msp::Input::KEY_ESC) signal_cancel.emit(); - else if(key==SDLK_BACKSPACE) + else if(key==Msp::Input::KEY_BACKSPACE) { if(pos>0) { @@ -28,17 +35,17 @@ void Input::key_press(unsigned key, unsigned, wchar_t ch) --pos; } } - else if(key==SDLK_DELETE) + else if(key==Msp::Input::KEY_DELETE) { if(pos0) --pos; } - else if(key==SDLK_RIGHT) + else if(key==Msp::Input::KEY_RIGHT) { if(pos