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
This commit is contained in:
alex 2008-04-01 14:06:20 +00:00
parent 94d905ef34
commit 167570049d
8 changed files with 28 additions and 31 deletions

View File

@ -807,11 +807,8 @@ TGrid_control::TGrid_control(
listdef->app_data = (long)this; listdef->app_data = (long)this;
XI_LIST_DEF* l = listdef->v.list; 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; 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;
l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font()) * lines_in_header;
#endif
l->sizable_columns = true; l->sizable_columns = true;
l->movable_columns = true; l->movable_columns = true;
l->fixed_columns = fixed_columns; l->fixed_columns = fixed_columns;

View File

@ -284,11 +284,7 @@ XVT_FNTID xvt_load_default_font()
return font; return font;
} }
#ifdef XI_R4 static byte event_map[XIE_LAST_EVENT];
static byte event_map[XIE_XVT_POST_EVENT+1];
#else
static byte event_map[XIE_POST_NAVIGATION+1];
#endif
enum event_action { a_ignore, a_xvt, a_xvt_post, a_obj, a_child, a_update, a_select, a_post, a_debug }; 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_NATIVE_CTRLS, NATIVE_CONTROLS);
xi_set_pref(XI_PREF_3D_LOOK, CAMPI_SCAVATI); xi_set_pref(XI_PREF_3D_LOOK, CAMPI_SCAVATI);
xi_set_pref(XI_PREF_CARET_WIDTH, 2); 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_COMBO_ICON, ICO_COMBO);
xi_set_pref(XI_PREF_OPTIMIZE_CELL_REQUESTS, true); xi_set_pref(XI_PREF_OPTIMIZE_CELL_REQUESTS, true);
/*
#else #else
xi_set_pref(XI_PREF_COMBO_ICON, COMBO_ICON); xi_set_pref(XI_PREF_COMBO_ICON, COMBO_ICON);
#endif #endif
*/
xi_init(); xi_init();
@ -1139,6 +1137,7 @@ void TControl::change_attrib(unsigned long mask, bool on, XI_OBJ* obj)
else attr &= ~mask; else attr &= ~mask;
if (attr != old_attr) // C'e' un vero cambiamento d'attributo if (attr != old_attr) // C'e' un vero cambiamento d'attributo
{ {
/*
#ifndef XI_R4 #ifndef XI_R4
// Se la finestra e' chiusa e il campo e un bottone o e' editabile allora cambia l'attributo // 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 // 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 #endif
*/
// Usa tranquillamente il metodo ortodosso // Usa tranquillamente il metodo ortodosso
xi_set_attrib(obj, attr); xi_set_attrib(obj, attr);
} }
@ -1275,8 +1275,9 @@ void TText_control::set_caption(const char* text)
xi_set_text(_obj, (char*)c); xi_set_text(_obj, (char*)c);
_obj->v.text->fore_color = color; _obj->v.text->fore_color = color;
#ifdef XI_R4 //#ifdef XI_R4
xi_set_obj_font_id(_obj, xvt_default_font(bold, big)); xi_set_obj_font_id(_obj, xvt_default_font(bold, big));
/*
#else #else
FONT_OBJ* &font = _obj->v.text->font; FONT_OBJ* &font = _obj->v.text->font;
@ -1296,6 +1297,7 @@ void TText_control::set_caption(const char* text)
} }
xi_invalidate_rect(parent(), &rct); xi_invalidate_rect(parent(), &rct);
#endif #endif
*/
} }
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////

View File

@ -5020,13 +5020,13 @@ const char* TMemo_field::reformat(const char* data) const
const char* TMemo_field::raw2win(const char* data) const const char* TMemo_field::raw2win(const char* data) const
{ {
#ifdef XI_R4 //#ifdef XI_R4
if (strchr(data, '\r') == NULL) if (strchr(data, '\r') == NULL)
return data; return data;
TString& s = _ctl_data._park; TString& s = _ctl_data._park;
s = data; s = data;
s.replace('\r', '\n'); s.replace('\r', '\n');
#else /* #else
if (strchr(data, '\n') == NULL) if (strchr(data, '\n') == NULL)
return data; return data;
@ -5034,14 +5034,15 @@ const char* TMemo_field::raw2win(const char* data) const
s = data; s = data;
for (int i = 0; s[i]; i++) for (int i = 0; s[i]; i++)
if (s[i] == '\n') s[i] = '\r'; if (s[i] == '\n') s[i] = '\r';
#endif #endif */
return s; return s;
} }
const char* TMemo_field::win2raw(const char* data) const const char* TMemo_field::win2raw(const char* data) const
{ {
#ifdef XI_R4 //#ifdef XI_R4
return data; return data;
/*
#else #else
if (strchr(data, '\r') == NULL) if (strchr(data, '\r') == NULL)
return data; return data;
@ -5050,6 +5051,7 @@ const char* TMemo_field::win2raw(const char* data) const
if (*s == '\r') *s = '\n'; if (*s == '\r') *s = '\n';
return _ctl_data._park; return _ctl_data._park;
#endif #endif
*/
} }
bool TMemo_field::on_key(KEY k) bool TMemo_field::on_key(KEY k)

