campo-sirio/include/controls.h
guy aec59575dc array.cpp Corretta packing nella remove/destroy
colors.h     Aggiunto colore della toolbar
controls.cpp Aggiunto supporto per il colore di sfondo
controls.h   Aggiunti metodi set/get_back_color
form.cpp     Reindentato
mask.cpp     Aggiunto supporto per il colore della toolbar
mask.h       Resa pubblica la funzione toolwin()
maskfld.cpp  Aggiunto supporto per il colore dello sfondo
maskfld.h    Aggiunta funzione set_back_color ai campi
msksheet.cpp Corretto metodi insert e destroy
pagsca.h     Aggiunto campo PASSATT
relapp.cpp   Cambiati messaggi di richiesta di proseguire in caso d'errore
relation.cpp Corretta lfile che non falliva mai anche se avrebbe dovuto
xvtility.cpp Aggiunta funzione xvt_ctrl_set_back_color
xvtility.h   Come sopra


git-svn-id: svn://10.65.10.50/trunk@2005 c028cbd2-c16b-5b4b-a496-9718f37d4682
1995-10-25 09:43:56 +00:00

111 lines
2.5 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;
TString _caption;
COLOR _color, _backcolor;
bool _disabled : 1;
bool _checked : 1;
bool _focused : 1;
bool _multiple : 1;
protected:
static long XVT_CALLCONV1 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);
COLOR color() const { return _color; }
void set_color(COLOR c) { _color = c; }
COLOR back_color() const { return _backcolor; }
void set_back_color(COLOR c) { _backcolor = 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