]> git.saurik.com Git - wxWidgets.git/commitdiff
Source cleaning for new features.
authorWłodzimierz Skiba <abx@abx.art.pl>
Mon, 29 May 2006 07:31:24 +0000 (07:31 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Mon, 29 May 2006 07:31:24 +0000 (07:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/hyperlink.tex
include/wx/hyperlink.h
src/generic/hyperlink.cpp

index 3068b8ebcf4708d10321c683b1cba4762439d3bb..f7c04c11a7cde8fec5b7bdde00ad9946733b5688 100644 (file)
@@ -65,7 +65,7 @@ Constructor. See \helpref{Create}{wxhyperlinkctrlcreate} for more info.
 
 \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.
 
@@ -73,7 +73,7 @@ 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.}
 
@@ -81,7 +81,7 @@ Creates the hyperlink control.
 
 \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}.}
@@ -217,4 +217,3 @@ Returns the URL of the hyperlink where the user has just clicked.
 \func{void}{SetURL}{\param{const wxString \&}{ url}}
 
 Sets the URL associated with the event.
-
index 474951d97c62214cb3f7ae37a3685b82022533bf..dc4e2fcac38d8b6f29475cffcfd92afbcb1da789 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        hyperlink.h
+// Name:        wx/hyperlink.h
 // Purpose:     Hyperlink control
 // Author:      David Norris <danorris@gmail.com>, Otto Wyss
 // Modified by: Ryan Norton, Francesco Montorsi
@@ -207,4 +207,3 @@ typedef void (wxEvtHandler::*wxHyperlinkEventFunction)(wxHyperlinkEvent&);
 #endif // wxUSE_HYPERLINKCTRL
 
 #endif // _WX_HYPERLINK_H__
-
index 6f078ca9fee765e0886fc36f1534bfe377a38cf9..54c6a9a092212eecc3c3d6b135705b1302e48d84 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// 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
@@ -69,15 +72,22 @@ bool wxHyperlinkCtrl::Create(wxWindow *parent, wxWindowID id,
     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));