summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-05-02 05:05:43 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-05-02 05:05:43 -0400
commitaa5a0fb53aedf8c7df5c5b6462cd51a347e0bd69 (patch)
treeb009e7d12624b5bef131a6bb323fa520cb3f45ec
parentcbd61ab459ff4799a7e2f95820f59fb0f3a2454b (diff)
Add widget creation to the items
-rw-r--r--sigmodr/tree/TreeItem.cpp140
1 files changed, 140 insertions, 0 deletions
diff --git a/sigmodr/tree/TreeItem.cpp b/sigmodr/tree/TreeItem.cpp
index 0b5509ee..3a3d0ac7 100644
--- a/sigmodr/tree/TreeItem.cpp
+++ b/sigmodr/tree/TreeItem.cpp
@@ -18,6 +18,40 @@
// Header include
#include "TreeItem.h"
+// Sigmodr widget includes
+#include <sigmodr/widgets/AbilityUI.h>
+#include <sigmodr/widgets/AuthorUI.h>
+#include <sigmodr/widgets/BadgeUI.h>
+#include <sigmodr/widgets/CoinListUI.h>
+#include <sigmodr/widgets/CoinListItemUI.h>
+#include <sigmodr/widgets/EggGroupUI.h>
+#include <sigmodr/widgets/GameUI.h>
+#include <sigmodr/widgets/GlobalScriptUI.h>
+#include <sigmodr/widgets/ItemUI.h>
+#include <sigmodr/widgets/ItemTypeUI.h>
+#include <sigmodr/widgets/MapUI.h>
+#include <sigmodr/widgets/MapEffectUI.h>
+#include <sigmodr/widgets/MapTrainerUI.h>
+#include <sigmodr/widgets/MapTrainerTeamMemberUI.h>
+#include <sigmodr/widgets/MapWarpUI.h>
+#include <sigmodr/widgets/MapWildListUI.h>
+#include <sigmodr/widgets/MapWildListEncounterUI.h>
+#include <sigmodr/widgets/MoveUI.h>
+#include <sigmodr/widgets/NatureUI.h>
+#include <sigmodr/widgets/RulesUI.h>
+#include <sigmodr/widgets/SkinUI.h>
+#include <sigmodr/widgets/SoundUI.h>
+#include <sigmodr/widgets/SpeciesUI.h>
+#include <sigmodr/widgets/SpeciesMoveUI.h>
+#include <sigmodr/widgets/SpriteUI.h>
+#include <sigmodr/widgets/StatusUI.h>
+#include <sigmodr/widgets/StoreUI.h>
+#include <sigmodr/widgets/TileUI.h>
+#include <sigmodr/widgets/TimeUI.h>
+#include <sigmodr/widgets/TrainerUI.h>
+#include <sigmodr/widgets/TypeUI.h>
+#include <sigmodr/widgets/WeatherUI.h>
+
// Sigmod includes
#include <sigmod/Ability.h>
#include <sigmod/Author.h>
@@ -340,6 +374,112 @@ bool TreeItem::canRemove() const
QWidget* TreeItem::editWidget(QWidget* parent)
{
// TODO
+ ObjectUI* editorWidget = NULL;
+ switch (m_type)
+ {
+ case EntryGame:
+ editorWidget = new GameUI(qobject_cast<Game*>(m_object), NULL);
+ break;
+ case EntryRules:
+ editorWidget = new RulesUI(qobject_cast<Rules*>(m_object), NULL);
+ break;
+ case EntryAbility:
+ editorWidget = new AbilityUI(qobject_cast<Ability*>(m_object), NULL);
+ break;
+ case EntryAuthor:
+ editorWidget = new AuthorUI(qobject_cast<Author*>(m_object), NULL);
+ break;
+ case EntryBadge:
+ editorWidget = new BadgeUI(qobject_cast<Badge*>(m_object), NULL);
+ break;
+ case EntryCoinList:
+ editorWidget = new CoinListUI(qobject_cast<CoinList*>(m_object), NULL);
+ break;
+ case EntryCoinListItem:
+ editorWidget = new CoinListItemUI(qobject_cast<CoinListItem*>(m_object), NULL);
+ break;
+ case EntryEggGroup:
+ editorWidget = new EggGroupUI(qobject_cast<EggGroup*>(m_object), NULL);
+ break;
+ case EntryGlobalScript:
+ editorWidget = new GlobalScriptUI(qobject_cast<GlobalScript*>(m_object), NULL);
+ break;
+ case EntryItem:
+ editorWidget = new ItemUI(qobject_cast<Item*>(m_object), NULL);
+ break;
+ case EntryItemType:
+ editorWidget = new ItemTypeUI(qobject_cast<ItemType*>(m_object), NULL);
+ break;
+ case EntryMap:
+ editorWidget = new MapUI(qobject_cast<Map*>(m_object), NULL);
+ break;
+ case EntryMapEffect:
+ editorWidget = new MapEffectUI(qobject_cast<MapEffect*>(m_object), NULL);
+ break;
+ case EntryMapTrainer:
+ editorWidget = new MapTrainerUI(qobject_cast<MapTrainer*>(m_object), NULL);
+ break;
+ case EntryMapTrainerTeamMember:
+ editorWidget = new MapTrainerTeamMemberUI(qobject_cast<MapTrainerTeamMember*>(m_object), NULL);
+ break;
+ case EntryMapWarp:
+ editorWidget = new MapWarpUI(qobject_cast<MapWarp*>(m_object), NULL);
+ break;
+ case EntryMapWildList:
+ editorWidget = new MapWildListUI(qobject_cast<MapWildList*>(m_object), NULL);
+ break;
+ case EntryMapWildListEncounter:
+ editorWidget = new MapWildListEncounterUI(qobject_cast<MapWildListEncounter*>(m_object), NULL);
+ break;
+ case EntryMove:
+ editorWidget = new MoveUI(qobject_cast<Move*>(m_object), NULL);
+ break;
+ case EntryNature:
+ editorWidget = new NatureUI(qobject_cast<Nature*>(m_object), NULL);
+ break;
+ case EntrySkin:
+ editorWidget = new SkinUI(qobject_cast<Skin*>(m_object), NULL);
+ break;
+ case EntrySound:
+ editorWidget = new SoundUI(qobject_cast<Sound*>(m_object), NULL);
+ break;
+ case EntrySpecies:
+ editorWidget = new SpeciesUI(qobject_cast<Species*>(m_object), NULL);
+ break;
+ case EntrySpeciesMove:
+ editorWidget = new SpeciesMoveUI(qobject_cast<SpeciesMove*>(m_object), NULL);
+ break;
+ case EntrySprite:
+ editorWidget = new SpriteUI(qobject_cast<Sprite*>(m_object), NULL);
+ break;
+ case EntryStatus:
+ editorWidget = new StatusUI(qobject_cast<Status*>(m_object), NULL);
+ break;
+ case EntryStore:
+ editorWidget = new StoreUI(qobject_cast<Store*>(m_object), NULL);
+ break;
+ case EntryTile:
+ editorWidget = new TileUI(qobject_cast<Tile*>(m_object), NULL);
+ break;
+ case EntryTime:
+ editorWidget = new TimeUI(qobject_cast<Time*>(m_object), NULL);
+ break;
+ case EntryTrainer:
+ editorWidget = new TrainerUI(qobject_cast<Trainer*>(m_object), NULL);
+ break;
+ case EntryType:
+ editorWidget = new TypeUI(qobject_cast<Type*>(m_object), NULL);
+ break;
+ case EntryWeather:
+ editorWidget = new WeatherUI(qobject_cast<Weather*>(m_object), NULL);
+ break;
+ default:
+ break;
+ }
+ if (editorWidget)
+ {
+ }
+ return NULL;
}
int TreeItem::childCount() const