From 9d3a868d0d39543d82cc62a979077f5b2ef9bdf9 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 26 May 2003 13:02:42 +0000 Subject: [PATCH] Patch level : 2.0 476 Files correlati : Ricompilazione Demo : [ ] Commento : Elininati tutti i riferimenti a WIN16 Aggiunto supporto per variabile ADVANCED_GRAPHICS, per dis/abilitare gli sfondi git-svn-id: svn://10.65.10.50/trunk@11187 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/applicat.cpp | 4 ++-- include/automask.cpp | 1 + include/ccustio.c | 3 ++- include/cfiles.c | 1 + include/codeb.c | 16 +++------------- include/colors.cpp | 4 ++-- include/colors.h | 6 ++++-- include/config.cpp | 2 +- include/controls.cpp | 2 ++ include/isam.cpp | 1 + include/printwin.cpp | 2 +- include/progind.cpp | 2 +- include/strings.cpp | 8 ++++---- include/strings.h | 2 +- include/utility.cpp | 2 +- include/window.cpp | 29 +---------------------------- 16 files changed, 28 insertions(+), 57 deletions(-) diff --git a/include/applicat.cpp b/include/applicat.cpp index c7dc152ff..6d186d9f3 100755 --- a/include/applicat.cpp +++ b/include/applicat.cpp @@ -179,8 +179,8 @@ HIDDEN const char* producer_name(TString& firm) HIDDEN long backdrop_eh(WINDOW win, EVENT* ep) { - XVT_DISPLAY_TYPE type = (XVT_DISPLAY_TYPE)xvt_vobj_get_attr(win, ATTR_DISPLAY_TYPE); - if (type == XVT_DISPLAY_DIRECT_COLOR) // True color (senza palette) + const XVT_DISPLAY_TYPE type = (XVT_DISPLAY_TYPE)xvt_vobj_get_attr(win, ATTR_DISPLAY_TYPE); + if (ADVANCED_GRAPHICS && type == XVT_DISPLAY_DIRECT_COLOR) { const int step = 6; RCT r; xvt_vobj_get_client_rect(win, &r); diff --git a/include/automask.cpp b/include/automask.cpp index ec1deaea1..d497e1d21 100755 --- a/include/automask.cpp +++ b/include/automask.cpp @@ -1,3 +1,4 @@ +#include #include bool TAutomask::error_box(const char* fmt, ...) diff --git a/include/ccustio.c b/include/ccustio.c index aa5946ba3..71bb9804e 100755 --- a/include/ccustio.c +++ b/include/ccustio.c @@ -5,7 +5,9 @@ #ifdef WIN32 #include #endif + #include + #ifdef LINUX #include #include @@ -14,7 +16,6 @@ #include #include #include -#include "modaut.h" #endif #define CalcPos(Rec, Len, Base) (((Rec) - 1) * ((RecNoType) (Len)) + ((RecNoType) (Base))) diff --git a/include/cfiles.c b/include/cfiles.c index ddd2c3c9d..6cab4f27f 100755 --- a/include/cfiles.c +++ b/include/cfiles.c @@ -1,5 +1,6 @@ #define __CFILES_C /* fv */ +#include #include #include "cfiles.h" diff --git a/include/codeb.c b/include/codeb.c index c4061247f..0764d32ad 100755 --- a/include/codeb.c +++ b/include/codeb.c @@ -21,11 +21,6 @@ #ifdef CB6 -#if XVT_OS == XVT_OS_WIN - #define S4DLL - #define S4WIN16 -#endif - #if XVT_OS == XVT_OS_WIN32 #define S4DLL #define S4WIN32 @@ -1202,16 +1197,11 @@ int DB_memowrite( const int handle, const char * fieldname, const char * data ) #else // CB6 -#if XVT_OS == XVT_OS_WIN +#if XVT_OS == XVT_OS_WIN32 #define S4DLL - #define S4WIN16 + #define S4WIN32 #else - #if XVT_OS == XVT_OS_WIN32 - #define S4DLL - #define S4WIN32 - #else - #define S4UNIX - #endif + #define S4UNIX #endif #include diff --git a/include/colors.cpp b/include/colors.cpp index 201d5a5d6..27e5c057d 100755 --- a/include/colors.cpp +++ b/include/colors.cpp @@ -302,8 +302,8 @@ void TSelect_color_mask::init(const char * mask_name, const char * para) TSelect_color_mask::TSelect_color_mask(const TSheet_field & field) : TVariable_mask("bagn007") { - TMask & m = field.mask(); - TString para("Colors"); + const TMask& m = field.mask(); + TString16 para("Colors"); const int num = field.sheet_mask().number() - 1; if (num > 0) para << num; diff --git a/include/colors.h b/include/colors.h index 1b8bb2dce..040d1848b 100755 --- a/include/colors.h +++ b/include/colors.h @@ -29,8 +29,10 @@ extern COLOR FOCUS_COLOR; extern COLOR FOCUS_BACK_COLOR; extern COLOR REQUIRED_BACK_COLOR; -extern bool CAMPI_SCAVATI; -extern bool AUTOSELECT; +extern bool CAMPI_SCAVATI; +extern bool ADVANCED_GRAPHICS; +extern bool AUTOSELECT; +extern bool SMALL_ICONS; const COLOR COLOR_DKCYAN = MAKE_COLOR(0,128,128); const COLOR COLOR_DKYELLOW = MAKE_COLOR(128,128, 0); diff --git a/include/config.cpp b/include/config.cpp index 0ddf044fc..a689ccfd8 100755 --- a/include/config.cpp +++ b/include/config.cpp @@ -161,7 +161,7 @@ void TConfig::_write_file() if (fexist(_file)) { - while (access(_file, 02) != 0) + while (xvt_fsys_access(_file, 02) != 0) message_box("Il file %s e' gia' in uso", (const char*)_file); } fcopy(temp, _file); // Copia dalla tempdir al nuovo .ini diff --git a/include/controls.cpp b/include/controls.cpp index 9aac689cb..df904ef79 100755 --- a/include/controls.cpp +++ b/include/controls.cpp @@ -36,6 +36,7 @@ COLOR REQUIRED_BACK_COLOR = MAKE_COLOR(255,255,156); bool CAMPI_SCAVATI = TRUE; bool AUTOSELECT = FALSE; +bool ADVANCED_GRAPHICS = TRUE; bool SMALL_ICONS=FALSE; HIDDEN bool _button_blocked = FALSE; @@ -254,6 +255,7 @@ void customize_colors() TOOL_BACK_COLOR = colors.get_color("ToolBack", NULL, -1, MASK_DARK_COLOR); CAMPI_SCAVATI = colors.get_bool("Campi3D", NULL, -1, CAMPI_SCAVATI); AUTOSELECT = colors.get_bool("AutoSelect", NULL, -1, AUTOSELECT); + ADVANCED_GRAPHICS = colors.get_bool("AdvancedGraphics", NULL, -1, ADVANCED_GRAPHICS); SMALL_ICONS = colors.get_bool("SmallIcons", NULL, -1, SMALL_ICONS); xi_set_pref(XI_PREF_COLOR_LIGHT, MASK_LIGHT_COLOR); diff --git a/include/isam.cpp b/include/isam.cpp index 128907684..15eb2889b 100755 --- a/include/isam.cpp +++ b/include/isam.cpp @@ -1,4 +1,5 @@ #include +#include #include #include diff --git a/include/printwin.cpp b/include/printwin.cpp index cd79ae998..dc64e362e 100755 --- a/include/printwin.cpp +++ b/include/printwin.cpp @@ -264,7 +264,7 @@ void TPrintwin::paint_row(long j) else { set_font(printer().fontname(), XVT_FS_NONE, _char_size); -#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_WIN32 +#if XVT_OS == XVT_OS_WIN32 // Questa e' la patch per TTY.DRV. if (j > 0 && (j % _realformlen) == 0) { diff --git a/include/progind.cpp b/include/progind.cpp index 377dc831e..48eeaf126 100755 --- a/include/progind.cpp +++ b/include/progind.cpp @@ -134,7 +134,7 @@ void TIndwin::update_bar() RCT b = r; const WINDOW w = win(); - if (CAMPI_SCAVATI) + if (ADVANCED_GRAPHICS) { // Rettangolo scavato xi_draw_3d_rect((XinWindow)w, (XinRect*)&r, TRUE, 2, diff --git a/include/strings.cpp b/include/strings.cpp index 6145b51cb..06556b2fa 100755 --- a/include/strings.cpp +++ b/include/strings.cpp @@ -1095,7 +1095,7 @@ bool TFilename::ok() const { switch(_str[c]) { -#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_WIN32 +#if XVT_OS == XVT_OS_WIN32 case ':': if (c != 1 || !isalpha(_str[0])) return FALSE; // Nome disco errato len = 0; @@ -1104,7 +1104,7 @@ bool TFilename::ok() const #endif case '/': if (ext) return FALSE; // Slash dopo estensione - if (len > 8) return FALSE; // Nome troppo lungo + if (len > _MAX_FNAME) return FALSE; // Nome troppo lungo if (!isalnum(_str[++c])) return FALSE; len = 1; break; @@ -1120,10 +1120,10 @@ bool TFilename::ok() const } } - if (ext && len > 3) + if (ext && len > _MAX_EXT) return FALSE; - return len > 0 && len < 9; + return len > 0 && len <= _MAX_FNAME; } // Certified 70% diff --git a/include/strings.h b/include/strings.h index a0a5cc5bd..5acaa8ffc 100755 --- a/include/strings.h +++ b/include/strings.h @@ -739,7 +739,7 @@ const TToken_string& empty_string(); __r = (__arr).pred(__r)) const char SLASH = -#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_WIN32 +#if XVT_OS == XVT_OS_WIN32 '\\'; #else '/'; diff --git a/include/utility.cpp b/include/utility.cpp index b69dfed7e..e97918ec4 100755 --- a/include/utility.cpp +++ b/include/utility.cpp @@ -74,7 +74,7 @@ bool fcopy( bool fexist( const char* file) // @parm Nome del file di cui contrallare l'esistenza { - int err = access(file, 0x00); + int err = xvt_fsys_access(file, 0x00); return err == 0; } diff --git a/include/window.cpp b/include/window.cpp index ebf69d1fd..5779fcf98 100755 --- a/include/window.cpp +++ b/include/window.cpp @@ -101,11 +101,6 @@ public: // @cmember Distruttore ~TWindow_manager(); - // @cmember Libera lo spazio per aprire il file (vedi

) - void free_handle(); - // @cmember Occupa lo spazio per aprire il file (vedi

) - void lock_handle(); - // @cmember Registra la finestra

