updated the makefile to copy dnd.wxr so that the program can find it,

don't forget to open the clipboard


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 1999-10-21 13:57:08 +00:00
parent f536e0f24b
commit ae125753e4
2 changed files with 38 additions and 3 deletions

View File

@ -13,7 +13,7 @@ top_srcdir = @top_srcdir@
top_builddir = ../..
program_dir = samples/dnd
DATAFILES=julian.png
DATAFILES=julian.png dnd.wxr
PROGRAM=dnd

View File

@ -619,6 +619,25 @@ END_EVENT_TABLE()
// `Main program' equivalent, creating windows and returning main app frame
bool DnDApp::OnInit()
{
// load our ressources
wxPathList pathList;
pathList.Add(".");
#ifdef __WXMSW__
pathList.Add("./Debug");
pathList.Add("./Release");
#endif // wxMSW
wxString path = pathList.FindValidPath("dnd.wxr");
if ( !path )
{
wxLogError("Can't find the resource file dnd.wxr in the current "
"directory, aborting.");
return FALSE;
}
wxDefaultResourceTable->ParseResourceFile(path);
#if wxUSE_LIBPNG
wxImage::AddHandler( new wxPNGHandler );
#endif
@ -633,8 +652,6 @@ bool DnDApp::OnInit()
SetTopWindow(frame);
wxDefaultResourceTable->ParseResourceFile("dnd.wxr");
return TRUE;
}
@ -1299,11 +1316,29 @@ void DnDShapeFrame::OnClearShape(wxCommandEvent& event)
void DnDShapeFrame::OnCopyShape(wxCommandEvent& event)
{
if ( m_shape )
{
wxClipboardLocker clipLocker;
if ( !clipLocker )
{
wxLogError("Can't open the clipboard");
return;
}
wxTheClipboard->AddData(new DnDShapeDataObject(m_shape));
}
}
void DnDShapeFrame::OnPasteShape(wxCommandEvent& event)
{
wxClipboardLocker clipLocker;
if ( !clipLocker )
{
wxLogError("Can't open the clipboard");
return;
}
DnDShapeDataObject shapeDataObject(NULL);
if ( wxTheClipboard->GetData(shapeDataObject) )
{