comparison src/depot_gui.cpp @ 13034:6eb3f749890a draft

(svn r17532) -Codechange: Rename several Invalidate functions to SetDirty for more consistency and distinguishability.
author frosch <frosch@openttd.org>
date Sun, 13 Sep 2009 19:15:59 +0000
parents 045a6264ea5b
children 090bac35e7e4
comparison
equal deleted inserted replaced
13033:bc1115a0f463 13034:6eb3f749890a
724 ResetObjectToPlace(); 724 ResetObjectToPlace();
725 ShowBuildVehicleWindow(this->window_number, this->type); 725 ShowBuildVehicleWindow(this->window_number, this->type);
726 break; 726 break;
727 727
728 case DEPOT_WIDGET_CLONE: // Clone button 728 case DEPOT_WIDGET_CLONE: // Clone button
729 this->InvalidateWidget(DEPOT_WIDGET_CLONE); 729 this->SetWidgetDirty(DEPOT_WIDGET_CLONE);
730 this->ToggleWidgetLoweredState(DEPOT_WIDGET_CLONE); 730 this->ToggleWidgetLoweredState(DEPOT_WIDGET_CLONE);
731 731
732 if (this->IsWidgetLowered(DEPOT_WIDGET_CLONE)) { 732 if (this->IsWidgetLowered(DEPOT_WIDGET_CLONE)) {
733 static const CursorID clone_icons[] = { 733 static const CursorID clone_icons[] = {
734 SPR_CURSOR_CLONE_TRAIN, SPR_CURSOR_CLONE_ROADVEH, 734 SPR_CURSOR_CLONE_TRAIN, SPR_CURSOR_CLONE_ROADVEH,
848 848
849 virtual void OnPlaceObjectAbort() 849 virtual void OnPlaceObjectAbort()
850 { 850 {
851 /* abort clone */ 851 /* abort clone */
852 this->RaiseWidget(DEPOT_WIDGET_CLONE); 852 this->RaiseWidget(DEPOT_WIDGET_CLONE);
853 this->InvalidateWidget(DEPOT_WIDGET_CLONE); 853 this->SetWidgetDirty(DEPOT_WIDGET_CLONE);
854 854
855 /* abort drag & drop */ 855 /* abort drag & drop */
856 this->sel = INVALID_VEHICLE; 856 this->sel = INVALID_VEHICLE;
857 this->InvalidateWidget(DEPOT_WIDGET_MATRIX); 857 this->SetWidgetDirty(DEPOT_WIDGET_MATRIX);
858 }; 858 };
859 859
860 /* check if a vehicle in a depot was clicked.. */ 860 /* check if a vehicle in a depot was clicked.. */
861 virtual void OnMouseLoop() 861 virtual void OnMouseLoop()
862 { 862 {
933 933
934 virtual void OnTimeout() 934 virtual void OnTimeout()
935 { 935 {
936 if (!this->IsWidgetDisabled(DEPOT_WIDGET_SELL)) { 936 if (!this->IsWidgetDisabled(DEPOT_WIDGET_SELL)) {
937 this->RaiseWidget(DEPOT_WIDGET_SELL); 937 this->RaiseWidget(DEPOT_WIDGET_SELL);
938 this->InvalidateWidget(DEPOT_WIDGET_SELL); 938 this->SetWidgetDirty(DEPOT_WIDGET_SELL);
939 } 939 }
940 if (!this->IsWidgetDisabled(DEPOT_WIDGET_SELL_CHAIN)) { 940 if (!this->IsWidgetDisabled(DEPOT_WIDGET_SELL_CHAIN)) {
941 this->RaiseWidget(DEPOT_WIDGET_SELL_CHAIN); 941 this->RaiseWidget(DEPOT_WIDGET_SELL_CHAIN);
942 this->InvalidateWidget(DEPOT_WIDGET_SELL_CHAIN); 942 this->SetWidgetDirty(DEPOT_WIDGET_SELL_CHAIN);
943 } 943 }
944 } 944 }
945 945
946 virtual void OnResize(Point delta) 946 virtual void OnResize(Point delta)
947 { 947 {
953 953
954 virtual EventState OnCTRLStateChange() 954 virtual EventState OnCTRLStateChange()
955 { 955 {
956 if (this->sel != INVALID_VEHICLE) { 956 if (this->sel != INVALID_VEHICLE) {
957 _cursor.vehchain = _ctrl_pressed; 957 _cursor.vehchain = _ctrl_pressed;
958 this->InvalidateWidget(DEPOT_WIDGET_MATRIX); 958 this->SetWidgetDirty(DEPOT_WIDGET_MATRIX);
959 return ES_HANDLED; 959 return ES_HANDLED;
960 } 960 }
961 961
962 return ES_NOT_HANDLED; 962 return ES_NOT_HANDLED;
963 } 963 }