Modifiche aga

git-svn-id: svn://10.65.10.50/trunk@5760 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1997-12-17 10:50:23 +00:00
parent 18c8e52948
commit 97094231a5
7 changed files with 96 additions and 44 deletions

View File

@ -64,7 +64,7 @@ TKLDLIBS = -L$(XVTLIBP) -l$(LIBUI) -l$(LIBHLP) -l$(LIBTK) -lMrm -lXm -lXt -lX11
# Imakefile for 'xpoxm' archive. # Imakefile for 'xpoxm' archive.
# #
# $RCSfile: makefile.sgi,v $ # $RCSfile: makefile.sgi,v $
# $Revision: 1.1.1.1 $ $Date: 1997-12-17 10:43:21 $ # $Revision: 1.2 $ $Date: 1997-12-17 10:49:40 $
# #
# Relative paths to build area root directory, source and objects files. # Relative paths to build area root directory, source and objects files.

60
xi/xi.c
View File

@ -1022,11 +1022,16 @@ draw_field_button(XI_OBJ *xi_obj)
xvt_dwin_draw_rect(win, &rct); xvt_dwin_draw_rect(win, &rct);
} }
#endif #endif
if ((BOOLEAN)xi_get_pref(XI_PREF_3D_LOOK)) if ((BOOLEAN)xi_get_pref(XI_PREF_3D_LOOK))
xi_draw_3d_rect(win, &r, fd->down, 2, stxd->hilight_color, {
stxd->attrib & XI_ATR_ENABLED ? stxd->back_color : stxd->disabled_back_color, stxd->shadow_color); const COLOR color_light = aga_get_pref(AGA_PREF_BTN_COLOR_LIGHT);
else const COLOR color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL);
{ const COLOR color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK);
xi_draw_3d_rect(win, &r, fd->down, 2, color_light, color_ctrl, color_dark);
}
else
{
xi_set_cbrush(win, &white_cbrush); xi_set_cbrush(win, &white_cbrush);
xi_set_cpen(win, &hollow_cpen); xi_set_cpen(win, &hollow_cpen);
xi_draw_rect(win, &r); xi_draw_rect(win, &r);
@ -1448,7 +1453,13 @@ draw_list_button(WINDOW win, RCT *rct, BOOLEAN down)
r.bottom--; r.bottom--;
r.right--; r.right--;
if ((BOOLEAN)xi_get_pref(XI_PREF_3D_LOOK)) if ((BOOLEAN)xi_get_pref(XI_PREF_3D_LOOK))
xi_draw_3d_rect(win, &r, down, 2, 0L, 0L, 0L); {
const COLOR color_light = aga_get_pref(AGA_PREF_BTN_COLOR_LIGHT);
const COLOR color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL);
const COLOR color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK);
xi_draw_3d_rect(win, &r, down, 2, color_light, color_ctrl, color_dark);
}
else else
{ {
xi_set_cbrush(win, &white_cbrush); xi_set_cbrush(win, &white_cbrush);
@ -2883,6 +2894,9 @@ BOOLEAN checked, BOOLEAN box_only)
WINDOW win; WINDOW win;
XI_OBJ *itf; XI_OBJ *itf;
XI_ITF_DATA *id; XI_ITF_DATA *id;
COLOR color_light = 0L;
COLOR color_ctrl = 0L;
COLOR color_dark = 0L;
if (! visible) if (! visible)
return; return;
@ -2893,6 +2907,12 @@ BOOLEAN checked, BOOLEAN box_only)
win = xi_get_window(itf); win = xi_get_window(itf);
xvt_dwin_set_clip( win, NULL ); xvt_dwin_set_clip( win, NULL );
bd = xi_obj->v.btn; bd = xi_obj->v.btn;
if (bd->type == XIBT_BUTTON)
{
color_light = aga_get_pref(AGA_PREF_BTN_COLOR_LIGHT);
color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL);
color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK);
}
fore_color = COLOR_BLACK; fore_color = COLOR_BLACK;
fore_cp = black_cpen; fore_cp = black_cpen;
if (bd->fore_color) if (bd->fore_color)
@ -2944,7 +2964,7 @@ BOOLEAN checked, BOOLEAN box_only)
xvt_dwin_draw_rect(win, &rct); xvt_dwin_draw_rect(win, &rct);
} }
#endif #endif
xi_draw_3d_rect(win, &r, (BOOLEAN)(down || bd->checked), 2, 0L, 0L, 0L); xi_draw_3d_rect(win, &r, (BOOLEAN)(down || bd->checked), 2, color_light, color_ctrl, color_dark);
if (up_icon_rid) if (up_icon_rid)
{ {
int x, y; int x, y;
@ -2956,16 +2976,13 @@ BOOLEAN checked, BOOLEAN box_only)
xi_inflate_rect(&r2, -2); xi_inflate_rect(&r2, -2);
xi_set_clip(win, &r2); xi_set_clip(win, &r2);
if (down) if (down)
xi_draw_icon(win, x, y + 1, down_icon_rid, COLOR_BLACK, xi_draw_icon(win, x, y + 1, down_icon_rid, COLOR_BLACK, color_ctrl);
xi_get_pref(XI_PREF_COLOR_CTRL));
else else
{ {
if (enabled || ! disabled_icon_rid) if (enabled || ! disabled_icon_rid)
xi_draw_icon(win, x, y, up_icon_rid, COLOR_BLACK, xi_draw_icon(win, x, y, up_icon_rid, COLOR_BLACK, color_ctrl);
xi_get_pref(XI_PREF_COLOR_CTRL)); else
else xi_draw_icon(win, x, y, disabled_icon_rid, COLOR_BLACK, color_ctrl);
xi_draw_icon(win, x, y, disabled_icon_rid, COLOR_BLACK,
xi_get_pref(XI_PREF_COLOR_CTRL));
} }
xi_set_clip(win, NULL); xi_set_clip(win, NULL);
} }
@ -2973,7 +2990,7 @@ BOOLEAN checked, BOOLEAN box_only)
{ {
unsigned long attrib; unsigned long attrib;
RCT text_rect; RCT text_rect;
COLOR color; // COLOR color;
FONT_OBJ* fontp; FONT_OBJ* fontp;
attrib = XI_ATR_VCENTER | XI_ATR_HCENTER | XI_ATR_VISIBLE; attrib = XI_ATR_VCENTER | XI_ATR_HCENTER | XI_ATR_VISIBLE;
@ -2990,8 +3007,7 @@ BOOLEAN checked, BOOLEAN box_only)
xi_set_xvt_font(win, fontp, FALSE); xi_set_xvt_font(win, fontp, FALSE);
else else
xi_set_xvt_font(win, &xi_sysfont, FALSE); xi_set_xvt_font(win, &xi_sysfont, FALSE);
color = (COLOR)xi_get_pref(XI_PREF_COLOR_CTRL); xi_set_xvt_back_color(win, color_ctrl);
xi_set_xvt_back_color(win, color);
xi_draw_clipped_text(win, text, &text_rect, &text_rect, attrib, FALSE, 0, -1); xi_draw_clipped_text(win, text, &text_rect, &text_rect, attrib, FALSE, 0, -1);
} }
if ((focus) || (xi_obj->v.btn->packed)) if ((focus) || (xi_obj->v.btn->packed))
@ -3224,8 +3240,14 @@ BOOLEAN checked, BOOLEAN box_only)
xvt_font_destroy( font_id ); xvt_font_destroy( font_id );
} else } else
xi_set_xvt_font(win, fontp, FALSE); xi_set_xvt_font(win, fontp, FALSE);
color = (COLOR)xi_get_pref(XI_PREF_COLOR_CTRL);
xi_set_xvt_back_color(win, color); {
DRAW_CTOOLS ct;
xi_get_draw_ctools(win, &ct);
ct.opaque_text = FALSE;
xi_set_draw_ctools(win, &ct);
}
xi_draw_clipped_text(win, text, &tbrct, &tbrct, attrib, FALSE, 0, -1); xi_draw_clipped_text(win, text, &tbrct, &tbrct, attrib, FALSE, 0, -1);
/* Draw focus line, or erase focus line */ /* Draw focus line, or erase focus line */

