|
Lines 3-9
Link Here
|
| 3 |
// Purpose: generic implementation of wxListCtrl |
3 |
// Purpose: generic implementation of wxListCtrl |
| 4 |
// Author: Robert Roebling |
4 |
// Author: Robert Roebling |
| 5 |
// Vadim Zeitlin (virtual list control support) |
5 |
// Vadim Zeitlin (virtual list control support) |
| 6 |
// Id: $Id: listctrl.cpp,v 1.378.2.7 2006/03/10 21:37:20 RD Exp $ |
6 |
// Id: $Id: listctrl.cpp,v 1.378.2.8 2006/03/28 08:25:51 RR Exp $ |
| 7 |
// Copyright: (c) 1998 Robert Roebling |
7 |
// Copyright: (c) 1998 Robert Roebling |
| 8 |
// Licence: wxWindows licence |
8 |
// Licence: wxWindows licence |
| 9 |
///////////////////////////////////////////////////////////////////////////// |
9 |
///////////////////////////////////////////////////////////////////////////// |
|
Lines 2914-2919
Link Here
|
| 2914 |
|
2914 |
|
| 2915 |
void wxListMainWindow::OnMouse( wxMouseEvent &event ) |
2915 |
void wxListMainWindow::OnMouse( wxMouseEvent &event ) |
| 2916 |
{ |
2916 |
{ |
|
|
2917 |
|
| 2917 |
#ifdef __WXMAC__ |
2918 |
#ifdef __WXMAC__ |
| 2918 |
// On wxMac we can't depend on the EVT_KILL_FOCUS event to properly |
2919 |
// On wxMac we can't depend on the EVT_KILL_FOCUS event to properly |
| 2919 |
// shutdown the edit control when the mouse is clicked elsewhere on the |
2920 |
// shutdown the edit control when the mouse is clicked elsewhere on the |
|
Lines 2937-2943
Link Here
|
| 2937 |
} |
2938 |
} |
| 2938 |
|
2939 |
|
| 2939 |
if ( !HasCurrent() || IsEmpty() ) |
2940 |
if ( !HasCurrent() || IsEmpty() ) |
|
|
2941 |
{ |
| 2942 |
if (event.RightDown()) |
| 2943 |
{ |
| 2944 |
SendNotify( (size_t)-1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, event.GetPosition() ); |
| 2945 |
// Allow generation of context menu event |
| 2946 |
event.Skip(); |
| 2947 |
} |
| 2940 |
return; |
2948 |
return; |
|
|
2949 |
} |
| 2941 |
|
2950 |
|
| 2942 |
if (m_dirty) |
2951 |
if (m_dirty) |
| 2943 |
return; |
2952 |
return; |
|
Lines 3005-3015
Link Here
|
| 3005 |
m_dragCount = 0; |
3014 |
m_dragCount = 0; |
| 3006 |
} |
3015 |
} |
| 3007 |
|
3016 |
|
| 3008 |
if ( !hitResult ) |
3017 |
if ( !hitResult ) |
| 3009 |
{ |
3018 |
{ |
| 3010 |
// outside of any item |
3019 |
if (event.RightDown()) |
| 3011 |
return; |
3020 |
{ |
| 3012 |
} |
3021 |
SendNotify( (size_t) -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, event.GetPosition() ); |
|
|
3022 |
// Allow generation of context menu event |
| 3023 |
event.Skip(); |
| 3024 |
} |
| 3025 |
|
| 3026 |
return; |
| 3027 |
} |
| 3013 |
|
3028 |
|
| 3014 |
bool forceClick = false; |
3029 |
bool forceClick = false; |
| 3015 |
if (event.ButtonDClick()) |
3030 |
if (event.ButtonDClick()) |
|
Lines 3319-3324
Link Here
|
| 3319 |
|
3334 |
|
| 3320 |
case WXK_PRIOR: |
3335 |
case WXK_PRIOR: |
| 3321 |
{ |
3336 |
{ |
|
|
3337 |
// avoid floating point exception |
| 3338 |
if (m_linesPerPage == 0) |
| 3339 |
m_linesPerPage = 1; |
| 3340 |
|
| 3322 |
int steps = InReportView() ? m_linesPerPage - 1 : m_current % m_linesPerPage; |
3341 |
int steps = InReportView() ? m_linesPerPage - 1 : m_current % m_linesPerPage; |
| 3323 |
|
3342 |
|
| 3324 |
int index = m_current - steps; |
3343 |
int index = m_current - steps; |
|
Lines 3331-3336
Link Here
|
| 3331 |
|
3350 |
|
| 3332 |
case WXK_NEXT: |
3351 |
case WXK_NEXT: |
| 3333 |
{ |
3352 |
{ |
|
|
3353 |
// avoid floating point exception |
| 3354 |
if (m_linesPerPage == 0) |
| 3355 |
m_linesPerPage = 1; |
| 3356 |
|
| 3334 |
int steps = InReportView() |
3357 |
int steps = InReportView() |
| 3335 |
? m_linesPerPage - 1 |
3358 |
? m_linesPerPage - 1 |
| 3336 |
: m_linesPerPage - (m_current % m_linesPerPage) - 1; |
3359 |
: m_linesPerPage - (m_current % m_linesPerPage) - 1; |
|
Lines 4667-4673
Link Here
|
| 4667 |
|
4690 |
|
| 4668 |
void wxListMainWindow::OnScroll(wxScrollWinEvent& event) |
4691 |
void wxListMainWindow::OnScroll(wxScrollWinEvent& event) |
| 4669 |
{ |
4692 |
{ |
| 4670 |
// update our idea of which lines are shown when we redraw the window the |
4693 |
int cw, ch, vw, vh; |
|
|
4694 |
GetVirtualSize(&vw, &vh); |
| 4695 |
GetClientSize(&cw, &ch); |
| 4696 |
if (event.GetOrientation() == wxVERTICAL && ch >= vh) |
| 4697 |
return; |
| 4698 |
|
| 4699 |
// update our idea of which lines are shown when we redraw the window the |
| 4671 |
// next time |
4700 |
// next time |
| 4672 |
ResetVisibleLinesRange(); |
4701 |
ResetVisibleLinesRange(); |
| 4673 |
|
4702 |
|