2019-02-02 11:30:40 +08:00
|
|
|
#ifndef EDIT_H
|
|
|
|
#define EDIT_H
|
2017-12-06 21:43:47 +08:00
|
|
|
|
|
|
|
#define KEY_BOARD_STYLE 0x00001000L
|
|
|
|
#define NUM_BOARD_STYLE 0x00002000L
|
|
|
|
#define MAX_EDIT_STRLEN 32
|
|
|
|
|
|
|
|
class c_edit : public c_wnd
|
|
|
|
{
|
|
|
|
friend class c_keyboard;
|
|
|
|
public:
|
|
|
|
virtual c_wnd* clone(){return new c_edit();}
|
|
|
|
virtual const char* get_class_name() const {return "c_edit";}
|
|
|
|
const char* get_text(){return m_str;}
|
|
|
|
void set_text(const char* str);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void pre_create_wnd();
|
|
|
|
virtual void on_paint();
|
|
|
|
virtual void on_focus();
|
|
|
|
virtual void on_kill_focus();
|
2019-04-17 15:00:47 +08:00
|
|
|
virtual bool on_touch(int x, int y, TOUCH_ACTION action);
|
2017-12-06 21:43:47 +08:00
|
|
|
|
|
|
|
void on_key_board_click(unsigned int ctrl_id, long param);
|
2018-12-02 22:39:43 +08:00
|
|
|
GL_DECLARE_MESSAGE_MAP()
|
2017-12-06 21:43:47 +08:00
|
|
|
private:
|
|
|
|
void show_keyboard();
|
2019-04-17 15:00:47 +08:00
|
|
|
void on_touch_down(int x, int y);
|
|
|
|
void on_touch_up(int x, int y);
|
2017-12-06 21:43:47 +08:00
|
|
|
|
|
|
|
char m_str_input[MAX_EDIT_STRLEN];
|
|
|
|
char m_str[MAX_EDIT_STRLEN];
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|