mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-26 18:40:54 +00:00
Editbox should now create it's text when added.
This commit is contained in:
parent
8888122737
commit
edfc2c5491
1 changed files with 24 additions and 1 deletions
|
@ -1411,7 +1411,8 @@ namespace NLGUI
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
void CGroupEditBox::checkCoords()
|
void CGroupEditBox::checkCoords()
|
||||||
{
|
{
|
||||||
setupDisplayText();
|
if( !editorMode )
|
||||||
|
setupDisplayText();
|
||||||
|
|
||||||
CInterfaceGroup::checkCoords();
|
CInterfaceGroup::checkCoords();
|
||||||
}
|
}
|
||||||
|
@ -1530,7 +1531,29 @@ namespace NLGUI
|
||||||
_ViewText = dynamic_cast<CViewText *>(CInterfaceGroup::getView("edit_text"));
|
_ViewText = dynamic_cast<CViewText *>(CInterfaceGroup::getView("edit_text"));
|
||||||
|
|
||||||
if(_ViewText == NULL)
|
if(_ViewText == NULL)
|
||||||
|
{
|
||||||
nlwarning("Interface: CGroupEditBox: text 'edit_text' missing or bad type");
|
nlwarning("Interface: CGroupEditBox: text 'edit_text' missing or bad type");
|
||||||
|
if( editorMode )
|
||||||
|
{
|
||||||
|
nlwarning( "Trying to create a new 'edit_text' for %s", getId().c_str() );
|
||||||
|
_ViewText = dynamic_cast< CViewText* >( CWidgetManager::getInstance()->getParser()->createClass( "text" ) );
|
||||||
|
if( _ViewText != NULL )
|
||||||
|
{
|
||||||
|
_ViewText->setParent( this );
|
||||||
|
_ViewText->setIdRecurse( "edit_text" );
|
||||||
|
_ViewText->setHardText( "sometext" );
|
||||||
|
_ViewText->setPosRef( Hotspot_TL );
|
||||||
|
_ViewText->setParentPosRef( Hotspot_TL );
|
||||||
|
addView( _ViewText );
|
||||||
|
|
||||||
|
setH( _ViewText->getFontHeight() );
|
||||||
|
setW( _ViewText->getFontWidth() * _ViewText->getText().size() );
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
nlwarning( "Failed to create new 'edit_text' for %s", getId().c_str() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// For MultiLine editbox, clip the end space, else weird when edit space at end of line (nothing happens)
|
// For MultiLine editbox, clip the end space, else weird when edit space at end of line (nothing happens)
|
||||||
if(_ViewText)
|
if(_ViewText)
|
||||||
|
|
Loading…
Reference in a new issue