\membersection{wxHyperLinkCtrl::Create}\label{wxhyperlinkctrlcreate}
-\func{}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id = -1} \param{const wxString \&}{ label}, \param{const wxString \&}{ url}, \param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\param{long}{ style}, \param{const wxString\& }{name = ``hyperlink"}}
+\func{}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id = wxID\_ANY} \param{const wxString \&}{ label}, \param{const wxString \&}{ url}, \param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\param{long}{ style}, \param{const wxString\& }{name = ``hyperlink"}}
Creates the hyperlink control.
\docparam{parent}{Parent window. Must not be \NULL.}
-\docparam{id}{Window identifier. A value of -1 indicates a default value.}
+\docparam{id}{Window identifier. A value of wxID\_ANY indicates a default value.}
\docparam{label}{The label of the hyperlink.}
\docparam{pos}{Window position.}
-\docparam{size}{Window size. If the default size (-1, -1) is specified then the window is sized
+\docparam{size}{Window size. If the wxDefaultSize is specified then the window is sized
appropriately.}
\docparam{style}{Window style. See \helpref{wxHyperlinkCtrl}{wxhyperlinkctrl}.}
\func{void}{SetURL}{\param{const wxString \&}{ url}}
Sets the URL associated with the event.
-
/////////////////////////////////////////////////////////////////////////////
-// Name: hyperlink.h
+// Name: wx/hyperlink.h
// Purpose: Hyperlink control
// Author: David Norris <danorris@gmail.com>, Otto Wyss
// Modified by: Ryan Norton, Francesco Montorsi
#endif // wxUSE_HYPERLINKCTRL
#endif // _WX_HYPERLINK_H__
-
/////////////////////////////////////////////////////////////////////////////
-// Name: hyperlink.cpp
+// Name: src/generic/hyperlink.cpp
// Purpose: Hyperlink control
// Author: David Norris <danorris@gmail.com>, Otto Wyss
// Modified by: Ryan Norton, Francesco Montorsi
#pragma hdrstop
#endif
+#if wxUSE_HYPERLINKCTRL
+
//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include "wx/hyperlink.h"
-#include "wx/utils.h" // for wxLaunchDefaultBrowser
-#include "wx/clipbrd.h"
+#ifndef WX_PRECOMP
+ #include "wx/utils.h" // for wxLaunchDefaultBrowser
+#endif
-#if wxUSE_HYPERLINKCTRL
+#include "wx/clipbrd.h"
// ============================================================================
// implementation
const wxString& label, const wxString& url, const wxPoint& pos,
const wxSize& size, long style, const wxString& name)
{
- wxASSERT_MSG(!url.IsEmpty() || !label.IsEmpty(),
+ wxASSERT_MSG(!url.empty() || !label.empty(),
wxT("Both URL and label are empty ?"));
if (!wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name))
return false;
// set to non empty strings both the url and the label
- SetURL(url.IsEmpty() ? label : url);
- SetLabel(label.IsEmpty() ? url : label);
+ if(url.empty())
+ SetURL(label);
+ else
+ SetUrl(url);
+
+ if(label.empty())
+ SetLabel(url);
+ else
+ SetLabel(label);
// by default the cursor to use in this window is wxCURSOR_HAND
SetCursor(wxCursor(wxCURSOR_HAND));