Source cleaning for new features.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2006-05-29 07:31:24 +00:00
parent 2858324691
commit 98159dd8b6
3 changed files with 22 additions and 14 deletions

View 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
@@ -28,17 +28,20 @@
#pragma hdrstop
#endif
#if wxUSE_HYPERLINKCTRL
//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include "wx/hyperlink.h"
#include "wx/utils.h" // for wxLaunchDefaultBrowser
#ifndef WX_PRECOMP
#include "wx/utils.h" // for wxLaunchDefaultBrowser
#endif
#include "wx/clipbrd.h"
#if wxUSE_HYPERLINKCTRL
// ============================================================================
// 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));