summaryrefslogtreecommitdiffstats
path: root/knights/challenge_graph.h
blob: 6fd92fff589a1a4284719afd44e96972edea8372 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/***************************************************************************
                      challenge_graph.h  -  description
                             -------------------
    begin                : Mon Jan 7 2002
    copyright            : (C) 2003 by Eric Faccer
    email                : e.faccer@qut.edu.au
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef CHALLENGE_GRAPH_H
#define CHALLENGE_GRAPH_H

#include <tqstringlist.h>
#include <tqvbox.h>
#include <tqevent.h>
#include <tqcolor.h>

#include "resource.h"
#include "challenge_game.h"

class TDEPopupMenu;
class TQCanvas;
class TQLabel;
class Challenge_Graph_View;
class Command;

class Challenge_Graph : public TQVBox
{
	Q_OBJECT
  

	public:
										Challenge_Graph(TQWidget *parent=0, const char *name=0, resource *Rsrc=0);
		virtual					~Challenge_Graph();
		void						resizeEvent( TQResizeEvent* );
		void						add( Challenge_Game *seek );
		void						clear();

	signals:
		void						sendCMD( const Command& );

	public slots:
		void						recvCMD( const Command& );
		void						display_menuSeek( Challenge_Game*, const TQPoint& );
		void						selectMatch( int );
		void						menuFunct( int );

	protected:
		virtual bool		isEmpty( int x, int y );
		void						drawChallenge( int time_control_x, int rating_y, bool rated, Challenge_Game *challenge );
		bool						addTo_Nearest_Neighbour( int orig_x, int orig_y, bool rated, Challenge_Game *challenge, int searchdepth=10 );
		void						createBackground( void );
		void						addSoughtItem( const TQString& );
		void						updateSoughtList( void );

	private:
		int x_size;
		int y_size;
		int max_rating;
		int max_time;
		bool seek;

		resource							*myResource;
		TQCanvas								*graph;
		Challenge_Graph_View	*myView;
		TQLabel								*myStatusBar;
		TQPixmap								background;

		TDEPopupMenu			*menuSeek;
		int							selectedMatchID;
		TQString					selectedPlayerName;
		/*
				These StringLists temporarily store Sought Game data
				until all ads have been displayed.
		*/
		TQStringList			SF_01;
		TQStringList			SF_02;
		TQStringList			SF_03;
		TQStringList			SF_04;
		TQStringList			SF_05;
		TQStringList			SF_06;
		TQStringList			SF_07;
};

#endif