tbx  0.7.6
showpointobject.h
1 /*
2  * tbx RISC OS toolbox library
3  *
4  * Copyright (C) 2010 Alan Buckley All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 
25 #ifndef TBX_SHOWPOINTOBJECT_H
26 #define TBX_SHOWPOINTOBJECT_H
27 
28 #include "object.h"
29 #include "menu.h"
30 #include "point.h"
31 
32 namespace tbx {
33 namespace res
34 {
35  class ResObject;
36 }
37 
43 {
44 public:
63  ShowPointObject(const Object &other) : Object(other) {}
70  ShowPointObject(const std::string &template_name) : Object(template_name) {}
78  ShowPointObject(const res::ResObject &object_template) : Object(object_template) {}
79 
80  using Object::show;
81 
82  void show(const Object &parent);
83  void show(const Component &parent);
84  void show(const Point &pos);
85  void show(const Point &pos, const Object &parent);
86  void show(const Point &pos, const Component &parent);
87 
88  void show_as_menu();
89  void show_as_menu(const Object &parent);
90  void show_as_menu(const Component &parent);
91  void show_as_menu(const Point &pos);
92  void show_as_menu(const Point &pos, const Object &parent);
93  void show_as_menu(const Point &pos, const Component &parent);
94 
95  void show_as_submenu(const MenuItem &parent);
96  void show_as_submenu(const Point &pos, const MenuItem &parent);
97 };
98 
99 }
100 
101 #endif /* TBX_SHOWPOINTOBJECT_H */
tbx
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
tbx::res::ResObject
Base class for a resource object that can be edited.
Definition: resobject.h:53
tbx::Object::handle
ObjectId handle() const
Return the underlying toolbox object id this object references.
Definition: object.h:93
tbx::ShowPointObject::ShowPointObject
ShowPointObject()
Constructor with no reference to a Toolbox object.
Definition: showpointobject.h:51
tbx::ShowPointObject
Object that can be shown at a specific position as well as its default place.
Definition: showpointobject.h:43
tbx::Component
Base class for components in an object.
Definition: component.h:42
tbx::ShowPointObject::ShowPointObject
ShowPointObject(const res::ResObject &object_template)
Create Toolbox object from a memory template and make this object a reference to it.
Definition: showpointobject.h:78
tbx::ShowPointObject::ShowPointObject
ShowPointObject(const std::string &template_name)
Create a Toolbox object and make this object a reference to it.
Definition: showpointobject.h:70
tbx::ShowPointObject::ShowPointObject
ShowPointObject(const Object &other)
Construct as reference to another Toolbox object.
Definition: showpointobject.h:63
tbx::Object::show
void show()
Show the object at the default place.
Definition: object.cc:240
tbx::MenuItem
Class representing a single menu item on a menu.
Definition: menu.h:174
tbx::ShowPointObject::ShowPointObject
ShowPointObject(ObjectId handle)
Construct from a Toolbox object id.
Definition: showpointobject.h:57
tbx::Object
Class to manipulate a toolbox object.
Definition: object.h:51
tbx::Point
Class to represent a position in two dimensional space.
Definition: point.h:37
tbx::ShowPointObject::show_as_submenu
void show_as_submenu(const MenuItem &parent)
Show object as a sub menu from the given menu item.
Definition: showpointobject.cc:187
tbx::ObjectId
unsigned int ObjectId
Type for underlying toolbox object id.
Definition: handles.h:31
tbx::ShowPointObject::show_as_menu
void show_as_menu()
Show object as a menu at default position.
Definition: showpointobject.cc:102
tbx::ShowPointObject::show
void show()
Show the object at the default place.
Definition: object.cc:240