separate short_name for packages, moved full_name,short_name and icon_filename to Packaged

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@173 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-25 14:19:36 +00:00
parent f7d12a4114
commit 031266c71b
12 changed files with 41 additions and 63 deletions
+5 -5
View File
@@ -33,14 +33,14 @@ void PackageList::drawItem(DC& dc, int x, int y, size_t item, bool selected) {
}
// draw short name
dc.SetFont(wxFont(12,wxSWISS,wxNORMAL,wxBOLD,false,_("Arial")));
dc.GetTextExtent(capitalize(d.package->name()), &w, &h);
dc.GetTextExtent(capitalize(d.package->short_name), &w, &h);
pos = align_in_rect(ALIGN_CENTER, RealSize(w,h), rect);
dc.DrawText(capitalize(d.package->name()), pos.x, pos.y + 110);
dc.DrawText(capitalize(d.package->short_name), pos.x, pos.y + 110);
// draw name
dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
dc.GetTextExtent(d.package->fullName(), &w, &h);
dc.GetTextExtent(d.package->full_name, &w, &h);
RealPoint text_pos = align_in_rect(ALIGN_CENTER, RealSize(w,h), rect);
dc.DrawText(d.package->fullName(), text_pos.x, text_pos.y + 130);
dc.DrawText(d.package->full_name, text_pos.x, text_pos.y + 130);
}
void PackageList::showData(const String& pattern) {
@@ -51,7 +51,7 @@ void PackageList::showData(const String& pattern) {
while (!f.empty()) {
// try to open the package
// try {
PackageP package = ::packages.openAny(f);
PackagedP package = ::packages.openAny(f);
// open image
InputStreamP stream = package->openIconFile();
Image img;
+4 -4
View File
@@ -12,7 +12,7 @@
#include <util/prec.hpp>
#include <gui/control/gallery_list.hpp>
DECLARE_POINTER_TYPE(Package);
DECLARE_POINTER_TYPE(Packaged);
// ----------------------------------------------------------------------------- : PackageList
@@ -59,9 +59,9 @@ class PackageList : public GalleryList {
// Information about a package
struct PackageData {
PackageData() {}
PackageData(const PackageP& package, const Bitmap& image) : package(package), image(image) {}
PackageP package;
Bitmap image;
PackageData(const PackagedP& package, const Bitmap& image) : package(package), image(image) {}
PackagedP package;
Bitmap image;
};
/// The displayed packages
vector<PackageData> packages;