2009-11-18 07:53:02 +00:00
|
|
|
/* PCSX2 - PS2 Emulator for PCs
|
2010-05-03 14:08:02 +00:00
|
|
|
* Copyright (C) 2002-2010 PCSX2 Dev Team
|
2009-11-18 07:53:02 +00:00
|
|
|
*
|
|
|
|
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU Lesser General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with PCSX2.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2010-06-04 08:00:19 +00:00
|
|
|
#include <wx/wizard.h>
|
2021-09-01 20:31:46 +00:00
|
|
|
#include "common/pxStaticText.h"
|
|
|
|
#include "common/Assertions.h"
|
2009-11-18 07:53:02 +00:00
|
|
|
|
|
|
|
// --------------------------------------------------------------------------------------
|
2010-06-04 08:00:19 +00:00
|
|
|
// pxStaticText (implementations)
|
2009-11-18 07:53:02 +00:00
|
|
|
// --------------------------------------------------------------------------------------
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText::pxStaticText(wxWindow* parent)
|
|
|
|
: _parent(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER)
|
2010-06-04 08:00:19 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
m_align = wxALIGN_CENTRE_HORIZONTAL;
|
|
|
|
m_autowrap = true;
|
|
|
|
m_wrappedWidth = -1;
|
|
|
|
m_heightInLines = 1;
|
2015-09-21 16:40:58 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
SetPaddingDefaults();
|
2010-06-04 08:00:19 +00:00
|
|
|
}
|
2009-11-18 07:53:02 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText::pxStaticText(wxWindow* parent, const wxString& label, wxAlignment align)
|
|
|
|
: _parent(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER)
|
2009-11-18 07:53:02 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
m_heightInLines = 1;
|
|
|
|
m_align = align;
|
2010-06-04 08:00:19 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
SetPaddingDefaults();
|
|
|
|
Init(label);
|
2009-11-18 07:53:02 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void pxStaticText::Init(const wxString& label)
|
2009-11-18 07:53:02 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
m_autowrap = true;
|
|
|
|
m_wrappedWidth = -1;
|
|
|
|
m_label = label;
|
|
|
|
Bind(wxEVT_PAINT, &pxStaticText::paintEvent, this);
|
2009-11-18 07:53:02 +00:00
|
|
|
}
|
|
|
|
|
2010-06-06 23:26:07 +00:00
|
|
|
// we need to refresh the window after changing its size as the standard
|
|
|
|
// control doesn't always update itself properly (fials typically on window resizes where
|
|
|
|
// the control is expanded to fit -- ie the control's size changes but the position does not)
|
|
|
|
void pxStaticText::DoSetSize(int x, int y, int w, int h, int sizeFlags)
|
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
_parent::DoSetSize(x, y, w, h, sizeFlags);
|
|
|
|
Refresh();
|
2010-06-06 23:26:07 +00:00
|
|
|
}
|
|
|
|
|
2010-06-04 08:00:19 +00:00
|
|
|
void pxStaticText::SetPaddingDefaults()
|
2009-11-18 07:53:02 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
m_paddingPix_horiz = 7;
|
|
|
|
m_paddingPix_vert = 1;
|
2010-06-04 08:00:19 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
m_paddingPct_horiz = 0.0f;
|
|
|
|
m_paddingPct_vert = 0.0f;
|
2010-06-04 08:00:19 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText& pxStaticText::SetMinWidth(int width)
|
2010-06-06 23:26:07 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
SetMinSize(wxSize(width, GetMinHeight()));
|
|
|
|
return *this;
|
2010-06-06 23:26:07 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText& pxStaticText::SetMinHeight(int height)
|
2010-06-06 23:26:07 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
SetMinSize(wxSize(GetMinWidth(), height));
|
|
|
|
return *this;
|
2010-06-06 23:26:07 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText& pxStaticText::SetHeight(int lines)
|
2010-06-04 08:00:19 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
if (!pxAssert(lines > 0))
|
|
|
|
lines = 2;
|
|
|
|
m_heightInLines = lines;
|
2010-06-04 08:00:19 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
const int newHeight = (pxGetCharHeight(this) * m_heightInLines) + (m_paddingPix_vert * 2);
|
|
|
|
SetMinSize(wxSize(GetMinWidth(), newHeight));
|
2010-06-04 08:00:19 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
return *this;
|
2009-11-18 07:53:02 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText& pxStaticText::Align(wxAlignment align)
|
2010-06-21 04:04:32 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
m_align = align;
|
|
|
|
return *this;
|
2010-06-21 04:04:32 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText& pxStaticText::Bold()
|
2009-11-18 07:53:02 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
wxFont bold(GetFont());
|
|
|
|
bold.SetWeight(wxFONTWEIGHT_BOLD);
|
|
|
|
SetFont(bold);
|
|
|
|
return *this;
|
2009-11-18 07:53:02 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText& pxStaticText::PaddingPixH(int pixels)
|
2009-11-18 07:53:02 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
m_paddingPix_horiz = pixels;
|
|
|
|
UpdateWrapping(false);
|
|
|
|
Refresh();
|
|
|
|
return *this;
|
2009-11-18 07:53:02 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText& pxStaticText::PaddingPixV(int pixels)
|
2009-11-18 07:53:02 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
m_paddingPix_vert = pixels;
|
|
|
|
Refresh();
|
|
|
|
return *this;
|
2009-11-18 07:53:02 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText& pxStaticText::PaddingPctH(float pct)
|
2009-11-18 07:53:02 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
pxAssert(pct < 0.5);
|
2010-06-04 08:00:19 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
m_paddingPct_horiz = pct;
|
|
|
|
UpdateWrapping(false);
|
|
|
|
Refresh();
|
|
|
|
return *this;
|
2009-11-18 07:53:02 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText& pxStaticText::PaddingPctV(float pct)
|
2009-11-18 07:53:02 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
pxAssert(pct < 0.5);
|
2010-06-04 08:00:19 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
m_paddingPct_vert = pct;
|
|
|
|
Refresh();
|
|
|
|
return *this;
|
2009-11-18 07:53:02 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText& pxStaticText::Unwrapped()
|
2009-11-18 07:53:02 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
m_autowrap = false;
|
|
|
|
UpdateWrapping(false);
|
|
|
|
return *this;
|
2010-06-04 08:00:19 +00:00
|
|
|
}
|
2009-11-18 07:53:02 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
int pxStaticText::calcPaddingWidth(int newWidth) const
|
2010-06-04 08:00:19 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
return (int)(newWidth * m_paddingPct_horiz * 2) + (m_paddingPix_horiz * 2);
|
2010-06-04 08:00:19 +00:00
|
|
|
}
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
int pxStaticText::calcPaddingHeight(int newHeight) const
|
2010-06-04 08:00:19 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
return (int)(newHeight * m_paddingPct_vert * 2) + (m_paddingPix_vert * 2);
|
2010-06-04 08:00:19 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
wxSize pxStaticText::GetBestWrappedSize(const wxClientDC& dc) const
|
2010-06-04 08:00:19 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
pxAssert(m_autowrap);
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
// Find an ideal(-ish) width, based on a search of all parent controls and their
|
|
|
|
// valid Minimum sizes.
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
int idealWidth = wxDefaultCoord;
|
|
|
|
int parentalAdjust = 0;
|
|
|
|
double parentalFactor = 1.0;
|
|
|
|
const wxWindow* millrun = this;
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
while (millrun)
|
|
|
|
{
|
|
|
|
// IMPORTANT : wxWizard changes its min size and then expects everything else
|
|
|
|
// to play nice and NOT resize according to the new min size. (wtf stupid)
|
|
|
|
// Anyway, this fixes it -- ignore min size specifier on wxWizard!
|
|
|
|
if (wxIsKindOf(millrun, wxWizard))
|
|
|
|
break;
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
int min = (int)((millrun->GetMinWidth() - parentalAdjust) * parentalFactor);
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
if (min > 0 && ((idealWidth < 0) || (min < idealWidth)))
|
|
|
|
{
|
|
|
|
idealWidth = min;
|
|
|
|
}
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
parentalAdjust += pxSizerFlags::StdPadding * 2;
|
|
|
|
millrun = millrun->GetParent();
|
|
|
|
}
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
if (idealWidth <= 0)
|
|
|
|
{
|
|
|
|
// FIXME: The minimum size of this control is unknown, so let's just pick a guess based on
|
|
|
|
// the size of the user's display area.
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
idealWidth = (int)(wxGetDisplaySize().GetWidth() * 0.66) - (parentalAdjust * 2);
|
|
|
|
}
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
return dc.GetMultiLineTextExtent(pxTextWrapper().Wrap(this, m_label, idealWidth - calcPaddingWidth(idealWidth)).GetResult());
|
2010-06-04 08:00:19 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticText& pxStaticText::WrapAt(int width)
|
2010-06-04 08:00:19 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
m_autowrap = false;
|
|
|
|
|
|
|
|
if ((width <= 1) || (width == m_wrappedWidth))
|
|
|
|
return *this;
|
|
|
|
|
|
|
|
wxString wrappedLabel;
|
|
|
|
m_wrappedWidth = width;
|
|
|
|
|
|
|
|
if (width > 1)
|
|
|
|
wrappedLabel = pxTextWrapper().Wrap(this, m_label, width).GetResult();
|
|
|
|
|
|
|
|
if (m_wrappedLabel != wrappedLabel)
|
|
|
|
{
|
|
|
|
m_wrappedLabel = wrappedLabel;
|
|
|
|
wxSize area = wxClientDC(this).GetMultiLineTextExtent(m_wrappedLabel);
|
|
|
|
SetMinSize(wxSize(
|
|
|
|
area.GetWidth() + calcPaddingWidth(area.GetWidth()),
|
|
|
|
area.GetHeight() + calcPaddingHeight(area.GetHeight())));
|
|
|
|
}
|
|
|
|
return *this;
|
2009-11-18 07:53:02 +00:00
|
|
|
}
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
bool pxStaticText::_updateWrapping(bool textChanged)
|
2009-11-18 07:53:02 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
if (!m_autowrap)
|
|
|
|
{
|
|
|
|
//m_wrappedLabel = wxEmptyString;
|
|
|
|
//m_wrappedWidth = -1;
|
|
|
|
return false;
|
|
|
|
}
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
wxString wrappedLabel;
|
|
|
|
int newWidth = GetSize().GetWidth();
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
if (!textChanged && (newWidth == m_wrappedWidth))
|
|
|
|
return false;
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
// Note: during various stages of sizer-calc, width can be 1, 0, or -1.
|
|
|
|
// We ignore wrapping in these cases. (the PaintEvent also checks the wrapping
|
|
|
|
// and updates it if needed, in case the control's size isn't figured out prior
|
|
|
|
// to being painted).
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
m_wrappedWidth = newWidth;
|
|
|
|
if (m_wrappedWidth > 1)
|
|
|
|
wrappedLabel = pxTextWrapper().Wrap(this, m_label, m_wrappedWidth).GetResult();
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
if (m_wrappedLabel == wrappedLabel)
|
|
|
|
return false;
|
|
|
|
m_wrappedLabel = wrappedLabel;
|
2016-11-12 15:28:37 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
return true;
|
2009-11-18 07:53:02 +00:00
|
|
|
}
|
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
void pxStaticText::UpdateWrapping(bool textChanged)
|
2009-11-18 07:53:02 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
if (_updateWrapping(textChanged))
|
|
|
|
Refresh();
|
2009-11-18 07:53:02 +00:00
|
|
|
}
|
2009-11-19 13:44:44 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void pxStaticText::SetLabel(const wxString& label)
|
2009-11-19 13:44:44 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
const bool labelChanged(label != m_label);
|
|
|
|
if (labelChanged)
|
|
|
|
{
|
|
|
|
m_label = label;
|
|
|
|
Refresh();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Always update wrapping, in case window width or something else also changed.
|
|
|
|
UpdateWrapping(labelChanged);
|
|
|
|
InvalidateBestSize();
|
2009-11-19 13:44:44 +00:00
|
|
|
}
|
2009-11-20 03:26:10 +00:00
|
|
|
|
2010-06-04 08:00:19 +00:00
|
|
|
wxFont pxStaticText::GetFontOk() const
|
2009-11-25 03:54:57 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
wxFont font(GetFont());
|
|
|
|
if (!font.Ok())
|
|
|
|
return wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
|
|
|
return font;
|
2009-11-25 03:54:57 +00:00
|
|
|
}
|
2009-12-14 12:18:55 +00:00
|
|
|
|
2016-11-12 15:28:37 +00:00
|
|
|
bool pxStaticText::Enable(bool enabled)
|
2010-06-05 14:25:41 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
if (_parent::Enable(enabled))
|
|
|
|
{
|
|
|
|
Refresh();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2010-06-05 14:25:41 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void pxStaticText::paintEvent(wxPaintEvent& evt)
|
2009-12-14 12:18:55 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
wxPaintDC dc(this);
|
|
|
|
const int dcWidth = dc.GetSize().GetWidth();
|
|
|
|
const int dcHeight = dc.GetSize().GetHeight();
|
|
|
|
if (dcWidth < 1)
|
|
|
|
return;
|
|
|
|
dc.SetFont(GetFontOk());
|
|
|
|
|
|
|
|
if (IsEnabled())
|
|
|
|
dc.SetTextForeground(GetForegroundColour());
|
|
|
|
else
|
|
|
|
dc.SetTextForeground(*wxLIGHT_GREY);
|
|
|
|
|
|
|
|
pxWindowTextWriter writer(dc);
|
|
|
|
writer.Align(m_align);
|
|
|
|
|
|
|
|
const wxString& label(m_autowrap ? m_wrappedLabel : m_label);
|
|
|
|
if (m_autowrap)
|
|
|
|
_updateWrapping(false);
|
|
|
|
|
|
|
|
int tWidth, tHeight;
|
|
|
|
dc.GetMultiLineTextExtent(label, &tWidth, &tHeight);
|
|
|
|
|
|
|
|
writer.Align(m_align);
|
|
|
|
if (m_align & wxALIGN_CENTER_VERTICAL)
|
|
|
|
writer.SetY((dcHeight - tHeight) / 2);
|
|
|
|
else
|
|
|
|
writer.SetY((int)(dcHeight * m_paddingPct_vert) + m_paddingPix_vert);
|
|
|
|
|
|
|
|
writer.WriteLn(label); // without formatting please.
|
|
|
|
|
|
|
|
//dc.SetBrush( *wxTRANSPARENT_BRUSH );
|
|
|
|
//dc.DrawRectangle(wxPoint(), dc.GetSize());
|
2009-12-14 12:18:55 +00:00
|
|
|
}
|
2010-06-04 08:00:19 +00:00
|
|
|
|
|
|
|
// Overloaded form wxPanel and friends.
|
|
|
|
wxSize pxStaticText::DoGetBestSize() const
|
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
wxClientDC dc(const_cast<pxStaticText*>(this));
|
|
|
|
dc.SetFont(GetFontOk());
|
|
|
|
|
|
|
|
wxSize best;
|
|
|
|
|
|
|
|
if (m_autowrap)
|
|
|
|
{
|
|
|
|
best = GetBestWrappedSize(dc);
|
|
|
|
//best.x = wxDefaultCoord;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// No autowrapping, so we can force a specific size here!
|
|
|
|
best = dc.GetMultiLineTextExtent(GetLabel());
|
|
|
|
best.x += calcPaddingWidth(best.x);
|
|
|
|
}
|
|
|
|
|
|
|
|
best.y += calcPaddingHeight(best.y);
|
|
|
|
|
|
|
|
CacheBestSize(best);
|
|
|
|
return best;
|
2010-06-04 08:00:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------------------
|
|
|
|
// pxStaticHeading (implementations)
|
|
|
|
// --------------------------------------------------------------------------------------
|
2021-09-06 18:28:26 +00:00
|
|
|
pxStaticHeading::pxStaticHeading(wxWindow* parent, const wxString& label)
|
|
|
|
: _parent(parent)
|
2010-06-04 08:00:19 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
m_align = wxALIGN_CENTER;
|
2010-06-04 08:00:19 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
SetPaddingDefaults();
|
|
|
|
Init(label);
|
2010-06-04 08:00:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void pxStaticHeading::SetPaddingDefaults()
|
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
m_paddingPix_horiz = 4;
|
|
|
|
m_paddingPix_vert = 1;
|
2010-06-04 08:00:19 +00:00
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
m_paddingPct_horiz = 0.08f;
|
|
|
|
m_paddingPct_vert = 0.0f;
|
2010-06-04 08:00:19 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void operator+=(wxSizer& target, pxStaticText* src)
|
2010-06-08 12:09:28 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
if (src)
|
|
|
|
target.Add(src, pxExpand);
|
2010-06-08 12:09:28 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void operator+=(wxSizer& target, pxStaticText& src)
|
2010-06-08 12:09:28 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
target.Add(&src, pxExpand);
|
2010-06-08 12:09:28 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 18:28:26 +00:00
|
|
|
void operator+=(wxSizer* target, pxStaticText& src)
|
2010-06-08 12:09:28 +00:00
|
|
|
{
|
2021-09-06 18:28:26 +00:00
|
|
|
target->Add(&src, pxExpand);
|
2010-06-08 12:09:28 +00:00
|
|
|
}
|