From 167570049ddc759aec8d62be8359e911c03766aa Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 1 Apr 2008 14:06:20 +0000 Subject: [PATCH] Patch level : 10.0 0020 Files correlati : Ricompilazione Demo : [ ] Commento : Sistemate le definizioni di XI_R4 git-svn-id: svn://10.65.10.50/trunk@16429 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg3600.cpp | 5 +---- include/controls.cpp | 16 +++++++++------- include/maskfld.cpp | 10 ++++++---- include/msksheet.cpp | 9 ++++----- include/progind.cpp | 4 +++- include/sheet.cpp | 7 ++----- include/virtkeyb.cpp | 1 - xi/xi.h | 7 +++---- 8 files changed, 28 insertions(+), 31 deletions(-) diff --git a/cg/cg3600.cpp b/cg/cg3600.cpp index 31298f672..a5496f8b3 100755 --- a/cg/cg3600.cpp +++ b/cg/cg3600.cpp @@ -807,11 +807,8 @@ TGrid_control::TGrid_control( listdef->app_data = (long)this; XI_LIST_DEF* l = listdef->v.list; -#ifdef XI_R4 l->min_heading_height = xi_button_calc_height_font(xi_get_system_font()) * lines_in_header; -#else - l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font()) * lines_in_header; -#endif +// l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font()) * lines_in_header; l->sizable_columns = true; l->movable_columns = true; l->fixed_columns = fixed_columns; diff --git a/include/controls.cpp b/include/controls.cpp index c8a7eedf5..e712fade7 100755 --- a/include/controls.cpp +++ b/include/controls.cpp @@ -284,11 +284,7 @@ XVT_FNTID xvt_load_default_font() return font; } -#ifdef XI_R4 -static byte event_map[XIE_XVT_POST_EVENT+1]; -#else -static byte event_map[XIE_POST_NAVIGATION+1]; -#endif +static byte event_map[XIE_LAST_EVENT]; enum event_action { a_ignore, a_xvt, a_xvt_post, a_obj, a_child, a_update, a_select, a_post, a_debug }; @@ -360,12 +356,14 @@ void init_controls() xi_set_pref(XI_PREF_NATIVE_CTRLS, NATIVE_CONTROLS); xi_set_pref(XI_PREF_3D_LOOK, CAMPI_SCAVATI); xi_set_pref(XI_PREF_CARET_WIDTH, 2); -#ifdef XI_R4 +//#ifdef XI_R4 xi_set_pref(XI_PREF_COMBO_ICON, ICO_COMBO); xi_set_pref(XI_PREF_OPTIMIZE_CELL_REQUESTS, true); +/* #else xi_set_pref(XI_PREF_COMBO_ICON, COMBO_ICON); #endif + */ xi_init(); @@ -1139,6 +1137,7 @@ void TControl::change_attrib(unsigned long mask, bool on, XI_OBJ* obj) else attr &= ~mask; if (attr != old_attr) // C'e' un vero cambiamento d'attributo { +/* #ifndef XI_R4 // Se la finestra e' chiusa e il campo e un bottone o e' editabile allora cambia l'attributo // senza ridisegnare il campo, il che provocherebbe problemi di funzionamento degli sheet @@ -1155,6 +1154,7 @@ void TControl::change_attrib(unsigned long mask, bool on, XI_OBJ* obj) } } #endif +*/ // Usa tranquillamente il metodo ortodosso xi_set_attrib(obj, attr); } @@ -1275,8 +1275,9 @@ void TText_control::set_caption(const char* text) xi_set_text(_obj, (char*)c); _obj->v.text->fore_color = color; -#ifdef XI_R4 +//#ifdef XI_R4 xi_set_obj_font_id(_obj, xvt_default_font(bold, big)); +/* #else FONT_OBJ* &font = _obj->v.text->font; @@ -1296,6 +1297,7 @@ void TText_control::set_caption(const char* text) } xi_invalidate_rect(parent(), &rct); #endif + */ } /////////////////////////////////////////////////////////// diff --git a/include/maskfld.cpp b/include/maskfld.cpp index 6349054fb..367e5d794 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -5020,13 +5020,13 @@ const char* TMemo_field::reformat(const char* data) const const char* TMemo_field::raw2win(const char* data) const { -#ifdef XI_R4 +//#ifdef XI_R4 if (strchr(data, '\r') == NULL) return data; TString& s = _ctl_data._park; s = data; s.replace('\r', '\n'); -#else +/* #else if (strchr(data, '\n') == NULL) return data; @@ -5034,14 +5034,15 @@ const char* TMemo_field::raw2win(const char* data) const s = data; for (int i = 0; s[i]; i++) if (s[i] == '\n') s[i] = '\r'; -#endif +#endif */ return s; } const char* TMemo_field::win2raw(const char* data) const { -#ifdef XI_R4 +//#ifdef XI_R4 return data; +/* #else if (strchr(data, '\r') == NULL) return data; @@ -5050,6 +5051,7 @@ const char* TMemo_field::win2raw(const char* data) const if (*s == '\r') *s = '\n'; return _ctl_data._park; #endif +*/ } bool TMemo_field::on_key(KEY k) diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 4ea190f25..1c5e4b41c 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -507,11 +507,8 @@ TSpreadsheet::TSpreadsheet( listdef->app_data = (long)this; XI_LIST_DEF* l = listdef->v.list; l->width = rct.right - rct.left; -#ifdef XI_R4 l->min_heading_height = xi_button_calc_height_font(xi_get_system_font()) * lines_in_header; -#else - l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font()) * lines_in_header; -#endif +// l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font()) * lines_in_header; l->sizable_columns = TRUE; l->movable_columns = TRUE; l->scroll_bar = TRUE; @@ -1436,13 +1433,15 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev) _edit_field->set_focusdirty(_cell_dirty = FALSE); // Azzera il flag di update_pending -#ifdef XI_R4 +//#ifdef XI_R4 XinEvent e; e.type = XinEventPaint; xi_eh(_obj->itf->v.itf->xin_win, &e); +/* #else EVENT e; e.type = E_UPDATE; xi_eh(_obj->itf->v.itf->xvt_win, &e); #endif +*/ owner().mask().notify_focus_field(id()); // Non si ripete mai abbastanza! } XI_OBJ row; diff --git a/include/progind.cpp b/include/progind.cpp index 6f2eefd5f..5c4493265 100755 --- a/include/progind.cpp +++ b/include/progind.cpp @@ -75,13 +75,15 @@ void TIndwin::set_text( // passato, quindi occorre dimensionare correttamente il primo passato // (es. inserire degli spazi) quando se ne prevede uno piu' lungo. { -#ifdef XI_R4 +//#ifdef XI_R4 _text->set_caption(t); +/* #else TString testo(t); testo.replace('\n', '\r'); _text->set_caption(testo); #endif +*/ } void TIndwin::setmax(long m) diff --git a/include/sheet.cpp b/include/sheet.cpp index a0066fc27..0b6efc12e 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -208,11 +208,8 @@ TSheet_control::TSheet_control( listdef->app_data = (long)this; XI_LIST_DEF* l = listdef->v.list; -#ifdef XI_R4 - l->min_heading_height = xi_button_calc_height_font(xi_get_system_font()) * lines_in_header; -#else - l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font()) * lines_in_header; -#endif + l->min_heading_height = xi_button_calc_height_font(xi_get_system_font()) * lines_in_header; +// l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font()) * lines_in_header; l->max_lines_in_cell = lines_in_cell; l->sizable_columns = TRUE; l->movable_columns = TRUE; diff --git a/include/virtkeyb.cpp b/include/virtkeyb.cpp index 0d9a0fb73..eafd1aa72 100755 --- a/include/virtkeyb.cpp +++ b/include/virtkeyb.cpp @@ -1,4 +1,3 @@ -#include #include #include #include diff --git a/xi/xi.h b/xi/xi.h index 007a6d67f..994588f18 100755 --- a/xi/xi.h +++ b/xi/xi.h @@ -672,13 +672,12 @@ typedef enum _xi_event_type XIE_COL_MOVE, XIE_COL_SIZE, XIE_DROP_ROW, -#if defined(XI_R3_COMPAT) || !defined(XI_R4_API) XIE_POST_NAVIGATION, +#if defined(XI_R3_COMPAT) || !defined(XI_R4_API) XIE_XVT_EVENT, - XIE_XVT_POST_EVENT -#else - XIE_POST_NAVIGATION + XIE_XVT_POST_EVENT, #endif + XIE_LAST_EVENT } XI_EVENT_TYPE;