Work on an input field.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@272 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-02-13 21:47:26 +00:00
parent aec27deaeb
commit 73b1c58f4c
19 changed files with 313 additions and 25 deletions
+37
View File
@@ -0,0 +1,37 @@
#ifndef RTORRENT_INPUT_TEXT_INPUT_H
#define RTORRENT_INPUT_TEXT_INPUT_H
#include <string>
#include <sigc++/slot.h>
namespace input {
class TextInput : private std::string {
public:
typedef std::string Base;
typedef sigc::slot0<void> SlotDirty;
using Base::c_str;
using Base::empty;
using Base::size;
TextInput() : m_pos(0), m_alt(false) {}
size_type get_pos() { return m_pos; }
bool pressed(int key);
void clear() { m_pos = 0; m_alt = false; Base::clear(); }
void slot_dirty(SlotDirty s) { m_slotDirty = s; }
private:
size_type m_pos;
bool m_alt;
SlotDirty m_slotDirty;
};
}
#endif