123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- #ifndef COMPONENTLISTBOX_H
- #define COMPONENTLISTBOX_H
- /*************************************************************************************************\
- ComponentListBox.h : Interface for the ComponentListBox component.
- //---------------------------------------------------------------------------//
- // Copyright (C) Microsoft Corporation. All rights reserved. //
- //===========================================================================//
- \*************************************************************************************************/
- #ifndef ALISTBOX_H
- #include "aListBox.h"
- #endif
- #ifndef AANIM_H
- #include "aanim.h"
- #endif
- #ifndef ELIST_H
- #include "eList.h"
- #endif
- class LogisticsVariant;
- class LogisticsComponent;
- class LogisticsVehicle;
- #define COMP_ANIMATION_COUNT 5
- //*************************************************************************************************
- /**************************************************************************************************
- CLASS DESCRIPTION
- ComponentListBox:
- **************************************************************************************************/
- // complex list box items, icons and all
- class ComponentListItem : public aListItem
- {
- public:
- ComponentListItem( LogisticsComponent* pComp );
- virtual ~ComponentListItem();
- static int init( FitIniFile& file );
- LogisticsComponent* getComponent() { return pComponent; }
- virtual void render();
- void update();
- private:
- friend class ComponentIconListBox;
- static ComponentListItem* s_templateItem;
- aText name;
- aText costText;
- aText heatText;
- aObject costIcon;
- aObject heatIcon;
- aObject icon;
- aRect iconOutline;
- aRect outline;
- aText disabledText;
- aAnimGroup animations[COMP_ANIMATION_COUNT];
- aAnimGroup* pChildAnims[6];
- LogisticsComponent* pComponent;
- static void assignAnimation( FitIniFile& file,
- int whichChild, char animNames[COMP_ANIMATION_COUNT][32], aObject* pObject );
- void doAdd();
- void setComponent();
- void startDrag();
- };
- class ComponentIconListBox : public aListBox
- {
- public:
- ComponentIconListBox();
- virtual ~ComponentIconListBox();
- void setType( int Type, int orThisType, int orThis);
- virtual void update();
- LogisticsComponent* getComponent();
- int selectFirstAvailableComponent();
- static ComponentIconListBox* s_instance;
-
- private:
- ComponentIconListBox( const ComponentIconListBox& src );
- ComponentIconListBox& operator=( const ComponentIconListBox& src );
- EList<ComponentListItem*, ComponentListItem*> masterComponentList;
- int type;
- void addSortedItem( ComponentListItem* pItem );
- };
- //*************************************************************************************************
- #endif // end of file ( ComponentListBox.h )
|