mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 15:56:38 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			603 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			603 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| 
 | |
| #include "text.hpp"
 | |
| 
 | |
| namespace LuaUi
 | |
| {
 | |
|     LuaText::LuaText()
 | |
|         : mAutoSized(true)
 | |
|     {}
 | |
| 
 | |
|     void LuaText::initialize()
 | |
|     {
 | |
|         WidgetExtension::initialize();
 | |
|     }
 | |
| 
 | |
|     void LuaText::setProperties(sol::object props)
 | |
|     {
 | |
|         setCaption(parseProperty(props, "caption", std::string()));
 | |
|         mAutoSized = parseProperty(props, "autoSize", true);
 | |
|         WidgetExtension::setProperties(props);
 | |
|     }
 | |
| 
 | |
|     MyGUI::IntSize LuaText::calculateSize()
 | |
|     {
 | |
|         if (mAutoSized)
 | |
|             return getTextSize();
 | |
|         else
 | |
|             return WidgetExtension::calculateSize();
 | |
|     }
 | |
| }
 |