symchoos.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef symchooser_h
00031 #define symchooser_h
00032
00033 #include <InterViews/dialog.h>
00034 #include <InterViews/resource.h>
00035
00036 #include <InterViews/_enter.h>
00037
00038 class SymChooser;
00039 class SymChooserImpl;
00040 class String;
00041 class WidgetKit;
00042 class SymDirectory;
00043
00044 class SymChooserAction : public Resource {
00045 protected:
00046 SymChooserAction();
00047 virtual ~SymChooserAction();
00048 public:
00049 virtual void execute(SymChooser*, boolean accept);
00050 };
00051
00052 #if defined(__STDC__) || defined(__ANSI_CPP__)
00053 #define SymChooserCallback(T) T##_SymChooserCallback
00054 #define SymChooserMemberFunction(T) T##_SymChooserMemberFunction
00055 #else
00056 #define SymChooserCallback(T) T_SymChooserCallback
00057 #define SymChooserMemberFunction(T) T_SymChooserMemberFunction
00058 #endif
00059
00060 #define declareSymChooserCallback(T) \
00061 typedef void (T::*SymChooserMemberFunction(T))(SymChooser*, boolean); \
00062 class SymChooserCallback(T) : public SymChooserAction { \
00063 public: \
00064 SymChooserCallback(T)(T*, SymChooserMemberFunction(T)); \
00065 virtual ~SymChooserCallback(T)(); \
00066 \
00067 virtual void execute(SymChooser*, boolean accept); \
00068 private: \
00069 T* obj_; \
00070 SymChooserMemberFunction(T) func_; \
00071 };
00072
00073 #define implementSymChooserCallback(T) \
00074 SymChooserCallback(T)::SymChooserCallback(T)( \
00075 T* obj, SymChooserMemberFunction(T) func \
00076 ) { \
00077 obj_ = obj; \
00078 func_ = func; \
00079 } \
00080 \
00081 SymChooserCallback(T)::~SymChooserCallback(T)() { } \
00082 \
00083 void SymChooserCallback(T)::execute(SymChooser* f, boolean accept) { \
00084 (obj_->*func_)(f, accept); \
00085 }
00086
00087 class SymChooser : public Dialog {
00088 public:
00089 SymChooser(
00090 SymDirectory*, WidgetKit*, Style*, SymChooserAction* = nil, int nbrowser = 3
00091 );
00092 virtual ~SymChooser();
00093
00094 virtual const String* selected() const;
00095 virtual double* selected_var();
00096 virtual int selected_vector_count();
00097 virtual void reread();
00098 virtual void dismiss(boolean);
00099 private:
00100 SymChooserImpl* impl_;
00101 };
00102
00103 #include <InterViews/_leave.h>
00104
00105 #endif