summaryrefslogtreecommitdiff
path: root/src/Fl_Dial.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2017-06-29 01:13:05 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2017-06-29 01:13:05 +0000
commitc6c4e8d426bba89736d1fc79eb464c5b6d14935f (patch)
tree40421da5d11950afd100e8d07cb90810fb0d2bff /src/Fl_Dial.cxx
parent14a6e9d10382944aa1d91438cc2cccdc3e17da04 (diff)
Remove unnecessary Fl_Widget_Tracker from Fl_Dial's handle().
handle_push() doesn't call a callback, hence Fl_Widget_Tracker is not necessary. Added FALLTHROUGH and NOTREACHED comments. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12279 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Dial.cxx')
-rw-r--r--src/Fl_Dial.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Fl_Dial.cxx b/src/Fl_Dial.cxx
index a29163ddc..333c9d549 100644
--- a/src/Fl_Dial.cxx
+++ b/src/Fl_Dial.cxx
@@ -103,10 +103,9 @@ void Fl_Dial::draw() {
*/
int Fl_Dial::handle(int event, int X, int Y, int W, int H) {
switch (event) {
- case FL_PUSH: {
- Fl_Widget_Tracker wp(this);
+ case FL_PUSH:
handle_push();
- if (wp.deleted()) return 1; }
+ /* FALLTHROUGH */
case FL_DRAG: {
int mx = (Fl::event_x()-X-W/2)*H;
int my = (Fl::event_y()-Y-H/2)*W;
@@ -124,12 +123,13 @@ int Fl_Dial::handle(int event, int X, int Y, int W, int H) {
val = minimum() + (maximum()-minimum())*(angle-a1)/(a2-a1);
}
handle_drag(clamp(round(val)));
- } return 1;
+ return 1;
+ } /* NOTREACHED */
case FL_RELEASE:
handle_release();
return 1;
- case FL_ENTER : /* FALLTHROUGH */
- case FL_LEAVE :
+ case FL_ENTER: /* FALLTHROUGH */
+ case FL_LEAVE:
return 1;
default:
return 0;
@@ -163,8 +163,7 @@ Fl_Fill_Dial::Fl_Fill_Dial(int X,int Y,int W,int H, const char *L)
Fl_Line_Dial::Fl_Line_Dial(int X,int Y,int W,int H, const char *L)
-: Fl_Dial(X,Y,W,H,L)
-{
+: Fl_Dial(X,Y,W,H,L) {
type(FL_LINE_DIAL);
}