Resize list of stylesheets to fit available space

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1138 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-08-11 13:23:29 +00:00
parent 5fddaa3715
commit 520b472483
4 changed files with 32 additions and 2 deletions
+4
View File
@@ -100,3 +100,7 @@ void PackageList::select(const String& name, bool send_event) {
update();
return;
}
int PackageList::requiredWidth() const {
return (item_size.x + SPACING) * (int)itemCount();
}
+6 -2
View File
@@ -48,11 +48,15 @@ class PackageList : public GalleryList {
/// Select the package with the given name, if it is not found, selects nothing
void select(const String& name, bool send_event = true);
/// Required width to show all items
int requiredWidth() const;
using GalleryList::column_count;
protected:
/// Return how many items there are in the list
virtual size_t itemCount() const;
/// Draw an item
virtual void drawItem(DC& dc, int x, int y, size_t item);
/// Return how many items there are in the list
virtual size_t itemCount() const;
private:
// The default icon to use