tbx  0.7.3
resscrolllist.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_RES_RESSCROLLLIST_H
26 #define TBX_RES_RESSCROLLLIST_H
27 
28 #include "resgadget.h"
29 
30 namespace tbx {
31 namespace res {
32 
36 class ResScrollList : public ResGadget
37 {
38 
39 public:
40  enum {TYPE_ID = 0x401A };
41 
48  ResScrollList(const ResGadget &other) : ResGadget(other)
49  {
50  check_type(TYPE_ID);
51  }
52 
58  ResScrollList(const ResScrollList &other) : ResGadget(other)
59  {
60  }
61 
62  virtual ~ResScrollList() {}
63 
71  {
72  other.check_type(TYPE_ID);
73  ResBase::operator=(other);
74  return *this;
75  }
76 
83  {
84  ResBase::operator=(other);
85  return *this;
86  }
87 
94  : ResGadget(0x401A,48)
95  {
96  background(0xffffff00); // White background
97  }
98 
99 
105  int event() const {return int_value(36);}
111  void event(int value) {int_value(36,value);}
117  int foreground() const {return int_value(40);}
123  void foreground(int value) {int_value(40,value);}
129  int background() const {return int_value(44);}
135  void background(int value) {int_value(44,value);}
136 
137 };
138 
139 }
140 }
141 
142 #endif // TBX_RES_RESSCROLLLIST_H
143 
Base class for gadget memory resources.
Definition: resgadget.h:42
void background(int value)
Set the background colour of the scroll list.
Definition: resscrolllist.h:135
int background() const
Get the background colour of the scroll list.
Definition: resscrolllist.h:129
ResScrollList & operator=(const ResGadget &other)
Assign from a ResGadget.
Definition: resscrolllist.h:70
void foreground(int value)
Set the foreground colour of the scroll list.
Definition: resscrolllist.h:123
ResScrollList & operator=(const ResScrollList &other)
Assign from another scroll list gadget resource.
Definition: resscrolllist.h:82
int event() const
Get the event returned when an item is selected.
Definition: resscrolllist.h:105
void event(int value)
Set the event returned when an item is selected.
Definition: resscrolllist.h:111
ResScrollList()
Construct a scroll list gadget resource.
Definition: resscrolllist.h:93
ResScrollList(const ResGadget &other)
Construct an scroll list gadget resource.
Definition: resscrolllist.h:48
Class for ScrollList gadget template.
Definition: resscrolllist.h:36
ResBase & operator=(const ResBase &other)
Assignment.
Definition: resbase.cc:1534
ResScrollList(const ResScrollList &other)
Construct an scroll list gadget resource.
Definition: resscrolllist.h:58
void check_type(int type) const
Check if this gadgets type is as specified.
Definition: reswindow.cc:97
int int_value(int offset) const
Get an integer value.
Definition: resbase.h:316
int foreground() const
Get the foreground colour of the scroll list.
Definition: resscrolllist.h:117