161 Commits

Author SHA1 Message Date
Charles Dang
9c33f77de2 Cleaned up inclusions of display.hpp 2016-03-19 22:30:21 +11:00
Charles Dang
819c352e7c Revert "Removed an extra CVideo::flip() call from GUI1"
This reverts commit 0aa8900dce348d5ca590250351b2ffafbc0befab.
2016-03-16 06:22:25 +11:00
Charles Dang
0aa8900dce Removed an extra CVideo::flip() call from GUI1 2016-03-16 06:13:21 +11:00
Charles Dang
02993cbaeb Removed empty resize_lock struct and resize_monitor class
Once again, SDL1.2 functionality that does nothing in SDL2.
2016-03-14 02:07:29 +11:00
Charles Dang
583ab69247 Rename menu2-* dialog images to menu-* 2016-01-22 04:37:47 +11:00
Charles Dang
8c0e56213b Convert GUI1 functions to use CVideo directly instead of display 2016-01-12 13:19:51 +11:00
Charles Dang
716b6e8e87 Call CVideo::flip() instead of display::flip() in GUI1 2016-01-12 13:19:50 +11:00
Charles Dang
41dab9fe5b Remove GUI1 calls to invalidate_all() 2016-01-12 10:55:56 +11:00
Charles Dang
4afd415143 Decoupled delay() from display class and moved it to a static CVideo function 2016-01-12 10:55:55 +11:00
Chris Beck
ba51524f6e update copyright to year 2016
using this shell script:

find src -type f -print0 | xargs -0 sed -i "s|Copyright (C) \([[:digit:]]*\)\([ ]*\)-\([ ]*\)2015|Copyright (C) \1\2-\32016|g"
2016-01-02 23:59:31 -05:00
Andreas Löf
422ab07191 Add event handling to GUI and redraw on window events.
This fixes bugs #24211, #24214, #24213, #24209, #19666, #23534.

The GUI1 components have been made window event aware and will redraw
themselves after a window event.
2015-12-31 11:10:48 +13:00
Ignacio R. Morelle
57ae45387a New Year copyright update 2015-01-01 19:07:35 -03:00
Chris Beck
1f93699c8b give plugins a chance to run in gui1 dialogs when disp is faked
Otherwise they cannot use any of the dialogs and we cannot do
leader select when joining a game.

