campo-sirio/include/controls.h
guy d72f84feb1 Corretto problemino col focus degli sheet
Aggiunta possibilita' di cambiare il prompt di un groupbox


git-svn-id: svn://10.65.10.50/trunk@948 c028cbd2-c16b-5b4b-a496-9718f37d4682
1995-02-01 18:04:04 +00:00

104 lines
2.3 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; }
void set_caption(const char* c);
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