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

  1.  
  2. // objects.h.fontdbox
  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_fontdbox_H
  14. #define dreamscape_fontdbox_H
  15.  
  16. #include "stringt.h"
  17.  
  18. #include "command.h"
  19. #include "basewindow.h"
  20.  
  21. class FontDBoxSelectionHandler {
  22. public:
  23.   class FontDBoxInfo {
  24.   public:
  25.     FontDBoxInfo(): size(12), width(100) {}
  26.  
  27.     String font;
  28.     int size, width;
  29.   };
  30.   virtual void font_dbox_selection(const FontDBoxInfo &info) = 0;
  31. };
  32.  
  33. class FontDBox: public BaseWindow {
  34.   static class Initialise {
  35.   public:
  36.     Initialise();
  37.   } init;
  38.   friend Initialise;
  39.  
  40.   static void *creator(toolbox_o object);
  41.   static void deleter(void *handle);
  42.   static void showing(const toolbox_action *event, const toolbox_block *ids);
  43.   static void hidden(const toolbox_action *event, const toolbox_block *ids);
  44.   static void selection(const toolbox_action *event,
  45.         const toolbox_block *ids);
  46.  
  47.   ToolboxObject impl;
  48.  
  49.   FontDBoxSelectionHandler *selection_handler;
  50.   Command *showing_handler, *hidden_handler;
  51.  
  52.   FontDBox(toolbox_o object);
  53. public:
  54.   FontDBox(const char *name);
  55.   virtual ~FontDBox();
  56.  
  57.   void set_handler(FontDBoxSelectionHandler *handler)
  58.     { selection_handler = handler; }
  59.  
  60.   void set_showing_handler(Command *handler) { showing_handler = handler; }
  61.   void set_hidden_handler(Command *handler) { hidden_handler = handler; }
  62.  
  63.   void set_font(const char *font);
  64.   String get_font() const;
  65.  
  66.   void set_size(int size);
  67.   int get_size() const;
  68.   void set_width(int ratio);
  69.   int get_width() const;
  70.  
  71.   void set_try_text(const char *text);
  72.   String get_try_text() const;
  73.  
  74.   void set_title(const char *title);
  75.   String get_title() const;
  76.  
  77.   Window &get_window();
  78.   const Window &get_window() const;
  79.   BaseWindow &get_next_window();
  80.   const BaseWindow &get_next_window() const;
  81.  
  82.   bool has_window() const;
  83.   bool has_next_window() const;
  84.  
  85.   // Low level
  86.   ToolboxObject &get_toolbox_object() { return impl; }
  87.   const ToolboxObject &get_toolbox_object() const { return impl; }
  88.   ToolboxObject &get_top_toolbox_object();
  89.   const ToolboxObject &get_top_toolbox_object() const;
  90. };
  91.  
  92. #endif
  93.