PeterN
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
PeterN
b49bd86a46
Fix dec7ff6b0c: Dropdowns couldn't be closed by pressing the parent button. ( #10954 )
...
Since dropdowns self-close, the detection of re-clicking a dropdown
button no longer worked, as the dropdown is already closed.
Instead set (and then test) a flag on the parent widget to indicate that
the dropdown closed. This method avoids looping windows on every click.
2023-06-07 19:01:30 +01:00
Patric Stout
c43a23cea8
Fix: crash when not even a single row fits for dropdowns on low resolution screens ( #10934 )
2023-06-04 15:07:18 +00:00
Peter Nelson
2e62682f73
Codechange: Close dropdowns by class instead of id.
2023-06-03 14:17:05 +01:00
Peter Nelson
2511649938
Codechange: Use window parent association for dropdowns.
...
This replaces the separate window class and number properties, and
allows the window system to close dropdowns automatically.
2023-06-03 14:17:05 +01:00
Peter Nelson
dec7ff6b0c
Fix: Make dropdowns self-close when losing focus.
2023-06-03 14:17:05 +01:00
Peter Nelson
d2034d9c38
Codechange: Scrollbar methods now accept size_t.
...
This clears up a lot of casts from size_t to int.
2023-05-07 20:25:44 +01:00
PeterN
a836edd5a7
Codechange: Scrollbar::UpdatePosition() will tell if the position changed. ( #10777 )
...
So we don't need to check this manually.
2023-05-06 19:45:32 +00:00
Rubidium
c829930440
Codechange: replace strnatcmp with C++ string capable version
2023-04-29 12:07:45 +02:00
Patric Stout
1ba4dcc924
Codechange: migrate all Window-related timers to the new framework
...
This means we also say goodbye to GUITimers.
2023-04-15 13:58:55 +02:00
Peter Nelson
e5af5907ec
Change: Make all dropdown lists extend width if necessary.
...
This removes the auto_width parameter from ShowDropDown(At).
2023-04-13 20:57:47 +01:00
Peter Nelson
5bc9d00735
Cleanup: Let GetStringBoundingBox deal with buffer.
2023-04-13 20:57:47 +01:00
PeterN
c962c77306
Fix: Incorrect available height for dropdowns due to unsigned promotion. ( #10264 )
...
Dropdowns which are taller than the main window should automatically have
a scrollbar added. This did not work for toolbar dropdown as the location
near the top of the window resulted in an unsigned underflow.
2022-12-20 09:39:23 -05:00
Peter Nelson
890b2666d3
Change: Use scaled WidgetDimensions.
2022-11-12 18:28:39 +00:00
Peter Nelson
6f95e04005
Change: Use Rect helpers for widget drawing.
...
This replaces repetitive and sometimes unwieldy use of constants.
2022-11-12 18:28:39 +00:00
Peter Nelson
632464a623
Codechange: Use Rect in DropDownListItem::Draw().
2022-11-12 18:28:39 +00:00
glx22
5799402f7a
Codechange: Rename window related DeleteXXX to match new behaviour
2021-05-29 21:08:25 +02:00
glx22
994bf19aef
Fix f6d5c01: Delay deletion when closing windows
2021-05-29 21:08:25 +02:00
glx22
e66e25ff71
Fix #9269 , f6d5c01: Hide windows without abusing WC_INVALID
2021-05-15 21:08:49 +02:00
frosch
f96f113951
Codechange: use IterateFromBack/Front only if the order is important.
...
Use Iterate if the order does not matter.
2021-05-12 23:22:41 +02:00
Peter Nelson
d8e06e590a
Codechange: Make GetCurrentRect() conform to usual Rect bounds, and reuse it.
...
Similar code is already repeated in other locations.
2021-05-08 09:53:55 +01:00
rubidium42
6bca9e090d
Codechange: add SetDParamStr that accepts std::string&
2021-05-06 21:45:36 +02:00
Peter Nelson
4791ff2862
Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed.
2021-04-30 17:08:15 +01:00
glx22
14e92bd8e2
Codechange: Replace window related FOR_ALL with range-based for loops
2021-04-29 21:08:24 +02:00
PeterN
ae7f07de74
Fix: Incorrect vertical alignment of icon and text in DropDownListIconItem. ( #9133 )
...
This happens if the bounding dimensions are changed so that each item is the same size, as happens on the railtype/roadtype dropdown lists, as the vertical offset was calculated before this dimension is changed.
2021-04-28 22:32:43 +01:00
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
2021-01-08 11:16:18 +01:00
Michael Lutz
a49fdb7ebb
Codechange: Store base set related texts in std::strings.
2020-05-21 20:02:34 +02:00
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
2019-11-10 17:59:20 +00:00
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
2019-04-10 23:22:20 +02:00
glx22
3b4f224c0b
Fix #7494 : std::sort() and qsort() use different comparators ( #7495 )
2019-04-10 20:55:53 +02:00
Michael Lutz
c7b9987d08
Codechange: Switch DropDownList to directly use std::vector, thus making AutoDeleteSmallVector obsolete.
...
DropDownListItem are strongly managed using std::unique_ptr to ensure leak-free handling. Appropriate use
of move-semantics make intent a lot clearer than parameter comments and allows the compiler to generate
copy-free code for most situations.
2019-04-09 22:45:15 +02:00
glx22
66dd7c3879
Fix: MSVC warnings ( #7423 )
2019-03-28 00:09:33 +01:00
Henry Wilson
ab711e6942
Codechange: Replaced SmallVector::[Begin|End]() with std alternatives
2019-03-26 20:15:57 +00:00
Henry Wilson
a0f36a50e6
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
2019-03-26 20:15:57 +00:00
Henry Wilson
a690936ed7
Codechange: Replace SmallVector::Length() with std::vector::size()
2019-03-26 20:15:57 +00:00
peter1138
b56ea5ca27
Add: Generic drop down list string item with icon.
2019-03-10 10:31:37 +00:00
peter1138
811bf22620
Codechange: Use Colours type instead of byte.
2019-03-10 09:20:11 +00:00
J0an Josep
628af2fabc
Fix #6060 : When opening a scrollable dropdown above a widget, scroll it to its very bottom.
...
This "prevents" the fast movement towards the bottom when holding down the mouse button.
2019-01-20 21:43:00 +00:00
Juanjo
226dbcb422
Codechange #6060 : Allow drawing dropdown lists with scrollbars above the widgets
2019-01-20 21:43:00 +00:00
PeterN
5ff0c24993
Fix #6780 : Some windows didn't get updated from OnTick() ( #7048 )
2019-01-12 23:23:23 +00:00
Charles Pigott
f5b1115039
Doc: Lots and lots of doxymentation fixes
2018-10-31 12:35:54 +01:00
peter1138
902663176d
(svn r27820) -Fix: Allow dropdown to be drawn above origin widget even with scrollbar (Juanjo)
2017-03-23 20:07:59 +00:00
michi_cc
2b8bb12d62
(svn r27381) -Fix: Warnings due to C++11 requirements for explicit narrowing conversions in initializer lists.
2015-08-10 20:24:13 +00:00
frosch
c9114af706
(svn r27131) -Fix: Dropdown- and tooltip-windows should not steal the focus.
2015-02-01 12:23:39 +00:00
frosch
925fb7bd37
(svn r26691) -Codechange: Simplify ShowDropDownListAt (Juanjo)
2014-07-16 20:38:36 +00:00
frosch
d7736e3797
(svn r26680) -Codechange: Simplify dropdown height computation. (Juanjo)
2014-07-08 20:07:50 +00:00
frosch
06b210ff42
(svn r26629) -Fix [FS#6012]: If the video driver fails to supply a list of resolutions, display an error message.
2014-06-05 17:14:16 +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
rubidium
b1bcd1adab
(svn r26128) -Fix: erroneous cast
2013-11-26 15:12:54 +00:00
rubidium
50fdf5e30c
(svn r26121) -Codechange: add some asserts after dynamic casts to show they shouldn't return NULL ever
2013-11-26 13:21:25 +00:00