home *** CD-ROM | disk | FTP | other *** search
-
- // objects.h.scaleview
-
- // 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_scaleview_H
- #define dreamscape_scaleview_H
-
- #include "stringt.h"
-
- #include "command.h"
- #include "basewindow.h"
-
- class ScaleViewHandler {
- public:
- virtual void scale_view(int scale) = 0;
- virtual void scale_to_fit();
- };
-
- class ScaleView: 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 scale(const toolbox_action *event, const toolbox_block *ids);
-
- ToolboxObject impl;
-
- ScaleViewHandler *scale_view_handler;
- Command *showing_handler, *hidden_handler;
-
- ScaleView(toolbox_o object);
- public:
- ScaleView(const char *name);
- virtual ~ScaleView();
-
- ScaleView &operator=(int scale) { set_value(scale); return *this; }
- operator int() const { return get_value(); }
-
- void set_handler(ScaleViewHandler *handler)
- { scale_view_handler = handler; }
-
- void set_showing_handler(Command *handler) { showing_handler = handler; }
- void set_hidden_handler(Command *handler) { hidden_handler = handler; }
-
- void set_value(int scale);
- int get_value() const;
-
- void set_bounds(int minimum, int maximum);
- void get_bounds(int &minimum, int &maximum) const;
- void set_minimum(int minimum);
- int get_minimum() const;
- void set_maximum(int maximum);
- int get_maximum() const;
-
- void set_step_size(int step);
- int get_step_size() 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
-