Planeshift
pawscraftcancelwindow.h
Go to the documentation of this file.
1 /*
2  * pawscraftcancelwindow.h by Tapped
3  *
4  * Copyright (C) 2010 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_CRAFTCANCEL_WINDOW_HEADER
21 #define PAWS_CRAFTCANCEL_WINDOW_HEADER
22 
23 #include "paws/pawswidget.h"
24 class pawsProgressBar;
25 
26 #include "net/cmdbase.h"
27 #include "net/msghandler.h"
28 
34 {
35 public:
36  virtual ~pawsCraftCancelWindow();
37  virtual void HandleMessage(MsgEntry* me);
38 
39  virtual bool PostSetup();
40  virtual void Draw();
44  void Start(csTicks craftTime);
45 
46  virtual bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
47 private:
50  void Cancel();
51 
52  pawsProgressBar* craftProgress;
53  csTicks startTime,craftTime;
54 };
55 
57 
58 #endif
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
CREATE_PAWS_FACTORY(pawsCraftCancelWindow)
This handles all the details about how the craft cancel works.
virtual ~pawsCraftCancelWindow()
virtual void HandleMessage(MsgEntry *me)
void Start(csTicks craftTime)
This is called every time the client is crafting something.
virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
virtual bool PostSetup()
This is called after the widget and all of it's children have been created.
virtual void Draw()
Draws the widget and all of it's children.