symchoos.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1991 Stanford University
00003  * Copyright (c) 1991 Silicon Graphics, Inc.
00004  *
00005  * Permission to use, copy, modify, distribute, and sell this software and 
00006  * its documentation for any purpose is hereby granted without fee, provided
00007  * that (i) the above copyright notices and this permission notice appear in
00008  * all copies of the software and related documentation, and (ii) the names of
00009  * Stanford and Silicon Graphics may not be used in any advertising or
00010  * publicity relating to the software without the specific, prior written
00011  * permission of Stanford and Silicon Graphics.
00012  * 
00013  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
00014  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
00015  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
00016  *
00017  * IN NO EVENT SHALL STANFORD OR SILICON GRAPHICS BE LIABLE FOR
00018  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
00019  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
00020  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
00021  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
00022  * OF THIS SOFTWARE.
00023  */
00024 
00025 /* hacked by Michael Hines from fchooser.h */
00026 /*
00027  * SymChooser -- select a Symbol
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
Generated on Mon Jun 13 08:10:24 2011 for NEURON by  doxygen 1.6.3