fixed menu accelerators

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder
1999-11-05 10:56:38 +00:00
parent bb44571b29
commit ef500a4059

View File

@@ -457,6 +457,7 @@ wxLayoutWindow::OnChar(wxKeyEvent& event)
if(keyCode == WXK_F1) if(keyCode == WXK_F1)
{ {
m_llist->Debug(); m_llist->Debug();
event.skip();
return; return;
} }
#endif #endif
@@ -563,14 +564,12 @@ wxLayoutWindow::OnChar(wxKeyEvent& event)
// this should work even in read-only mode // this should work even in read-only mode
Copy(); Copy();
break; break;
#ifdef M_BASEDIR
case 's': // search case 's': // search
Find(""); Find("");
break; break;
case 't': // search again case 't': // search again
FindAgain(); FindAgain();
break; break;
#endif
default: default:
; ;
} }
@@ -611,14 +610,12 @@ wxLayoutWindow::OnChar(wxKeyEvent& event)
SetDirty(); SetDirty();
} }
break; break;
#ifdef M_BASEDIR
case 's': // search case 's': // search
Find(""); Find("");
break; break;
case 't': // search again case 't': // search again
FindAgain(); FindAgain();
break; break;
#endif
case 'u': case 'u':
m_llist->DeleteToBeginOfLine(); m_llist->DeleteToBeginOfLine();
SetDirty(); SetDirty();
@@ -1081,28 +1078,32 @@ wxLayoutWindow::Paste(bool primary)
// Read some text // Read some text
if (wxTheClipboard->Open()) if (wxTheClipboard->Open())
{ {
#if __WXGTK__
if(primary) if(primary)
wxTheClipboard->UsePrimarySelection(); wxTheClipboard->UsePrimarySelection();
#endif
#if wxUSE_PRIVATE_CLIPBOARD_FORMAT
wxLayoutDataObject wxldo; wxLayoutDataObject wxldo;
if (wxTheClipboard->IsSupported( wxldo.GetFormat() )) if (wxTheClipboard->IsSupported( wxldo.GetFormat() ))
{ {
wxTheClipboard->GetData(wxldo); wxTheClipboard->GetData(&wxldo);
{
// now we can access the data we had put into wxLayoutDataObject in }
// wxLayoutList::GetSelection by calling its GetLayoutData() - the //FIXME: missing functionality m_llist->Insert(wxldo.GetList());
// trouble is that I don't know what to do with it! (VZ)
} }
else else
#endif
{ {
#if 0 //RE_ENABLE FIXME!!
wxTextDataObject data; wxTextDataObject data;
if (wxTheClipboard->IsSupported( data.GetFormat() )) if (wxTheClipboard->IsSupported( data.GetFormat() ))
{ {
wxTheClipboard->GetData(data); wxTheClipboard->GetData(&data);
wxString text = data.GetText(); wxString text = data.GetText();
wxLayoutImportText( m_llist, text); wxLayoutImportText( m_llist, text);
SetDirty(); SetDirty();
} }
#endif
} }
wxTheClipboard->Close(); wxTheClipboard->Close();
} }
@@ -1119,8 +1120,9 @@ wxLayoutWindow::Copy(bool invalidate)
m_llist->EndSelection(); m_llist->EndSelection();
} }
wxLayoutDataObject *wldo = new wxLayoutDataObject; #if 0 //FIXME CLIPBOARD
wxLayoutList *llist = m_llist->GetSelection(wldo, invalidate); wxLayoutDataObject wldo;
wxLayoutList *llist = m_llist->GetSelection(&wldo, invalidate);
if(! llist) if(! llist)
return FALSE; return FALSE;
// Export selection as text: // Export selection as text:
@@ -1148,15 +1150,15 @@ wxLayoutWindow::Copy(bool invalidate)
if (wxTheClipboard->Open()) if (wxTheClipboard->Open())
{ {
wxDataObjectComposite *dobj = new wxDataObjectComposite; wxTextDataObject *data = new wxTextDataObject( text );
dobj->Add(new wxTextDataObject(text)); bool rc = wxTheClipboard->SetData( data );
dobj->Add(wldo); #if wxUSE_PRIVATE_CLIPBOARD_FORMAT
rc |= wxTheClipboard->AddData( &wldo );
bool rc = wxTheClipboard->SetData(dobj); #endif
wxTheClipboard->Close(); wxTheClipboard->Close();
return rc; return rc;
} }
#endif //FIXME CLIPBOARD
return FALSE; return FALSE;
} }