1994-08-30 14:40:29 +00:00
|
|
|
#ifndef __CONTROLS_H
|
|
|
|
#define __CONTROLS_H
|
|
|
|
|
|
|
|
#ifndef __STRINGS_H
|
|
|
|
#include <strings.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
WINDOW xvt_create_checkbox(
|
1996-01-31 17:19:02 +00:00
|
|
|
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
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// @doc INTERNAL
|
|
|
|
|
|
|
|
// @class TControl | Classe per la creazione di controlli personalizzati
|
|
|
|
class TControl
|
|
|
|
// @author:(INTERNAL) Guido
|
|
|
|
|
|
|
|
// @access Private Member
|
1994-08-30 14:40:29 +00:00
|
|
|
{
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Handle del controllo creato
|
1994-08-30 14:40:29 +00:00
|
|
|
WINDOW _win;
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Iedntificatore assegnato al cotrollo
|
1994-08-30 14:40:29 +00:00
|
|
|
short _id;
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Prompt del controllo
|
1995-10-25 09:43:56 +00:00
|
|
|
TString _caption;
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Colore di foreground del controllo
|
|
|
|
COLOR _color;
|
|
|
|
// @cmember Colore di background del controllo
|
|
|
|
COLOR _backcolor;
|
1994-08-30 14:40:29 +00:00
|
|
|
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Indica se il controllo e' disabilitato
|
1994-08-30 14:40:29 +00:00
|
|
|
bool _disabled : 1;
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Indica se il controllo ha un check
|
|
|
|
bool _checked : 1;
|
|
|
|
// @cmember Indica se il controllo ha il focus
|
|
|
|
bool _focused : 1;
|
|
|
|
// @cmember Indica varie cose a seconda del tipo di controllo she si sta utilizzando
|
1994-08-30 14:40:29 +00:00
|
|
|
bool _multiple : 1;
|
|
|
|
|
1996-01-31 17:19:02 +00:00
|
|
|
// @access Protected Member
|
1994-08-30 14:40:29 +00:00
|
|
|
protected:
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember E' l'handler del controllo
|
1995-03-16 13:44:11 +00:00
|
|
|
static long XVT_CALLCONV1 handler(WINDOW win, EVENT* ep);
|
1994-08-30 14:40:29 +00:00
|
|
|
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Crea il controllo
|
|
|
|
void create(short left, short top, short right, short bottom, const char* caption, WINDOW parent, long flags, long app_data, short id);
|
1994-08-30 14:40:29 +00:00
|
|
|
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Ridisegna il controllo a video
|
1994-08-30 14:40:29 +00:00
|
|
|
virtual void update() const pure;
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Chiamate ogni volta che viene premuto il mouse sul controllo
|
|
|
|
virtual void mouse_down(PNT)
|
|
|
|
{};
|
|
|
|
// @cmember Chiamate ogni volta che viene rialsciato il mouse sul controllo
|
|
|
|
virtual void mouse_up()
|
|
|
|
{};
|
|
|
|
// @cmember Ritorna il tipo di finestra su cui si trova il controllo
|
|
|
|
virtual WIN_TYPE type() const
|
|
|
|
{ return W_NO_BORDER; }
|
|
|
|
|
|
|
|
// @access Public Member
|
1994-08-30 14:40:29 +00:00
|
|
|
public:
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Ritorna il TControl dalla finestra del controllo
|
1994-08-30 14:40:29 +00:00
|
|
|
static TControl* WINDOW2TControl(WINDOW win);
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Distruttore. Necessariamente virtuale per derivare altri distruttori
|
1994-08-30 14:40:29 +00:00
|
|
|
virtual ~TControl();
|
|
|
|
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Ritorna l'handle del controllo
|
|
|
|
WINDOW win() const
|
|
|
|
{ return _win; }
|
|
|
|
// @cmember Ritorna l'identificatore assegnato al controllo
|
|
|
|
short id() const
|
|
|
|
{ return _id; }
|
|
|
|
// @cmember Ritorna il prompt del controllo
|
|
|
|
const char* caption() const
|
|
|
|
{ return _caption; }
|
|
|
|
// @cmember Setta il prompt del controllo
|
1995-02-01 18:04:04 +00:00
|
|
|
void set_caption(const char* c);
|
1996-01-31 17:19:02 +00:00
|
|
|
|
|
|
|
// @cmember Ritorna il colore di forground del controllo
|
|
|
|
COLOR color() const
|
|
|
|
{ return _color; }
|
|
|
|
// @cmember Setta il colore di forground del controllo
|
|
|
|
void set_color(COLOR c)
|
|
|
|
{ _color = c; }
|
|
|
|
|
|
|
|
// @cmember Ritorna il colore di background del controllo
|
|
|
|
COLOR back_color() const
|
|
|
|
{ return _backcolor; }
|
|
|
|
// @cmember Setta il colore di background del controllo
|
|
|
|
void set_back_color(COLOR c)
|
|
|
|
{ _backcolor = c; }
|
|
|
|
|
|
|
|
// @cmember Ritorna se il controllo possiede un check
|
|
|
|
bool checked() const
|
|
|
|
{ return _checked; }
|
|
|
|
// @cmember Setta se il controllo debba avere un check
|
1994-08-30 14:40:29 +00:00
|
|
|
virtual void check(bool on);
|
|
|
|
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Ritorna se il controllo e' disabilitato
|
|
|
|
bool disabled() const
|
|
|
|
{ return _disabled; }
|
|
|
|
// @cmember Abilita/disabilita il controllo
|
1994-08-30 14:40:29 +00:00
|
|
|
void enable(bool on);
|
|
|
|
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Ritorna se il controllo ha il focus
|
|
|
|
bool focused() const
|
|
|
|
{ return _focused; }
|
|
|
|
// @cmember Setta il focus sul cursore (stessa sintassi di <mf TCursor::enable>)
|
|
|
|
void focus(bool on)
|
|
|
|
{ _focused = on; }
|
1994-08-30 14:40:29 +00:00
|
|
|
|
1996-01-31 17:19:02 +00:00
|
|
|
// @cmember Ritorna il contenuto della variabile <md TControl::_multiple>
|
|
|
|
bool multiple() const
|
|
|
|
{ return _multiple; }
|
1994-08-30 14:40:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|