Commit Graph
125 Commits
Author SHA1 Message Date
Peter NelsonandPeter Nelson ee07790a87 Codechange: Move to GetWidgetString for osk window. 2025-03-03 21:19:44 +00:00
Rubidiumandrubidium42 c540c2bcf7 Codechange: explicitly initialise member variables of Windows 2025-02-27 19:58:31 +01:00
Peter NelsonandPeter Nelson d30e8dd1c1 Codechange: Use EnumBitSet for WindowDefaultFlags. 2025-01-30 08:40:42 +00:00
Peter NelsonandGitHub afc0745aa2 Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
Rubidiumandrubidium42 4b2051a1c1 Codechange: use Textbuf::GetText() to access the buffer / hide Textbuf::buf 2025-01-19 23:01:35 +01:00
Rubidiumandrubidium42 99d790c4bb Codechange: split widget_data into its actual components 2025-01-04 11:33:24 +01:00
Rubidiumandrubidium42 ef87acc1ff Codechange: make STR_NULL the default for all widget construction functions 2025-01-03 23:25:27 +01:00
Rubidiumandrubidium42 9ac1bad480 Codechange: add and use GetString over directly accessing widget_data 2025-01-03 11:11:01 +01:00
Rubidiumandrubidium42 4bf36e3fa6 Codechange: replace SetDataTip(STR_ with SetStringTip(STR_ 2025-01-02 23:28:43 +01:00
Peter NelsonandGitHub 55314513ce Codechange: Pass NWidgetParts as span instead of begin/end pointers. (#12779) 2024-06-12 23:08:35 +01:00
Peter NelsonandGitHub 4cf6d1dd79 Codechange: Pass WindowDesc by reference instead of pointer. (#12771)
WindowDesc as passed to Windows is not optional so don't allow to it to be nullptr.
2024-06-11 08:58:03 +01:00
Peter NelsonandGitHub 0f230244fe Codechange: [UI] Remove redundant SetMinimalSize for WWT_EDITBOX widgets. (#12733) 2024-05-30 08:34:26 +01:00
Peter NelsonandGitHub 8a6745b26f Codechange: Use PIP instead of spacer widgets for OSK spacing. (#12709)
This (slightly) simplifies the OSK widget layout.
2024-05-22 19:06:52 +01:00
Patric StoutandGitHub a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Rubidiumandrubidium42 86cb184eb4 Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc 2024-03-10 10:14:20 +01:00
Peter NelsonandPeter Nelson 7737aa6640 Codechange: Make all NWidgetPart arrays constexpr.
This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
2024-01-16 21:57:05 +00:00
Peter NelsonandGitHub 71aaed860b Codechange: Missing some conversions to WidgetID. (#11773) 2024-01-14 16:47:10 +00:00
Peter NelsonandPeter Nelson 7124b4eef1 Codechange: Use std::unique_ptr for all NWidgets. 2023-12-31 15:33:56 +00:00
Peter NelsonandPeter Nelson a0dfb76e34 Codechange: Replace mishmash of types for widget index with WidgetID.
Indices were stored as int, but often passed around as uint/uint8_t and casts.

Now they should all use WidgetID.
2023-12-30 00:23:57 +00:00
Peter NelsonandPeter Nelson b86182ab84 Codechange: Use std::map to provide indexed widget access.
This removes the need to determine the biggest widget index and replaces C-style memory handling.
2023-12-29 18:45:43 +00:00
Peter NelsonandPeter Nelson 18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
2023-11-02 22:25:01 +00:00
froschandfrosch b5885295f0 Codechange: Use parameters, which should be used. 2023-09-19 22:49:59 +02:00
froschandfrosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Peter NelsonandPeterN e8015e497d Codechange: Use begin/end of nwidget parts of begin/length.
This simplifies processing nwidget parts as, unlike the remaining length, the pointer to the end of the list never changes. This is the same principle as we use(d) for tracking end instead of length for C-style strings.

And this removes 160~ instances of the lengthof() macro.
2023-09-04 10:20:45 +01:00
Rubidiumandrubidium42 eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
glx22andLoïc Guilloux 46b504a700 Fix: ini_key issues reported by the script 2023-07-14 14:32:46 +02:00
PeterNandGitHub ebc451b071 Fix #10987: Double-close of dropdown stopped land-info tool working as default. (#11000)
Clicking and releasing on the query toolbar icon is meant to select the land-info tool.

This did not work as during closing a window, OnFocusLost() is called, which then closes the window again. These two calls toggled the land-info tool one and off in the same action.

Resolve by not calling Window::Close in OnFocusLost() if the window is already closing.
2023-06-12 08:42:02 +01:00
Rubidiumandrubidium42 d9f8a4c380 Codechange: use std::string GetString variant 2023-05-31 19:31:09 +02:00
Peter NelsonandPeterN c38df2d589 Codechange: Use std::map instead of custom SmallMap. 2023-05-18 12:18:30 +01:00
Rubidiumandrubidium42 6d1586dd49 Codechange: use std::string instead of char* for original editor strings 2023-05-10 23:15:09 +02:00
Peter NelsonandPeterN 0880616851 Codechange: Remove various STRING strings. 2023-05-05 07:07:54 +01:00
Rubidiumandrubidium42 f5f6306af3 Codechange: use string/fmt instead of printf for ShowInfo(F) 2023-04-24 17:51:54 +02:00
glx22andLoïc Guilloux 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 2021-05-29 21:08:25 +02:00
glx22andLoïc Guilloux 994bf19aef Fix f6d5c01: Delay deletion when closing windows 2021-05-29 21:08:25 +02:00
rubidium42andrubidium42 95386dc2b8 Codechange: move misc settings to std::string 2021-05-13 23:13:17 +02:00
Peter NelsonandPeterN 09206be054 Fix: Use unscaled values for padding OSK 2021-04-30 17:08:15 +01:00
Peter NelsonandPeterN 4791ff2862 Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed. 2021-04-30 17:08:15 +01:00
Peter NelsonandPeterN 2efa390a7d Codechange: Simplify calling of DrawCharCentered() 2021-04-30 17:08:15 +01:00
Peter NelsonandCharles Pigott b43cc21214 Fix: OSK layout not scaled for 2x or 4x GUI scale. 2021-03-20 17:55:17 +00:00
Charles PigottandGitHub 9b800a96ed Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
S. D. CloudtandCharles Pigott 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
JMcKiernandCharles Pigott 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
Henry WilsonandMichael Lutz 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
peter1138andMichael Lutz 317f69c152 Codechange: Use override specifier in Window-derived classes. 2019-03-24 16:10:04 +01:00
Charles Pigottandfrosch f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
rubidium b476086c39 (svn r26538) -Codechange: remove double accounting of the drivers 2014-04-28 21:06:51 +00:00
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 2014-04-25 15:40:32 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
michi_cc 13873d2534 (svn r25678) -Codechange: Notify the video driver when an edit box lost (global) focus so it can abort any current input composition. 2013-08-05 20:37:02 +00:00
frosch 8157a8afd8 (svn r25290) -Add: Assign string names to notable windows. 2013-05-26 19:25:01 +00:00