25#include <wx/clipbrd.h>
27#include <wx/textctrl.h>
35 const wxPoint& aPosition,
const wxSize& aSize ) :
38 m_htmlWindow->SetLayoutDirection( wxLayout_LeftToRight );
42 if( aSize != wxDefaultSize )
51 Bind( wxEVT_SYS_COLOUR_CHANGED,
87 wxArrayString strings_list;
90 wxString msg = wxT(
"<ul>" );
92 for (
unsigned ii = 0; ii < strings_list.GetCount(); ii++ )
95 msg += strings_list.Item( ii ) + wxT(
"</li>" );
98 msg += wxT(
"</ul>" );
107 wxString msg = wxT(
"<ul>" );
109 for(
unsigned ii = 0; ii < aList.GetCount(); ii++ )
111 msg += wxT(
"<li>" );
112 msg += aList.Item( ii ) + wxT(
"</li>" );
115 msg += wxT(
"</ul>" );
124 wxString message_value = wxString::Format( wxT(
"<b>%s</b><br>" ), message );
151 wxString href =
event.GetLinkInfo().GetHref();
153 if( href.StartsWith( wxS(
"https://docs.kicad.org/" ) ) )
158 wxLaunchDefaultBrowser( uri.BuildURI() );
166 if( aEvent.GetKeyCode() == WXK_ESCAPE )
168 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
171 else if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() ==
'A' )
176 else if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() ==
'C' )
180 if( wxTheClipboard->Open() )
182 wxTheClipboard->SetData(
new wxTextDataObject(
m_htmlWindow->SelectionToText() ) );
183 wxTheClipboard->Flush();
184 wxTheClipboard->Close();
wxString GetMajorMinorVersion()
Get only the major and minor version in a string major.minor.
Class DIALOG_DISPLAY_HTML_TEXT_BASE.
HTML_WINDOW * m_htmlWindow
wxStdDialogButtonSizer * m_sdbSizer1
bool Show(bool show) override
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void setSizeInDU(int x, int y)
Set the dialog to the given dimensions in "dialog units".
void OnHTMLLinkClicked(wxHtmlLinkEvent &event) override
~HTML_MESSAGE_BOX() override
void MessageSet(const wxString &message)
Add a message (in bold) to message list.
void onThemeChanged(wxSysColourChangedEvent &aEvent)
virtual void OnCharHook(wxKeyEvent &aEvt) override
HTML_MESSAGE_BOX(wxWindow *aParent, const wxString &aTitle=wxEmptyString, const wxPoint &aPosition=wxDefaultPosition, const wxSize &aSize=wxDefaultSize)
void AddHTML_Text(const wxString &message)
Add HTML text (without any change) to message list.
void ListSet(const wxString &aList)
Add a list of items.
void ShowModeless()
Show a modeless version of the dialog (without an OK button).
bool SetPage(const wxString &aSource) override
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.