From a7fb8fefed0eabde38366d59c2035324a8a7c6f2 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 18 Jan 1995 14:41:01 +0000 Subject: [PATCH] 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 --- include/mask.cpp | 31 +++++++++++++++++++------------ include/mask.h | 25 ++++++++++++------------- include/maskfld.cpp | 20 +++++++------------- include/xvtility.cpp | 4 ---- 4 files changed, 38 insertions(+), 42 deletions(-) diff --git a/include/mask.cpp b/include/mask.cpp index 4b4e787e7..5bf1eeb40 100755 --- a/include/mask.cpp +++ b/include/mask.cpp @@ -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 diff --git a/include/mask.h b/include/mask.h index 03ff0896a..2ec111083 100755 --- a/include/mask.h +++ b/include/mask.h @@ -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; } diff --git a/include/maskfld.cpp b/include/maskfld.cpp index f8bf89253..eb11b243b 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -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 #include @@ -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() diff --git a/include/xvtility.cpp b/include/xvtility.cpp index 20c14dadb..b6a1d9558 100755 --- a/include/xvtility.cpp +++ b/include/xvtility.cpp @@ -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; }