home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / dreamscape / source / Dreamscape / Headers / objects / h / fontmenu < prev    next >
Encoding:
Text File  |  1996-07-29  |  1.8 KB  |  69 lines

  1.  
  2. // objects.h.fontmenu
  3.  
  4. // Dreamscape - C++ class library for RISC OS
  5. // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
  6. //
  7. // This library is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU Library General Public
  9. // License as published by the Free Software Foundation; either
  10. // version 2 of the License, or (at your option) any later version.
  11. // See the Dreamscape documentation for more information.
  12.  
  13. #ifndef dreamscape_fontmenu_H
  14. #define dreamscape_fontmenu_H
  15.  
  16. #include "stringt.h"
  17.  
  18. #include "command.h"
  19. #include "basemenu.h"
  20.  
  21. class FontSelectionHandler {
  22. public:
  23.   virtual void font_selection(const char *font) = 0;
  24. };
  25.  
  26. class FontMenu: public BaseMenu {
  27.   static class Initialise {
  28.   public:
  29.     Initialise();
  30.   } init;
  31.   friend Initialise;
  32.  
  33.   static void *creator(toolbox_o object);
  34.   static void deleter(void *handle);
  35.   static void showing(const toolbox_action *event, const toolbox_block *ids);
  36.   static void hidden(const toolbox_action *event, const toolbox_block *ids);
  37.   static void selection(const toolbox_action *event,
  38.         const toolbox_block *ids);
  39.  
  40.   ToolboxObject impl;
  41.  
  42.   FontSelectionHandler *selection_handler;
  43.   Command *showing_handler, *hidden_handler;
  44.  
  45.   FontMenu(toolbox_o object);
  46. public:
  47.   FontMenu(const char *name);
  48.   virtual ~FontMenu();
  49.  
  50.   void set_handler(FontSelectionHandler *handler)
  51.     { selection_handler = handler; }
  52.  
  53.   void set_showing_handler(Command *handler) { showing_handler = handler; }
  54.   void set_hidden_handler(Command *handler) { hidden_handler = handler; }
  55.  
  56.   void set_font(const char *font);
  57.   String get_font() const;
  58.  
  59.   BaseMenu &get_next_menu();
  60.   const BaseMenu &get_next_menu() const;
  61.   bool has_next_menu() const;
  62.  
  63.   // Low level
  64.   ToolboxObject &get_toolbox_object();
  65.   const ToolboxObject &get_toolbox_object() const;
  66. };
  67.  
  68. #endif
  69.