1
0
forked from 0ad/0ad
0ad/source/gui
s0600204 9c5062147a Add a GetTextSize() method to GUI objects
Usage:
  let size = Engine.GetGUIObjectByName({gui_object_name}).GetTextSize()

Returns a JS object containing the height and width of the primary text
field within
the object, taking into account new lines, text wrapping, and font
changes.

Unless the object doesn't contain text, in which case the method will
return undefined.

Commented on by: vladislavbelov
Additional code by: elexis
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D844
This was SVN commit r22134.
2019-03-18 22:15:40 +00:00
..
scripting Add a GetTextSize() method to GUI objects 2019-03-18 22:15:40 +00:00
tests Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
CButton.cpp GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
CButton.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
CChart.cpp Adds axes to the CChart and the summary screen. 2018-03-04 12:42:35 +00:00
CChart.h Adds axes to the CChart and the summary screen. 2018-03-04 12:42:35 +00:00
CCheckBox.cpp GUI cleanup. 2016-06-21 14:38:06 +00:00
CCheckBox.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
CDropDown.cpp Make sure dropdowns fit in the screen by allowing the list to be above when there is not enough space 2018-02-25 22:26:31 +00:00
CDropDown.h Fix dropdown list height after resizing the window (in case there is an item that used wordwrapping before but not after the resize or vice versa). 2017-06-29 23:39:12 +00:00
CGUI.cpp Add a GetTextSize() method to GUI objects 2019-03-18 22:15:40 +00:00
CGUI.h Add a GetTextSize() method to GUI objects 2019-03-18 22:15:40 +00:00
CGUIList.h Add GPL header 2009-04-18 17:00:33 +00:00
CGUIScrollBarVertical.cpp GUI engine cleanup. 2016-06-07 15:57:33 +00:00
CGUIScrollBarVertical.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
CGUISeries.h Fix [19027] by using generic code for conversions and fixing a few other issues. Refs #3403. Reviewed by leper. 2017-01-06 11:14:03 +00:00
CGUISprite.cpp GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
CGUISprite.h Allow multiple special sprites, to facilitate cases where we want to add an overlay to a sprite. 2015-12-13 16:03:17 +00:00
CImage.cpp GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
CImage.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
CInput.cpp Add FALLTHROUGH, which in the best case is just [[fallthrough]]. 2017-09-01 20:04:53 +00:00
CInput.h Implement readonly Input GUI objects and use it in the file location indicator in the replay menu, 2017-08-29 23:53:23 +00:00
CList.cpp Bump copyright header year numbers. 2018-02-21 18:44:52 +00:00
CList.h Get the index of the hovered element in GUI lists and use it to display item-specific tooltips in the gamesetup for the victory condition, maptype and starting resources. 2017-05-15 21:49:10 +00:00
COList.cpp Fix cell text wrapping inside COList. 2019-01-24 20:00:31 +00:00
COList.h Fix cell text wrapping inside COList. 2019-01-24 20:00:31 +00:00
CProgressBar.cpp GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
CProgressBar.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
CRadioButton.cpp GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
CRadioButton.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
CSlider.cpp Add sliders to the GUI. Use them for the sound/music volume controls. 2017-04-30 16:51:18 +00:00
CSlider.h Add sliders to the GUI. Use them for the sound/music volume controls. 2017-04-30 16:51:18 +00:00
CText.cpp Scroll to the top when switching between tabs in the credits. Patch by vladislavbelov 2016-12-11 21:15:50 +00:00
CText.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
CTooltip.cpp Bump copyright header year numbers. 2018-02-21 18:44:52 +00:00
CTooltip.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
GUI.h Add C++ GUI code for drawing charts. Patch by vladislavbelov. JS will come later. Refs #3403 2016-12-07 19:03:54 +00:00
GUIbase.cpp GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
GUIbase.h Split CColor from Shapes. 2019-01-13 15:38:41 +00:00
GUIManager.cpp Remove obsolete DisplayMessageBox function from 00e18e4ea8, unused since 835609df20. 2018-11-29 12:33:45 +00:00
GUIManager.h Remove obsolete DisplayMessageBox function from 00e18e4ea8, unused since 835609df20. 2018-11-29 12:33:45 +00:00
GUIRenderer.cpp Allow multiple special sprites, to facilitate cases where we want to add an overlay to a sprite. 2015-12-13 16:03:17 +00:00
GUIRenderer.h Split CColor from Shapes. 2019-01-13 15:38:41 +00:00
GUItext.cpp Add FALLTHROUGH, which in the best case is just [[fallthrough]]. 2017-09-01 20:04:53 +00:00
GUItext.h Ignore color and font tags when typing something in a Dropdown gui element to select an item. 2017-05-09 13:29:19 +00:00
GUITooltip.cpp Tooltip GUI engine cleanup. 2016-06-15 15:40:05 +00:00
GUITooltip.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
GUItypes.h Make sure dropdowns fit in the screen by allowing the list to be above when there is not enough space 2018-02-25 22:26:31 +00:00
GUIutil.cpp Make sure dropdowns fit in the screen by allowing the list to be above when there is not enough space 2018-02-25 22:26:31 +00:00
GUIutil.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
IGUIButtonBehavior.cpp GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
IGUIButtonBehavior.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
IGUIObject.cpp Use direct gui.scale instead of reciprocal gui.scale 2017-06-14 17:13:44 +00:00
IGUIObject.h Add a GetTextSize() method to GUI objects 2019-03-18 22:15:40 +00:00
IGUIScrollBar.cpp GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
IGUIScrollBar.h Fix scrollbare edgy-case and off by 1's in dropdown 2017-11-21 20:07:23 +00:00
IGUIScrollBarOwner.cpp Add a GetTextSize() method to GUI objects 2019-03-18 22:15:40 +00:00
IGUIScrollBarOwner.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
IGUITextOwner.cpp GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
IGUITextOwner.h GUI code cleanup. Fixes #3354. 2015-08-21 17:08:41 +00:00
MiniMap.cpp In preparation of renaming and grouping main.cpp shutdown variables: 2018-05-08 09:24:16 +00:00
MiniMap.h Update the Minimap texture if the waterheight has changed. 2017-04-16 22:13:32 +00:00