summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2022-12-30 19:14:36 +0100
committerGitHub <noreply@github.com>2022-12-30 19:14:36 +0100
commit44c874b731f9f58c2f50c3c6076371058cbe26e3 (patch)
tree2386dfcc700c41a1109fc78b96875c11056abcc9 /examples
parentf58a93a159105336136ce6e54ab7fc161e4fa15a (diff)
Use `FL_OVERRIDE` for all overridden virtual methods (#611)
FL_OVERRIDE is defined as `override` for C++11 and higher FL_OVERRIDE is defined as `override` for VisualC 2015 and newer Don't interfere with Fl_Widget::override()
Diffstat (limited to 'examples')
-rw-r--r--examples/OpenGL3test.cxx4
-rw-r--r--examples/draggable-group.cxx2
-rw-r--r--examples/howto-drag-and-drop.cxx4
-rw-r--r--examples/howto-draw-an-x.cxx2
-rw-r--r--examples/shapedwindow.cxx2
-rw-r--r--examples/table-as-container.cxx2
-rw-r--r--examples/table-simple.cxx2
-rw-r--r--examples/table-sort.cxx4
-rw-r--r--examples/table-spreadsheet-with-keyboard-nav.cxx6
-rw-r--r--examples/table-spreadsheet.cxx2
-rw-r--r--examples/table-with-keynav.cxx4
-rw-r--r--examples/table-with-right-column-stretch-fit.cxx4
-rw-r--r--examples/tree-custom-draw-items.cxx2
-rw-r--r--examples/tree-of-tables.cxx4
14 files changed, 22 insertions, 22 deletions
diff --git a/examples/OpenGL3test.cxx b/examples/OpenGL3test.cxx
index 528610553..5f373635b 100644
--- a/examples/OpenGL3test.cxx
+++ b/examples/OpenGL3test.cxx
@@ -49,7 +49,7 @@ public:
shaderProgram = 0;
gl_version_major = 0;
}
- void draw(void) {
+ void draw(void) FL_OVERRIDE {
if (gl_version_major >= 3 && !shaderProgram) {
GLuint vs;
GLuint fs;
@@ -141,7 +141,7 @@ public:
}
Fl_Gl_Window::draw(); // Draw FLTK child widgets.
}
- virtual int handle(int event) {
+ int handle(int event) FL_OVERRIDE {
static int first = 1;
if (first && event == FL_SHOW && shown()) {
first = 0;
diff --git a/examples/draggable-group.cxx b/examples/draggable-group.cxx
index 9bfd4694f..5ec92d826 100644
--- a/examples/draggable-group.cxx
+++ b/examples/draggable-group.cxx
@@ -92,7 +92,7 @@ public:
All other events are handled in Fl_Group::handle().
Dragged widgets are limited inside the borders of their parent group.
*/
- virtual int handle(int e) {
+ int handle(int e) FL_OVERRIDE {
switch (e) {
diff --git a/examples/howto-drag-and-drop.cxx b/examples/howto-drag-and-drop.cxx
index 856838d61..72e32996d 100644
--- a/examples/howto-drag-and-drop.cxx
+++ b/examples/howto-drag-and-drop.cxx
@@ -38,7 +38,7 @@ public:
label("Drag\nfrom\nhere..");
}
// Sender event handler
- int handle(int event) {
+ int handle(int event) FL_OVERRIDE {
int ret = Fl_Box::handle(event);
switch ( event ) {
case FL_PUSH: { // do 'copy/dnd' when someone clicks on box
@@ -64,7 +64,7 @@ public:
dnd_text = 0;
}
// Receiver event handler
- int handle(int event) {
+ int handle(int event) FL_OVERRIDE {
int ret = Fl_Box::handle(event);
int len;
switch ( event ) {
diff --git a/examples/howto-draw-an-x.cxx b/examples/howto-draw-an-x.cxx
index c1bce5b0f..c8b66b1c4 100644
--- a/examples/howto-draw-an-x.cxx
+++ b/examples/howto-draw-an-x.cxx
@@ -27,7 +27,7 @@ class DrawX : public Fl_Widget {
public:
DrawX(int X, int Y, int W, int H, const char*L=0) : Fl_Widget(X,Y,W,H,L) {
}
- void draw() {
+ virtual void draw() FL_OVERRIDE {
// Draw background - a white filled rectangle
fl_color(FL_WHITE); fl_rectf(x(),y(),w(),h());
// Draw black 'X' over base widget's background
diff --git a/examples/shapedwindow.cxx b/examples/shapedwindow.cxx
index b06a6c0fb..36433fb13 100644
--- a/examples/shapedwindow.cxx
+++ b/examples/shapedwindow.cxx
@@ -33,7 +33,7 @@ void cb(Fl_Widget *w, void *) {
class dragbox : public Fl_Box {
public:
dragbox(int x, int y, int w, int h, const char *t=0) : Fl_Box(x,y,w,h,t) {}
- int handle(int event) {
+ int handle(int event) FL_OVERRIDE {
static int fromx, fromy, winx, winy;
if (event == FL_PUSH) {
fromx = Fl::event_x_root();
diff --git a/examples/table-as-container.cxx b/examples/table-as-container.cxx
index d5887439d..5c0051bfb 100644
--- a/examples/table-as-container.cxx
+++ b/examples/table-as-container.cxx
@@ -40,7 +40,7 @@ void button_cb(Fl_Widget *w, void*);
class WidgetTable : public Fl_Table {
protected:
void draw_cell(TableContext context, // table cell drawing
- int R=0, int C=0, int X=0, int Y=0, int W=0, int H=0);
+ int R=0, int C=0, int X=0, int Y=0, int W=0, int H=0) FL_OVERRIDE;
public:
WidgetTable(int x, int y, int w, int h, const char *l=0) : Fl_Table(x,y,w,h,l) {
diff --git a/examples/table-simple.cxx b/examples/table-simple.cxx
index accf3f3bb..e4f520228 100644
--- a/examples/table-simple.cxx
+++ b/examples/table-simple.cxx
@@ -59,7 +59,7 @@ class MyTable : public Fl_Table {
// Fl_Table calls this function to draw each visible cell in the table.
// It's up to us to use FLTK's drawing functions to draw the cells the way we want.
//
- void draw_cell(TableContext context, int ROW=0, int COL=0, int X=0, int Y=0, int W=0, int H=0) {
+ void draw_cell(TableContext context, int ROW=0, int COL=0, int X=0, int Y=0, int W=0, int H=0) FL_OVERRIDE {
static char s[40];
switch ( context ) {
case CONTEXT_STARTPAGE: // before page is drawn..
diff --git a/examples/table-sort.cxx b/examples/table-sort.cxx
index ec3498c83..5e2afa725 100644
--- a/examples/table-sort.cxx
+++ b/examples/table-sort.cxx
@@ -97,8 +97,8 @@ private:
void event_callback2(); // callback for table events
protected:
- void draw_cell(TableContext context, int R=0, int C=0, // table cell drawing
- int X=0, int Y=0, int W=0, int H=0);
+ void draw_cell(TableContext context, int R=0, int C=0, // table cell drawing
+ int X=0, int Y=0, int W=0, int H=0) FL_OVERRIDE;
void sort_column(int col, int reverse=0); // sort table by a column
void draw_sort_arrow(int X,int Y,int W,int H);
diff --git a/examples/table-spreadsheet-with-keyboard-nav.cxx b/examples/table-spreadsheet-with-keyboard-nav.cxx
index ec8714df3..8b6dd7510 100644
--- a/examples/table-spreadsheet-with-keyboard-nav.cxx
+++ b/examples/table-spreadsheet-with-keyboard-nav.cxx
@@ -40,7 +40,7 @@ class Spreadsheet : public Fl_Table {
int s_left, s_top, s_right, s_bottom; // kb nav + mouse selection
protected:
- void draw_cell(TableContext context,int=0,int=0,int=0,int=0,int=0,int=0);
+ void draw_cell(TableContext context,int=0,int=0,int=0,int=0,int=0,int=0) FL_OVERRIDE;
void event_callback2(); // table's event callback (instance)
static void event_callback(Fl_Widget*, void *v) { // table's event callback (static)
((Spreadsheet*)v)->event_callback2();
@@ -75,11 +75,11 @@ public:
window()->cursor(FL_CURSOR_DEFAULT); // XXX: if we don't do this, cursor can disappear!
}
// Change number of rows
- void rows(int val) {
+ void rows(int val) FL_OVERRIDE {
Fl_Table::rows(val);
}
// Change number of columns
- void cols(int val) {
+ void cols(int val) FL_OVERRIDE {
Fl_Table::cols(val);
}
// Get number of rows
diff --git a/examples/table-spreadsheet.cxx b/examples/table-spreadsheet.cxx
index ac7c334e0..2b792231b 100644
--- a/examples/table-spreadsheet.cxx
+++ b/examples/table-spreadsheet.cxx
@@ -31,7 +31,7 @@ class Spreadsheet : public Fl_Table {
int row_edit, col_edit; // row/col being modified
protected:
- void draw_cell(TableContext context,int=0,int=0,int=0,int=0,int=0,int=0);
+ void draw_cell(TableContext context,int=0,int=0,int=0,int=0,int=0,int=0) FL_OVERRIDE;
void event_callback2(); // table's event callback (instance)
static void event_callback(Fl_Widget*,void *v) { // table's event callback (static)
((Spreadsheet*)v)->event_callback2();
diff --git a/examples/table-with-keynav.cxx b/examples/table-with-keynav.cxx
index ee5f98ed5..fb28d4523 100644
--- a/examples/table-with-keynav.cxx
+++ b/examples/table-with-keynav.cxx
@@ -41,7 +41,7 @@ Fl_Output *G_sum = 0; // displays sum of user's select
class MyTable : public Fl_Table_Row {
protected:
// Handle drawing all cells in table
- void draw_cell(TableContext context, int R=0,int C=0, int X=0,int Y=0,int W=0,int H=0) {
+ void draw_cell(TableContext context, int R=0,int C=0, int X=0,int Y=0,int W=0,int H=0) FL_OVERRIDE {
static char s[30];
switch ( context ) {
case CONTEXT_COL_HEADER:
@@ -119,7 +119,7 @@ public:
{ G_sum->value(s); G_sum->redraw(); }
}
// Keyboard and mouse events
- int handle(int e) {
+ int handle(int e) FL_OVERRIDE {
int ret = Fl_Table_Row::handle(e);
if ( e == FL_KEYBOARD && Fl::event_key() == FL_Escape ) exit(0);
switch (e) {
diff --git a/examples/table-with-right-column-stretch-fit.cxx b/examples/table-with-right-column-stretch-fit.cxx
index 374bcec5b..c6722fc61 100644
--- a/examples/table-with-right-column-stretch-fit.cxx
+++ b/examples/table-with-right-column-stretch-fit.cxx
@@ -59,7 +59,7 @@ class MyTable : public Fl_Table {
// Fl_Table calls this function to draw each visible cell in the table.
// It's up to us to use FLTK's drawing functions to draw the cells the way we want.
//
- void draw_cell(TableContext context, int ROW=0, int COL=0, int X=0, int Y=0, int W=0, int H=0) {
+ void draw_cell(TableContext context, int ROW=0, int COL=0, int X=0, int Y=0, int W=0, int H=0) FL_OVERRIDE {
static char s[40];
switch ( context ) {
case CONTEXT_STARTPAGE: // before page is drawn..
@@ -115,7 +115,7 @@ public:
}
// Handle window resizing
- void resize(int X,int Y,int W,int H) {
+ void resize(int X,int Y,int W,int H) FL_OVERRIDE {
Fl_Table::resize(X,Y,W,H);
FixColumnSize(); // after letting window resize, fix our right most column
}
diff --git a/examples/tree-custom-draw-items.cxx b/examples/tree-custom-draw-items.cxx
index e7fb3ecde..8101b54e2 100644
--- a/examples/tree-custom-draw-items.cxx
+++ b/examples/tree-custom-draw-items.cxx
@@ -59,7 +59,7 @@ public:
// that we want the user to be able to use the horizontal scrollbar
// to reach.
//
- int draw_item_content(int render) {
+ int draw_item_content(int render) FL_OVERRIDE {
Fl_Color fg = drawfgcolor();
Fl_Color bg = drawbgcolor();
// Show the date and time as two small strings
diff --git a/examples/tree-of-tables.cxx b/examples/tree-of-tables.cxx
index f26d685b0..94c7705a9 100644
--- a/examples/tree-of-tables.cxx
+++ b/examples/tree-of-tables.cxx
@@ -37,7 +37,7 @@ public:
this->mode = mode;
end();
}
- void resize(int X,int Y,int W,int H) {
+ void resize(int X,int Y,int W,int H) FL_OVERRIDE {
if ( W > 718 ) W = 718; // don't exceed 700 in width
Fl_Table::resize(X,Y,W,h()); // disallow changes in height
}
@@ -45,7 +45,7 @@ public:
// Fl_Table calls this function to draw each visible cell in the table.
// It's up to us to use FLTK's drawing functions to draw the cells the way we want.
//
- void draw_cell(TableContext context, int ROW, int COL, int X, int Y, int W, int H) {
+ void draw_cell(TableContext context, int ROW, int COL, int X, int Y, int W, int H) FL_OVERRIDE {
static char s[40];
switch ( context ) {
case CONTEXT_STARTPAGE: // before page is drawn..