mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
Finally got precompiled headers to work.
Now all C++ files need to #include <util/prec.hpp>
That is why all .cpp files are touched by this commit
Many changes to installers and update checking:
- the window is now called PackagesWindow, in a new source file
- update checking is now independent from the PackagesWindow. For update checking only a list of package versions are needed (vector<PackageDependency>). This is much less information to download at each startup.
- the list of available packages is now a list of available Installers, since an installer can contain multiple packages.
- moved the logic of dependency checking etc. to data/installer
- moved the actual installation to util/io/package_manager
- moved directory iteration/creation logic to util/file_utils
- added PackageDirectory: the local and global package directory now have their own object (was part of PackageManager)
- added PackageVersion: for detecting if a package has been modified after it was installed.
- added PackageDescription: description/header of a package. Basicly the same as what Packaged provides.
- added DownloadableInstaller: where to find an insaller, what does it contain?
- added InstallablePackage: brining it all together: installer, package, status, action.
Current status: the insaller is currently broken in a few places, more on that soon.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@792 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -12,8 +12,6 @@
|
||||
#include <util/prec.hpp>
|
||||
#include <wx/vscroll.h>
|
||||
|
||||
typedef intrusive_ptr<IntrusivePtrVirtualBase> VoidP;
|
||||
|
||||
// ----------------------------------------------------------------------------- : TreeList
|
||||
|
||||
/// A combination of a TreeCtrl and a ListCtrl. A tree with multiple columns.
|
||||
@@ -24,7 +22,7 @@ class TreeList : public wxPanel {
|
||||
/// Expand/collapse an item
|
||||
void expand(size_t item, bool expand = true);
|
||||
/// Select an item
|
||||
void select(size_t item);
|
||||
void select(size_t item, bool event = true);
|
||||
|
||||
/// (re)build the list
|
||||
void rebuild(bool full = true);
|
||||
@@ -32,24 +30,26 @@ class TreeList : public wxPanel {
|
||||
public:
|
||||
|
||||
/// An item in the tree list
|
||||
struct Item {
|
||||
Item() {}
|
||||
Item(int level, bool expanded = false, VoidP data = VoidP())
|
||||
: level(level), expanded(expanded), data(data)
|
||||
{}
|
||||
class Item : public IntrusivePtrBase<Item> {
|
||||
public:
|
||||
Item() : level(0), expanded(false) {}
|
||||
virtual ~Item() {}
|
||||
|
||||
int level;
|
||||
bool expanded;
|
||||
VoidP data;
|
||||
inline bool visible() const { return position != NOTHING; }
|
||||
|
||||
private:
|
||||
friend class TreeList;
|
||||
size_t position; // NOTHING if invisible, otherwise the line the item is on
|
||||
UInt lines; // lines in front of this item (bit set)
|
||||
inline bool visible() const { return position != NOTHING; }
|
||||
};
|
||||
typedef intrusive_ptr<Item> ItemP;
|
||||
|
||||
protected:
|
||||
|
||||
/// The items in the tree list
|
||||
vector<Item> items;
|
||||
vector<ItemP> items;
|
||||
|
||||
static const size_t NOTHING = (size_t)-1;
|
||||
size_t selection;
|
||||
@@ -57,10 +57,8 @@ class TreeList : public wxPanel {
|
||||
/// Initialize the items
|
||||
virtual void initItems() = 0;
|
||||
|
||||
/// Get the text of an item
|
||||
virtual String itemText(size_t item, size_t column) const = 0;
|
||||
/// Get the color of an item
|
||||
virtual Color itemColor(size_t item, size_t column) const = 0;
|
||||
/// Draw the text of an item
|
||||
virtual void drawItem(DC& dc, size_t index, size_t column, int x, int y, bool selected) const = 0;
|
||||
|
||||
/// The number of columns
|
||||
virtual size_t columnCount() const = 0;
|
||||
@@ -69,11 +67,11 @@ class TreeList : public wxPanel {
|
||||
/// The width of a column in pixels
|
||||
virtual int columnWidth(size_t column) const = 0;
|
||||
|
||||
private:
|
||||
int item_height;
|
||||
static const int header_height = 17;
|
||||
static const int level_width = 17;
|
||||
|
||||
private:
|
||||
size_t total_lines; // number of shown items
|
||||
size_t first_line; // first visible line
|
||||
size_t visible_lines; // number of (partially) visible lines
|
||||
|
||||
Reference in New Issue
Block a user