15
xi/xi.h
View File

@ -285,8 +285,17 @@ typedef enum
XI_PREF_LASTPREF /* should always be last */ XI_PREF_LASTPREF /* should always be last */
} }
XI_PREF_TYPE; XI_PREF_TYPE;
typedef enum
{
AGA_PREF_BTN_COLOR_LIGHT,
AGA_PREF_BTN_COLOR_CTRL,
AGA_PREF_BTN_COLOR_DARK,
AGA_PREF_LASTPREF /* should always be last */
}
AGA_PREF_TYPE;
#define XI_NBR_PREFERENCES XI_PREF_LASTPREF #define XI_NBR_PREFERENCES XI_PREF_LASTPREF
#define AGA_NBR_PREFERENCES AGA_PREF_LASTPREF
/********************************** /**********************************
* XI Object definition structures * XI Object definition structures
@ -1355,11 +1364,11 @@ Tree module
void XVT_CALLCONV1 xi_tree_dbg XVT_CC_ARGS((char *title)); void XVT_CALLCONV1 xi_tree_dbg XVT_CC_ARGS((char *title));
void XVT_CALLCONV1 xi_tree_check_sanity XVT_CC_ARGS((char *title)); void XVT_CALLCONV1 xi_tree_check_sanity XVT_CC_ARGS((char *title));
void XVT_CALLCONV1 xi_tree_reg_error_fcn XVT_CC_ARGS((void (* fcn)(void))); void XVT_CALLCONV1 xi_tree_reg_error_fcn XVT_CC_ARGS((void (* fcn)(void)));
void XVT_CALLCONV1 aga_set_pref XVT_CC_ARGS((AGA_PREF_TYPE preftype, long value));
long XVT_CALLCONV1 aga_get_pref XVT_CC_ARGS((AGA_PREF_TYPE preftype));
#ifdef __cplusplus #ifdef __cplusplus
} }
// End of extern "C" // End of extern "C"
#endif #endif
#endif /* INCL_XI */ #endif /* INCL_XI */

