1
0
forked from 0ad/0ad

Fix layout errors and crash with Atlas terrain previews.

Fix warning.

This was SVN commit r8103.
This commit is contained in:
Ykkrosh 2010-09-10 21:35:08 +00:00
parent c8eaee35cc
commit f3c9a59d29
2 changed files with 6 additions and 1 deletions

View File

@ -78,9 +78,12 @@ function TerrainPreviewPage(panel, name)
}
TerrainPreviewPage.prototype = {
reloadPreviews: function() {
this.panel.freeze();
this.scrolled.destroyChildren();
this.itemSizer.clear();
lastTerrainSelection = null; // clear any reference to deleted window
// TODO: Do something clever like load the preview images asynchronously,
// to avoid the annoying freeze when switching tabs
var previews = Atlas.Message.GetTerrainGroupPreviews(this.name, this.w, this.h).previews;
@ -106,7 +109,9 @@ TerrainPreviewPage.prototype = {
this.itemSizer.add(imgSizer, 0, wxAlignment.CENTRE | wxStretch.EXPAND);
}
this.itemSizer.layout();
this.panel.layout();
this.panel.thaw();
// If not all textures were loaded yet, run a timer to reload the previews
// every so often until they've all finished

View File

@ -230,7 +230,7 @@ namespace
template<> struct ToJSVal<bool>
{
static jsval Convert(JSContext* cx, const bool& val)
static jsval Convert(JSContext* WXUNUSED(cx), const bool& val)
{
return val ? JSVAL_TRUE : JSVAL_FALSE;
}