(svn r21665) -Codechange: Make GetCallbackWnd a method of _thd.

This commit is contained in:
alberth
2010-12-30 13:16:31 +00:00
parent 703ff560c1
commit 22a13850cb
5 changed files with 17 additions and 12 deletions

View File

@@ -1871,7 +1871,7 @@ static void PlaceObject()
_tile_fract_coords.x = pt.x & TILE_UNIT_MASK;
_tile_fract_coords.y = pt.y & TILE_UNIT_MASK;
w = GetCallbackWnd();
w = _thd.GetCallbackWnd();
if (w != NULL) w->OnPlaceObject(pt, TileVirtXY(pt.x, pt.y));
}
@@ -2016,6 +2016,17 @@ bool TileHighlightData::IsDraggingDiagonal()
return (this->place_mode & HT_DIAGONAL) != 0 && _ctrl_pressed && _left_button_down;
}
/**
* Get the window that started the current highlighting.
* @return The window that requested the current tile highlighting, or \c NULL if not available.
*/
Window *TileHighlightData::GetCallbackWnd()
{
return FindWindowById(this->window_class, this->window_number);
}
/**
* Updates tile highlighting for all cases.
* Uses _thd.selstart and _thd.selend and _thd.place_mode (set elsewhere) to determine _thd.pos and _thd.size