KiCad PCB EDA Suite
|
A version of a wxStaticText control that will request a smaller size than the full string. More...
#include <wx_ellipsized_static_text.h>
Public Member Functions | |
WX_ELLIPSIZED_STATIC_TEXT (wxWindow *aParent, wxWindowID aID, const wxString &aLabel, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, long aStyle=0) | |
void | SetMinimumStringLength (const wxString &aString) |
Set the string that is used for determining the requested size of the control. | |
Protected Member Functions | |
wxSize | DoGetBestSize () const override |
Private Attributes | |
wxString | m_minimumString |
A version of a wxStaticText control that will request a smaller size than the full string.
This can be used with the ellipsization styles to ensure that the control will actually ellipsize properly inside sizer elements (since they ask for the best size but GTK reports the best size as being the full string length, even when ellipsization is enabled). This work around is discussed in upstream ticket https://trac.wxwidgets.org/ticket/18992.
Definition at line 37 of file wx_ellipsized_static_text.h.
WX_ELLIPSIZED_STATIC_TEXT::WX_ELLIPSIZED_STATIC_TEXT | ( | wxWindow * | aParent, |
wxWindowID | aID, | ||
const wxString & | aLabel, | ||
const wxPoint & | aPos = wxDefaultPosition , |
||
const wxSize & | aSize = wxDefaultSize , |
||
long | aStyle = 0 |
||
) |
Definition at line 27 of file wx_ellipsized_static_text.cpp.
|
overrideprotected |
Definition at line 36 of file wx_ellipsized_static_text.cpp.
References KIUI::GetTextSize(), and m_minimumString.
|
inline |
Set the string that is used for determining the requested size of the control.
The control will return this string length from GetBestSize(), regardless of what string the control is displaying.
aString | is the smallest string to display without ellipses |
Definition at line 52 of file wx_ellipsized_static_text.h.
References m_minimumString.
Referenced by LAYER_WIDGET::insertLayerRow().
|
private |
Definition at line 61 of file wx_ellipsized_static_text.h.
Referenced by DoGetBestSize(), and SetMinimumStringLength().