home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / dreamscape / examples / Dreamscape / Examples / TestProg / h / testobj < prev    next >
Encoding:
Text File  |  1996-06-17  |  2.1 KB  |  92 lines

  1.  
  2. #ifndef testprog_testobj_H
  3. #define testprog_testobj_H
  4.  
  5. #include "window.h"
  6. #include "iconbar.h"
  7. #include "menu.h"
  8. #include "fontmenu.h"
  9. #include "windowcmds.h"
  10. #include "displayfield.h"
  11. #include "actionbutton.h"
  12. #include "writablefield.h"
  13. #include "numberrange.h"
  14.  
  15. class Object: public Window::DataLoaderOneType, public FontSelectionHandler {
  16. public:
  17.   Object();
  18.  
  19.   void load(const WindowFileInfo &info, istream &stream);
  20.  
  21.   IconbarIcon icon;
  22.   Window window, leaf_window, &toolbar;
  23.   Menu menu;
  24.  
  25.   DisplayField &output, *dyn;
  26.   ActionButton &button;
  27.   WritableField &filename;
  28.   WritableFieldFilenameInserter filename_inserter;
  29.  
  30.   FontMenu font_menu;
  31.   void font_selection(const char *font);
  32.  
  33.   class IconiseCommand: public Command {
  34.     BaseWindow *window;
  35.   public:
  36.     IconiseCommand(BaseWindow *w): window(w) {}
  37.     void execute() { window->iconise(); }
  38.   } iconise_command;
  39.   ActionButton &iconise_button;
  40.  
  41.   ShowWindowCommand select;
  42.   ShowWindowTransientCommand button_action;
  43.   class InfoSubmenuCommand: public Command {
  44.   public:
  45.     void execute();
  46.   } info_submenu;
  47.  
  48.   class AddCommand: public Command {
  49.     Object *object;
  50.   public:
  51.     AddCommand(Object *o): object(o) {}
  52.     void execute();
  53.   } add;
  54.  
  55.   class RemoveCommand: public Command {
  56.     Object *object;
  57.   public:
  58.     RemoveCommand(Object *o): object(o) {}
  59.     void execute();
  60.   } remove;
  61.  
  62.   class NewPictureCommand: public Command {
  63.   public:
  64.     void execute();
  65.   } new_picture;
  66.   class NewThingyCommand: public Command {
  67.   public:
  68.     void execute();
  69.   } new_thingy;
  70.  
  71.   class ObjectNumberState: public State<float> {
  72.     float number;
  73.   public:
  74.     ObjectNumberState(): number(78.9) {}
  75.     void get_state(float &i) const { i = number; }
  76.     void set_state(const float &i)
  77.       { State<float>::set_state(i); number = i; }
  78.   } number_state;
  79.  
  80.   NumberRangeEcho number_echo;//, number_editable;
  81.   class EditableChange: public Command {
  82.     Object *object;
  83.   public:
  84.     EditableChange(Object *o): object(o) {}
  85.     void execute()
  86.       { object->number_state.set_state(((NumberRange *)
  87.         object->window.get_gadget(6))->get_value()); }
  88.   } number_changed;
  89. };
  90.  
  91. #endif
  92.