Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted class Fl_Sys_Menu_Bar to the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12575 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
- Loading branch information
Manolo Gouy
authored and
Manolo Gouy
committed
Dec 2, 2017
1 parent
a8fe10c
commit 34dd1b1
Showing
8 changed files
with
358 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// "$Id$" | ||
// | ||
// system menu bar widget for the Fast Light Tool Kit (FLTK). | ||
// | ||
// Copyright 1998-2017 by Bill Spitzak and others. | ||
// | ||
// This library is free software. Distribution and use rights are outlined in | ||
// the file "COPYING" which should have been included with this file. If this | ||
// file is missing or damaged, see the license at: | ||
// | ||
// http://www.fltk.org/COPYING.php | ||
// | ||
// Please report all bugs and problems on the following page: | ||
// | ||
// http://www.fltk.org/str.php | ||
// | ||
|
||
#ifndef Fl_Sys_Menu_Bar_Driver_H | ||
#define Fl_Sys_Menu_Bar_Driver_H | ||
|
||
#include <FL/Fl_Sys_Menu_Bar.H> | ||
|
||
class Fl_Sys_Menu_Bar_Driver { | ||
friend class Fl_Sys_Menu_Bar; | ||
protected: | ||
Fl_Sys_Menu_Bar *bar; | ||
public: | ||
Fl_Sys_Menu_Bar_Driver(); | ||
virtual ~Fl_Sys_Menu_Bar_Driver(); | ||
virtual void update() {} | ||
virtual void draw() { bar->Fl_Menu_Bar::draw();} | ||
virtual void about(Fl_Callback *cb, void *data) {} | ||
virtual int add(const char* label, int shortcut, Fl_Callback *cb, void *user_data, int flags) { | ||
return bar->Fl_Menu_Bar::add(label, shortcut, cb, user_data, flags); | ||
} | ||
virtual int add(const char* str) { return bar->Fl_Menu_Bar::add(str); } | ||
virtual int insert(int index, const char* label, int shortcut, Fl_Callback *cb, void *user_data, int flags) { | ||
return bar->Fl_Menu_Bar::insert(index, label, shortcut, cb, user_data, flags); | ||
} | ||
virtual void menu(const Fl_Menu_Item *m) { bar->Fl_Menu_Bar::menu(m); } | ||
virtual void shortcut(int i, int s) { bar->Fl_Menu_Bar::shortcut(i, s); } | ||
virtual void setonly(Fl_Menu_Item *item) { bar->Fl_Menu_Bar::setonly(item); } | ||
virtual void clear() { bar->Fl_Menu_Bar::clear(); } | ||
virtual int clear_submenu(int index) { return bar->Fl_Menu_Bar::clear_submenu(index);} | ||
virtual void remove(int index) { bar->Fl_Menu_Bar::remove(index); } | ||
virtual void replace(int index, const char *name) { bar->Fl_Menu_Bar::replace(index, name); } | ||
virtual void mode(int i, int fl) { bar->Fl_Menu_Bar::mode(i, fl); } | ||
|
||
static Fl_Sys_Menu_Bar_Driver *driver_; // to be assigned with a unique object of this class or of a derived class | ||
}; | ||
|
||
|
||
#endif // Fl_Sys_Menu_Bar_Driver_H | ||
|
||
// | ||
// End of "$Id$". | ||
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.