src/news_gui.cpp
branchcpp_gui
changeset 6251 cd413fa2e252
parent 6246 2a4c2c4d66f0
child 6258 a2f86b8fd99b
equal deleted inserted replaced
6250:5135b200b376 6251:cd413fa2e252
   743 	case WE_PAINT: {
   743 	case WE_PAINT: {
   744 		uint32 val = _news_display_opt;
   744 		uint32 val = _news_display_opt;
   745 		int click_state = WP(w, def_d).data_1;
   745 		int click_state = WP(w, def_d).data_1;
   746 		int i, y;
   746 		int i, y;
   747 
   747 
   748 		if (_news_ticker_sound) LowerWindowWidget(w, 25);
   748 		if (_news_ticker_sound) w->LowerWidget(25);
   749 		w->DrawWidgets();
   749 		w->DrawWidgets();
   750 
   750 
   751 		/* XXX - Draw the fake widgets-buttons. Can't add these to the widget-desc since
   751 		/* XXX - Draw the fake widgets-buttons. Can't add these to the widget-desc since
   752 		 * openttd currently can only handle 32 widgets. So hack it *g* */
   752 		 * openttd currently can only handle 32 widgets. So hack it *g* */
   753 		for (i = 0, y = 26; i != 10; i++, y += 12, click_state >>= 1, val >>= 2) {
   753 		for (i = 0, y = 26; i != 10; i++, y += 12, click_state >>= 1, val >>= 2) {
   782 		case 23: case 24: /* Dropdown menu for all settings */
   782 		case 23: case 24: /* Dropdown menu for all settings */
   783 			w->ShowDropDownMenu(message_opt, WP(w, def_d).data_2, 24, 0, 0);
   783 			w->ShowDropDownMenu(message_opt, WP(w, def_d).data_2, 24, 0, 0);
   784 			break;
   784 			break;
   785 		case 25: /* Change ticker sound on/off */
   785 		case 25: /* Change ticker sound on/off */
   786 			_news_ticker_sound ^= 1;
   786 			_news_ticker_sound ^= 1;
   787 			ToggleWidgetLoweredState(w, e->we.click.widget);
   787 			w->ToggleWidgetLoweredState(e->we.click.widget);
   788 			w->InvalidateWidget(e->we.click.widget);
   788 			w->InvalidateWidget(e->we.click.widget);
   789 			break;
   789 			break;
   790 		default: { /* Clicked on the [<] .. [>] widgets */
   790 		default: { /* Clicked on the [<] .. [>] widgets */
   791 			int wid = e->we.click.widget;
   791 			int wid = e->we.click.widget;
   792 			if (wid > 2 && wid < 23) {
   792 			if (wid > 2 && wid < 23) {