home *** CD-ROM | disk | FTP | other *** search
-
- // objects.h.fontdbox
-
- // 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_fontdbox_H
- #define dreamscape_fontdbox_H
-
- #include "stringt.h"
-
- #include "command.h"
- #include "basewindow.h"
-
- class FontDBoxSelectionHandler {
- public:
- class FontDBoxInfo {
- public:
- FontDBoxInfo(): size(12), width(100) {}
-
- String font;
- int size, width;
- };
- virtual void font_dbox_selection(const FontDBoxInfo &info) = 0;
- };
-
- class FontDBox: public BaseWindow {
- 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;
-
- FontDBoxSelectionHandler *selection_handler;
- Command *showing_handler, *hidden_handler;
-
- FontDBox(toolbox_o object);
- public:
- FontDBox(const char *name);
- virtual ~FontDBox();
-
- void set_handler(FontDBoxSelectionHandler *handler)
- { selection_handler = handler; }
-
- void set_showing_handler(Command *handler) { showing_handler = handler; }
- void set_hidden_handler(Command *handler) { hidden_handler = handler; }
-
- void set_font(const char *font);
- String get_font() const;
-
- void set_size(int size);
- int get_size() const;
- void set_width(int ratio);
- int get_width() const;
-
- void set_try_text(const char *text);
- String get_try_text() const;
-
- void set_title(const char *title);
- String get_title() const;
-
- Window &get_window();
- const Window &get_window() const;
- BaseWindow &get_next_window();
- const BaseWindow &get_next_window() const;
-
- bool has_window() const;
- bool has_next_window() const;
-
- // Low level
- ToolboxObject &get_toolbox_object() { return impl; }
- const ToolboxObject &get_toolbox_object() const { return impl; }
- ToolboxObject &get_top_toolbox_object();
- const ToolboxObject &get_top_toolbox_object() const;
- };
-
- #endif
-