KiCad PCB EDA Suite
Loading...
Searching...
No Matches
html_message_box.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2011-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef HTML_MESSAGE_BOX_H
26#define HTML_MESSAGE_BOX_H
27
29#include <vector>
30
31class wxPanel;
32class wxStaticText;
33class wxTextCtrl;
34class wxButton;
35
36
38{
39public:
40 HTML_MESSAGE_BOX( wxWindow* aParent, const wxString& aTitle = wxEmptyString,
41 const wxPoint& aPosition = wxDefaultPosition,
42 const wxSize& aSize = wxDefaultSize );
43
44 ~HTML_MESSAGE_BOX() override;
45
55 void SetDialogSizeInDU( int aWidth, int aHeight )
56 {
57 setSizeInDU( aWidth, aHeight );
58 Center();
59 }
60
66 void ListSet( const wxString& aList );
67
73 void ListSet( const wxArrayString& aList );
74
75 void ListClear();
76
80 void MessageSet( const wxString& message );
81
85 void AddHTML_Text( const wxString& message );
86
90 void ShowModeless();
91
92 void OnHTMLLinkClicked( wxHtmlLinkEvent& event ) override;
93
94
95protected:
96 void reload();
97
98 void onThemeChanged( wxSysColourChangedEvent &aEvent );
99 virtual void OnCharHook( wxKeyEvent& aEvt ) override;
100 void OnSearchText( wxCommandEvent& aEvent );
101 void OnNext( wxCommandEvent& aEvent );
102 void OnPrev( wxCommandEvent& aEvent );
103 void ShowSearchBar();
104 void HideSearchBar();
105 void updateSearch();
106
107private:
108 wxString m_source;
111 wxStaticText* m_matchCount;
112 wxTextCtrl* m_searchCtrl;
113 wxButton* m_prevBtn;
114 wxButton* m_nextBtn;
115 std::vector<size_t> m_matchPos;
117};
118
119#endif // HTML_MESSAGE_BOX_H
DIALOG_DISPLAY_HTML_TEXT_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void setSizeInDU(int x, int y)
Set the dialog to the given dimensions in "dialog units".
wxTextCtrl * m_searchCtrl
std::vector< size_t > m_matchPos
void OnSearchText(wxCommandEvent &aEvent)
void OnHTMLLinkClicked(wxHtmlLinkEvent &event) override
~HTML_MESSAGE_BOX() override
wxStaticText * m_matchCount
void OnPrev(wxCommandEvent &aEvent)
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 SetDialogSizeInDU(int aWidth, int aHeight)
Set the dialog size, using a "logical" value.
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 OnNext(wxCommandEvent &aEvent)
void ShowModeless()
Show a modeless version of the dialog (without an OK button).