1 // OpenLieroX
2 
3 // Line
4 // Created 5/11/06
5 // Dark Charlie
6 
7 // code under LGPL
8 
9 
10 #ifndef __CLINE_H__DEPRECATED_GUI__
11 #define __CLINE_H__DEPRECATED_GUI__
12 
13 #include "Color.h"
14 
15 
16 namespace DeprecatedGUI {
17 
18 // Line events
19 enum {
20 	LIN_NONE=-1
21 };
22 
23 
24 class CLine : public CWidget {
25 public:
26 	// Constructor
CLine(int x1,int y1,int dx,int dy,Color col)27 	CLine(int x1, int y1, int dx, int dy, Color col) {
28 		iX = x1;
29 		iY = y1;
30 		iWidth = dx;
31 		iHeight = dy;
32 		iColour = col;
33 	}
34 
35 
36 private:
37 	// Attributes
38 	Color	iColour;
39 
40 public:
41 	// Methods
42 
Create()43 	void	Create() { }
Destroy()44 	void	Destroy() { }
45 
46 	//These events return an event id, otherwise they return -1
MouseOver(mouse_t * tMouse)47 	int		MouseOver(mouse_t *tMouse)			{ return LIN_NONE; }
MouseUp(mouse_t * tMouse,int nDown)48 	int		MouseUp(mouse_t *tMouse, int nDown)		{ return LIN_NONE; }
MouseDown(mouse_t * tMouse,int nDown)49 	int		MouseDown(mouse_t *tMouse, int nDown)	{ return LIN_NONE; }
MouseWheelDown(mouse_t * tMouse)50 	int		MouseWheelDown(mouse_t *tMouse)		{ return LIN_NONE; }
MouseWheelUp(mouse_t * tMouse)51 	int		MouseWheelUp(mouse_t *tMouse)		{ return LIN_NONE; }
KeyDown(UnicodeChar c,int keysym,const ModifiersState & modstate)52 	int		KeyDown(UnicodeChar c, int keysym, const ModifiersState& modstate)	{ return LIN_NONE; }
KeyUp(UnicodeChar c,int keysym,const ModifiersState & modstate)53 	int		KeyUp(UnicodeChar c, int keysym, const ModifiersState& modstate)	{ return LIN_NONE; }
54 
SendMessage(int iMsg,DWORD Param1,DWORD Param2)55 	DWORD SendMessage(int iMsg, DWORD Param1, DWORD Param2)	{
56 							return 0;
57 						}
SendMessage(int iMsg,const std::string & sStr,DWORD Param)58 	DWORD SendMessage(int iMsg, const std::string& sStr, DWORD Param) { return 0; }
SendMessage(int iMsg,std::string * sStr,DWORD Param)59 	DWORD SendMessage(int iMsg, std::string *sStr, DWORD Param)  { return 0; }
60 
ChangeColour(Color col)61 	void	ChangeColour(Color col)			{ iColour = col; }
62 
63 	// Draw the line
Draw(SDL_Surface * bmpDest)64 	void	Draw(SDL_Surface * bmpDest) {
65 		DrawLine(bmpDest, iX, iY, iX + iWidth, iY + iHeight, iColour);
66 	}
67 };
68 
69 }; // namespace DeprecatedGUI
70 
71 #endif  //  __CLINE_H__DEPRECATED_GUI__
72