home *** CD-ROM | disk | FTP | other *** search
-
- #ifndef testprog_testobj_H
- #define testprog_testobj_H
-
- #include "window.h"
- #include "iconbar.h"
- #include "menu.h"
- #include "fontmenu.h"
- #include "windowcmds.h"
- #include "displayfield.h"
- #include "actionbutton.h"
- #include "writablefield.h"
- #include "numberrange.h"
-
- class Object: public Window::DataLoaderOneType, public FontSelectionHandler {
- public:
- Object();
-
- void load(const WindowFileInfo &info, istream &stream);
-
- IconbarIcon icon;
- Window window, leaf_window, &toolbar;
- Menu menu;
-
- DisplayField &output, *dyn;
- ActionButton &button;
- WritableField &filename;
- WritableFieldFilenameInserter filename_inserter;
-
- FontMenu font_menu;
- void font_selection(const char *font);
-
- class IconiseCommand: public Command {
- BaseWindow *window;
- public:
- IconiseCommand(BaseWindow *w): window(w) {}
- void execute() { window->iconise(); }
- } iconise_command;
- ActionButton &iconise_button;
-
- ShowWindowCommand select;
- ShowWindowTransientCommand button_action;
- class InfoSubmenuCommand: public Command {
- public:
- void execute();
- } info_submenu;
-
- class AddCommand: public Command {
- Object *object;
- public:
- AddCommand(Object *o): object(o) {}
- void execute();
- } add;
-
- class RemoveCommand: public Command {
- Object *object;
- public:
- RemoveCommand(Object *o): object(o) {}
- void execute();
- } remove;
-
- class NewPictureCommand: public Command {
- public:
- void execute();
- } new_picture;
- class NewThingyCommand: public Command {
- public:
- void execute();
- } new_thingy;
-
- class ObjectNumberState: public State<float> {
- float number;
- public:
- ObjectNumberState(): number(78.9) {}
- void get_state(float &i) const { i = number; }
- void set_state(const float &i)
- { State<float>::set_state(i); number = i; }
- } number_state;
-
- NumberRangeEcho number_echo;//, number_editable;
- class EditableChange: public Command {
- Object *object;
- public:
- EditableChange(Object *o): object(o) {}
- void execute()
- { object->number_state.set_state(((NumberRange *)
- object->window.get_gadget(6))->get_value()); }
- } number_changed;
- };
-
- #endif
-