X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/7bc4a59528ab13f3062dc1520e76f9ecedd87400..bbd6ab926a139a317cc1be03016dceb8d88da6a8:/lib/gui/einput.h diff --git a/lib/gui/einput.h b/lib/gui/einput.h index b742a6d8..ae838978 100644 --- a/lib/gui/einput.h +++ b/lib/gui/einput.h @@ -1,12 +1,12 @@ #ifndef __lib_gui_einput_h #define __lib_gui_einput_h -#include +#include #include class eInputContent; -class eInput: public eLabel +class eInput: public eWidget { public: eInput(eWidget *parent); @@ -14,19 +14,35 @@ public: PSignal0 changed; int m_cursor; - + + enum { + INPUT_ACTIONS, + ASCII_ACTIONS + }; + enum InputActions { moveLeft, moveRight, moveHome, moveEnd, - deleteChar + deleteForward, + deleteBackward, + toggleOverwrite, + accept }; - + + enum AsciiActions { + gotAsciiCode + }; + void setContent(eInputContent *cnt); - int getNumber(); + void setOverwriteMode(int o); + + void setFont(gFont *font); protected: + ePtr m_font; + int m_mode, m_have_focus; ePtr m_content; int event(int event, void *data=0, void *data2=0); }; @@ -47,34 +63,19 @@ public: dirUser }; virtual void moveCursor(int dir)=0; + + enum { + deleteForward, deleteBackward + }; + virtual void deleteChar(int dir)=0; + /* no movement keys except stuff like '.' or so*/ - virtual int haveKey(int code)=0; + virtual int haveKey(int code, int overwrite)=0; virtual int isValid()=0; + virtual void validate()=0; protected: eInput *m_input; }; -class eInputContentNumber: public eInputContent -{ - DECLARE_REF(eInputContentNumber); -public: - eInputContentNumber(int cur, int min, int max); - - void getDisplay(std::string &res, int &cursor); - void moveCursor(int dir); - int haveKey(int code); - int isValid(); - -private: - void recalcLen(); - - void insertDigit(int pos, int dig); - - int m_value; - int m_cursor, m_len; - - int m_min, m_max; -}; - #endif