Author: greg.ercolano
Date: 2010-10-26 04:30:58 -0700 (Tue, 26 Oct 2010)
New Revision: 7751
Log:
doxygen fixes:
o Docs added for set_selection(), get_selection(), is_selected()
o Renamed confusing variable names for get/set selection functions.
Modified:
branches/branch-1.3/FL/Fl_Table.H
branches/branch-1.3/src/Fl_Table.cxx
Modified: branches/branch-1.3/FL/Fl_Table.H
===================================================================
--- branches/branch-1.3/FL/Fl_Table.H 2010-10-26 10:58:42 UTC (rev 7750)
+++ branches/branch-1.3/FL/Fl_Table.H 2010-10-26 11:30:58 UTC (rev 7751)
@@ -816,8 +816,8 @@
return(row_position());
}
int is_selected(int r, int c); // selected cell
- void get_selection(int& s_top, int& s_left, int& s_bottom, int& s_right);
- void set_selection(int s_top, int s_left, int s_bottom, int s_right);
+ void get_selection(int &row_top, int &col_left, int &row_bot, int
&col_right);
+ void set_selection(int row_top, int col_left, int row_bot, int col_right);
int move_cursor(int R, int C);
/**
Modified: branches/branch-1.3/src/Fl_Table.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Table.cxx 2010-10-26 10:58:42 UTC (rev
7750)
+++ branches/branch-1.3/src/Fl_Table.cxx 2010-10-26 11:30:58 UTC (rev
7751)
@@ -1041,6 +1041,10 @@
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 @@
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);
}
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit