src/news_gui.cpp
changeset 9761 2fe11e6d2280
parent 9739 9cf125da8789
child 10123 f73d96619303
equal deleted inserted replaced
9760:92202f8b455a 9761:2fe11e6d2280
   189 		int left = 0;
   189 		int left = 0;
   190 		int right = this->width - 1;
   190 		int right = this->width - 1;
   191 		int top = 0;
   191 		int top = 0;
   192 		int bottom = this->height - 1;
   192 		int bottom = this->height - 1;
   193 
   193 
   194 		GfxFillRect(left, top, right, bottom, 0xF);
   194 		GfxFillRect(left,  top,    right, bottom, 0xF);
   195 
   195 
   196 		GfxFillRect(left, top, left, bottom, 0xD7);
   196 		GfxFillRect(left,  top,    left,  bottom, 0xD7);
   197 		GfxFillRect(right, top, right, bottom, 0xD7);
   197 		GfxFillRect(right, top,    right, bottom, 0xD7);
   198 		GfxFillRect(left, top, right, top, 0xD7);
   198 		GfxFillRect(left,  top,    right, top,    0xD7);
   199 		GfxFillRect(left, bottom, right, bottom, 0xD7);
   199 		GfxFillRect(left,  bottom, right, bottom, 0xD7);
   200 
   200 
   201 		DrawString(left + 2, top + 1, STR_00C6, TC_FROMSTRING);
   201 		DrawString(left + 2, top + 1, STR_00C6, TC_FROMSTRING);
   202 	}
   202 	}
   203 
   203 
   204 	virtual void OnPaint()
   204 	virtual void OnPaint()
   320 
   320 
   321 /* static */ uint NewsWindow::duration; ///< Remaining time for showing current news message
   321 /* static */ uint NewsWindow::duration; ///< Remaining time for showing current news message
   322 
   322 
   323 
   323 
   324 static const Widget _news_type13_widgets[] = {
   324 static const Widget _news_type13_widgets[] = {
   325 {      WWT_PANEL,   RESIZE_NONE,    15,     0,   429,     0,   169, 0x0, STR_NULL},
   325 {      WWT_PANEL,   RESIZE_NONE,  COLOUR_WHITE,     0,   429,     0,   169, 0x0, STR_NULL},
   326 {      WWT_PANEL,   RESIZE_NONE,    15,     0,    10,     0,    11, 0x0, STR_NULL},
   326 {      WWT_PANEL,   RESIZE_NONE,  COLOUR_WHITE,     0,    10,     0,    11, 0x0, STR_NULL},
   327 {   WIDGETS_END},
   327 {   WIDGETS_END},
   328 };
   328 };
   329 
   329 
   330 static WindowDesc _news_type13_desc = {
   330 static WindowDesc _news_type13_desc = {
   331 	WDP_CENTER, 476, 430, 170, 430, 170,
   331 	WDP_CENTER, 476, 430, 170, 430, 170,
   333 	WDF_DEF_WIDGET,
   333 	WDF_DEF_WIDGET,
   334 	_news_type13_widgets,
   334 	_news_type13_widgets,
   335 };
   335 };
   336 
   336 
   337 static const Widget _news_type2_widgets[] = {
   337 static const Widget _news_type2_widgets[] = {
   338 {      WWT_PANEL,   RESIZE_NONE,    15,     0,   429,     0,   129, 0x0, STR_NULL},
   338 {      WWT_PANEL,   RESIZE_NONE,  COLOUR_WHITE,     0,   429,     0,   129, 0x0, STR_NULL},
   339 {      WWT_PANEL,   RESIZE_NONE,    15,     0,    10,     0,    11, 0x0, STR_NULL},
   339 {      WWT_PANEL,   RESIZE_NONE,  COLOUR_WHITE,     0,    10,     0,    11, 0x0, STR_NULL},
   340 {   WIDGETS_END},
   340 {   WIDGETS_END},
   341 };
   341 };
   342 
   342 
   343 static WindowDesc _news_type2_desc = {
   343 static WindowDesc _news_type2_desc = {
   344 	WDP_CENTER, 476, 430, 130, 430, 130,
   344 	WDP_CENTER, 476, 430, 130, 430, 130,
   346 	WDF_DEF_WIDGET,
   346 	WDF_DEF_WIDGET,
   347 	_news_type2_widgets,
   347 	_news_type2_widgets,
   348 };
   348 };
   349 
   349 
   350 static const Widget _news_type0_widgets[] = {
   350 static const Widget _news_type0_widgets[] = {
   351 {      WWT_PANEL,   RESIZE_NONE,     5,     0,   279,    14,    86, 0x0,              STR_NULL},
   351 {      WWT_PANEL,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,     0,   279,    14,    86, 0x0,              STR_NULL},
   352 {   WWT_CLOSEBOX,   RESIZE_NONE,     5,     0,    10,     0,    13, STR_00C5,         STR_018B_CLOSE_WINDOW},
   352 {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,     0,    10,     0,    13, STR_00C5,         STR_018B_CLOSE_WINDOW},
   353 {    WWT_CAPTION,   RESIZE_NONE,     5,    11,   279,     0,    13, STR_012C_MESSAGE, STR_NULL},
   353 {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,    11,   279,     0,    13, STR_012C_MESSAGE, STR_NULL},
   354 {      WWT_INSET,   RESIZE_NONE,     5,     2,   277,    16,    64, 0x0,              STR_NULL},
   354 {      WWT_INSET,   RESIZE_NONE,  COLOUR_LIGHT_BLUE,     2,   277,    16,    64, 0x0,              STR_NULL},
   355 {   WIDGETS_END},
   355 {   WIDGETS_END},
   356 };
   356 };
   357 
   357 
   358 static WindowDesc _news_type0_desc = {
   358 static WindowDesc _news_type0_desc = {
   359 	WDP_CENTER, 476, 280, 87, 280, 87,
   359 	WDP_CENTER, 476, 280, 87, 280, 87,
   744 		this->vscroll.cap += delta.y / 12;
   744 		this->vscroll.cap += delta.y / 12;
   745 	}
   745 	}
   746 };
   746 };
   747 
   747 
   748 static const Widget _message_history_widgets[] = {
   748 static const Widget _message_history_widgets[] = {
   749 {   WWT_CLOSEBOX,   RESIZE_NONE,    13,     0,    10,     0,    13, STR_00C5,            STR_018B_CLOSE_WINDOW},
   749 {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_BROWN,     0,    10,     0,    13, STR_00C5,            STR_018B_CLOSE_WINDOW},
   750 {    WWT_CAPTION,  RESIZE_RIGHT,    13,    11,   387,     0,    13, STR_MESSAGE_HISTORY, STR_018C_WINDOW_TITLE_DRAG_THIS},
   750 {    WWT_CAPTION,  RESIZE_RIGHT,  COLOUR_BROWN,    11,   387,     0,    13, STR_MESSAGE_HISTORY, STR_018C_WINDOW_TITLE_DRAG_THIS},
   751 {  WWT_STICKYBOX,     RESIZE_LR,    13,   388,   399,     0,    13, 0x0,                 STR_STICKY_BUTTON},
   751 {  WWT_STICKYBOX,     RESIZE_LR,  COLOUR_BROWN,   388,   399,     0,    13, 0x0,                 STR_STICKY_BUTTON},
   752 {      WWT_PANEL,     RESIZE_RB,    13,     0,   387,    14,   139, 0x0,                 STR_MESSAGE_HISTORY_TIP},
   752 {      WWT_PANEL,     RESIZE_RB,  COLOUR_BROWN,     0,   387,    14,   139, 0x0,                 STR_MESSAGE_HISTORY_TIP},
   753 {  WWT_SCROLLBAR,    RESIZE_LRB,    13,   388,   399,    14,   127, 0x0,                 STR_0190_SCROLL_BAR_SCROLLS_LIST},
   753 {  WWT_SCROLLBAR,    RESIZE_LRB,  COLOUR_BROWN,   388,   399,    14,   127, 0x0,                 STR_0190_SCROLL_BAR_SCROLLS_LIST},
   754 {  WWT_RESIZEBOX,   RESIZE_LRTB,    13,   388,   399,   128,   139, 0x0,                 STR_RESIZE_BUTTON},
   754 {  WWT_RESIZEBOX,   RESIZE_LRTB,  COLOUR_BROWN,   388,   399,   128,   139, 0x0,                 STR_RESIZE_BUTTON},
   755 {   WIDGETS_END},
   755 {   WIDGETS_END},
   756 };
   756 };
   757 
   757 
   758 static const WindowDesc _message_history_desc = {
   758 static const WindowDesc _message_history_desc = {
   759 	240, 22, 400, 140, 400, 140,
   759 	240, 22, 400, 140, 400, 140,