View File

@ -1362,6 +1362,9 @@ lm_draw_3d_rect(LM_DATA *lmp, RCT *rctp, BOOLEAN well, int depth, BOOLEAN adj_v)
{ {
RCT r; RCT r;
BOOLEAN left, right; BOOLEAN left, right;
const COLOR color_light = aga_get_pref(AGA_PREF_BTN_COLOR_LIGHT);
const COLOR color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL);
const COLOR color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK);
r = *rctp; r = *rctp;
@ -1378,10 +1381,8 @@ lm_draw_3d_rect(LM_DATA *lmp, RCT *rctp, BOOLEAN well, int depth, BOOLEAN adj_v)
right = lm_adj_h(lmp, &r.right); right = lm_adj_h(lmp, &r.right);
if (! left && ! right) if (! left && ! right)
return; return;
xi_draw_3d_rect(lmp->win, &r, well, depth, 0L, 0L, 0L); xi_draw_3d_rect(lmp->win, &r, well, depth, color_light, color_ctrl, color_dark);
} }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
function: lm_draw_icon function: lm_draw_icon
lmp: current lmp lmp: current lmp
@ -1589,7 +1590,7 @@ BOOLEAN down, BOOLEAN clear_button)
r.right = min(r.right, col_rct.right); r.right = min(r.right, col_rct.right);
xi_get_draw_ctools(lmp->win, &ct); xi_get_draw_ctools(lmp->win, &ct);
ct.fore_color = lmp->enabled_color; ct.fore_color = lmp->enabled_color;
ct.back_color = xi_get_pref(XI_PREF_COLOR_CTRL); ct.back_color = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL);
ct.opaque_text = TRUE; ct.opaque_text = TRUE;
if (lmp->row_colors[row]) if (lmp->row_colors[row])
ct.fore_color = lmp->row_colors[row]; ct.fore_color = lmp->row_colors[row];
@ -1598,7 +1599,7 @@ BOOLEAN down, BOOLEAN clear_button)
xi_set_draw_ctools(lmp->win, &ct); xi_set_draw_ctools(lmp->win, &ct);
lm_draw_icon(lmp, r.left + cell_btn_icon_x, r.top + cell_btn_icon_y + down, lm_draw_icon(lmp, r.left + cell_btn_icon_x, r.top + cell_btn_icon_y + down,
button_icon_rid ? button_icon_rid : (int)xi_get_pref(XI_PREF_COMBO_ICON), button_icon_rid ? button_icon_rid : (int)xi_get_pref(XI_PREF_COMBO_ICON),
&r, clip_rct, TRUE, COLOR_BLACK, xi_get_pref(XI_PREF_COLOR_CTRL)); &r, clip_rct, TRUE, COLOR_BLACK, aga_get_pref(AGA_PREF_BTN_COLOR_CTRL));
} }
@ -2041,7 +2042,7 @@ draw_column_headings(LM_DATA *lmp, RCT *actual_rct)
back_color = lmp->disabled_back_color; back_color = lmp->disabled_back_color;
} }
if (col_data->heading_well || col_data->heading_platform) if (col_data->heading_well || col_data->heading_platform)
back_color = xi_get_pref(XI_PREF_COLOR_CTRL); back_color = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL);
xi_set_xvt_fore_color(win, fore_color); xi_set_xvt_fore_color(win, fore_color);
xi_set_xvt_back_color(win, back_color); xi_set_xvt_back_color(win, back_color);
} }
@ -2106,7 +2107,7 @@ draw_column_headings(LM_DATA *lmp, RCT *actual_rct)
back_color = lmp->disabled_back_color; back_color = lmp->disabled_back_color;
} }
if (col_data->heading_well || col_data->heading_platform) if (col_data->heading_well || col_data->heading_platform)
back_color = xi_get_pref(XI_PREF_COLOR_CTRL); back_color = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL);
lm_draw_icon(lmp, cell_rct.left + col_data->icon_x, lm_draw_icon(lmp, cell_rct.left + col_data->icon_x,
cell_rct.top + col_data->icon_y, col_data->icon_rid, cell_rct.top + col_data->icon_y, col_data->icon_rid,
&cell_rct, actual_rct, FALSE, fore_color, back_color); &cell_rct, actual_rct, FALSE, fore_color, back_color);
@ -2425,9 +2426,15 @@ TO OPTIMIZE BACKGROUND DRAWING, USE NEXT TWO LINES
rct.top = ri->prct.top; rct.top = ri->prct.top;
rct.bottom = ri->prct.bottom; rct.bottom = ri->prct.bottom;
if (column_data->column_well || column_data->column_platform) if (column_data->column_well || column_data->column_platform)
{
const COLOR color_light = aga_get_pref(AGA_PREF_BTN_COLOR_LIGHT);
const COLOR color_ctrl = aga_get_pref(AGA_PREF_BTN_COLOR_CTRL);
const COLOR color_dark = aga_get_pref(AGA_PREF_BTN_COLOR_DARK);
xi_draw_3d_rect(win, &rct, (BOOLEAN)(CELL_IS_SELECTED(lmp, row, col) ? ! column_data->column_well : xi_draw_3d_rect(win, &rct, (BOOLEAN)(CELL_IS_SELECTED(lmp, row, col) ? ! column_data->column_well :
column_data->column_well), 2, 0L, 0L, 0L); column_data->column_well), 2, 0L, 0L, 0L);
} }
}
} }
#else #else
for (col = 0; col < lmp->nbr_columns; ++col) for (col = 0; col < lmp->nbr_columns; ++col)
@ -5765,7 +5772,7 @@ Up arrow and down arrow work. If the focus is on a cell, the focus stays
Page up and down should work. Page up and down should work.
If the focus is on the last editable cell, and tab_wrap is set, then the If the focus is on the last editable cell, and tab_wrap is set, then the
focus moves to the next row. focus moves to the next row.
If the focus is on the last editable cell, and tab_wrap is not set, then If the focus is
the focus move to the current row. the focus move to the current row.
Have an option on a list by list basis, enter selects if a row has the Have an option on a list by list basis, enter selects if a row has the
focus. Enter will act like a double click selection. focus. Enter will act like a double click selection.
@ -5803,4 +5810,3 @@ make readonly cells
need colors for static text need colors for static text
want ability on XVT/CH to have single character fields. Eliminate the [ and ]. want ability on XVT/CH to have single character fields. Eliminate the [ and ].
*/ */

