summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2010-10-26 11:30:58 +0000
committerGreg Ercolano <erco@seriss.com>2010-10-26 11:30:58 +0000
commite831cf9dcf7681ae66746298f6106c005849b7a2 (patch)
tree8a6aae7d3989703c6a39e58d40d0971c7f6cab1f /src
parent347007964e5e0a131afa34bff3061dcafe24f021 (diff)
doxygen fixes:
o Docs added for set_selection(), get_selection(), is_selected() o Renamed confusing variable names for get/set selection functions. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7751 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Table.cxx51
1 files changed, 37 insertions, 14 deletions
diff --git a/src/Fl_Table.cxx b/src/Fl_Table.cxx
index 9a14ec1d9..96fb838dc 100644
--- a/src/Fl_Table.cxx
+++ b/src/Fl_Table.cxx
@@ -1041,6 +1041,10 @@ void Fl_Table::_redraw_cell(TableContext context, int r, int c) {
draw_cell(context, r, c, X, Y, W, H); // call users' function to draw it
}
+/**
+ See if the cell at row \p r and column \p c is selected.
+ \returns 1 if the cell is selected, 0 if not.
+ */
int Fl_Table::is_selected(int r, int c) {
int s_left, s_right, s_top, s_bottom;
@@ -1064,29 +1068,48 @@ int Fl_Table::is_selected(int r, int c) {
return 0;
}
-void Fl_Table::get_selection(int& s_top, int& s_left, int& s_bottom, int& s_right) {
+/**
+ Gets the region of cells selected (highlighted).
+
+ \param[in] row_top Returns the top row of selection area
+ \param[in] col_left Returns the left column of selection area
+ \param[in] row_bot Returns the bottom row of selection area
+ \param[in] col_right Returns the right column of selection area
+*/
+void Fl_Table::get_selection(int& row_top, int& col_left, int& row_bot, int& col_right) {
if (select_col > current_col) {
- s_left = current_col;
- s_right = select_col;
+ col_left = current_col;
+ col_right = select_col;
} else {
- s_right = current_col;
- s_left = select_col;
+ col_right = current_col;
+ col_left = select_col;
}
if (select_row > current_row) {
- s_top = current_row;
- s_bottom = select_row;
+ row_top = current_row;
+ row_bot = select_row;
} else {
- s_bottom = current_row;
- s_top = select_row;
+ row_bot = current_row;
+ row_top = select_row;
}
}
-void Fl_Table::set_selection(int s_top, int s_left, int s_bottom, int s_right) {
+/**
+ Sets the region of cells to be selected (highlighted).
+
+ So for instance, set_selection(0,0,0,0) selects the top/left cell in the table.
+ And set_selection(0,0,1,1) selects the four cells in rows 0 and 1, column 0 and 1.
+
+ \param[in] row_top Top row of selection area
+ \param[in] col_left Left column of selection area
+ \param[in] row_bot Bottom row of selection area
+ \param[in] col_right Right column of selection area
+*/
+void Fl_Table::set_selection(int row_top, int col_left, int row_bot, int col_right) {
damage_zone(current_row, current_col, select_row, select_col);
- current_col = s_left;
- current_row = s_top;
- select_col = s_right;
- select_row = s_bottom;
+ current_col = col_left;
+ current_row = row_top;
+ select_col = col_right;
+ select_row = row_bot;
damage_zone(current_row, current_col, select_row, select_col);
}