27#include <wx/infobar.h>
84 WX_INFOBAR( wxWindow* aParent, wxAuiManager* aMgr =
nullptr, wxWindowID aWinid = wxID_ANY );
118 void AddCloseButton(
const wxString& aTooltip =
_(
"Hide this message." ) );
134 void AddButton( wxHyperlinkCtrl* aHypertextButton );
143 void AddButton( wxWindowID aId,
const wxString& aLabel = wxEmptyString )
override;
170 void ShowMessageFor(
const wxString& aMessage,
int aTime,
int aFlags = wxICON_INFORMATION,
179 void ShowMessage(
const wxString& aMessage,
int aFlags = wxICON_INFORMATION )
override;
202 void QueueShowMessage(
const wxString& aMessage,
int aFlags = wxICON_INFORMATION );
240 void onTimer( wxTimerEvent& aEvent );
242 void onSize( wxSizeEvent& aEvent );
260 DECLARE_EVENT_TABLE()
282 const wxPoint& aPos = wxDefaultPosition,
283 const wxSize& aSize = wxSize( -1,-1 ),
284 long aStyle = wxTAB_TRAVERSAL,
285 const wxString& aName = wxEmptyString );
A wxPanel derived class that hold an infobar and another control.
EDA_INFOBAR_PANEL(wxWindow *aParent, wxWindowID aId=wxID_ANY, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxSize(-1,-1), long aStyle=wxTAB_TRAVERSAL, const wxString &aName=wxEmptyString)
wxFlexGridSizer * m_mainSizer
void AddInfoBar(WX_INFOBAR *aInfoBar)
Add the given infobar object to the panel.
void AddOtherItem(wxWindow *aOtherItem)
Add the other item to the panel.
A modified version of the wxInfoBar class that allows us to:
void SetShowTime(int aTime)
Set the time period to show the infobar.
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
bool HasCloseButton() const
MESSAGE_TYPE m_type
The type of message being displayed.
void updateAuiLayout(bool aShow)
Update the AUI pane to show or hide this infobar.
std::optional< std::function< void(void)> > m_callback
Optional callback made when closing infobar.
bool IsLocked()
Returns true if the infobar is being updated.
int m_showTime
The time to show the infobar. 0 = don't auto hide.
bool m_updateLock
True if this infobar requested the UI update.
void onShowInfoBar(wxCommandEvent &aEvent)
Event handler for showing the infobar using a wxCommandEvent of the type KIEVT_SHOW_INFOBAR.
void onDismissInfoBar(wxCommandEvent &aEvent)
Event handler for dismissing the infobar using a wxCommandEvent of the type KIEVT_DISMISS_INFOBAR.
void AddButton(wxButton *aButton)
Add an already created button to the infobar.
MESSAGE_TYPE
Sets the type of message for special handling if needed.
@ GENERIC
GENERIC Are messages that do not have special handling.
void QueueShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION)
Send the infobar an event telling it to show a message.
WX_INFOBAR(wxWindow *aParent, wxAuiManager *aMgr=nullptr, wxWindowID aWinid=wxID_ANY)
Construct an infobar that can exist inside an AUI managed frame.
void onCloseButton(wxCommandEvent &aEvent)
Event handler for the close button.
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
void AddCloseButton(const wxString &aTooltip=_("Hide this message."))
Add the default close button to the infobar on the right side.
MESSAGE_TYPE GetMessageType() const
void SetCallback(std::function< void(void)> aCallback)
Provide a callback to be called when the infobar is dismissed (either by user action or timer).
wxTimer * m_showTimer
The timer counting the autoclose period.
void onTimer(wxTimerEvent &aEvent)
Event handler for the automatic closing timer.
void ShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION) override
Show the info bar with the provided message and icon.
wxAuiManager * m_auiManager
The AUI manager that contains this infobar.
void onSize(wxSizeEvent &aEvent)
void QueueDismiss()
Send the infobar an event telling it to hide itself.
@ ID_CLOSE_INFOBAR
ID for the close button on the frame's infobar.
wxDECLARE_EVENT(KIEVT_SHOW_INFOBAR, wxCommandEvent)