summaryrefslogtreecommitdiffstats
path: root/src/VButton.h
blob: cab13cd47e1794944799584b92a669449dda51f2 (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
#ifndef VBUTTON_H
#define VBUTTON_H

#include <tqpushbutton.h>
#include <tqevent.h>

class VButton : public TQPushButton
{
Q_OBJECT
  
public:
	VButton(TQWidget *parent=0, const char *name=0);
	~VButton();

	unsigned int getKeyCode();
	void setKeyCode(unsigned int keycode);
	void setText(const TQString &text);
	void setShiftText(const TQString &text);
	void setColor(const TQColor &color);

	void reposition(int width, int height);
	void res();

	static double pw;
	static double ph;

private:
	bool press;
	bool inrpt;
	bool inside;

protected:
	unsigned int keycode;
	TQString u;
	TQString l;
	TQRect orig_size;

	void timerEvent ( TQTimerEvent * );

public slots:
	void sendKey();
	void shiftPressed(bool press);

protected slots:
	void enterEvent(TQEvent *e);
	void leaveEvent(TQEvent *e);
	void mousePressEvent(TQMouseEvent *e);
	void mouseReleaseEvent(TQMouseEvent *e);

signals:
	void keyClick(unsigned int keycode);
};

#endif