Changeset 9b4e33b4404dbc6d313345aae3fe87c4351e8453

Show
Ignore:
Timestamp:
04/11/03 23:19:49 (5 years ago)
Author:
VideoLAN <videolan@videolan.org>
git-committer:
VideoLAN <videolan@videolan.org> 1050095989 +0000
git-parent:

[c31926a0489ced7523294ef7bd74c3bee9ea3ae0]

git-author:
VideoLAN <videolan@videolan.org> 1050095989 +0000
Message:

* Fixed bug: When button or checkbox are disabled, the previous control can't

take the hand

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/skins/controls/button.cpp

    r8558137 r9b4e33b  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: button.cpp,v 1.4 2003/03/20 09:29:07 karibu Exp $ 
     5 * $Id: button.cpp,v 1.5 2003/04/11 21:19:49 videolan Exp $ 
    66 * 
    77 * Authors: Olivier Teuli� <ipkiss@via.ecp.fr> 
     
    135135bool ControlButton::MouseUp( int x, int y, int button ) 
    136136{ 
    137     if( !Enabled ) 
    138         return false; 
    139  
    140     if( Img[1]->Hit( x - Left, y - Top ) && button == 1 && Selected ) 
    141     { 
    142         State = 1; 
    143         Selected = false; 
    144         ClickAction->SendEvent(); 
    145         ParentWindow->Refresh( Left, Top, Width, Height ); 
    146         return true; 
     137    // If hit in the button 
     138    if( Img[1]->Hit( x - Left, y - Top ) ) 
     139    { 
     140        if( !Enabled ) 
     141            return true; 
     142 
     143        if( button == 1 && Selected ) 
     144        { 
     145            State = 1; 
     146            Selected = false; 
     147            ClickAction->SendEvent(); 
     148            ParentWindow->Refresh( Left, Top, Width, Height ); 
     149            return true; 
     150        } 
    147151    } 
    148152 
     
    155159bool ControlButton::MouseDown( int x, int y, int button ) 
    156160{ 
    157     if( !Enabled ) 
    158         return false; 
    159  
    160     if( Img[0]->Hit( x - Left, y - Top ) && button == 1 ) 
    161     { 
    162         State = 0; 
    163         Selected = true; 
    164         ParentWindow->Refresh( Left, Top, Width, Height ); 
    165         return true; 
    166     } 
     161    if( Img[0]->Hit( x - Left, y - Top ) ) 
     162    { 
     163        if( !Enabled ) 
     164            return true; 
     165 
     166        if( button == 1 ) 
     167        { 
     168            State = 0; 
     169            Selected = true; 
     170            ParentWindow->Refresh( Left, Top, Width, Height ); 
     171            return true; 
     172        } 
     173    } 
     174 
    167175    return false; 
    168176} 
  • modules/gui/skins/controls/checkbox.cpp

    rfff2958 r9b4e33b  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: checkbox.cpp,v 1.2 2003/03/19 17:14:50 karibu Exp $ 
     5 * $Id: checkbox.cpp,v 1.3 2003/04/11 21:19:49 videolan Exp $ 
    66 * 
    77 * Authors: Olivier Teuli� <ipkiss@via.ecp.fr> 
     
    200200{ 
    201201    // Test enabled 
    202     if( ( !Enabled1 && Act == 1 ) || ( !Enabled2 && Act == 2 ) ) 
    203         return false; 
     202    if( ( !Enabled1 && Act == 1 && Img[1]->Hit( x - Left, y - Top ) ) || 
     203        ( !Enabled2 && Act == 2 && Img[3]->Hit( x - Left, y - Top ) ) ) 
     204            return true; 
    204205 
    205206    if( button == 1 && Selected ) 
     
    230231bool ControlCheckBox::MouseDown( int x, int y, int button ) 
    231232{ 
     233 
    232234    // Test enabled 
    233     if( ( !Enabled1 && Act == 1 ) || ( !Enabled2 && Act == 2 ) ) 
    234         return false; 
    235  
     235    if( ( !Enabled1 && Act == 1 && Img[1]->Hit( x - Left, y - Top ) ) || 
     236        ( !Enabled2 && Act == 2 && Img[3]->Hit( x - Left, y - Top ) ) ) 
     237            return true; 
    236238    if( button == 1 ) 
    237239    { 
  • modules/gui/skins/controls/image.cpp

    ra64501f r9b4e33b  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: image.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $ 
     5 * $Id: image.cpp,v 1.2 2003/04/11 21:19:49 videolan Exp $ 
    66 * 
    77 * Authors: Olivier Teuli� <ipkiss@via.ecp.fr> 
     
    9696    if( !Enabled || !Img[0]->Hit( x - Left, y - Top ) || button != 1 || 
    9797        !MouseDownAction->SendEvent() ) 
    98         return false; 
     98            return false; 
     99 
    99100    return true; 
    100101}