summaryrefslogtreecommitdiff
path: root/window.c
AgeCommit message (Collapse)Author
2007-01-02(svn r7759) -Merge: makefile rewrite. This merge features:rubidium
- A proper ./configure, so everything needs to be configured only once, not for every make. - Usage of makedepend when available. This greatly reduces the time needed for generating the dependencies. - A generator for all project files. There is a single file with sources, which is used to generate Makefiles and the project files for MSVC. - Proper support for OSX universal binaries. - Object files for non-MSVC compiles are also placed in separate directories, making is faster to switch between debug and release compiles and it does not touch the directory with the source files. - Functionality to make a bundle of all needed files for for example a nightly or distribution of a binary with all needed GRFs and language files. Note: as this merge moves almost all files, it is recommended to make a backup of your working copy before updating your working copy.
2006-12-30(svn r7635) -Fix (r7618, r7621): Guard against recursive deletion. It is ↵Darkvater
possible that when a parent window is deleted it deletes its child (always) and in turn, through some code the child initiates the deletion of the parent which, if not guarded against, deletes the child and so on...
2006-12-29(svn r7619) -Feature (Internal): Add support for modal children. It's a ↵Darkvater
window-child that will block activity for the parent window until the modal popup is dismissed.
2006-12-29(svn r7618) -Feature: Add support for a parent<>child relationship in Window ↵Darkvater
terms. A child is a window whose parent pointer is non-null. Deleting the parent cascades deleting the children as well; children first.
2006-12-29(svn r7616) -Cleanup:Darkvater
-(re)set _rename_[id/what] to -1 to catch invalid calls (main_gui.c) -Only invalidate widget of pause/ff instead of whole window (main_gui.c) -Remove numbering from WE_ and WC_ as it's not needed, also remove non-existing windowclasses (window.h, openttd.h) -Give names to some of the enums (window.h) -In UninitWindowSystem not only free malloc'd widgets, but also reset the z-array (window.c) -Some coding style, comments, etc.
2006-12-26(svn r7565) -Codechange: Rework DEBUG functionality. Look for appropiate ↵Darkvater
debugging levels to use in debug.h. grfmsg() is now used as a specific debug-function for grf.
2006-12-07(svn r7414) -Fix: Immediately invalidate the resize widget when clicked, ↵Darkvater
instead of when started to drag
2006-12-07(svn r7409) -Codechange: Make the ResizeWindow function also available ↵Darkvater
outside of window.c. This makes it possible to programmatically resize windows specifying a delta x,y.
2006-12-04(svn r7356) -Codechange: replace 'for (i = 0, wi = w->widget; wi->type != ↵rubidium
WWT_LAST; i++, wi++)' type for loops with 'for (i = 0; i < w->window_count; i++) { wi = &w->widget[i];'-type for loops for better readability. -Codechange: use IsWindowWidget(Disabled|Hidden) in favor of IsWidget(Disabled|Hidden).
2006-12-04(svn r7355) -Codechange: replace 'for (i = 0; w->widget[i].type != WWT_TYPE; ↵rubidium
i++)'-type for loops with 'for (i = 0; i < w->widget_count; i++)'-type for loops
2006-12-04(svn r7352) -Codechange: add widget_count parameter to the window.rubidium
-Codechange: check whether widget indices are valid for all the (Set|Is)WindowWidget(Disabled|Lowered|Hidden) and related functions.
2006-12-01(svn r7313) -Codechange: Calling invalidate data on a window will surely ↵Darkvater
warrant a redraw, so call that after the WE_INVALIDATE_DATA event and remove (some of) the superflouous calls.
2006-11-21(svn r7233) -Codechange: get rid of three console.c globalsDarkvater
2006-11-19(svn r7219) -Fix: Several warnings by gcc introduced in r7206 which MSVC ↵Darkvater
found not of a problem. Thanks Tron
2006-11-18(svn r7207) -Codechange: Pass the (unchanged) windowpointer to the console ↵Darkvater
window and do it only once.
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 r7202) -Codechange: Move _viewports and _active_viewports local to ↵Darkvater
viewport.c and have them called from the appropiate places in window.c
2006-11-18(svn r7201) -Codechange: Use goto's to loop _windows when there is a change ↵Darkvater
you need to start over
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 r7156) -Codechange: Remove obsolete variable, localize global variable, ↵Darkvater
use GB and change logic of the win32: TAB speeds up, but ALT+TAB doesn't code.
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 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-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-06(svn r6671) -Fix r6670: typo :Pglx
2006-10-06(svn r6670) -Fix r6669: SetWindowWidgetsDisableState() should disable ↵glx
widgets, not hide them
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-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-09-23(svn r6499) -Codechange: Finally, got "byte event" outside of the union ↵belugas
WindowEvent, which is now a struct
2006-09-04(svn r6381) -Cleanup: make the '/* */' comments that span multiple lines ↵rubidium
more uniform. -Cleanup: whitespace alignment of a few tables.
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-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-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-07-26(svn r5609) CodeChange : Apply coding stylebelugas
2006-06-27(svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectaculartron
2006-06-10(svn r5210) Many small changes which piled up: const, unsigned, variable ↵tron
scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
2006-04-03(svn r4249) -Codechange: Replace more occurences of 16 by TILE_SIZE and of 8 ↵celestar
by TILE_HEIGHT. Reverted one change from the previous commit because it was faulty
2006-02-06(svn r3564) Several smaller changes:tron
- Don't treat non-booleans as booleans - Reduce variable scope - Bracing - Use DeMorgan's law to make conditionals easier to read - if cascade -> switch - Replace some magic numbers by symbolic names - Avoid assignments within other statements
2006-02-01(svn r3511) More whitespace ([FS#46] by Rubidium)tron
2006-02-01(svn r3510) Fiddle with whitespace and parenthesestron
2006-01-24(svn r3425) - Fix: Followup to r3421. Correctly reset the TileHighLightData ↵Darkvater
structure to prevent crashes in all the other cases where it is not guarded against sufficiently