OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::HyperLink Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/HyperLink.hpp>

Inheritance diagram for Slic3r::GUI::HyperLink:
Collaboration diagram for Slic3r::GUI::HyperLink:

Public Member Functions

 HyperLink (wxWindow *parent, const wxString &label=wxEmptyString, const wxString &url=wxEmptyString, const long style=0)
void SetURL (const wxString &url)
wxString GetURL () const
bool SetFont (const wxFont &font)

Private Attributes

wxString m_url
wxColour m_normalColor
wxColour m_hoverColor

Detailed Description

Constructor & Destructor Documentation

◆ HyperLink()

Slic3r::GUI::HyperLink::HyperLink ( wxWindow * parent,
const wxString & label = wxEmptyString,
const wxString & url = wxEmptyString,
const long style = 0 )
15 : wxStaticText(parent, wxID_ANY, label)
16 , m_url(url)
17 , m_normalColor(wxColour("#009687")) // used slightly different color otherwise automatically uses ColorForDark that not visible enough
18 , m_hoverColor(wxColour("#26A69A"))
19{
20 SetForegroundColour(m_normalColor);
22 SetCursor(wxCursor(wxCURSOR_HAND));
23
24 if (!m_url.IsEmpty())
25 SetToolTip(m_url);
26
27 Bind(wxEVT_LEFT_DOWN, ([this](wxMouseEvent& e) {
28 if (!m_url.IsEmpty())
29 wxLaunchDefaultBrowser(m_url);
30 }));
31
32 Bind(wxEVT_ENTER_WINDOW, ([this](wxMouseEvent& e) {
33 SetForegroundColour(m_hoverColor);
34 Refresh();
35 }));
36 Bind(wxEVT_LEAVE_WINDOW, ([this](wxMouseEvent& e) {
37 SetForegroundColour(m_normalColor);
38 Refresh();
39 }));
40}
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
static wxFont Head_14
Definition Label.hpp:45
wxMouseEvent
Definition CameraPopup.cpp:47

References Label::Head_14, m_hoverColor, m_normalColor, m_url, SetFont(), style, Slic3r::GUI::wxMouseEvent, and wxStaticText.

Here is the call graph for this function:

Member Function Documentation

◆ GetURL()

wxString Slic3r::GUI::HyperLink::GetURL ( ) const
55{ return m_url; }

References m_url.

◆ SetFont()

bool Slic3r::GUI::HyperLink::SetFont ( const wxFont & font)
43{ // ensure it stays underlined
44 wxFont f = font;
45 f.SetUnderlined(true);
46 return wxStaticText::SetFont(f);
47}
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:124

References Slic3r::f().

Referenced by HyperLink(), and Slic3r::GUI::PresetTree::get_child_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetURL()

void Slic3r::GUI::HyperLink::SetURL ( const wxString & url)
50{
51 m_url = url;
52 SetToolTip(m_url);
53}

References m_url.

Member Data Documentation

◆ m_hoverColor

wxColour Slic3r::GUI::HyperLink::m_hoverColor
private

Referenced by HyperLink().

◆ m_normalColor

wxColour Slic3r::GUI::HyperLink::m_normalColor
private

Referenced by HyperLink().

◆ m_url

wxString Slic3r::GUI::HyperLink::m_url
private

Referenced by HyperLink(), GetURL(), and SetURL().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/HyperLink.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/HyperLink.cpp