void aui_Control::ResizeLayers(ldl_datablock *theBlock) { TextReloadFont(); sint32 width = Width(); sint32 height = Height(); for(sint32 layerIndex = 0; layerIndex < m_numberOfLayers; layerIndex++) { sint32 *rowIndices = new sint32[m_imagesPerLayer]; sint32 numberOfRows = SegmentImages(theBlock, layerIndex, rowIndices); ResizeLayerWidth(theBlock, layerIndex, numberOfRows, rowIndices, width); ResizeLayerHeight(theBlock, layerIndex, numberOfRows, rowIndices, height); delete [] rowIndices; } aui_Region::Resize(width, height); }
AUI_ERRCODE aui_TextBox::InitCommon( void ) { m_numItems = 0, m_curItem = 0; m_curColor = k_AUI_UI_NOCOLOR; m_curBold = 0; m_curItalic = 0; TextReloadFont(); aui_Static **itemPtr = m_items; for ( uint32 i = k_AUI_TEXTBOX_MAXITEMS; i; i--, itemPtr++ ) { AUI_ERRCODE errcode; *itemPtr = new aui_Static( &errcode, aui_UniqueId(), 0, 0, m_width, m_textfont->GetMaxHeight(), NULL, k_AUI_TEXTBOX_MAXTEXT ); (*itemPtr)->SetBlindness( TRUE ); (*itemPtr)->TextFlags() = k_AUI_BITMAPFONT_DRAWFLAG_JUSTLEFT; (*itemPtr)->SetTextFont( m_textfont->GetTTFFile() ); (*itemPtr)->SetTextFontSize( m_textfont->GetPointSize() ); } return AUI_ERRCODE_OK; }
AUI_ERRCODE TextBox::InitCommon( BOOL fromLDL ) { m_numItems = 0, m_curItem = 0; m_curColor = k_AUI_UI_NOCOLOR; m_curBold = FALSE; m_curItalic = FALSE; sint32 i; aui_Static **itemPtr = m_items; TextReloadFont(); for (i=0; i<k_AUI_TEXTBOX_MAXITEMS; i++) { (*itemPtr) = NULL; itemPtr++; } aui_BitmapFont *font = GetTextFont(); if (!font) { aui_TextBase::SetTextFont(k_AUI_TEXTBASE_DEFAULT_FONTNAME); aui_TextBase::TextReloadFont(); font = GetTextFont(); } MBCHAR *fontName = font->GetTTFFile(); itemPtr = m_items; for (i = k_AUI_TEXTBOX_MAXITEMS; i; i--, itemPtr++ ) { AUI_ERRCODE errcode; *itemPtr = new c3_Static( &errcode, aui_UniqueId(), 10, 0, m_width-20, 14, NULL, NULL, k_AUI_TEXTBOX_MAXTEXT, 0 ,0 ); (*itemPtr)->SetTextFont( fontName); (*itemPtr)->SetTextFontSize(9); (*itemPtr)->TextFlags() = k_AUI_BITMAPFONT_DRAWFLAG_JUSTLEFT; (*itemPtr)->SetTextColor(GetTextColor()); if (GetTextShadow()) (*itemPtr)->SetTextShadow(TRUE); (*itemPtr)->SetTextShadowColor(GetTextShadowColor()); } return AUI_ERRCODE_OK; }