// send out a wxListEvent
void SendNotify( size_t line,
- wxEventType command,
+ wxEventType command,
const wxPoint& point = wxDefaultPosition );
// override base class virtual to reset m_lineHeight when the font changes
{
return m_hasFocus ? m_highlightBrush : m_highlightUnfocusedBrush;
}
-
+
bool HasFocus() const
{
return m_hasFocus;
if ( m_mask & wxLIST_MASK_WIDTH )
SetWidth(item.m_width);
-
+
if ( m_mask & wxLIST_MASK_STATE )
SetState(item.m_state);
}
if (m_owner->HasFocus())
flags |= wxCONTROL_FOCUSED;
wxRendererNative::Get().DrawItemSelectionRect( m_owner, *dc, m_gi->m_rectHighlight, flags );
-
+
}
else
{
if (!m_parent->IsEnabled())
flags |= wxCONTROL_DISABLED;
-// NB: The code below is not really Mac-specific, but since we are close
+// NB: The code below is not really Mac-specific, but since we are close
// to 2.8 release and I don't have time to test on other platforms, I
// defined this only for wxMac. If this behavior is desired on
// other platforms, please go ahead and revise or remove the #ifdef.
#ifdef __WXMAC__
- if ( !m_owner->IsVirtual() && (item.m_mask & wxLIST_MASK_STATE) &&
+ if ( !m_owner->IsVirtual() && (item.m_mask & wxLIST_MASK_STATE) &&
(item.m_state & wxLIST_STATE_SELECTED) )
flags |= wxCONTROL_SELECTED;
#endif
{
wxListItem colItem;
m_owner->GetColumn(i, colItem);
- long state = colItem.GetState();
+ long state = colItem.GetState();
if (i == m_column)
colItem.SetState(state | wxLIST_STATE_SELECTED);
else
m_owner->SetColumn(i, colItem);
}
}
-
+
SendListEvent( event.LeftDown()
? wxEVT_COMMAND_LIST_COL_CLICK
: wxEVT_COMMAND_LIST_COL_RIGHT_CLICK,
EVT_MOUSE_EVENTS (wxListMainWindow::OnMouse)
EVT_CHAR (wxListMainWindow::OnChar)
EVT_KEY_DOWN (wxListMainWindow::OnKeyDown)
- EVT_KEY_UP (wxListMainWindow::OnKeyUp)
+ EVT_KEY_UP (wxListMainWindow::OnKeyUp)
EVT_SET_FOCUS (wxListMainWindow::OnSetFocus)
EVT_KILL_FOCUS (wxListMainWindow::OnKillFocus)
EVT_SCROLLWIN (wxListMainWindow::OnScroll)
),
wxSOLID
);
-
+
m_highlightUnfocusedBrush = new wxBrush
(
wxSystemSettings::GetColour
wxRect rectLine;
int xOrig = dc.LogicalToDeviceX( 0 );
int yOrig = dc.LogicalToDeviceY( 0 );
-
+
// tell the caller cache to cache the data
if ( IsVirtual() )
{
dc.DrawRectangle( rect );
#else
wxRendererNative::Get().DrawItemSelectionRect( this, dc, rect, wxCONTROL_CURRENT|wxCONTROL_FOCUSED );
-
+
#endif
}
}
{
wxListEvent le( command, GetParent()->GetId() );
le.SetEventObject( GetParent() );
-
+
le.m_itemIndex = line;
// set only for events which have position
{
m_current = current;
+ // as the current item changed, we shouldn't start editing it when the
+ // "slow click" timer expires as the click happened on another item
+ if ( m_renameTimer->IsRunning() )
+ m_renameTimer->Stop();
+
SendNotify(current, wxEVT_COMMAND_LIST_ITEM_FOCUSED);
}
if ( event.LeftDown() )
SetFocus();
-
+
event.SetEventObject( GetParent() );
if ( GetParent()->GetEventHandler()->ProcessEvent( event) )
return;
bool forceClick = false;
if (event.ButtonDClick())
{
- m_renameTimer->Stop();
+ if ( m_renameTimer->IsRunning() )
+ m_renameTimer->Stop();
+
m_lastOnSame = false;
if ( current == m_lineLastClicked )
if ( m_current != index || m_current == count - 1 )
m_current--;
}
-
+
if ( InReportView() )
{
// mark the Column Max Width cache as dirty if the items in the line
{
if (str.empty())
return wxNOT_FOUND;
-
+
long pos = start;
wxString str_upper = str.Upper();
if (pos < 0)