home *** CD-ROM | disk | FTP | other *** search
-
- // objects.h.colourmenu
-
- // Dreamscape - C++ class library for RISC OS
- // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
- //
- // This library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Library General Public
- // License as published by the Free Software Foundation; either
- // version 2 of the License, or (at your option) any later version.
- // See the Dreamscape documentation for more information.
-
- #ifndef dreamscape_colourmenu_H
- #define dreamscape_colourmenu_H
-
- #include "stringt.h"
-
- #include "command.h"
- #include "colour.h"
- #include "basemenu.h"
-
- class ColourMenuSelectionHandler {
- public:
- virtual void colour_menu_selection(DesktopColour colour) = 0;
- };
-
- class ColourMenu: public BaseMenu {
- static class Initialise {
- public:
- Initialise();
- } init;
- friend Initialise;
-
- static void *creator(toolbox_o object);
- static void deleter(void *handle);
- static void showing(const toolbox_action *event, const toolbox_block *ids);
- static void hidden(const toolbox_action *event, const toolbox_block *ids);
- static void selection(const toolbox_action *event,
- const toolbox_block *ids);
-
- ToolboxObject impl;
-
- ColourMenuSelectionHandler *selection_handler;
- Command *showing_handler, *hidden_handler;
-
- ColourMenu(toolbox_o object);
- public:
- ColourMenu(const char *name);
- virtual ~ColourMenu();
-
- void set_handler(ColourMenuSelectionHandler *handler)
- { selection_handler = handler; }
-
- void set_showing_handler(Command *handler) { showing_handler = handler; }
- void set_hidden_handler(Command *handler) { hidden_handler = handler; }
-
- void set_colour(DesktopColour colour);
- DesktopColour get_colour() const;
-
- void set_none_available(bool available);
- bool get_none_available() const;
-
- void set_title(const char *title);
- String get_title() const;
-
- BaseMenu &get_next_menu();
- const BaseMenu &get_next_menu() const;
- bool has_next_menu() const;
-
- // Low level
- ToolboxObject &get_toolbox_object();
- const ToolboxObject &get_toolbox_object() const;
- };
-
- #endif
-