mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-09 03:32:29 +00:00
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:
@@ -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
|
||||
Reference in New Issue
Block a user