Beispiel #1
0
void TextRender::SetExpanse(const Vec2& _expanse, bool _onlyScaleDown)
{
    int len = (int)m_text.length();
    int lineCount = 1;
    int charCount = 0;
    int charCountMax = 0;
    for (int i = 0; i < len; i++)
    {
        charCount++;
        if (m_text[i] == '\n')
        {
            if (charCountMax < charCount)
                charCountMax = charCount;
            charCount = 0;
            lineCount++;
        }
    }

    //if the text contains no linebreaks
    if (!charCountMax) charCountMax = charCount;

    Vec2 captionDim = GetDim();

    // in case that the text is to large in any direction scale it down
    if (!_onlyScaleDown || (captionDim[0] * charCountMax * GetDefaultSize() >= _expanse[0] || captionDim[1] * lineCount >= _expanse[1]))
    {
        SetDefaultSize(min((float)(_expanse[0] / (captionDim[0] * charCountMax)),
                           (float)(_expanse[1] / (captionDim[1] * lineCount))));
    }

}
Beispiel #2
0
EbmlCrc32::EbmlCrc32()
{
	ResetCRC();
	SetDefaultSize(4);
	m_crc_final = 0;
	SetSize_(4);
	//This EbmlElement has been set
//	SetValueIsSet();
}
Beispiel #3
0
EbmlString::EbmlString(const std::string & aDefaultValue)
 :EbmlElement(0, true), Value(aDefaultValue), DefaultValue(aDefaultValue)
{
	SetDefaultSize(0);
	SetDefaultIsSet();
/* done automatically	
	SetSize_(Value.length());
	if (GetDefaultSize() > GetSize())
		SetSize_(GetDefaultSize());*/
}
Beispiel #4
0
START_LIBEBML_NAMESPACE

EbmlString::EbmlString()
 :EbmlElement(0, false)
{
	SetDefaultSize(0);
/* done automatically	
	SetSize_(Value.length());
	if (GetDefaultSize() > GetSize())
		SetSize_(GetDefaultSize());*/
}
Beispiel #5
0
 CWinXPButtonComp::CWinXPButtonComp(LPTSTR _name):ControlComponent<CWinXPButtonComp>(_name)
 {
    SetDefaultSize(40,60);
 }
 CFadeStateButtonCtrlComp::CFadeStateButtonCtrlComp(LPTSTR _name):ControlComponent<CFadeStateButtonCtrlComp>(_name)
 {
    SetDefaultSize(40,60);
 }
void CActivityAreaCtrl::OnSashDragged	(wxSashEvent & ev)
{
	wxGetApp().Prefs.nActivityCtrlHeight = wxMax(ev.GetDragRect().height,50);
	SetDefaultSize(wxSize( 1000, wxGetApp().Prefs.nActivityCtrlHeight));
	ev.Skip();
}
void CSourcesBox::OnSashDragged	(wxSashEvent & ev)
{
	wxGetApp().Prefs.nSourceBoxWidth = wxMax(ev.GetDragRect().width,50);
	SetDefaultSize(wxSize(wxGetApp().Prefs.nSourceBoxWidth, 1000));
	ev.Skip();
}
Beispiel #9
0
CHotKeyCtrl::CHotKeyCtrl(LPTSTR _name):ControlComponent<StdCtrl::CHotKeyCtrl>(_name)
{
    SetDefaultSize(80,14);
    RegisterStatusBarCtrlStyles();
}