48 #ifndef _TBX_VIEW_GADGETLISTVIEW_
49 #define _TBX_VIEW_GADGETLISTVIEW_
51 #include "../window.h"
52 #include "../gadget.h"
53 #include "../margin.h"
54 #include "../res/reswindow.h"
95 unsigned int _num_gadgets;
98 unsigned int _row_height;
99 unsigned int _spacing;
102 bool _updates_enabled;
118 unsigned int count()
const {
return _count;}
159 return row * _num_gadgets + _first_gadget_id + col;
168 return _window.
gadget(row * _num_gadgets + _first_gadget_id + col);
173 void remove(
unsigned int row,
unsigned int count = 1);
176 void copy(
unsigned int from_row,
unsigned int to_row);
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
tbx::ComponentId insert(unsigned int row, unsigned int count=1)
Insert row(s) before the given row number.
Definition: gadgetlistview.cc:269
int ComponentId
Type for underlying toolbox component id.
Definition: handles.h:33
bool updates_enabled() const
Check if updating of the window extent is enabled.
Definition: gadgetlistview.h:137
const tbx::Margin & margin() const
Return the margin around the data in the window.
Definition: gadgetlistview.h:128
tbx::ComponentId gadget_id(int row, int col) const
Return the gadget_id for a specific row and column.
Definition: gadgetlistview.h:157
The Window object represents a toolbox window.
Definition: window.h:70
Base class for gadget memory resources.
Definition: resgadget.h:43
unsigned int count() const
Return the number of rows.
Definition: gadgetlistview.h:118
Class to create a list view with each line made up of one or more gadgets.
Definition: gadgetlistview.h:89
Interface for copying from one row to another.
Definition: gadgetlistview.h:66
void copy(unsigned int from_row, unsigned int to_row)
Use currently assigned copy function to copy from one row to another.
Definition: gadgetlistview.cc:366
Window resource object.
Definition: reswindow.h:49
Gadget gadget(ComponentId component_id)
Get the gadget with the given component id.
Definition: window.cc:515
void setup(tbx::Window window, tbx::res::ResWindow &res_window, tbx::ComponentId first_gadget_id, tbx::ComponentId last_gadget_id, unsigned int spacing, bool first_row_created)
Setup the gadget list view.
Definition: gadgetlistview.cc:98
void clear()
Clear all gadgets from the list.
Definition: gadgetlistview.cc:331
virtual void copy_row(GadgetListView &glv, unsigned int from_row, unsigned int to_row)
Copy data from one row in a gadget list to another.
Definition: gadgetlistview.cc:380
void remove(unsigned int row, unsigned int count=1)
Remove row(s) from the list.
Definition: gadgetlistview.cc:293
tbx::Window & window()
Return the window this view is attached to.
Definition: gadgetlistview.h:123
void updates_enabled(bool enabled)
Set if updating of the window extent is enabled.
Definition: gadgetlistview.h:146
unsigned int num_gadgets() const
Return the number of gadgets in a row.
Definition: gadgetlistview.h:114
tbx::Gadget gadget(int row, int col)
Return the gadget for a specified row and column.
Definition: gadgetlistview.h:166
void update_window_extent()
Update the windows extents to fit the current size of the list and its margin.
Definition: gadgetlistview.cc:193
This is the base class for all Gadgets.
Definition: gadget.h:49
tbx::ComponentId add(unsigned int count=1)
Add row(s) to the end of the list.
Definition: gadgetlistview.cc:232
Class to represent a margin around an area.
Definition: margin.h:35
void copy_interface(GadgetListCopyRow *copy)
Set object that implement the copy row interface to copy data from one row to another.
Definition: gadgetlistview.cc:219