Planeshift
pawsglyphwindow.h
Go to the documentation of this file.
1 /*
2  * pawsglyphwindow.h - Author: Anders Reggestad
3  *
4  * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef PAWS_GLYPH_WINDOW
21 #define PAWS_GLYPH_WINDOW
22 
23 // CS INCLUDES
24 #include <csutil/array.h>
25 #include <imap/loader.h>
26 
27 #include "paws/pawswidget.h"
28 #include "paws/pawsbutton.h"
29 #include "paws/pawstextbox.h"
30 #include "pawsslot.h"
31 #include "inventorywindow.h"
32 #include "util/psconst.h"
33 #include "net/messages.h"
34 
35 #define FLOATING_SLOT GLYPH_LIST_MAX_SLOTS
36 
37 struct iEngine;
38 
39 
40 class pawsGlyphSlot : public pawsSlot
41 {
42 public:
44  {
45  dragDrop = false;
46  emptyOnZeroCount = true;
47  Clear();
48  }
49  int GetStatID()
50  {
51  return statID;
52  }
53  void SetStatID(int statID)
54  {
55  this->statID = statID;
56  }
57  void Clear()
58  {
59  statID = 0;
60 
62  }
63  int Way()
64  {
65  return wayID;
66  }
67  void SetWay(int way)
68  {
69  wayID = way;
70  }
71 protected:
72  int statID;
73  int wayID;
74 };
75 
77 
78 
83 {
84 public:
85 
87  virtual ~pawsGlyphWindow();
88 
91  void HandleMessage( MsgEntry* message );
92 
93  bool PostSetup();
94  void Show();
95  void Hide();
96  bool OnMouseDown(int button, int modifiers, int x, int y);
97  bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
98 
99 protected:
100  void HandleAssemble( MsgEntry* me );
101  void HandleGlyphList( MsgEntry* me );
102 
104  void NewGlyphSlotRow(int wayNum);
105 
107  pawsGlyphSlot * FindFreeSlot(int wayNum);
108 
110  void StartDrag(pawsGlyphSlot *sourceSlot);
111  void StopDrag(pawsGlyphSlot *sourceSlot);
112 
114  void SendAssembler(bool infoRequest = false);
115 
116  /*** Clears the Spell name and Description fields. ***/
117  void ClearSpell();
118 
124  csArray <pawsListBox*> ways;
125 
127 };
128 
129 
131 
132 
133 
134 #endif
135 
void SetStatID(int statID)
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
bool emptyOnZeroCount
should the slot clear itself when the stackcount hits 0 ?
Definition: pawsslot.h:114
A slot which may contain one item, with icon, and stack count.
Definition: pawsslot.h:22
pawsMessageTextBox * description
csArray< pawsListBox * > ways
virtual bool PostSetup()
This is called after the widget and all of it&#39;s children have been created.
Definition: pawswidget.h:709
CREATE_PAWS_FACTORY(pawsGlyphSlot)
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
#define GLYPH_ASSEMBLER_SLOTS
Definition: psconst.h:74
pawsTextBox * spellName
virtual void Clear()
bool OnMouseDown(int button, int modifiers, int x, int y)
Manage mouse down event to test for and apply window changes.
bool dragDrop
Definition: pawsslot.h:105
This is a special type of text box that is used for messages.
Definition: pawstextbox.h:285
A simple button widget.
Definition: pawsbutton.h:43
virtual void Show()
Makes widget visible and brings it to the front.
pawsWidget * helpWindow
void SetWay(int way)
Window opened from the spell book, when you want to see your glyphs and research new spells...
virtual bool OnButtonPressed(int button, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
Definition: pawswidget.h:1190
virtual void Hide()
Makes widget invisible and removes focus if widget has current focus.
A basic text box widget.
Definition: pawstextbox.h:42
pawsWidget * spellImage
pawsButton * helpButton