|
KiCad PCB EDA Suite
|
A warning icon drawn inside the right edge of a field, left of its dropdown button when it has one, with the warnings as its tooltip. More...
#include <field_warning_icon.h>
Public Member Functions | |
| FIELD_WARNING_ICON (wxWindow *aField) | |
| ~FIELD_WARNING_ICON () override | |
| void | SetWarnings (const wxArrayString &aMessages) |
| Lists aMessages in the tooltip, once each with a count when repeated, and shows the icon, or hides it when there are none. | |
| void | SetWarning (const wxString &aMessage) |
| Shows aMessage as the tooltip, or hides the icon when it is empty. | |
| void | Reposition () |
| Moves the icon back over the field after the field has moved or changed size. | |
Static Public Attributes | |
| static constexpr size_t | MAX_LINES = 10 |
| The most warnings listed in the tooltip, with a count of the rest. | |
Private Member Functions | |
| void | onFieldChanged (wxEvent &aEvent) |
| void | onFieldDestroyed (wxWindowDestroyEvent &aEvent) |
Private Attributes | |
| wxWindow * | m_field |
| Null once the field has been destroyed. | |
A warning icon drawn inside the right edge of a field, left of its dropdown button when it has one, with the warnings as its tooltip.
The icon is shown only while there is something to warn about. It marks a combo box, a choice or a text control.
The icon is a sibling of the field, since native combo boxes cannot host child windows on every port, and follows the field when it moves or changes size. Like any child window it belongs to the field's parent, which destroys it.
Definition at line 39 of file field_warning_icon.h.
|
explicit |
| aField | the field to mark, which needs a parent window |
Definition at line 35 of file field_warning_icon.cpp.
References KiBitmapBundle(), m_field, onFieldChanged(), onFieldDestroyed(), and small_warning.
|
override |
Definition at line 50 of file field_warning_icon.cpp.
References m_field, onFieldChanged(), and onFieldDestroyed().
|
private |
Definition at line 144 of file field_warning_icon.cpp.
References Reposition().
Referenced by FIELD_WARNING_ICON(), and ~FIELD_WARNING_ICON().
|
private |
Definition at line 157 of file field_warning_icon.cpp.
References m_field.
Referenced by FIELD_WARNING_ICON(), and ~FIELD_WARNING_ICON().
| void FIELD_WARNING_ICON::Reposition | ( | ) |
Moves the icon back over the field after the field has moved or changed size.
Definition at line 115 of file field_warning_icon.cpp.
References m_field.
Referenced by onFieldChanged(), and SetWarnings().
| void FIELD_WARNING_ICON::SetWarning | ( | const wxString & | aMessage | ) |
Shows aMessage as the tooltip, or hides the icon when it is empty.
Definition at line 104 of file field_warning_icon.cpp.
References SetWarnings().
| void FIELD_WARNING_ICON::SetWarnings | ( | const wxArrayString & | aMessages | ) |
Lists aMessages in the tooltip, once each with a count when repeated, and shows the icon, or hides it when there are none.
Definition at line 62 of file field_warning_icon.cpp.
References _, MAX_LINES, message, Reposition(), and text.
Referenced by SetWarning().
|
private |
Null once the field has been destroyed.
Definition at line 63 of file field_warning_icon.h.
Referenced by FIELD_WARNING_ICON(), onFieldDestroyed(), Reposition(), and ~FIELD_WARNING_ICON().
|
staticconstexpr |
The most warnings listed in the tooltip, with a count of the rest.
Definition at line 43 of file field_warning_icon.h.
Referenced by SetWarnings().