Changeset 9b4e33b4404dbc6d313345aae3fe87c4351e8453
- 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
| r8558137 |
r9b4e33b |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Olivier Teuli� <ipkiss@via.ecp.fr> |
|---|
| … | … | |
| 135 | 135 | bool ControlButton::MouseUp( int x, int y, int button ) |
|---|
| 136 | 136 | { |
|---|
| 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 | } |
|---|
| 147 | 151 | } |
|---|
| 148 | 152 | |
|---|
| … | … | |
| 155 | 159 | bool ControlButton::MouseDown( int x, int y, int button ) |
|---|
| 156 | 160 | { |
|---|
| 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 | |
|---|
| 167 | 175 | return false; |
|---|
| 168 | 176 | } |
|---|
| rfff2958 |
r9b4e33b |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Olivier Teuli� <ipkiss@via.ecp.fr> |
|---|
| … | … | |
| 200 | 200 | { |
|---|
| 201 | 201 | // 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; |
|---|
| 204 | 205 | |
|---|
| 205 | 206 | if( button == 1 && Selected ) |
|---|
| … | … | |
| 230 | 231 | bool ControlCheckBox::MouseDown( int x, int y, int button ) |
|---|
| 231 | 232 | { |
|---|
| | 233 | |
|---|
| 232 | 234 | // 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; |
|---|
| 236 | 238 | if( button == 1 ) |
|---|
| 237 | 239 | { |
|---|
| ra64501f |
r9b4e33b |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Olivier Teuli� <ipkiss@via.ecp.fr> |
|---|
| … | … | |
| 96 | 96 | if( !Enabled || !Img[0]->Hit( x - Left, y - Top ) || button != 1 || |
|---|
| 97 | 97 | !MouseDownAction->SendEvent() ) |
|---|
| 98 | | return false; |
|---|
| | 98 | return false; |
|---|
| | 99 | |
|---|
| 99 | 100 | return true; |
|---|
| 100 | 101 | } |
|---|