26#include <wx/clipbrd.h>
28#include <wx/settings.h>
33 const wxSize& aSize,
long aStyle,
const wxString& aName ) :
34 wxHtmlWindow( aParent, aId, aPos, aSize, aStyle, aName )
36 Bind( wxEVT_SYS_COLOUR_CHANGED,
54 wxColour fgColor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
55 wxColour bgColor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
56 wxColour linkColor = wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT );
58 wxString html = wxString::Format( wxT(
"<html>\n<body text='%s' bgcolor='%s' link='%s'>\n" ),
59 fgColor.GetAsString( wxC2S_HTML_SYNTAX ),
60 bgColor.GetAsString( wxC2S_HTML_SYNTAX ),
61 linkColor.GetAsString( wxC2S_HTML_SYNTAX ) );
62 html.Append( aSource );
63 html.Append( wxT(
"\n</body>\n</html>" ) );
65 return wxHtmlWindow::SetPage( html );
90 popup.Append( wxID_COPY,
"Copy" );
97 if( event.GetId() == wxID_COPY )
101 if( wxTheClipboard->Open() )
103 bool primarySelection = wxTheClipboard->IsUsingPrimarySelection();
104 wxTheClipboard->UsePrimarySelection(
false );
105 wxTheClipboard->SetData(
new wxTextDataObject( SelectionToText() ) );
106 wxTheClipboard->Flush();
107 wxTheClipboard->Close();
108 wxTheClipboard->UsePrimarySelection( primarySelection );
bool SetPage(const wxString &aSource) override
HTML_WINDOW(wxWindow *aParent, wxWindowID aId=wxID_ANY, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, long aStyle=wxHW_DEFAULT_STYLE, const wxString &aName=wxT("htmlWindow"))
void onRightClick(wxMouseEvent &event)
void onMenuEvent(wxMenuEvent &event)
void onThemeChanged(wxSysColourChangedEvent &aEvent)
bool AppendToPage(const wxString &aSource)