29 #ifndef ivlook_sfield_h
30 #define ivlook_sfield_h
32 #include <InterViews/input.h>
36 class FieldSEditorImpl;
51 #if defined(__STDC__) || defined(__ANSI_CPP__)
52 #define __FieldSEditorCallback(T) T##_FieldSEditorCallback
53 #define FieldSEditorCallback(T) __FieldSEditorCallback(T)
54 #define __FieldSEditorMemberFunction(T) T##_FieldSEditorMemberFunction
55 #define FieldSEditorMemberFunction(T) __FieldSEditorMemberFunction(T)
57 #define __FieldSEditorCallback(T) T _FieldSEditorCallback
58 #define FieldSEditorCallback(T) __FieldSEditorCallback(T)
59 #define __FieldSEditorMemberFunction(T) T _FieldSEditorMemberFunction
60 #define FieldSEditorMemberFunction(T) __FieldSEditorMemberFunction(T)
63 #define declareFieldSEditorCallback(T) \
64 typedef void (T::*FieldSEditorMemberFunction(T))(FieldSEditor*); \
65 class FieldSEditorCallback(T) \
66 : public FieldSEditorAction { \
68 FieldSEditorCallback( \
69 T)(T*, FieldSEditorMemberFunction(T) accept, FieldSEditorMemberFunction(T) cancel); \
70 virtual ~FieldSEditorCallback(T)(); \
72 virtual void accept(FieldSEditor*); \
73 virtual void cancel(FieldSEditor*); \
77 FieldSEditorMemberFunction(T) accept_; \
78 FieldSEditorMemberFunction(T) cancel_; \
81 #define implementFieldSEditorCallback(T) \
82 FieldSEditorCallback(T)::FieldSEditorCallback( \
83 T)(T * obj, FieldSEditorMemberFunction(T) accept, FieldSEditorMemberFunction(T) cancel) { \
89 FieldSEditorCallback(T)::~FieldSEditorCallback(T)() {} \
91 void FieldSEditorCallback(T)::accept(FieldSEditor* f) { \
92 (obj_->*accept_)(f); \
94 void FieldSEditorCallback(T)::cancel(FieldSEditor* f) { \
95 (obj_->*cancel_)(f); \
virtual void cancel(FieldSEditor *)
virtual ~FieldSEditorAction()
virtual void accept(FieldSEditor *)
virtual void field(const String &)
virtual void release(const Event &)
virtual void edit(const char *, int left, int right)
virtual const String * text() const
virtual void selection(int &start, int &index) const
virtual void press(const Event &)
virtual void select(int pos)
virtual void keystroke(const Event &)
virtual void drag(const Event &)
virtual void select(int left, int right)
virtual InputHandler * focus_in()
virtual void edit(const String &, int left, int right)
FieldSEditor(const String &sample, WidgetKit *, Style *, FieldSEditorAction *=NULL)
virtual void field(const char *)