corrente void reg(TWindow* m); // @cmember De-registra la finestra corrente @@ -125,13 +120,11 @@ public: TWindow_manager::TWindow_manager() : _current(-1), _lowhandle(NULL) { - lock_handle(); } TWindow_manager::~TWindow_manager() { destroy(); - free_handle(); } void TWindow_manager::destroy() @@ -144,25 +137,6 @@ void TWindow_manager::destroy() } } -void TWindow_manager::lock_handle() -{ -#if XVT_OS == XVT_OS_WIN - CHECK(_lowhandle == NULL, "Can't relock low handle"); - _lowhandle = fopen("con", "r"); - CHECK(_lowhandle != NULL, "Can't lock low handle"); -#endif -} - -void TWindow_manager::free_handle() -{ -#if XVT_OS == XVT_OS_WIN - CHECK(_lowhandle, "Can't unlock low handle"); - fclose(_lowhandle); - _lowhandle = NULL; -#endif -} - - bool TWindow_manager::can_close() const { bool ok = TRUE; @@ -171,7 +145,6 @@ bool TWindow_manager::can_close() const return ok; } - // Dis/abilitazione del menu principale HIDDEN void xvt_menu_enable(MENU_ITEM* m, bool on) { @@ -458,7 +431,7 @@ KEY TWindow::run() { do_events(); #if XVT_OS == XVT_OS_WIN32 - xvt_sys_sleep(10); + xvt_sys_sleep(50); #endif }