This commit also adds an "any_running" helper to plugins_manager.
2014-12-19 19:47:25 -05:00
Chris Beck
bda6cb0a57 add an automatic plugins context to all gui1 dialogs 2014-12-19 19:47:21 -05:00
Ignacio R. Morelle
0f453ea24c gui1: Fix bogus dialog option buttons layout (bug #22791, #22379)
Formerly, the option buttons at the bottom of the dialog were laid out
by redoing some math instead of tracking the dialog's menu position,
which is always valid (even when there is no menu!). I'm not entirely
sure why, but the math reprised here became bogus with the introduction
of top buttons in commit 045bda037d78056866bdd918b51708d44d2bf515 (for
the Add-ons Manager dialog), in particular for dialogs *not* using them
(such as the in-game Statistics dialog), even though the menu is still
laid out correctly.

So instead of reinventing the wheel, we really should just take the
menu's position and height as a baseline for the bottom option buttons.
At worst the height is 0, but the position is still within the dialog's
boundaries (but see below for an unsolved corner case).

This commit reverts commit f60ef98e275fd3d16733f7d5dfd7314920841fd5
(a.k.a. 69521000dc5c45f9745131ee13e76493e14fefaa in 1.12) that's part of
PR #263, because it turns out that the solution proposed there is only a
convenient workaround that solves a layout issue for a single dialog
(Statistics, see bug #22379) and introduces a new bug for another
(Add-ons Manager, see bug #22791).

Regardless of the cause for #22791, the approach put forward by this
commit is more consistent with best practice (laying out widgets from
top to bottom each row's geometry depending on the previous row's), so I
have decided to not look too much into it.

It should be noted that the layout of bottom option buttons breaks
entirely for dialogs missing a menu, both before and after the
introduction of top buttons. Currently there is no GUI1 dialog that
attempts to insert option buttons while lacking menu entries, so I'm not
too concerned about this bug (which affects 1.10 too!). Besides, some
day GUI1 is supposed to go the way of the dodo and stop bothering us
with its marvelous inflexibility and arcane logic.
2014-11-10 22:32:52 -03:00
Ignacio R. Morelle
c3c48434fa gui1: Reuse an unchanged max instead of recalculating it
Counts as a minor cleanup of commit
045bda037d78056866bdd918b51708d44d2bf515.
2014-11-10 21:37:46 -03:00
unknown
f60ef98e27 In the dialog layout code, fixed the button padding.
There was no check if the "text_and_image_height"
variable was equal to zero. If so, the buttons were
placed -6 units too high.
2014-08-01 04:58:34 -04:00
Boldizsár Lipka
0f463a7d7d SDL_gpu support for GUI1 menus. 2014-07-29 19:03:19 +02:00
Chris Beck
e32de173ea remove unit.hpp include from team.hpp 2014-06-15 14:57:47 -04:00
Boldizsár Lipka
ac96a2b91b Move some functions to sdl/rect. 2014-06-03 10:30:12 +02:00
Chris Beck
3c9844889b Make sure all error logs flush with std::endl, so we get on travis.
This is the result of running this command in directory src/

find . -type f -exec sed -i 's/\(ERR.*\)\\n\"\;/\1\" << std::endl\;/g' '{}' \;

and carefully inspecting the results.
2014-05-20 15:37:52 -04:00
Alexander van Gessel
cad98a3278 Use unicode_cast 2014-03-30 18:51:28 +02:00
Alexander van Gessel
6b5f357b6e Follow up the utf8 namespace with ucs4 and utf16 namespaces 2014-03-23 04:24:02 +01:00
Alexander van Gessel
b0d31d07e3 Merge branch 'wide_string_elimination'
Conflicts:
	src/dialogs.cpp
	src/gui/dialogs/addon_list.cpp
	src/gui/widgets/password_box.cpp
	src/gui/widgets/text.cpp
	src/gui/widgets/text_box.cpp
	src/marked-up_text.cpp
	src/serialization/string_utils.cpp
	src/serialization/string_utils.hpp
	src/text.cpp
2014-03-23 03:46:01 +01:00
Alexander van Gessel
6318b37ffd Get rid of utils::wide_string
utils::wide_string was a std::vector<wchar_t>
On most unix systems, this is 32 bits wide, and therefore a UCS-4 encoding.
On windows however, wchar_t is 16 bits wide, and the naive approach results
in UCS-2, which can only represent the Basic Multilingual Plane.

Most functions that used wide_string have been moved over to ucs4_string.
The Win32 API has been moved over to a specially created utf16_string instead.

Specialty tolower #ifdefs have been removed, as the towlower function has
been available since OS X 10.3, OpenBSD 3.7 and probably ancient versions of
all other BSDs too. The only issue is that on windows, the function cannot
be applied to characters outside the BMP.
2014-03-23 01:56:40 +01:00
aquileia
2f6a6a7d0e move UTF-8 functions to a separate namespace 2014-03-22 20:57:01 +01:00
Ignacio R. Morelle
a4f47a63c7 New Year copyright update 2014-01-01 02:08:52 -03:00
Mark de Wever
7953c7e930 Use a const ref variable instead of const value.
Issue found by cppcheck.
2013-07-07 11:16:50 +02:00
Eric S. Raymond
043c4f9fd3 Remove $Id$ cookies. 2013-03-26 21:41:37 -04:00
Mark de Wever
43b71f2ff0 New year copyright update. 2013-01-01 09:22:03 +00:00
J. Tyne
723d5da2bb Safer and more modular implementation for gui::empty_menu.
Fixes bug #20258 -- see the bug report for more details.
2012-10-23 21:58:35 +00:00
J. Tyne
3eec1b69a7 Add option for gui::dialog::set_menu_items() to (try to) preserve...
...the selected line.
2012-09-08 16:40:12 +00:00
Mark de Wever
aa7f926ca8 Remove a useless cast.
Detected by the upcoming gcc-4.8.
2012-08-25 16:14:33 +00:00
Mark de Wever
9ee25a4ef3 Initialize all members. 2012-06-30 20:28:16 +00:00
Ignacio R. Morelle
d25365eb0e gui1: Add border case for gui::dialog::BUTTON_TOP
When there's only one button with this hint, and there's a textbox, try
to align the button to the textbox. This makes the Filter/View Mode row
in the Add-ons Manager dialog look tidier.
2012-05-26 05:09:42 +00:00
Ignacio R. Morelle
045bda037d gui1: Add and implement gui::dialog::BUTTON_TOP layout hint
This allows placing a button at the top-right corner in a stock gui1
dialog.

This implementation might not be bug-free (has only been tested against
the Add-ons Manager dialog for now), but it works and doesn't introduce
or fix bugs in other current dialogs.
2012-05-26 04:48:46 +00:00
Ignacio R. Morelle
d9ba35e359 gui1: Let users specify tooltip text in dialog::add_option() 2012-02-07 19:05:59 +00:00
Ignacio R. Morelle
6ca69b2df5 New year copyright update 2012-01-07 02:35:17 +00:00
Iurii Chernyi
ecc1782c03 Fixed bug #17150: fix naming conflict with OpenBSD macro by renaming 2011-08-11 23:30:38 +00:00
Nils Kneuper
a9c341e278 "tiny gui support"-removal part 1:
removed all the if(n)defs from the sources (please review that I got
everything right!)

TODO: remove from build systems and data/
2011-02-12 16:20:24 +00:00
Mark de Wever
ecbabea838 New year copyright update. 2011-01-01 15:57:50 +00:00
Mark de Wever
f6bf9339c5 Remove unneeded includes. 2010-12-05 18:09:51 +00:00
Guillaume Melquiond
f84ebcb52a Removed unused class gui::message_dialog. 2010-10-30 09:02:06 +00:00
Guillaume Melquiond
eeb047de55 Fixed file headers so that they match the content of the COPYING file. 2010-09-01 21:12:38 +00:00
Ali El Gariani
f6fab3788f Rename all SDL_Color font::FOO_COLOUR as font::FOO_COLOR 2010-06-02 22:14:44 +00:00
Mark de Wever
92f5f92ce5 New year copyright update. 2010-01-01 13:16:49 +00:00
Ali El Gariani
32c7e6d15f Fix an incorrect update of unit-preview when using filter and some sorting.
(to reproduce the bug, type "arc" in english create-unit dialog)
2009-10-09 14:38:38 +00:00
Mark de Wever
eb73b52e6a Include cleanup. 2009-09-08 20:12:39 +00:00
Guillaume Melquiond
789736ac91 Removed specialized domains from log.hpp,
...so that adding a new domain no longer forces to recompile the whole
game.
2009-04-24 23:18:31 +00:00
Mark de Wever
973a0a7d5c Remove trailing whitespace. 2009-01-01 10:28:26 +00:00