summaryrefslogtreecommitdiff
path: root/window.h
AgeCommit message (Collapse)Author
2006-11-30(svn r7299) -CodeChange: Train and Aircraft Build window GUI code simplified ↵KUDr
a bit: - using one engine list instead of 3 - removed engine filters (loco, wagons, helicopters, etc.) - EngineList code isolated from GUI (moved to helpers.cpp - reusing CBlobT code which does exactly what is needed for EngineList) - removed unnecessary "optimization" (rebuild and sort engine list on each WE_PAINT)
2006-11-18(svn r7205) -Fix [FS#350, SF#1560913]: Window allocation and deletion messed ↵Darkvater
with the actual window structs inside their array, and possibly invalidating pointers higher up. Meaning that any function called within an wndproc could cause unknown/invalid pointers once control was returned to this function. Solved by the introduction of an extra abstraction layer, an array of z-window positions that is only concerned with the pointers.
2006-11-18(svn r7203) -Cleanup: Donnu what Miham was smoking there, but removed it ↵Darkvater
(assert_compile + 3)
2006-11-18(svn r7200) -Codechange: remove unneeded redraw (console.c), coding style, ↵Darkvater
use FindWindowById instead of _windows loop (viewport.c), remove dump-code (mixer.c), MSVC6 borkdness in stdafx.h, constness (viewport.c), variable localization (win32.c), comments (window.c)
2006-11-16(svn r7182) -Feature: Merge utf8 branch. This brings us support for ↵peter1138
Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
2006-11-15(svn r7157) -Fix [FS#221, SF1168820]: Some mouse events possibly lost under ↵Darkvater
high CPU load, handle mouse input right away instead of waiting for GameLoop. (KUDr)
2006-11-15(svn r7153) -Fix [FS#279]: Some keyboard events possibly lost under high CPU ↵Darkvater
load, handle keyboard input in place instead of global variables magic. (KUDr)
2006-11-13(svn r7138) -Fix: [vehicle list windows] fixed a rare crash where having ↵bjarni
some (not all) vehicle list windows open for a player, that goes bankrupt would crash the game -Codechange: closing all windows for a player will now loop all windows and close those, which got the player as caption instead of having a list of windows to close
2006-11-11(svn r7130) -Codechange: Handle the positioning of windows through the ↵Darkvater
desc->left/top settings with some special values (WDP_) instead of checking window-class. This also fixes FS#172 now that we can position windows arbitrarily and are not restricted to window-classes.
2006-11-11(svn r7129) -Codechange: Get rid of a global variable that only sets a ↵Darkvater
window's number.
2006-11-07(svn r7092) -Codechange: Add function to send a window message to a whole ↵Darkvater
class of windows, SendWindowMessageClass().
2006-10-27(svn r6961) -Codechange: Remove relic from r212 WWT_NODISTXTBTN which was ↵Darkvater
originally used to not to allow clicking if a button was disabled. This has been superseded in r212 with general code that doesn't allow any click events for disabled buttons.
2006-10-24(svn r6926) -Codechange: Rename WWT_4 to WWT_TEXTBTN_2 and WWT_6 to ↵Darkvater
WWT_INSET (credits to peter1138 for the aptly found name) -Codechange: Remove the explicit numbering from WindowWidgetTypes
2006-10-24(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL ↵Darkvater
is only plain panel, WWT_IMGBTN must contain an image for drawing. Renamed WWT_PANEL_2 to WWT_IMGBTN_2 because that is what it is. Added WWT_PUSHBTN that is either just a pushable button, or a textbutton, which text's drawn dynamically independent of widget.
2006-10-18(svn r6821) -Codechange: For the measurement tool do not show the tooltip ↵Darkvater
when the selection is only a single tile. Seems this was a bit annoying to some ;)
2006-10-12(svn r6758) -Feature: Add a measurement tool that will show dimensions and ↵Darkvater
height differences of various draggable tools (inspiration, concept and double checking by MeusH).
2006-10-10(svn r6722) -Codechange: [aircraft build window] moved aircraft build window ↵bjarni
to a file of it's own Also made some changes to it so it should be easier to unify all the build vehicle windows
2006-10-10(svn r6712) -Code cleanup: renamed buildtrain_d to buildvehicle_d as it's ↵bjarni
used for all vehicle types
2006-10-09(svn r6707) -Feature: [build aircraft window] added buttons to view ↵bjarni
propeller planes, jet planes or helicopters -Codechange: the build aircraft window now generates 3 malleced lists and displays based on those list This is preparation for sorting aircraft
2006-10-07(svn r6684) -Feature: [train build window] added sorting options for the enginesbjarni
2006-10-07(svn r6680) -Codechange r6679: [train build window] only generate the list ↵bjarni
when the window data is invalidated or the window is generated, not on each redraw
2006-10-07(svn r6679) -Feature: [train build window] added filter for wagons, engines ↵bjarni
or both in the display -Codechange: [train build window] to get rid of a really ugly hack, the train build list is now generated in one loop and stored in an array
2006-10-06(svn r6669) -Add: vararg functions to set hidden/disabled/lowered state of ↵glx
multiple widgets in one call
2006-10-06(svn r6661) Feature: Windows are not restricted to 32 widget items anymore. belugas
The functions required to do so are to be found in window.h. Rather then use the old deprecated disabled_state, hidden_state and click_state uint32 variables, we now need to use accessors like SetWindowWidgetDisabledState, SetWindowWidgetHiddenState or SetWindowWidgetLoweredState. This is the final commit for the merge of XTDwidget branch.
2006-10-05(svn r6651) -Coding feature: added the windowevent WE_INVALIDATE_DATAbjarni
This gives the ability to invalidate some window data and recalculate as needed instead of doing it for each WE_PAINT This event is called right away when using InvalidateWindowData(), so it may be a good idea to set a bool or similar in the window or similar and then act on that bool in WE_PAINT instead of doing a lot of stuff in WE_INVALIDATE_DATA as it might be called more than once before WE_PAINT is called InvalidateWindowData() will not automatically repaint the window, so if you want to repaint it as well, you need to mark it dirty as well. Made the depot windows use WE_INVALIDATE_DATA to set when to generate the engine and wagon lists instead of at each redraw It makes no sense to regenerate the list when say using the scrollbar if we know that no vehicle have entered or left the list NOTE: currently there is a piece of code to generate the list when it's not needed and compare it to the stored list and assert if they mismatch This check is somewhat slow and kills the whole idea of WE_INVALIDATE_DATA, so it's a short lived one to verify that InvalidateWindowData() is used everywhere where it's needed
2006-10-04(svn r6642) -Fix r6639: 2 conversions missedglx
2006-10-04(svn r6639) -CodeChange : Conversion of SetWidgetLoweredState to ↵belugas
SetWindowWidgetLoweredState, in order to follow pre-established standard
2006-10-03(svn r6631) -Codechange: Use accessors for click_state.belugas
Another step toward merging XTDwidget. The only two files not converted (window.h and widget.c) will be done at the very last commit)
2006-10-03(svn r6624) -Feature: added ability to add refit commands to vehicle orders ↵bjarni
(can only be done in goto depot orders) Example: make a train transport iron ore from A to B, then it visits a depot and refits to steel It then transport steel back to A or near A if there is a factory and then it visits another depot to refit to iron ore again This is controlled in the orders. If a goto depot order is lightlighted, then "Unload" changes to "Refit" Control click "Refit" removes the refit part of the order (as the tooltip says) The player will still pay the normal refit costs Known issues: If a vehicle is not in a depot, then the refit window will fail to tell refitted cargo capacity Refit costs in the refit window can sometimes print 0 when it should not because the refit calculation is unaware that the vehicle will be refitted in between Warning: autoreplace got a protection against replacing something so you get a new cargo type, but it can fail here. In the iron ore/steel example, it can see that the vehicle carries iron ore and the new one can be refitted to iron ore, then it will replace. It will not check to see that it's valid for steel as well. This is something to look into in the future
2006-10-01(svn r6602) - Feature: we now support NewGRF livery refits, as used by ↵peter1138
DBsetXL, amongst others. This requires a savegame bump to save the cargo subtype.
2006-10-01(svn r6601) - Codechange: Support cargo subtypes in the refit window. The ↵peter1138
refit window has been altered to support resizing and scrolling. Note that the cargo subtype isn't yet passed for actual refitting yet. (Based on mart3p's patch)
2006-10-01(svn r6599) -Codechange: Add accessors around the members ↵belugas
click/disabled/hidden_state of Window This is the first step toward merging XTDwidget.
2006-09-26(svn r6513) -Codechange: unified the code to draw depot windowsbjarni
This change is intended to make it easier to make depot behaviour consistent and faster to code when adding more features in the future The user interface should hopefully not be affected by this
2006-09-24(svn r6503) -Codechange: added a function to tell what vehicles a depot containsbjarni
This will ensure that you can always get the same list when checking for vehicles in a depot (no need to duplicate code for each place, that needs such a list) Since the vehicles are only looped once for each redraw, drawing speed is around twice as fast (measured to be 114%-121% faster depending on the number of vehicles in the game)
2006-09-23(svn r6499) -Codechange: Finally, got "byte event" outside of the union ↵belugas
WindowEvent, which is now a struct
2006-09-04(svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it ↵Darkvater
to 'data'.
2006-09-03(svn r6372) -Codechange: static, unneeded decleration in headers, ↵Darkvater
superfluous header includes -Codechange: Unify the Sorting struct both for vehicle-lists and network-lists.
2006-09-02(svn r6345) -Codechange: AllocateWindowDescFront() now ensures that ↵bjarni
window_number is set before calling the WE_CREATE event this allows using the window_number in WE_CREATE window event handlers
2006-08-29(svn r6210) Remove FR_NOBORDER, because it is exclusivly used in conjunction ↵tron
with FR_TRANSPARENT
2006-08-29(svn r6209) Move DrawFrameRect() out of gfx.[ch], because it uses data ↵tron
(_color_list) which the renderer shouldn't have know about
2006-08-28(svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else ↵rubidium
{' -> '} else {', tabs between code and comment, etc.
2006-08-22(svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered ↵belugas
label CodeChange : Move almost all fixed strings from ON_PAINT event to Widget array using WWT_LABEL. Feature : All "Select Refit Cargo" are now centered, instead of been left aligned
2006-08-22(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. ↵rubidium
whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
2006-08-21(svn r6038) -Codechange: move mousewheel code to event WE_MOUSEWHEEL instead ↵truelight
of a general function that handles that -Codechange: use always 'e' for WindowsEvent, neverr 'we'
2006-08-21(svn r6036) -Codechange: do not handle SCROLL in a central function, but let ↵truelight
windows handle them theirself. Added WE_SCROLL for this.
2006-08-20(svn r5971) -Fix: wrong struct in assert_compile (thomasdev)truelight
2006-08-19(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:truelight
- New optional landscape generator (TerraGenesis Perlin) - Load heightmaps (either BMP or PNG) - Progress dialog while generating worlds (no longer a 'hanging' screen) - New dialogs for NewGame, Create Scenario and Play Heightmap - Easier to configure your landscape - More things to configure (tree-placer, ..) - Speedup of world generation - New console command 'restart': restart the map EXACTLY as it was when you first started it (needs a game made after or with this commit) - New console command 'getseed': get the seed of your map and share it with others (of course only works with generated maps) - Many new, world generation related, things - Many internal cleanups and rewrites Many tnx to those people who helped making this: Belugas, DaleStan, glx, KUDr, RichK67, Rubidium, and TrueLight (alfabetic) Many tnx to those who helped testing: Arnau, Bjarni, and tokai (alfabetic) And to all other people who helped testing and sending comments / bugs Stats: 673 lines changed, 3534 new lines, 79 new strings
2006-08-19(svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for ↵truelight
textboxes to only allow certain patterns (like numbers only)
2006-08-14(svn r5894) Remove a totally unnecessary indirection in the vehicle sorter ↵tron
code. Less code, less data, simply better
2006-07-26(svn r5609) CodeChange : Apply coding stylebelugas