108 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			108 lines
		
	
	
		
			2.4 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;
 | 
						|
  COLOR _color;
 | 
						|
 | 
						|
  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; }
 | 
						|
 | 
						|
  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
 |