27#include <wx/infobar.h>
85 WX_INFOBAR( wxWindow* aParent, wxAuiManager* aMgr =
nullptr, wxWindowID aWinid = wxID_ANY );
119 void AddCloseButton(
const wxString& aTooltip =
_(
"Hide this message." ) );
135 void AddButton( wxHyperlinkCtrl* aHypertextButton );
144 void AddButton( wxWindowID aId,
const wxString& aLabel = wxEmptyString )
override;
171 void ShowMessageFor(
const wxString& aMessage,
int aTime,
int aFlags = wxICON_INFORMATION,
180 void ShowMessage(
const wxString& aMessage,
int aFlags = wxICON_INFORMATION )
override;
203 void QueueShowMessage(
const wxString& aMessage,
int aFlags = wxICON_INFORMATION );
241 void onTimer( wxTimerEvent& aEvent );
243 void onSize( wxSizeEvent& aEvent );
261 DECLARE_EVENT_TABLE()
283 const wxPoint& aPos = wxDefaultPosition,
284 const wxSize& aSize = wxSize( -1,-1 ),
285 long aStyle = wxTAB_TRAVERSAL,
286 const wxString& aName = wxEmptyString );
A wxPanel derived class that hold an infobar and another control.
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 wrapper for reporting to a WX_INFOBAR UI element.
INFOBAR_REPORTER(WX_INFOBAR *aInfoBar)
void Finalize()
Update the infobar with the reported text.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
std::unique_ptr< wxString > m_message
virtual ~INFOBAR_REPORTER()
bool HasMessage() const override
Returns true if the reporter client is non-empty.
A pure virtual class used to derive REPORTER objects from.
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.
@ OUTDATED_SAVE
OUTDATED_SAVE Messages that should be cleared on save.
@ 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.
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)