00001
00002
00003
00004
00006
00007 #ifndef KYRA_IMAGESCROLLBOX_INCLUDED
00008 #define KYRA_IMAGESCROLLBOX_INCLUDED
00009
00010
00011 #include "../gui/widget.h"
00012
00013 class KrTextWidget;
00014
00015
00030 class KrImageListBox : public KrWidget
00031 {
00032 public:
00033 KrImageListBox(int width, int height, int imageheight, const KrScheme& scheme);
00034 virtual ~KrImageListBox();
00035
00036 KrImage* QuerySelectedItem();
00037 std::string& QuerySelectedItemText();
00038
00039 void AddedtoTree();
00040 int AddImage( KrImage* _image, std::string text );
00041 int NumItems() { return objectImages.Count(); }
00043 int QuerySelectedItemNum() { return selectedItem; }
00044
00045 void MoveSelection( int delta );
00046 virtual int IsMouseListener() { return LEFT_MOUSE; }
00047 virtual void MouseClick( int down, int x, int y );
00048 virtual void MouseMove( bool down, int x, int y );
00049 virtual void MouseIn( bool down, bool in );
00050
00051 private:
00052
00053 void DrawImage();
00054 void CalcImagePosition(KrImage* image);
00055
00056 int width, height;
00057 int imageHeight;
00058 int fontHeight;
00059
00060 KrBevelElement *outerBevel;
00061
00062 typedef struct{
00063 KrImage* image;
00064 KrImage* clone;
00065 KrTextWidget* textWidget;
00066 std::string imageText;
00067 }ImageItem;
00068
00069 void CalcTextPosition(ImageItem& item);
00070 GlDynArray< ImageItem > objectImages;
00071 GlDynArray< KrBox* > objectViewImages;
00072
00073 int firstItem;
00074 int selectedItem;
00075 int viewSelection;
00076 int currHiLight;
00077
00078 unsigned numVisibleItems;
00079 std::string emptyString;
00080 };
00081
00082 #endif