View File

@ -507,11 +507,8 @@ TSpreadsheet::TSpreadsheet(
listdef->app_data = (long)this; listdef->app_data = (long)this;
XI_LIST_DEF* l = listdef->v.list; XI_LIST_DEF* l = listdef->v.list;
l->width = rct.right - rct.left; 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; 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;
l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font()) * lines_in_header;
#endif
l->sizable_columns = TRUE; l->sizable_columns = TRUE;
l->movable_columns = TRUE; l->movable_columns = TRUE;
l->scroll_bar = 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); _edit_field->set_focusdirty(_cell_dirty = FALSE);
// Azzera il flag di update_pending // Azzera il flag di update_pending
#ifdef XI_R4 //#ifdef XI_R4
XinEvent e; e.type = XinEventPaint; XinEvent e; e.type = XinEventPaint;
xi_eh(_obj->itf->v.itf->xin_win, &e); xi_eh(_obj->itf->v.itf->xin_win, &e);
/*
#else #else
EVENT e; e.type = E_UPDATE; EVENT e; e.type = E_UPDATE;
xi_eh(_obj->itf->v.itf->xvt_win, &e); xi_eh(_obj->itf->v.itf->xvt_win, &e);
#endif #endif
*/
owner().mask().notify_focus_field(id()); // Non si ripete mai abbastanza! owner().mask().notify_focus_field(id()); // Non si ripete mai abbastanza!
} }
XI_OBJ row; XI_OBJ row;

View File

@ -75,13 +75,15 @@ void TIndwin::set_text(
// passato, quindi occorre dimensionare correttamente il primo passato // passato, quindi occorre dimensionare correttamente il primo passato
// (es. inserire degli spazi) quando se ne prevede uno piu' lungo. // (es. inserire degli spazi) quando se ne prevede uno piu' lungo.
{ {
#ifdef XI_R4 //#ifdef XI_R4
_text->set_caption(t); _text->set_caption(t);
/*
#else #else
TString testo(t); TString testo(t);
testo.replace('\n', '\r'); testo.replace('\n', '\r');
_text->set_caption(testo); _text->set_caption(testo);
#endif #endif
*/
} }
void TIndwin::setmax(long m) void TIndwin::setmax(long m)

View File

@ -208,11 +208,8 @@ TSheet_control::TSheet_control(
listdef->app_data = (long)this; listdef->app_data = (long)this;
XI_LIST_DEF* l = listdef->v.list; 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; 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;
l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font()) * lines_in_header;
#endif
l->max_lines_in_cell = lines_in_cell; l->max_lines_in_cell = lines_in_cell;
l->sizable_columns = TRUE; l->sizable_columns = TRUE;
l->movable_columns = TRUE; l->movable_columns = TRUE;

View File

@ -1,4 +1,3 @@
#include <xi.h>
#include <controls.h> #include <controls.h>
#include <image.h> #include <image.h>
#include <virtkeyb.h> #include <virtkeyb.h>

View File

@ -672,13 +672,12 @@ typedef enum _xi_event_type
XIE_COL_MOVE, XIE_COL_MOVE,
XIE_COL_SIZE, XIE_COL_SIZE,
XIE_DROP_ROW, XIE_DROP_ROW,
#if defined(XI_R3_COMPAT) || !defined(XI_R4_API)
XIE_POST_NAVIGATION, XIE_POST_NAVIGATION,
#if defined(XI_R3_COMPAT) || !defined(XI_R4_API)
XIE_XVT_EVENT, XIE_XVT_EVENT,
XIE_XVT_POST_EVENT XIE_XVT_POST_EVENT,
#else
XIE_POST_NAVIGATION
#endif #endif
XIE_LAST_EVENT
} }
XI_EVENT_TYPE; XI_EVENT_TYPE;