Commit Graph

324 Commits

Author SHA1 Message Date
Peter Nelson 23a8222200 Change: Split vscroll and hscroll padding.
Vertical and horizontal scrollbars are different sizes, this allows
different padding for each type.
2022-11-12 18:28:39 +00:00
Peter Nelson b5693becdc Add: Define scaled WidgetDimensions.
Includes RectPadding container.
2022-11-12 18:28:39 +00:00
Peter Nelson 17d1fe26c2 Codechange: Helpers to allow passing a Rect to some functions. 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
frosch f6d5c0136e Codechange: make Window destruction not rely on undefined behavior. 2021-05-12 23:22:41 +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
frosch 22567a1f43 Codechange: use iterators instead of 'subranges' when iterating from a specific window.
Using iterators makes it easier to include or exclude the start window in the iteration.
2021-05-12 23:22:41 +02:00
frosch aba239479b Codechange: remove excessive templating in favour of a single const_cast.
The const_cast will be removed again in a later commit.
2021-05-12 23:22:41 +02:00
glx22 14e92bd8e2 Codechange: Replace window related FOR_ALL with range-based for loops 2021-04-29 21:08:24 +02:00
Peter Nelson 51b4bd6c38 Codechange: Add widget text colour override property. 2021-04-22 16:42:04 +01:00
Peter Nelson 636e37d183 Codechange: Add internal widget alignment property, along with widget part. 2021-04-22 16:42:04 +01:00
Jonathan G Rennison 3ede756d23 Fix: Viewport drag tooltips not being removed when dragging over other windows 2021-04-08 19:34:45 +02:00
glx c0d7949d7c Fix: Don't use a timer for hundredth tick determination 2021-01-10 14:07:17 +01:00
Niels Martin Hansen 2d9fa81bd0 Feature: Plant clumps of trees in editor by dragging on the landscape 2020-12-27 01:03:27 +01:00
TechGeekNZ a10013dd00 Codechange: Spell 'Viewport' consistently
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
2020-07-27 17:31:29 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Jonathan G Rennison 81f159434d Codechange: Add EditBoxGainedFocus method to VideoDriver base class 2019-11-10 17:58:42 +00:00
glx 410b81537c Fix 801cbea9c: operator< is not always the best idea
Also removes unused and anyway broken SmallMap::SortByKey() function.
2019-04-13 21:05:25 +02:00
glx 801cbea9cc Codechange: use std::sort() for all std::vector types 2019-04-13 12:49:18 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 2019-03-26 20:15:57 +00:00
peter1138 f5f33da126 Codechange: Implement OnTooltip event for custom window tooltips.
This avoids windows from needing to know or care about tooltip delay settings.
2019-03-20 23:00:32 +00:00
peter1138 4da83d2f66 Fix #7386: Measurement tooltip for tunnels, aqueducts & docks did not display or flickered.
Measurement tooltip was auto-closed as the hover/right-click test for tooltips was not
satisfied in this case. This is fixed by keeping the tooltip visible and instead explicitly
closing the tooltip when the PlaceObject is cancelled/completed.
2019-03-20 23:00:32 +00:00
Peter Nelson de9f54ccc1 Codechange: Change scrolling_scrollbar to mouse_capture_widget, and dispatch OnClick() event if widget is not a scrollbar.
This allows any widget to support mouse capture.
2019-02-21 08:11:35 +00:00
Peter Nelson 2a8fa5fef9 Change: Split up Window::OnTick into OnGameTick and OnRealtimeTick. Adjust timers to work with milliseconds instead of ticks. 2019-01-11 11:56:21 +00:00
frosch 1cf09f804b (svn r27147) -Fix: Scale (non-custom) default window sizes according to GUI zoom. 2015-02-13 21:25:48 +00:00
frosch e113f5e4a1 (svn r27146) -Fix: Make statusbar and chat-entry window use the same width as the toolbar. Otherwise they lack a size definition. 2015-02-13 21:13:45 +00:00
alberth 78896895cf (svn r27085) -Fix: Always return a valid window to the world generation gui code. 2014-12-18 18:20:59 +00:00
alberth edea2ce96d (svn r27084) -Doc: Improve documentation of AllocateWindowDescFront. 2014-12-18 16:50:11 +00:00
peter1138 0877f892c5 (svn r26960) -Codechange: Draw sort button symbols as sprites, and pad sort buttons with non-static width. 2014-10-05 11:20:02 +00:00
frosch 12ddbb7cb1 (svn r25864) -Fix: Use the actual sprite dimensions for sizing the dropdown arrow of dropdown widgets. 2013-10-13 19:18:30 +00:00
michi_cc d15c1c5d4a (svn r25692) -Add: Replacement of a part of the edit box text with a new string. 2013-08-05 20:37:57 +00:00
michi_cc 30867c487f (svn r25691) -Add: [OSX] Support for mouse selection in the IME composition string. 2013-08-05 20:37:53 +00:00
michi_cc e2ec0ddb03 (svn r25690) -Change: [OSX] Position the candidate window at the caret position. 2013-08-05 20:37:48 +00:00
michi_cc f5e4131492 (svn r25689) -Add: [OSX] Display the IME composition string ourself. 2013-08-05 20:37:44 +00:00
michi_cc 0883cf76e3 (svn r25684) -Change: [Win32] Draw the composition string ourselves if possible. 2013-08-05 20:37:25 +00:00
michi_cc da09fd3077 (svn r25681) -Change: [Win32] Position the IME composition window at the caret position. 2013-08-05 20:37:14 +00:00
michi_cc 7422120014 (svn r25679) -Codechange: [Win32] Get the result string of an IME input directly without a trip through the window messaging system. 2013-08-05 20:37:06 +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
michi_cc 270d8aa639 (svn r25670) -Codechange: Pass UCS-4 characters to the edit box key handler. 2013-08-05 20:36:32 +00:00
michi_cc b911f4a452 (svn r25668) -Codechange: Pass proper Unicode UCS-4 characters instead of just UCS-2 to the window key press handlers. 2013-08-05 20:36:24 +00:00
frosch fef30983e6 (svn r25414) -Codechange: Move handling of global hotkeys to HotkeyList. 2013-06-15 15:31:22 +00:00
frosch 6291383823 (svn r25411) -Add: Window::OnHotkey 2013-06-15 15:30:16 +00:00
frosch 18ae9c78bc (svn r25402) -Fix-ish: Prevent copying of BasePool and WindowDesc, since they register in static vectors. 2013-06-15 15:06:22 +00:00
frosch 05c472f08a (svn r25295) -Feature: Allow saving window sizes as default sizes. 2013-05-26 19:30:31 +00:00
frosch 4e4e635916 (svn r25294) -Feature: Add another button to window title bars to resize the window to its default size. 2013-05-26 19:30:07 +00:00
frosch ed851034f5 (svn r25292) -Feature: Save stickyness of windows when Ctrl+Clicking the sticky button. 2013-05-26 19:27:44 +00:00
frosch 23ba42b66c (svn r25291) -Add: WindowDesc ability to load and store information in a config file. 2013-05-26 19:27:22 +00:00
frosch 8157a8afd8 (svn r25290) -Add: Assign string names to notable windows. 2013-05-26 19:25:01 +00:00
frosch b6d76c4d4c (svn r25288) -Codechange: No need to copy the WindowDesc flags if the WindowDesc is directly accessible. 2013-05-26 19:24:11 +00:00
frosch 56e4a8c4d6 (svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction. 2013-05-26 19:23:42 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
glx 5d74b679e6 (svn r24780) -Fix [FS#5378]: passing an int to a function expecting a byte can have side effects when MSVC optimises it 2012-12-03 21:03:13 +00:00
frosch f5d8ba5d7f (svn r24742) -Codechange: Remove QueryStringBaseWindow and store QueryStrings per widget instead. 2012-11-14 22:50:35 +00:00
frosch fc2b12acca (svn r24735) -Codechange: Move HandleEditBoxKey to Window class. 2012-11-13 21:47:13 +00:00
frosch 2c22fe98dd (svn r24734) -Codechange: Move QueryStringBaseWindow::OnOSKInput to Window::OnEditboxChanged. 2012-11-13 21:47:07 +00:00
frosch 03736af2ae (svn r24700) -Cleanup: Remove WDF_UNCLICK_BUTTONS and make it the default. 2012-11-11 16:10:43 +00:00
frosch cfccaff645 (svn r24696) -Doc: Improve documentation for button widget types. 2012-11-11 16:01:34 +00:00
frosch 6207a6017f (svn r24307) -Codechange: Move all interaction of the dropdown window with widgets of the parent window to a method of the parent window. 2012-06-01 10:42:46 +00:00
truebrain 1c9bec1999 (svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC) 2011-12-20 17:57:56 +00:00
truebrain 403cd3acdb (svn r23631) -Add: ScriptWindow, to manipulate windows on the client (GameScript only) 2011-12-19 21:05:14 +00:00
truebrain df0afdf0dc (svn r23525) -Codechange: make Window::flags4 WindowFlags instead of uint16, with only values known in WindowFlags (and move out 2 timers to their own variable)
-Codechange: rename Window::flags4 to Window::flags
-Codechange: move some non-inline functions from .hpp to .cpp
2011-12-15 19:54:23 +00:00
rubidium b5a2183214 (svn r23484) -Fix [FS#4770]: in case you already have orders, ignore the vehicles when adding an extra order 2011-12-10 19:20:30 +00:00
frosch ca4f0509fc (svn r23252) -Codechange: Add WD_BEVEL_xxx constants. 2011-11-18 20:38:30 +00:00
peter1138 50d1541270 (svn r23017) -Codechange: Add support for resized scrollbars. 2011-10-11 08:07:47 +00:00
frosch 51ddbbb13d (svn r22242) -Codechange: Let OnInvalidateData() decide itself what to do immediately in command scope, and what to do asynchronously in GUI-scope. 2011-03-13 21:32:13 +00:00
frosch ec9540a12a (svn r22241) -Codechange: Add additional to-be-used parameter to OnInvalidateData(). 2011-03-13 21:31:29 +00:00
frosch 19b7249ade (svn r22135) -Fix [FS#4523]: When commands need to invalidate windows, process these events asynchronously before the next redraw. Calling window code directly from command scope uses wrong _current_company and might issue nested DoCommands() which interfer with the running command. 2011-02-23 20:54:55 +00:00
terkhen 679cd3c21b (svn r21803) -Cleanup: Remove unnecessary semicolons. 2011-01-15 15:36:58 +00:00
alberth 22a13850cb (svn r21665) -Codechange: Make GetCallbackWnd a method of _thd. 2010-12-30 13:16:31 +00:00
rubidium a029b2b83a (svn r21477) -Fix [FS#4300]: tooltips were removed when their related window got closed 2010-12-12 14:14:26 +00:00
alberth f5c6fd1a25 (svn r21331) -Codechange: Make drawing the widgets default behaviour in OnPaint(). 2010-11-26 15:22:18 +00:00
smatz fd54943c7a (svn r20753) -Feature [FS#3999]: make it possible to select vehicle to clone and vehicle to clone orders from directly from vehicle lists and depot window 2010-09-06 14:14:09 +00:00
alberth 9f5a96ead2 (svn r20689) -Codechange: Make some global functions used in 1 .cpp file static in that file. 2010-08-29 15:58:43 +00:00
rubidium 30f2afac9b (svn r20632) -Cleanup: remove "a few" unneeded includes, and add them to some headers 2010-08-26 22:01:16 +00:00
frosch b37be47f16 (svn r20460) -Codechange: Remove WF_SCROLL window flags and store the state directly in the scrollbar widget instead. 2010-08-12 09:14:34 +00:00
frosch 6e9c9c28d9 (svn r20459) -Codechange: Remove the Scrollbar members of Window and make NWidgetScrollbar inherit from Scrollbar instead. 2010-08-12 09:13:04 +00:00
frosch 55bd5de43d (svn r20458) -Codechange: Move Scrollbar from window.cpp to widget.cpp 2010-08-12 09:11:12 +00:00
frosch 57c063250f (svn r20457) -Codechange: Remove _scrolling_scrollbar and WF_SCROLL_MIDDLE and instead store the widget index of the being scrolled scrollbar in the Window. 2010-08-12 09:09:24 +00:00
frosch 71ca58c2bb (svn r20453) -Codechange: Remove direct accesses to Window::hscroll, vscroll and vscroll2.
Note: All windows get individual members with the same names, which are initialised via Window::GetScrollbar(). This caching is not required at all, but simplifies conversion.
2010-08-12 08:37:01 +00:00
frosch 629b350a71 (svn r20451) -Codechange: Add helper function Window::GetScrollbar() to get the Scrollbar belonging to a scrollbar widget. 2010-08-12 06:40:28 +00:00
frosch ed4f806f1d (svn r20283) -Codechange: Unify start of doygen comments. 2010-08-01 19:22:34 +00:00
alberth 97f85f7bfb (svn r20222) -Add: Add functions to compute the row in a scrolled widget. 2010-07-26 13:03:40 +00:00
alberth 3a1451644a (svn r20221) -Codechange: Move unscrolled row calculation into a function. 2010-07-26 13:02:28 +00:00
rubidium 0e078670b7 (svn r20145) -Codechange: keep original RMB->tooltip behaviour when hovering is disabled and there is no handled right click event for the widget, i.e. if a widget would handle the right click you won't see the tooltip anymore by right clicking; by enabling hovering you would get access to that tooltip again. 2010-07-14 17:36:27 +00:00
terkhen 9cf9bb9b92 (svn r20121) -Add: OnHover method for windows. 2010-07-11 11:00:09 +00:00
terkhen 10fbb87823 (svn r20120) -Feature [FS#3913]: Tooltips are shown by hovering the mouse over a widget instead of by right clicking on it. 2010-07-11 10:58:55 +00:00
terkhen 51e6cb0a70 (svn r20119) -Add: Tooltips can be removed if the user stops hovering the mouse. 2010-07-11 10:55:57 +00:00
terkhen 9aef7b8c3d (svn r20118) -Add: Detect if the mouse has been hovering over the same point. 2010-07-11 10:53:07 +00:00
frosch 38b8259f3b (svn r19943) -Fix [FS#3865]: Disallow moving of vehicle news window. 2010-06-07 19:56:32 +00:00
alberth 113f3ef0eb (svn r19904) -Codechange: Make EventState usable outside Window context. 2010-05-30 12:06:18 +00:00
alberth fc82d9cd77 (svn r19903) -Codechange: Use SpecialMouseMode enum as type of _special_mouse_mode. 2010-05-30 10:36:32 +00:00
alberth ae560aeb8b (svn r19886) -Add [FS#3705]: Perform window callback during mouse dragging for the purpose of highlighting the destination (sbr). 2010-05-23 14:53:39 +00:00
frosch 68c1213efa (svn r19746) -Fix [FS#3675]: Do not recenter usually centered windows when resizing main window or changing language, if they have been moved/resized before. 2010-05-01 15:32:17 +00:00
rubidium e75e2648fc (svn r19706) -Add: support for the (NewGRF) debug box 2010-04-24 13:27:22 +00:00
smatz 53aaabe6e9 (svn r19507) -Codechange: remove semicolon after DECLARE_POSTFIX_INCREMENT and DECLARE_ENUM_AS_BIT_SET 2010-03-23 22:25:43 +00:00
frosch 88019e64e1 (svn r18966) -Codechange: Remove Window::OnDoubleClick() in favour of a parameter for OnClick(). 2010-01-30 18:34:48 +00:00
rubidium 37b0a61b42 (svn r18900) -Document: that an empty string for OnQueryTextFinished means 'use default' 2010-01-23 19:30:53 +00:00
rubidium 82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 2010-01-15 16:41:15 +00:00