8779aa4841
git-svn-id: svn://10.65.10.50/trunk@103 c028cbd2-c16b-5b4b-a496-9718f37d4682
99 lines
2.2 KiB
C++
Executable File
99 lines
2.2 KiB
C++
Executable File
#ifndef __CONTROLS_H
|
|
#define __CONTROLS_H
|
|
|
|
#ifndef __STRINGS_H
|
|
#include <strings.h>
|
|
#endif
|
|
|
|
WINDOW xvt_create_checkbox(
|
|
short left, short top, short right, short bottom,
|
|
const char* caption,
|
|
WINDOW parent,
|
|
long flags,
|
|
long app_data,
|
|
int id);
|
|
|
|
WINDOW xvt_create_radiobutton(
|
|
short left, short top, short right, short bottom,
|
|
const char* caption,
|
|
WINDOW parent,
|
|
long flags,
|
|
long app_data,
|
|
int id);
|
|
|
|
WINDOW xvt_create_pushbutton(
|
|
short left, short top, short right, short bottom,
|
|
const char* caption,
|
|
WINDOW parent,
|
|
long flags,
|
|
long app_data,
|
|
int id);
|
|
|
|
WINDOW xvt_create_text(
|
|
short left, short top, short right, short bottom,
|
|
const char* caption,
|
|
WINDOW parent,
|
|
long flags,
|
|
long app_data,
|
|
int id);
|
|
|
|
WINDOW xvt_create_groupbox(
|
|
short left, short top, short right, short bottom,
|
|
const char* caption,
|
|
WINDOW parent,
|
|
long flags,
|
|
long app_data,
|
|
int id);
|
|
|
|
void free_controls_bmp();
|
|
|
|
///////////////////////////////////////////////////////////
|
|
// Custom control
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
class TControl
|
|
{
|
|
WINDOW _win;
|
|
short _id;
|
|
TString80 _caption;
|
|
|
|
bool _disabled : 1;
|
|
bool _checked : 1;
|
|
bool _focused : 1;
|
|
bool _multiple : 1;
|
|
|
|
protected:
|
|
static long handler(WINDOW win, EVENT* ep);
|
|
|
|
void create(short left, short top, short right, short bottom,
|
|
const char* caption,
|
|
WINDOW parent, long flags, long app_data, short id);
|
|
|
|
virtual void update() const pure;
|
|
virtual void mouse_down(PNT) {};
|
|
virtual void mouse_up() {};
|
|
virtual WIN_TYPE type() const { return W_NO_BORDER; }
|
|
|
|
public:
|
|
static TControl* WINDOW2TControl(WINDOW win);
|
|
virtual ~TControl();
|
|
|
|
WINDOW win() const { return _win; }
|
|
short id() const { return _id; }
|
|
const char* caption() const { return _caption; }
|
|
|
|
bool checked() const { return _checked; }
|
|
virtual void check(bool on);
|
|
|
|
bool disabled() const { return _disabled; }
|
|
void enable(bool on);
|
|
|
|
bool focused() const { return _focused; }
|
|
void focus(bool on) { _focused = on; }
|
|
|
|
bool multiple() const { return _multiple; }
|
|
};
|
|
|
|
#endif
|