Changeset - r4438:d44613af0690
[Not reviewed]
master
0 2 0
tron - 18 years ago 2006-08-29 06:39:00
tron@openttd.org
(svn r6210) Remove FR_NOBORDER, because it is exclusivly used in conjunction with FR_TRANSPARENT
2 files changed with 2 insertions and 7 deletions:
0 comments (0 inline, 0 general)
widget.c
Show inline comments
 
@@ -148,30 +148,26 @@ int GetWidgetFromPos(const Window *w, in
 

	
 
	return found_index;
 
}
 

	
 

	
 
void DrawFrameRect(int left, int top, int right, int bottom, int ctab, FrameFlags flags)
 
{
 
	uint dark         = _color_list[ctab].window_color_1a;
 
	uint medium_dark  = _color_list[ctab].window_color_bga;
 
	uint medium_light = _color_list[ctab].window_color_bgb;
 
	uint light        = _color_list[ctab].window_color_2;
 

	
 
	if (flags & FR_NOBORDER) {
 
		if (flags & FR_TRANSPARENT) {
 
			GfxFillRect(left, top, right, bottom, 0x322 | USE_COLORTABLE);
 
		} else {
 
			GfxFillRect(left, top, right, bottom, medium_dark);
 
		}
 
	if (flags & FR_TRANSPARENT) {
 
		GfxFillRect(left, top, right, bottom, 0x322 | USE_COLORTABLE);
 
	} else {
 
		uint interior;
 

	
 
		if (flags & FR_LOWERED) {
 
			GfxFillRect(left,     top,     left,  bottom,     dark);
 
			GfxFillRect(left + 1, top,     right, top,        dark);
 
			GfxFillRect(right,    top + 1, right, bottom - 1, light);
 
			GfxFillRect(left + 1, bottom,  right, bottom,     light);
 
			interior = (flags & FR_DARKENED ? medium_dark : medium_light);
 
		} else {
 
			GfxFillRect(left,     top,    left,      bottom - 1, light);
 
			GfxFillRect(left + 1, top,    right - 1, top,        light);
window.h
Show inline comments
 
@@ -54,25 +54,24 @@ enum {
 

	
 
typedef struct Widget {
 
	byte type;
 
	byte resize_flag;
 
	byte color;
 
	uint16 left, right, top, bottom;
 
	uint16 unkA;
 
	StringID tooltips;
 
} Widget;
 

	
 
typedef enum FrameFlags {
 
	FR_TRANSPARENT  = 0x01,  ///< Makes the background transparent if set
 
	FR_NOBORDER     = 0x08,  ///< Hide border (draws just a solid box)
 
	FR_BORDERONLY   = 0x10,  ///< Draw border only, no background
 
	FR_LOWERED      = 0x20,  ///< If set the frame is lowered and the background color brighter (ie. buttons when pressed)
 
	FR_DARKENED     = 0x40,  ///< If set the background is darker, allows for lowered frames with normal background color when used with FR_LOWERED (ie. dropdown boxes)
 
} FrameFlags;
 

	
 
void DrawFrameRect(int left, int top, int right, int bottom, int color, FrameFlags flags);
 

	
 
/* XXX - outside "byte event" so you can set event directly without going into
 
 * the union elements at first. Because of this every first element of the union
 
 * MUST BE 'byte event'. Whoever did this must get shot! Scheduled for immediate
 
 * rewrite after 0.4.0 */
 
union WindowEvent {
0 comments (0 inline, 0 general)