32 #ifndef TBX_REPORTVIEW_H_ 33 #define TBX_REPORTVIEW_H_ 50 unsigned int _column_gap;
57 std::vector<ColInfo> _columns;
90 void column_width(
unsigned int column,
unsigned int width);
93 void size_column_to_width(
unsigned int column,
unsigned int min_width = 0,
unsigned int max_width = 0xFFFFFFFF);
94 void size_all_to_width(
unsigned int min_width = 0,
unsigned int max_width = 0xFFFFFFFF);
112 virtual void inserted(
unsigned int where,
unsigned int how_many);
113 virtual void removing(
unsigned int where,
unsigned int how_many);
114 virtual void removed(
unsigned int where,
unsigned int how_many);
115 virtual void changing(
unsigned int where,
unsigned int how_many);
116 virtual void changed(
unsigned int where,
unsigned int how_many);
120 void cell_changed(
unsigned int index,
unsigned int column);
132 virtual void get_bounds(
BBox &bounds,
unsigned int first,
unsigned int last)
const;
virtual void redraw(const tbx::RedrawEvent &event)
Redraw the window.
Definition: reportview.cc:800
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:34
virtual void removed(unsigned int where, unsigned int how_many)
Call after removing rows from the collection the ReportView is showing.
Definition: reportview.cc:493
virtual void changing(unsigned int where, unsigned int how_many)
Inform the view that items are about to be changed.
Definition: reportview.cc:540
Class to handle the display/interaction with a list of items presented in columns.
Definition: reportview.h:45
unsigned int add_column(ItemRenderer *cr, unsigned int width=0)
Add a column to the report view.
Definition: reportview.cc:197
unsigned int column_from_x(int x) const
Get column from position on window.
Definition: reportview.cc:762
unsigned int column_count() const
Get the number of columns in the report view.
Definition: reportview.h:84
virtual void get_bounds(BBox &bounds, unsigned int index) const
Get bounding box of the given index in work area coordinates.
Definition: reportview.cc:964
Helper classes to display and edit data.
virtual void update_window_extent()
Called to update the window extent needed to contain this view.
Definition: reportview.cc:154
unsigned int row_count() const
Get the number of rows in the report view.
Definition: reportview.h:88
int x_from_column(unsigned int column) const
Return x coordinate relative to window of column.
Definition: reportview.cc:781
void cell_changing(unsigned int index, unsigned int column)
Inform the view that one column has been changed.
Definition: reportview.cc:678
Class to represent a two dimensional bounding box.
Definition: bbox.h:37
tbx::Window & window()
Return the Window that this item view is attached to.
Definition: itemview.h:107
void cell_changed(unsigned int index, unsigned int column)
Inform the view that items have been changed.
Definition: reportview.cc:702
bool adjust_max_width(unsigned int start, unsigned int end)
Adjust column widths and total width if any items in the given range exceed the current widths...
Definition: reportview.cc:343
virtual unsigned int insert_index(const Point &scr_pt) const
Return the index for inserting an item from a screen point.
Definition: reportview.cc:870
virtual unsigned int screen_index(const Point &scr_pt) const
Return the index under the screen point, does not check if it hits content of the item renderer...
Definition: reportview.cc:894
unsigned int row_height() const
Get the height of one row of the report.
Definition: reportview.h:69
Base class for views that show an indexed list of items.
Definition: itemview.h:63
virtual void inserted(unsigned int where, unsigned int how_many)
Call after inserting rows into the collection the ReportView is showing.
Definition: reportview.cc:417
bool adjust_min_width(unsigned int from, unsigned int end)
Check if any of the column widths have been reduced and adjust columns if necessary.
Definition: reportview.cc:380
virtual void process_drag_selection(const BBox &drag_box, bool adjust)
Override this method to process selection by dragging.
Definition: reportview.cc:1014
ReportView(tbx::Window window)
Construct a report view for a window.
Definition: reportview.cc:43
virtual ~ReportView()
Destructor of report view.
Definition: reportview.cc:52
void column_width(unsigned int column, unsigned int width)
Set the column width.
Definition: reportview.cc:242
Base class to render an indexed item.
Definition: itemrenderer.h:53
virtual void refresh()
Called to refresh the entire views contents.
Definition: reportview.cc:178
Class to represent a position in two dimensional space.
Definition: point.h:36
virtual void changed(unsigned int where, unsigned int how_many)
Inform the view that items have been changed.
Definition: reportview.cc:573
Event passed to redraw listener to give details on the area that needs a redraw.
Definition: redrawlistener.h:43
unsigned int calc_row_height() const
Calculate the row height from the first row of the report.
Definition: reportview.cc:88
virtual unsigned int hit_test(const Point &scr_pt) const
Return the index under the screen point, checks if it hits content of the item renderer.
Definition: reportview.cc:918
bool auto_size() const
Returns true if auto size is on.
Definition: itemview.h:128
The Window object represents a toolbox window.
Definition: window.h:69
unsigned int _count
Number of items displayed in this view.
Definition: itemview.h:75
void remove_column(unsigned int column)
Remove column from report.
Definition: reportview.cc:223
virtual void cleared()
Whole view has been cleared.
Definition: reportview.cc:636
virtual void removing(unsigned int where, unsigned int how_many)
Inform the view that items are about to be removed.
Definition: reportview.cc:458
void size_column_to_width(unsigned int column, unsigned int min_width=0, unsigned int max_width=0xFFFFFFFF)
Size column to content.
Definition: reportview.cc:282
unsigned int column_gap() const
Get the gap between columns in the report.
Definition: reportview.h:75
void get_cell_bounds(BBox &bounds, unsigned int row, unsigned int column) const
Get the cell bounds for the specified column and row.
Definition: reportview.cc:997
void size_all_to_width(unsigned int min_width=0, unsigned int max_width=0xFFFFFFFF)
Size all columns to content.
Definition: reportview.cc:306