Aggiunto un valore di ritorno WINDOW ai metodi add_* di TMask
git-svn-id: svn://10.65.10.50/trunk@876 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									8dd13258ab
								
							
						
					
					
						commit
						a7fb8fefed
					
				@ -1221,53 +1221,60 @@ void TMask::set_handler(MASK_HANDLER handler)
 | 
			
		||||
 | 
			
		||||
// aggiunta campi a runtime
 | 
			
		||||
 | 
			
		||||
void TMask::add_static (short id, int page, const char* prompt, int x,
 | 
			
		||||
                        int y, const char* flags)
 | 
			
		||||
WINDOW TMask::add_static (short id, int page, const char* prompt, int x,
 | 
			
		||||
                          int y, const char* flags)
 | 
			
		||||
{
 | 
			
		||||
  TMask_field* f = new TMask_field(this);
 | 
			
		||||
  f->construct(id, prompt, x, y, strlen(prompt), _pagewin[page], flags);
 | 
			
		||||
  _field.add(f);
 | 
			
		||||
  return f->win();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TMask::add_string (short id, int page, const char* prompt, int x,
 | 
			
		||||
                        int y, int dim, const char* flags, int width)
 | 
			
		||||
WINDOW TMask::add_string (short id, int page, const char* prompt, int x,
 | 
			
		||||
                          int y, int dim, const char* flags, int width)
 | 
			
		||||
{
 | 
			
		||||
  TEdit_field* f = new TEdit_field(this);
 | 
			
		||||
  f->construct(id, prompt, x, y, dim, _pagewin[page], flags, width);
 | 
			
		||||
  _field.add(f);
 | 
			
		||||
  return f->win();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TMask::add_number (short id, int page, const char* prompt, int x,
 | 
			
		||||
                        int y, int dim, const char* flags, int ndec)
 | 
			
		||||
WINDOW TMask::add_number (short id, int page, const char* prompt, int x,
 | 
			
		||||
                          int y, int dim, const char* flags, int ndec)
 | 
			
		||||
{
 | 
			
		||||
  TReal_field* f = new TReal_field(this);
 | 
			
		||||
  f->construct(id, prompt, x, y, dim, _pagewin[page], flags, ndec);
 | 
			
		||||
  _field.add(f);
 | 
			
		||||
  return f->win();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TMask::add_date   (short id, int page, const char* prompt, int x,
 | 
			
		||||
WINDOW TMask::add_date (short id, int page, const char* prompt, int x,
 | 
			
		||||
                        int y, const char* flags)
 | 
			
		||||
{
 | 
			
		||||
  TDate_field* f = new TDate_field(this);
 | 
			
		||||
  f->construct(id, prompt, x, y, 10, _pagewin[page], flags);
 | 
			
		||||
  _field.add(f);
 | 
			
		||||
  return f->win();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TMask::add_button (short id, int page, const char* prompt, int x,
 | 
			
		||||
                        int y, int dx, int dy, const char* flags)
 | 
			
		||||
WINDOW TMask::add_button (short id, int page, const char* prompt, int x,
 | 
			
		||||
                          int y, int dx, int dy, const char* flags)
 | 
			
		||||
{
 | 
			
		||||
  TButton_field* f = new TButton_field(this);
 | 
			
		||||
  f->construct(id, prompt, x, y, dy, _pagewin[page], flags, dx);
 | 
			
		||||
  _field.add(f);
 | 
			
		||||
}
 | 
			
		||||
  return f->win();
 | 
			
		||||
} 
 | 
			
		||||
 | 
			
		||||
void TMask::add_radio(short id, int page, const char* prompt, int x,
 | 
			
		||||
                      int y, int dx, const char* codes, const char* items, const char* flags)
 | 
			
		||||
 | 
			
		||||
WINDOW TMask::add_radio(short id, int page, const char* prompt, int x,
 | 
			
		||||
                        int y, int dx, const char* codes, const char* items, const char* flags)
 | 
			
		||||
{
 | 
			
		||||
  TRadio_field* f = new TRadio_field(this);
 | 
			
		||||
  f->replace_items(codes, items);
 | 
			
		||||
  f->construct(id, prompt, x, y, dx, _pagewin[page], flags, dx);
 | 
			
		||||
  _field.add(f);
 | 
			
		||||
  return ((TMask_field*)f)->win();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool TMask::save(bool append) const
 | 
			
		||||
 | 
			
		||||
@ -95,19 +95,18 @@ public:
 | 
			
		||||
  const TFilename& source_file() const { return _source_file; }
 | 
			
		||||
 | 
			
		||||
  // aggiunta campi a runtime
 | 
			
		||||
  void add_static (short id, int page, const char* prompt, int x, int y,
 | 
			
		||||
                   const char* flags = "");
 | 
			
		||||
  void add_string (short id, int page, const char* prompt, int x, int y,
 | 
			
		||||
                   int dim, const char* flags = "", int width = 0);
 | 
			
		||||
  void add_number (short id, int page, const char* prompt, int x, int y,
 | 
			
		||||
                   int dim,  const char* flags = "", int ndec = 0);
 | 
			
		||||
  void add_date   (short id, int page, const char* prompt, int x, int y,
 | 
			
		||||
                   const char* flags = "");
 | 
			
		||||
  void add_button (short id, int page, const char* prompt, int x, int y,
 | 
			
		||||
                   int dx = 9, int dy = 1, const char* flags = "");
 | 
			
		||||
 | 
			
		||||
  void add_radio(short id, int page, const char* prompt, int x, int y,
 | 
			
		||||
                 int dx, const char* codes, const char* items, const char* flags = "");
 | 
			
		||||
  WINDOW add_static (short id, int page, const char* prompt, int x, int y,
 | 
			
		||||
                     const char* flags = "");
 | 
			
		||||
  WINDOW add_string (short id, int page, const char* prompt, int x, int y,
 | 
			
		||||
                     int dim, const char* flags = "", int width = 0);
 | 
			
		||||
  WINDOW add_number (short id, int page, const char* prompt, int x, int y,
 | 
			
		||||
                     int dim,  const char* flags = "", int ndec = 0);
 | 
			
		||||
  WINDOW add_date   (short id, int page, const char* prompt, int x, int y,
 | 
			
		||||
                     const char* flags = "");
 | 
			
		||||
  WINDOW add_button (short id, int page, const char* prompt, int x, int y,
 | 
			
		||||
                     int dx = 9, int dy = 1, const char* flags = "");
 | 
			
		||||
  WINDOW add_radio(short id, int page, const char* prompt, int x, int y,
 | 
			
		||||
                   int dx, const char* codes, const char* items, const char* flags = "");
 | 
			
		||||
 | 
			
		||||
  int fields() const { return _field.items(); }
 | 
			
		||||
  int sheets() const { return _sheets; }
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
//      $Id: maskfld.cpp,v 1.68 1995-01-16 15:10:31 guy Exp $
 | 
			
		||||
//      $Id: maskfld.cpp,v 1.69 1995-01-18 14:40:52 guy Exp $
 | 
			
		||||
#include <xvt.h>
 | 
			
		||||
 | 
			
		||||
#include <applicat.h>
 | 
			
		||||
@ -1261,8 +1261,9 @@ int TBrowse::inputs()
 | 
			
		||||
{
 | 
			
		||||
  int inp = 0;
 | 
			
		||||
  for (const char* fld = _inp_id.get(0); fld; fld = _inp_id.get())
 | 
			
		||||
  {
 | 
			
		||||
    if (*fld != '"' && strchr(fld, '@') == NULL)
 | 
			
		||||
  {                                             
 | 
			
		||||
    
 | 
			
		||||
    if (*fld != '"' && strchr(fld, '@') == NULL && field(atoi(fld)).is_edit())
 | 
			
		||||
      inp++;
 | 
			
		||||
  }
 | 
			
		||||
  return inp;    
 | 
			
		||||
@ -2907,16 +2908,9 @@ const char* TList_field::get_window_data() const
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TList_field::set_field_data(const char* data)
 | 
			
		||||
{
 | 
			
		||||
  _str = data;
 | 
			
		||||
  if (_str.not_empty()) 
 | 
			
		||||
  {
 | 
			
		||||
    const int i = _codes.get_pos(_str);
 | 
			
		||||
    if (i < 0) 
 | 
			
		||||
      _str = _codes.get(0);
 | 
			
		||||
  }
 | 
			
		||||
  else
 | 
			
		||||
    _str = _codes.get(0);    
 | 
			
		||||
{         
 | 
			
		||||
  const int i = str2curr(data);
 | 
			
		||||
  _str = _codes.get(i);    
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool TList_field::on_hit()
 | 
			
		||||
 | 
			
		||||
@ -217,10 +217,6 @@ static void createwindow_hook(DWORD* exstyle, LPCSTR* classname, LPCSTR* windown
 | 
			
		||||
{
 | 
			
		||||
  if (_wc_type == WC_EDIT)
 | 
			
		||||
  {
 | 
			
		||||
    if (_bandiere & CTL_FLAG_RIGHT_JUST)
 | 
			
		||||
      *exstyle |= ES_MULTILINE | ES_RIGHT;
 | 
			
		||||
    if (_bandiere & CTL_FLAG_MAC_GENEVA9)
 | 
			
		||||
      *exstyle |= ES_UPPERCASE;
 | 
			
		||||
    if (_bandiere & CTL_FLAG_MAC_MONACO9)
 | 
			
		||||
      *exstyle |= ES_PASSWORD;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user