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, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef HTML_MESSAGE_BOX_H
22#define HTML_MESSAGE_BOX_H
23
25#include <vector>
26
27class wxPanel;
28class wxStaticText;
29class wxTextCtrl;
30class wxButton;
31
32
34{
35public:
36 HTML_MESSAGE_BOX( wxWindow* aParent, const wxString& aTitle = wxEmptyString,
37 const wxPoint& aPosition = wxDefaultPosition,
38 const wxSize& aSize = wxDefaultSize );
39
40 ~HTML_MESSAGE_BOX() override;
41
51 void SetDialogSizeInDU( int aWidth, int aHeight )
52 {
53 setSizeInDU( aWidth, aHeight );
54 Center();
55 }
56
62 void ListSet( const wxString& aList );
63
69 void ListSet( const wxArrayString& aList );
70
71 void ListClear();
72
76 void MessageSet( const wxString& message );
77
81 void AddHTML_Text( const wxString& message );
82
86 void ShowModeless();
87
88 void OnHTMLLinkClicked( wxHtmlLinkEvent& event ) override;
89
90
91protected:
92 void reload();
93
94 void onThemeChanged( wxSysColourChangedEvent &aEvent );
95 virtual void OnCharHook( wxKeyEvent& aEvt ) override;
96 void OnSearchText( wxCommandEvent& aEvent );
97 void OnNext( wxCommandEvent& aEvent );
98 void OnPrev( wxCommandEvent& aEvent );
99 void ShowSearchBar();
100 void HideSearchBar();
101 void updateSearch();
102
103private:
104 wxString m_source;
107 wxStaticText* m_matchCount;
108 wxTextCtrl* m_searchCtrl;
109 wxButton* m_prevBtn;
110 wxButton* m_nextBtn;
111 std::vector<size_t> m_matchPos;
113};
114
115#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).