]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dnd/dnd.cpp
Fixed OS/2 compilation problems.
[wxWidgets.git] / samples / dnd / dnd.cpp
index 474633ce8931a8d1b70f9e1aaa3aaf70c60477d4..396987ce6d73a8c43e6fbef7531d9cb59d5babbe 100644 (file)
@@ -54,7 +54,7 @@
     #include "wx/metafile.h"
 #endif // Windows
 
-#if defined(__WXGTK__) || defined(__WXMOTIF__)
+#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__)
     #include "mondrian.xpm"
 
     #include "dnd_copy.xpm"
@@ -224,6 +224,7 @@ public:
     ~DnDFrame();
 
     void OnPaint(wxPaintEvent& event);
+    void OnSize(wxSizeEvent& event);
     void OnQuit (wxCommandEvent& event);
     void OnAbout(wxCommandEvent& event);
     void OnDrag (wxCommandEvent& event);
@@ -816,6 +817,7 @@ BEGIN_EVENT_TABLE(DnDFrame, wxFrame)
     EVT_LEFT_DOWN(            DnDFrame::OnLeftDown)
     EVT_RIGHT_DOWN(           DnDFrame::OnRightDown)
     EVT_PAINT(                DnDFrame::OnPaint)
+    EVT_SIZE(                 DnDFrame::OnSize)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(DnDShapeFrame, wxFrame)
@@ -931,17 +933,17 @@ DnDFrame::DnDFrame(wxFrame *frame, char *title, int x, int y, int w, int h)
     help_menu->Append(Menu_About, "&About");
 
     wxMenu *clip_menu = new wxMenu;
-    clip_menu->Append(Menu_Copy, "&Copy text\tCtrl+C");
-    clip_menu->Append(Menu_Paste, "&Paste text\tCtrl+V");
+    clip_menu->Append(Menu_Copy, "&Copy text\tCtrl-C");
+    clip_menu->Append(Menu_Paste, "&Paste text\tCtrl-V");
     clip_menu->AppendSeparator();
-    clip_menu->Append(Menu_CopyBitmap, "Copy &bitmap\tAlt+C");
-    clip_menu->Append(Menu_PasteBitmap, "Paste b&itmap\tAlt+V");
+    clip_menu->Append(Menu_CopyBitmap, "Copy &bitmap\tCtrl-Shift-C");
+    clip_menu->Append(Menu_PasteBitmap, "Paste b&itmap\tCtrl-Shift-V");
 #ifdef USE_METAFILES
     clip_menu->AppendSeparator();
     clip_menu->Append(Menu_PasteMFile, "Paste &metafile\tCtrl-M");
 #endif // USE_METAFILES
     clip_menu->AppendSeparator();
-    clip_menu->Append(Menu_CopyFiles, "Copy &files\tCtrl+F");
+    clip_menu->Append(Menu_CopyFiles, "Copy &files\tCtrl-F");
 
     wxMenuBar *menu_bar = new wxMenuBar;
     menu_bar->Append(file_menu, "&File");
@@ -1009,6 +1011,13 @@ void DnDFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
     Close(TRUE);
 }
 
+void DnDFrame::OnSize(wxSizeEvent& event)
+{
+    Refresh();
+
+    event.Skip();
+}
+
 void DnDFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
     int w = 0;
@@ -1016,6 +1025,7 @@ void DnDFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
     GetClientSize( &w, &h );
 
     wxPaintDC dc(this);
+    dc.Clear();
     dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL, FALSE, "charter" ) );
     dc.DrawText( "Drag text from here!", 100, h-50 );
 }
@@ -1864,7 +1874,7 @@ void DnDShapeDataObject::CreateBitmap() const
     wxBitmap bitmap(x, y);
     wxMemoryDC dc;
     dc.SelectObject(bitmap);
-    dc.SetBrush(wxBrush("white", wxSOLID));
+    dc.SetBrush(wxBrush(wxT("white"), wxSOLID));
     dc.Clear();
     m_shape->Draw(dc);
     dc.SelectObject(wxNullBitmap);