Changeset 169


Ignore:
Timestamp:
Aug 23, 2010, 3:56:08 AM (10 years ago)
Author:
sam
Message:

Minor code simplifications.

Location:
trunk/src/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gtk/glmapview.cpp

    r168 r169  
    142142}
    143143
    144 gboolean GlMapView::Scroll(double dx, double dy)
     144void GlMapView::Scroll(double dx, double dy)
    145145{
    146146    gtk_adjustment_set_value(hadj, gtk_adjustment_get_value(hadj) + dx);
     
    148148
    149149    UpdateAdjustments();
    150 
    151     return TRUE;
    152 }
    153 
    154 gboolean GlMapView::UpdateAdjustments()
     150}
     151
     152void GlMapView::UpdateAdjustments()
    155153{
    156154    float w = mapviewer ? mapviewer->GetWidth() : glarea->allocation.width;
     
    180178        }
    181179    }
    182 
    183     return TRUE;
    184180}
    185181
     
    213209        xpan = e->x;
    214210        ypan = e->y;
    215     }
    216 
    217     return TRUE;
     211        return TRUE;
     212    }
     213
     214    return FALSE;
    218215}
    219216
     
    222219    switch (e->keyval)
    223220    {
    224     case GDK_Up:    Scroll(  0.0, -10.0); break;
    225     case GDK_Down:  Scroll(  0.0,  10.0); break;
    226     case GDK_Left:  Scroll(-10.0,  0.0); break;
    227     case GDK_Right: Scroll( 10.0,  0.0); break;
    228     default: return FALSE;
    229     }
    230 
    231     return TRUE;
     221    case GDK_Up:    Scroll(  0.0, -10.0); return TRUE;
     222    case GDK_Down:  Scroll(  0.0,  10.0); return TRUE;
     223    case GDK_Left:  Scroll(-10.0,   0.0); return TRUE;
     224    case GDK_Right: Scroll( 10.0,   0.0); return TRUE;
     225    }
     226
     227    return FALSE;
    232228}
    233229
  • trunk/src/gtk/glmapview.h

    r168 r169  
    2222    gboolean Destroy();
    2323    gboolean Draw(GdkEventExpose *e);
    24     gboolean Scroll(double dx, double dy);
    25     gboolean UpdateAdjustments();
     24    void Scroll(double dx, double dy);
     25    void UpdateAdjustments();
    2626    gboolean MouseButton(GdkEventButton *e);
    2727    gboolean MouseMotion(GdkEventMotion *e);
Note: See TracChangeset for help on using the changeset viewer.