]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/hyperlink.cpp
Hacks for wine.
[wxWidgets.git] / src / generic / hyperlink.cpp
index 54c6a9a092212eecc3c3d6b135705b1302e48d84..fb245d32b22002bed8890b49a244711d0a6c389d 100644 (file)
 // Pre-compiled header stuff
 //---------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "hyperlink.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
-#pragma hdrstop
+    #pragma hdrstop
 #endif
 
 #if wxUSE_HYPERLINKCTRL
 
 #ifndef WX_PRECOMP
     #include "wx/utils.h" // for wxLaunchDefaultBrowser
+    #include "wx/dcclient.h"
+    #include "wx/menu.h"
+    #include "wx/log.h"
+    #include "wx/dataobj.h"
 #endif
 
 #include "wx/clipbrd.h"
@@ -47,6 +47,7 @@
 // ============================================================================
 
 IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkCtrl, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkEvent, wxCommandEvent)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_HYPERLINK)
 
 // reserved for internal use only
@@ -82,7 +83,7 @@ bool wxHyperlinkCtrl::Create(wxWindow *parent, wxWindowID id,
     if(url.empty())
         SetURL(label);
     else
-        SetUrl(url);
+        SetURL(url);
 
     if(label.empty())
         SetLabel(url);
@@ -218,12 +219,14 @@ void wxHyperlinkCtrl::OnLeaveWindow(wxMouseEvent& WXUNUSED(event))
 
 void wxHyperlinkCtrl::OnPopUpCopy( wxCommandEvent& WXUNUSED(event) )
 {
+#if wxUSE_CLIPBOARD
     if (!wxTheClipboard->Open())
         return;
 
     wxTextDataObject *data = new wxTextDataObject( m_url );
     wxTheClipboard->SetData( data );
     wxTheClipboard->Close();
+#endif // wxUSE_CLIPBOARD
 }
 
 #endif // wxUSE_HYPERLINKCTRL