aboutsummaryrefslogtreecommitdiff
path: root/dw/fltkcomplexbutton.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-08-20 23:24:19 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-08-20 23:24:19 +0200
commitf5c598b518d1f906148534d015f50075d3e8242d (patch)
tree21dd70add5b366c3dd80641b77f6b18e0baa009e /dw/fltkcomplexbutton.cc
parente98d02a01ffeb18ede86af025e51ae1ec011c75a (diff)
parent5f0fc0e48b8cbee7e1795935da0abff6627fd498 (diff)
merge
Diffstat (limited to 'dw/fltkcomplexbutton.cc')
-rw-r--r--dw/fltkcomplexbutton.cc43
1 files changed, 22 insertions, 21 deletions
diff --git a/dw/fltkcomplexbutton.cc b/dw/fltkcomplexbutton.cc
index 6c15cee3..f80d0eb0 100644
--- a/dw/fltkcomplexbutton.cc
+++ b/dw/fltkcomplexbutton.cc
@@ -1,21 +1,22 @@
-//
-//
-// Copyright 1998-2006 by Bill Spitzak and others.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 3 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
+
+// fltkcomplexbutton.cc contains code from FLTK2's src/Button.cxx
+// that is Copyright 1998-2006 by Bill Spitzak and others.
+// (see http://svn.easysw.com/public/fltk/fltk/trunk/src/Button.cxx)
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
#include <fltk/events.h>
#include <fltk/damage.h>
@@ -87,7 +88,7 @@ int ComplexButton::handle(int event, const Rectangle& rectangle) {
if (pushed()) return 1; // ignore extra pushes on currently-pushed button
initial_state = state();
clear_flag(PUSHED);
- do_callback();
+ /* do_callback(); */
case DRAG: {
bool inside = event_inside(rectangle);
if (inside) {
@@ -112,7 +113,7 @@ int ComplexButton::handle(int event, const Rectangle& rectangle) {
redraw(DAMAGE_VALUE);
if (type() == RADIO)
setonly();
- else if (type()) // TOGGLE
+ else if (type() == TOGGLE)
state(!initial_state);
else {
state(initial_state);
@@ -139,7 +140,7 @@ int ComplexButton::handle(int event, const Rectangle& rectangle) {
setonly();
if (when() & WHEN_CHANGED) do_callback(); else set_changed();
}
- } else if (type()) { // TOGGLE
+ } else if (type() == TOGGLE) {
state(!state());
if (when() & WHEN_CHANGED) do_callback(); else set_changed();
}