wxHSCROLL | wxVSCROLL | wxBORDER)
{
+ SetStatusBar(NULL); // don't use statusbar
m_Editable = false;
m_doSendEvents = false;
m_ViewStartX = 0; m_ViewStartY = 0;
bool found;
wxLayoutObject *obj = m_llist->FindObjectScreen(dc, findPos,
&cursorPos, &found);
+ wxLayoutObject::UserData *u = obj ? obj->GetUserData() : NULL;
//has the mouse only been moved?
if(eventId == WXLOWIN_MENU_MOUSEMOVE)
{
// found is only true if we are really over an object, not just
// behind it
- if(found && obj && obj->GetUserData() != NULL)
+ if(found && u && ! m_Selecting)
{
if(!m_HandCursor)
SetCursor(wxCURSOR_HAND);
m_HandCursor = TRUE;
+ if(m_StatusBar && m_StatusFieldLabel != -1)
+ {
+ const wxString &label = u->GetLabel();
+ if(label.Length())
+ m_StatusBar->SetStatusText(label,
+ m_StatusFieldLabel);
+ }
}
else
{
if(m_HandCursor)
SetCursor(wxCURSOR_IBEAM);
m_HandCursor = FALSE;
+ if(m_StatusBar && m_StatusFieldLabel != -1)
+ m_StatusBar->SetStatusText("", m_StatusFieldLabel);
}
if(event.LeftIsDown())
{
m_Selecting = false;
DoPaint(FALSE);
}
+ if(u) u->DecRef();
return;
}
ScrollToCursor();
DoPaint(FALSE); // DoPaint suppresses flicker under GTK
}
+
if(!m_doSendEvents) // nothing to do
+ {
+ if(u) u->DecRef();
return;
+ }
// only do the menu if activated, editable and not on a clickable object
if(eventId == WXLOWIN_MENU_RCLICK
&& IsEditable()
- && (! obj || (obj && obj->GetUserData() == NULL))
- )
+ && (! obj || u == NULL))
{
PopupMenu(m_PopupMenu, m_ClickPosition.x, m_ClickPosition.y);
+ if(u) u->DecRef();
return;
}
+
+ if(u) u->DecRef();
// find the object at this position
if(obj)
{
{
switch(keyCode)
{
+ case WXK_INSERT:
+ Copy();
+ break;
case WXK_DELETE :
case 'd':
m_llist->Delete(1);
case 'v':
Paste();
break;
+ case 'c':
+ Copy();
+ break;
+ case 'x':
+ Cut();
+ break;
#ifdef WXLAYOUT_DEBUG
case WXK_F1:
m_llist->SetFont(-1,-1,-1,-1,true); // underlined
Paste();
break;
case WXK_DELETE :
- m_llist->Delete(1);
+ if(event.ShiftDown())
+ Cut();
+ else
+ m_llist->Delete(1);
break;
case WXK_BACK: // backspace
if(m_llist->MoveCursorHorizontally(-1)) m_llist->Delete(1);
wxLayoutWindow::OnKeyUp(wxKeyEvent& event)
{
if(event.KeyCode() == WXK_SHIFT && m_llist->IsSelecting())
+ {
m_llist->EndSelection();
+ m_Selecting = false;
+ }
event.Skip();
}
ResetDirty();
m_ScrollToCursor = false;
+ if(m_StatusBar && m_StatusFieldCursor != -1)
+ {
+ wxString label;
+ label.Printf(_("L:%d C:%d"), m_llist->GetCursorPos().x+1, m_llist->GetCursorPos().y+1);
+ m_StatusBar->SetStatusText(label, m_StatusFieldCursor);
+ }
}
// change the range and position of scrollbars