22 #ifndef TITANIC_PET_GLYPHS_H 23 #define TITANIC_PET_GLYPHS_H 25 #include "common/keyboard.h" 26 #include "titanic/core/list.h" 27 #include "titanic/messages/mouse_messages.h" 28 #include "titanic/pet_control/pet_gfx_element.h" 29 #include "titanic/support/rect.h" 33 #define TOTAL_GLYPHS 7 39 enum GlyphActionMode { ACTION_REMOVE = 0, ACTION_REMOVED = 1, ACTION_CHANGE = 2 };
41 enum GlyphFlag { GFLAG_1 = 1, GFLAG_2 = 2, GFLAG_4 = 4, GFLAG_8 = 8, GFLAG_16 = 16 };
45 GlyphActionMode _mode;
50 GlyphActionMode getMode()
const {
return _mode; }
73 virtual bool reset() {
return false; }
98 virtual void updateTooltip();
174 virtual bool contains(
const Point &delta,
const Point &pt);
186 virtual bool proc33(
CPetGlyph *glyph) {
return true; }
241 bool isHighlighted()
const;
249 Point getPosition(
int index)
const;
254 Rect getRect(
int index)
const;
259 int getHighlightedIndex(
int index)
const;
264 int getItemIndex(
int index)
const;
269 void setSelectedIndex(
int index);
279 void setFirstVisible(
int index);
289 bool areItemsValid()
const;
291 int _firstVisibleIndex;
293 int _numVisibleGlyphs;
306 void changeHighlight(
int index);
313 void setNumVisible(
int total);
324 virtual void setup(
int numVisible,
CPetSection *owner);
329 virtual void reset();
334 virtual void enter();
339 virtual void leave();
341 void setFlags(
int flags) { _flags = flags; }
351 void highlight(
int index);
371 bool MouseButtonDownMsg(
const Point &pt);
376 bool MouseButtonUpMsg(
const Point &pt);
401 bool KeyCharMsg(
int key);
412 bool enterHighlighted();
418 void leaveHighlighted();
435 bool highlighted14();
440 int indexOf(
const CPetGlyph *glyph)
const;
475 bool isGlyphHighlighted(
const CPetGlyph *glyph)
const;
485 Point getHighlightedGlyphPos()
const;
491 void removeInvalid();
Definition: mouse_messages.h:150
virtual void glyphFocused(const Point &topLeft, bool flag)
Definition: pet_glyphs.h:158
virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg)
Definition: pet_glyphs.h:143
Definition: text_control.h:35
void translate(int deltaX, int deltaY)
Definition: pet_element.h:143
virtual bool doAction(CGlyphAction *action)
Definition: pet_glyphs.h:211
virtual void leaveHighlighted()
Definition: pet_glyphs.h:201
Definition: mouse_messages.h:117
virtual bool MouseButtonUpMsg(const Point &pt)
Definition: pet_glyphs.h:128
CPetSection * getOwner() const
Definition: pet_glyphs.h:361
Definition: pet_section.h:51
Definition: mouse_messages.h:139
virtual void highlightCurrent(const Point &pt)
Definition: pet_glyphs.h:153
virtual bool MouseButtonDownMsg(const Point &pt)
Definition: pet_glyphs.h:108
Definition: simple_file.h:49
void translate(const Point &pt)
Definition: pet_glyphs.h:216
virtual void enter()
Definition: pet_glyphs.h:78
virtual void getTooltip(CTextControl *text)
Definition: pet_glyphs.h:179
virtual bool dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg)
Definition: pet_glyphs.h:168
Definition: screen_manager.h:49
virtual bool MouseDragEndMsg(CMouseDragEndMsg *msg)
Definition: pet_glyphs.h:123
virtual void unhighlightCurrent()
Definition: pet_glyphs.h:148
Definition: pet_gfx_element.h:29
Definition: game_object.h:79
Definition: messages.h:408
Definition: mouse_messages.h:181
Definition: pet_glyphs.h:53
void resetHighlight()
Definition: pet_glyphs.h:433
CPetGlyphs * getOwner()
Definition: pet_glyphs.h:226
virtual void selectGlyph(const Point &topLeft, const Point &pt)
Definition: pet_glyphs.h:163
virtual void leave()
Definition: pet_glyphs.h:83
virtual CGameObject * getObjectAt()
Definition: pet_glyphs.h:206
void translateBack(const Point &pt)
Definition: pet_glyphs.h:221
virtual bool reset()
Definition: pet_glyphs.h:73
Definition: pet_glyphs.h:244
virtual bool enterHighlighted()
Definition: pet_glyphs.h:196
virtual void saveGlyph(SimpleFile *file, int indent)
Definition: pet_glyphs.h:184
virtual void draw2(CScreenManager *screenManager)
Definition: pet_glyphs.h:93
int16 x
Definition: rect.h:46
virtual bool KeyCharMsg(int key)
Definition: pet_glyphs.h:138
int16 y
Definition: rect.h:47
void scrollToStart()
Definition: pet_glyphs.h:445
virtual bool isValid() const
Definition: pet_glyphs.h:191
virtual bool MouseDragMoveMsg(CMouseDragMoveMsg *msg)
Definition: pet_glyphs.h:118
virtual bool MouseDragStartMsg(CMouseDragStartMsg *msg)
Definition: pet_glyphs.h:113
Definition: pet_glyphs.h:43
int getHighlightIndex() const
Definition: pet_glyphs.h:480
Definition: pet_control.h:45
virtual Rect getBounds() const
Definition: pet_glyphs.h:103
virtual bool MouseDoubleClickMsg(const CMouseDoubleClickMsg *msg)
Definition: pet_glyphs.h:133
bool MouseDoubleClickMsg(const Point &pt)
Definition: pet_glyphs.h:381