View File

@ -264,7 +264,7 @@ redraw_stx(STX stx, BOOLEAN update, BOOLEAN inside_only)
ct.pen = hollow_cpen; ct.pen = hollow_cpen;
inside_only = TRUE; inside_only = TRUE;
} }
ct.opaque_text = FALSE;
xi_set_draw_ctools(stxp->win, &ct); xi_set_draw_ctools(stxp->win, &ct);
/* TODO moved following two lines down */ /* TODO moved following two lines down */
@ -321,7 +321,10 @@ redraw_stx(STX stx, BOOLEAN update, BOOLEAN inside_only)
else else
{ {
/* draw cell text */ /* draw cell text */
const int old_bottom = rct.bottom;
get_text_rect(stx, &rct); get_text_rect(stx, &rct);
rct.bottom = old_bottom;
xi_draw_clipped_text(stxp->win, stxp->text, &rct, &rct, stxp->attrib, xi_draw_clipped_text(stxp->win, stxp->text, &rct, &rct, stxp->attrib,
TRUE, 0, -1); TRUE, 0, -1);
} }
@ -456,13 +459,15 @@ do_stx_cb(STX stx, STX_CB_TYPE cb_reason, EVENT *ep)
void void
stx_focus_cb(long stx, BOOLEAN set) stx_focus_cb(long stx, BOOLEAN set)
{ {
xvt_errmsg_sig_if(!(set != STXP(stx)->has_focus), if (set != STXP(stx)->has_focus)
NULL_WIN, SEV_FATAL, ERR_ASSERT_4, "30101", {
30101, "Internal focus error"); if (set)
if (set) stx_start_edit(stx);
stx_start_edit(stx); else
else stx_stop_edit(stx);
stx_stop_edit(stx); }
} }
/* /*
@ -1137,4 +1142,4 @@ stx_get_inside_rect( STX stx, RCT* rect )
xi_inflate_rect(rect, -2); xi_inflate_rect(rect, -2);
return rect; return rect;
} }

View File

@ -292,7 +292,8 @@ BOOLEAN do_border, BOOLEAN inverted)
ct->pen.pat = do_border ? PAT_SOLID : PAT_HOLLOW; ct->pen.pat = do_border ? PAT_SOLID : PAT_HOLLOW;
CTOS_END; CTOS_END;
#endif #endif
ct->opaque_text = TRUE; ct->opaque_text = FALSE; // Minchia!
*font = *txt->font; *font = *txt->font;
ct->mode = M_COPY; ct->mode = M_COPY;
return(ct); return(ct);
@ -1416,4 +1417,3 @@ txt_set_text(TXT_DATA *txt, char *s)

View File

@ -470,6 +470,7 @@ static long xi_preferences[XI_NBR_PREFERENCES] =
#endif #endif
}; };
static long aga_preferences[AGA_NBR_PREFERENCES] = { COLOR_LTGRAY, COLOR_GRAY, COLOR_DKGRAY};
RCT big_clip = { RCT big_clip = {
@ -956,6 +957,16 @@ void xi_set_pref(XI_PREF_TYPE preftype, long value)
xi_preferences[preftype] = value; xi_preferences[preftype] = value;
} }
long aga_get_pref(AGA_PREF_TYPE preftype)
{
return aga_preferences[preftype];
}
void aga_set_pref(AGA_PREF_TYPE preftype, long value)
{
aga_preferences[preftype] = value;
}
void void
xi_set_font_id(XVT_FNTID font_id) xi_set_font_id(XVT_FNTID font_id)
{ {
@ -4340,4 +4351,3 @@ BOOLEAN xi_get_xil_pref( XI_OBJ* obj )
return FALSE; return FALSE;
} }