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

  1.  
  2. // objects.h.scaleview
  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_scaleview_H
  14. #define dreamscape_scaleview_H
  15.  
  16. #include "stringt.h"
  17.  
  18. #include "command.h"
  19. #include "basewindow.h"
  20.  
  21. class ScaleViewHandler {
  22. public:
  23.   virtual void scale_view(int scale) = 0;
  24.   virtual void scale_to_fit();
  25. };
  26.  
  27. class ScaleView: public BaseWindow {
  28.   static class Initialise {
  29.   public:
  30.     Initialise();
  31.   } init;
  32.   friend Initialise;
  33.  
  34.   static void *creator(toolbox_o object);
  35.   static void deleter(void *handle);
  36.   static void showing(const toolbox_action *event, const toolbox_block *ids);
  37.   static void hidden(const toolbox_action *event, const toolbox_block *ids);
  38.   static void scale(const toolbox_action *event, const toolbox_block *ids);
  39.  
  40.   ToolboxObject impl;
  41.  
  42.   ScaleViewHandler *scale_view_handler;
  43.   Command *showing_handler, *hidden_handler;
  44.  
  45.   ScaleView(toolbox_o object);
  46. public:
  47.   ScaleView(const char *name);
  48.   virtual ~ScaleView();
  49.  
  50.   ScaleView &operator=(int scale) { set_value(scale); return *this; }
  51.   operator int() const { return get_value(); }
  52.  
  53.   void set_handler(ScaleViewHandler *handler)
  54.     { scale_view_handler = handler; }
  55.  
  56.   void set_showing_handler(Command *handler) { showing_handler = handler; }
  57.   void set_hidden_handler(Command *handler) { hidden_handler = handler; }
  58.  
  59.   void set_value(int scale);
  60.   int get_value() const;
  61.  
  62.   void set_bounds(int minimum, int maximum);
  63.   void get_bounds(int &minimum, int &maximum) const;
  64.   void set_minimum(int minimum);
  65.   int get_minimum() const;
  66.   void set_maximum(int maximum);
  67.   int get_maximum() const;
  68.  
  69.   void set_step_size(int step);
  70.   int get_step_size() const;
  71.  
  72.   void set_title(const char *title);
  73.   String get_title() const;
  74.  
  75.   Window &get_window();
  76.   const Window &get_window() const;
  77.   BaseWindow &get_next_window();
  78.   const BaseWindow &get_next_window() const;
  79.  
  80.   bool has_window() const;
  81.   bool has_next_window() const;
  82.  
  83.   // Low level
  84.   ToolboxObject &get_toolbox_object() { return impl; }
  85.   const ToolboxObject &get_toolbox_object() const { return impl; }
  86.   ToolboxObject &get_top_toolbox_object();
  87.   const ToolboxObject &get_top_toolbox_object() const;
  88. };
  89.  
  90. #endif
  91.