Changeset 7965 for code/branches/kicklib
- Timestamp:
- Feb 26, 2011, 11:06:36 AM (14 years ago)
- Location:
- code/branches/kicklib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib/data/gui/scripts/GUITools.lua
r7964 r7965 46 46 end 47 47 48 function getStaticTextArea(static_text)49 local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(static_text:getLookNFeel())50 51 return lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(static_text)52 end53 54 48 function getStaticTextWindowHeight(window) 55 49 -- Get the area the text is formatted and drawn into. 56 local formattedArea = getStaticTextArea(window) 50 local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel()) 51 local formattedArea = lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window) 57 52 -- Calculate the pixel height of the frame by subtracting the height of the area above from the total height of the window. 58 53 local frameHeight = window:getUnclippedOuterRect():getHeight() - formattedArea:getHeight() 59 54 60 local height = math.floor(CEGUI.PropertyHelper.stringToFloat(window:getProperty("VertExtent")) + frameHeight) + 1 55 local height = 0 56 if orxonox.GUIManager:isCEGUIVersion7() then 57 height = math.floor(CEGUI.PropertyHelper.stringToFloat(window:getProperty("VertExtent")) + frameHeight) + 1 58 else 59 local lines = window:getFont():getFormattedLineCount(window:getText(), formattedArea, CEGUI.WordWrapLeftAligned) 60 height = lines * window:getFont():getLineSpacing() + frameHeight 61 end 61 62 return height 62 63 end -
code/branches/kicklib/src/libraries/core/GUIManager.h
r7960 r7965 116 116 static void setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled); //tolua_export 117 117 118 static bool isCEGUIVersion7(void) { return CEGUIVERSION7; } // tolua_export 119 118 120 static GUIManager& getInstance() { return Singleton<GUIManager>::getInstance(); } // tolua_export 119 121 … … 150 152 CEGUI::OgreCEGUIRenderer* guiRenderer_; //!< CEGUI's interface to the Ogre Engine 151 153 CEGUI::ResourceProvider* resourceProvider_; //!< CEGUI's resource provider 154 static const bool CEGUIVERSION7 = false; 152 155 #else 153 156 CEGUI::OgreRenderer* guiRenderer_; //!< CEGUI's interface to the Ogre Engine 154 157 CEGUI::OgreResourceProvider* resourceProvider_; //!< CEGUI's resource provider 155 158 CEGUI::OgreImageCodec* imageCodec_; 159 static const bool CEGUIVERSION7 = false; 156 160 #endif 157 161 LuaState* luaState_; //!< LuaState, access point to the Lua engine
Note: See TracChangeset
for help on using the changeset viewer.