Index: Xbae/README diff -c Xbae/README:1.22 Xbae/README:1.23 *** Xbae/README:1.22 Sat May 24 08:27:55 1997 --- Xbae/README Thu Jul 10 18:17:56 1997 *************** *** 1,16 **** # ! # $Date: 1997/05/23 22:27:55 $ # $Source: /usr/local/src/Xbae/README,v $ ! Xbae Library version 4.6.1 -------------------------- See the INSTALL file for installation procedure. ! Once again, comments, questions, bugs & postcards can be directed to ! Andrew Lister (lister@syd.net.au). This is a new address which will ! not be available until after June '97. The old address is ! lister@shadow.apana.org.au. Postcards will earn you a spot in the manual page and can be sent to --- 1,14 ---- # ! # $Date: 1997/07/10 08:17:56 $ # $Source: /usr/local/src/Xbae/README,v $ ! Xbae Library version 4.6.2 -------------------------- See the INSTALL file for installation procedure. ! Comments, questions, bugs & postcards can be directed to Andrew Lister ! (lister@syd.net.au). Postcards will earn you a spot in the manual page and can be sent to *************** *** 31,41 **** Also, take a look at the web page: ! http://xbae.syd.net.au - If that's not there, try: - - http://shadow.apana.org.au/~lister Documentation ------------- --- 29,36 ---- Also, take a look at the web page: ! http://www.xbae.syd.net.au Documentation ------------- *************** *** 97,150 **** for associating labels with individual XmTextField widgets. ! Changes in 4.6.1 ---------------- ! * Added a weeny patch from Callum Gibson (callum.gibson@aus.deuba.com) ! that fixed a problem when there are no rows and row 0 is accessed. ! * Philip Aston (philipa@parallax.co.uk) sent a patch in that missed out ! on the 4.6 release that handled null buttons when row or column label ! buttons were specified. Added that in. ! ! * Daiji Takamori (daijit@std.teradyne.com) suggested that all clip ! widgets should change their background colour - not just the main ! one. Made this change. ! ! * Steven Chase (schase@xpletive.mitre.org) provided two more public ! routines called XbaeMatrixGetColumnLabel() and ! XbaeMatrixGetRowLabel() which do what they imply. ! ! * Inspired by Steven's idea, I went ahead and wrote some companion ! routines called XbaeMatrixSetColumnLabel() and XbaeMatrixSetRowLabel() ! which remove the overhead and flicker of SetValues() as well as help ! me not to have to answer people who try to "swap" columns the wrong way. ! ! * Found a couple of public functions that weren't documented - ! XbaeMatrixSetRowUserData() and XbaeMatrixSetColumnUserData() and ! put them in the manual page. ! ! * Made an effort to support smooth scrolling. You'll now find that ! the last row, if not fully displayed is not blanked out as it was ! previously. Change suggested by Adam Kerrison ! (Adam.Kerrison@micromuse.co.uk) ! ! * Converted comments in the imake stuff to use XCOMM - apparently, it's the ! standard. ! ! * Fixed a redisplay problem when there are different coloured backgrounds/ ! foregrounds and rows are deleted. Found by Craig Bruenell ! (cbruenell@macaw.retix.com) ! ! * Added in a patch from Andy Warburton (andyw@parallax.co.uk) that fixed ! problems causing the SelectCell callback not to be called when the ! pointer was outside the matrix. ! ! * Howie Kaye (howie@columbia.edu) suggested a smoother method for ! scrolling when setting XmNtopRow. It prevents excessive redraws ! by using the matrix's internal scrolling methods. ! ! * Philip Aston (philipa@parallax.co.uk) had an idea that scrolling to ! the selected cell when in auto scroll mode should be disabled. I ! liked the idea, too. --- 92,106 ---- for associating labels with individual XmTextField widgets. ! Changes in 4.6.2 ---------------- ! * Heinz Nagel (heinznagel@lucent.com) discovered an uninitialised ! variable in Methods.c ! * Tim Bomgardner (Tim.Bomgardner@mci.com) found a clipping problem ! when a horizontal scrollbar and row labels are present. The ! row labels were being drawn to the left of the horizontal SB. + * Whilst fixing Tim's problem, I also found several other small + scrolling problems that were rectified Index: Xbae/Xbae.tmpl diff -c Xbae/Xbae.tmpl:1.16 Xbae/Xbae.tmpl:1.17 *** Xbae/Xbae.tmpl:1.16 Sun May 11 14:38:25 1997 --- Xbae/Xbae.tmpl Thu Jul 10 18:15:47 1997 *************** *** 1,8 **** XCOMM Copyright(c) 1992 Bell Communications Research, Inc. (Bellcore) XCOMM Copyright(c) 1995-97 Andrew Lister XCOMM ! XCOMM $Date: 1997/05/11 04:38:25 $ ! XCOMM $Id: Xbae.tmpl,v 1.16 1997/05/11 04:38:25 lister Exp $ #include "Xbae.rules" --- 1,8 ---- XCOMM Copyright(c) 1992 Bell Communications Research, Inc. (Bellcore) XCOMM Copyright(c) 1995-97 Andrew Lister XCOMM ! XCOMM $Date: 1997/07/10 08:15:47 $ ! XCOMM $Id: Xbae.tmpl,v 1.17 1997/07/10 08:15:47 lister Exp $ #include "Xbae.rules" *************** *** 120,132 **** XCOMM to override the definitions in Library.tmpl. Not recommended unless XCOMM you know what you're doing! The second one is for me. ! /* CDEBUGFLAGS=-g -Wall -pedantic -pedantic-errors -ansi /**/ XCOMM Version to make the shared library. Only used if DoSharedLib is set to XCOMM YES. Again, don't change this, unless you know what you are doing. ! XbaeSharedLibraryRevision=6.0 XBAEVERSION=4.6 --- 120,132 ---- XCOMM to override the definitions in Library.tmpl. Not recommended unless XCOMM you know what you're doing! The second one is for me. ! /* CDEBUGFLAGS=-O -Wall -pedantic -pedantic-errors -ansi /**/ XCOMM Version to make the shared library. Only used if DoSharedLib is set to XCOMM YES. Again, don't change this, unless you know what you are doing. ! XbaeSharedLibraryRevision=6.2 XBAEVERSION=4.6 Index: Xbae/src/Actions.c diff -c Xbae/src/Actions.c:1.12 Xbae/src/Actions.c:1.13 *** Xbae/src/Actions.c:1.12 Sat May 24 08:24:16 1997 --- Xbae/src/Actions.c Thu Jul 10 18:06:45 1997 *************** *** 21,27 **** * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT- * ING TO THE SOFTWARE. * ! * $Id: Actions.c,v 1.12 1997/05/23 22:24:16 lister Exp $ */ /* --- 21,27 ---- * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT- * ING TO THE SOFTWARE. * ! * $Id: Actions.c,v 1.13 1997/07/10 08:06:45 lister Exp $ */ /* *************** *** 752,758 **** if (q == QPointer) { ! CellType cellType; int x, y; /* --- 752,758 ---- if (q == QPointer) { ! CellType cellType = NonFixedCell; int x, y; /* Index: Xbae/src/Create.c diff -c Xbae/src/Create.c:1.4 Xbae/src/Create.c:1.5 *** Xbae/src/Create.c:1.4 Sat Feb 8 14:08:21 1997 --- Xbae/src/Create.c Sun Jul 6 21:42:49 1997 *************** *** 22,28 **** * * MatrixWidget Author: Andrew Wason, Bellcore, aw@bae.bellcore.com * ! * $Id: Create.c,v 1.4 1997/02/08 03:08:21 lister Exp $ */ /* --- 22,28 ---- * * MatrixWidget Author: Andrew Wason, Bellcore, aw@bae.bellcore.com * ! * $Id: Create.c,v 1.5 1997/07/06 11:42:49 lister Exp $ */ /* *************** *** 40,46 **** static Pixmap createInsensitivePixmap P(( XbaeMatrixWidget mw )); void ! xbaeCopyBackground( widget, offset, value ) Widget widget; int offset; XrmValue *value; --- 40,46 ---- static Pixmap createInsensitivePixmap P(( XbaeMatrixWidget mw )); void ! xbaeCopyBackground(widget, offset, value) Widget widget; int offset; XrmValue *value; *************** *** 50,56 **** void ! xbaeCopyForeground( widget, offset, value ) Widget widget; int offset; XrmValue *value; --- 50,56 ---- void ! xbaeCopyForeground(widget, offset, value) Widget widget; int offset; XrmValue *value; *************** *** 59,65 **** } void ! xbaeCopyDoubleClick( widget, offset, value ) Widget widget; int offset; XrmValue *value; --- 59,65 ---- } void ! xbaeCopyDoubleClick(widget, offset, value) Widget widget; int offset; XrmValue *value; *************** *** 112,126 **** empty_row = True; for (j = 0; j < mw->matrix.columns; j++) { ! if ( empty_row || !mw->matrix.cells[i][j]) { XtAppWarningMsg( XtWidgetToApplicationContext((Widget)mw), "copyCells", "badValue", "XbaeMatrix", "XbaeMatrix: NULL entry found in cell table", NULL, 0); ! for ( ;j < mw->matrix.columns; j++) ! copy[i][j] = XtNewString(""); } else copy[i][j] = XtNewString(mw->matrix.cells[i][j]); --- 112,126 ---- empty_row = True; for (j = 0; j < mw->matrix.columns; j++) { ! if (empty_row || !mw->matrix.cells[i][j]) { XtAppWarningMsg( XtWidgetToApplicationContext((Widget)mw), "copyCells", "badValue", "XbaeMatrix", "XbaeMatrix: NULL entry found in cell table", NULL, 0); ! for (;j < mw->matrix.columns; j++) ! copy[i][j] = XtNewString(""); } else copy[i][j] = XtNewString(mw->matrix.cells[i][j]); *************** *** 151,157 **** { copy[i] = (Widget *) XtCalloc((Cardinal)mw->matrix.columns, sizeof(Widget)); ! if( mw->matrix.cell_widgets ) for (j = 0; j < mw->matrix.columns; j++) if (mw->matrix.cell_widgets[i][j]) copy[i][j] = mw->matrix.cell_widgets[i][j]; --- 151,157 ---- { copy[i] = (Widget *) XtCalloc((Cardinal)mw->matrix.columns, sizeof(Widget)); ! if (mw->matrix.cell_widgets) for (j = 0; j < mw->matrix.columns; j++) if (mw->matrix.cell_widgets[i][j]) copy[i][j] = mw->matrix.cell_widgets[i][j]; *************** *** 499,505 **** if (mw->matrix.columns) { copy = (Boolean *) XtMalloc(mw->matrix.columns * ! sizeof(Boolean)); for (i = 0; i < mw->matrix.columns; i++) { --- 499,505 ---- if (mw->matrix.columns) { copy = (Boolean *) XtMalloc(mw->matrix.columns * ! sizeof(Boolean)); for (i = 0; i < mw->matrix.columns; i++) { *************** *** 519,525 **** if (mw->matrix.rows) { copy = (Boolean *) XtMalloc(mw->matrix.rows * ! sizeof(Boolean)); for (i = 0; i < mw->matrix.rows; i++) { --- 519,525 ---- if (mw->matrix.rows) { copy = (Boolean *) XtMalloc(mw->matrix.rows * ! sizeof(Boolean)); for (i = 0; i < mw->matrix.rows; i++) { *************** *** 553,559 **** "copyColumnLabelAlignments", "tooShort", "XbaeMatrix", "XbaeMatrix: Column label alignments array is too short", ! NULL, 0); copy[i] = XmALIGNMENT_BEGINNING; } else if (bad) --- 553,559 ---- "copyColumnLabelAlignments", "tooShort", "XbaeMatrix", "XbaeMatrix: Column label alignments array is too short", ! NULL, 0); copy[i] = XmALIGNMENT_BEGINNING; } else if (bad) *************** *** 596,602 **** } else for (i = 0; i < mw->matrix.rows; i++) { ! if (!badrow && !mw->matrix.colors[i] ) { badrow = True; XtAppWarningMsg( XtWidgetToApplicationContext((Widget)mw), --- 596,602 ---- } else for (i = 0; i < mw->matrix.rows; i++) { ! if (!badrow && !mw->matrix.colors[i]) { badrow = True; XtAppWarningMsg( XtWidgetToApplicationContext((Widget)mw), *************** *** 608,619 **** badcol = badrow; for (j = 0; j < mw->matrix.columns; j++) { ! if (badcol || mw->matrix.colors[i][j] == BAD_PIXEL ) { badcol = True; ! if ( j > 0 ) copy[i][j] = copy[i][j-1] ; ! else if ( i > 0 ) copy[i][j] = copy[i-1][j] ; else copy[i][j] = mw->manager.foreground; --- 608,619 ---- badcol = badrow; for (j = 0; j < mw->matrix.columns; j++) { ! if (badcol || mw->matrix.colors[i][j] == BAD_PIXEL) { badcol = True; ! if (j > 0) copy[i][j] = copy[i][j-1] ; ! else if (i > 0) copy[i][j] = copy[i-1][j] ; else copy[i][j] = mw->manager.foreground; *************** *** 655,663 **** for (i = 0; i < mw->matrix.rows; i++) { Boolean alt = (mw->matrix.alt_row_count && ! i >= (int)mw->matrix.fixed_rows) ? ( ! ( ( i - (int)mw->matrix.fixed_rows) / ! mw->matrix.alt_row_count) % 2 ) : False; /* * Assign the even and odd row colours appropriately. These --- 655,663 ---- for (i = 0; i < mw->matrix.rows; i++) { Boolean alt = (mw->matrix.alt_row_count && ! i >= (int)mw->matrix.fixed_rows) ? ( ! ((i - (int)mw->matrix.fixed_rows) / ! mw->matrix.alt_row_count) % 2) : False; /* * Assign the even and odd row colours appropriately. These *************** *** 666,678 **** * preserve the colours as they appear now */ for (j = 0; j < mw->matrix.columns; j++) ! copy[i][j] = ( alt ? mw->matrix.odd_row_background : ! mw->matrix.even_row_background ); } } else for (i = 0; i < mw->matrix.rows; i++) { ! if (!badrow && !mw->matrix.cell_background[i] ) { badrow = True; XtAppWarningMsg( XtWidgetToApplicationContext((Widget)mw), --- 666,678 ---- * preserve the colours as they appear now */ for (j = 0; j < mw->matrix.columns; j++) ! copy[i][j] = (alt ? mw->matrix.odd_row_background : ! mw->matrix.even_row_background); } } else for (i = 0; i < mw->matrix.rows; i++) { ! if (!badrow && !mw->matrix.cell_background[i]) { badrow = True; XtAppWarningMsg( XtWidgetToApplicationContext((Widget)mw), *************** *** 684,695 **** badcol = badrow; for (j = 0; j < mw->matrix.columns; j++) { ! if (badcol || mw->matrix.cell_background[i][j] == BAD_PIXEL ) { badcol = True; ! if ( j > 0 ) copy[i][j] = copy[i][j-1] ; ! else if ( i > 0 ) copy[i][j] = copy[i-1][j] ; else copy[i][j] = mw->core.background_pixel; --- 684,695 ---- badcol = badrow; for (j = 0; j < mw->matrix.columns; j++) { ! if (badcol || mw->matrix.cell_background[i][j] == BAD_PIXEL) { badcol = True; ! if (j > 0) copy[i][j] = copy[i][j-1] ; ! else if (i > 0) copy[i][j] = copy[i-1][j] ; else copy[i][j] = mw->core.background_pixel; *************** *** 738,744 **** for (j = 0; j < mw->matrix.columns; j++) { copy[i][j] = mw->matrix.selected_cells[i][j]; ! if( mw->matrix.selected_cells[i][j] ) mw->matrix.num_selected_cells++; } } --- 738,744 ---- for (j = 0; j < mw->matrix.columns; j++) { copy[i][j] = mw->matrix.selected_cells[i][j]; ! if (mw->matrix.selected_cells[i][j]) mw->matrix.num_selected_cells++; } } *************** *** 817,835 **** * XmNsensitive is set to False */ static Pixmap ! createInsensitivePixmap( mw ) XbaeMatrixWidget mw; { static char stippleBits[] = { 0x01, 0x02 }; ! static Pixmap stipple = ( Pixmap )NULL; ! if( !stipple ) { ! Screen *scr = XtScreen( mw ); ! stipple = XCreatePixmapFromBitmapData( DisplayOfScreen( scr ), ! RootWindowOfScreen( scr ), ! stippleBits, 2, 2, 0, 1, 1 ); } return stipple; } --- 817,835 ---- * XmNsensitive is set to False */ static Pixmap ! createInsensitivePixmap(mw) XbaeMatrixWidget mw; { static char stippleBits[] = { 0x01, 0x02 }; ! static Pixmap stipple = (Pixmap)NULL; ! if (!stipple) { ! Screen *scr = XtScreen(mw); ! stipple = XCreatePixmapFromBitmapData(DisplayOfScreen(scr), ! RootWindowOfScreen(scr), ! stippleBits, 2, 2, 0, 1, 1); } return stipple; } *************** *** 870,876 **** */ values.foreground = mw->manager.foreground; values.font = mw->matrix.font->fid; ! values.stipple = createInsensitivePixmap( mw ); mw->matrix.draw_gc = XCreateGC(XtDisplay(mw), GC_PARENT_WINDOW(mw), --- 870,876 ---- */ values.foreground = mw->manager.foreground; values.font = mw->matrix.font->fid; ! values.stipple = createInsensitivePixmap(mw); mw->matrix.draw_gc = XCreateGC(XtDisplay(mw), GC_PARENT_WINDOW(mw), *************** *** 886,892 **** values.foreground = mw->manager.foreground; values.graphics_exposures = False; ! values.stipple = createInsensitivePixmap( mw ); mw->matrix.pixmap_gc = XCreateGC(XtDisplay(mw), GC_PARENT_WINDOW(mw), --- 886,892 ---- values.foreground = mw->manager.foreground; values.graphics_exposures = False; ! values.stipple = createInsensitivePixmap(mw); mw->matrix.pixmap_gc = XCreateGC(XtDisplay(mw), GC_PARENT_WINDOW(mw), *************** *** 905,911 **** */ values.foreground = mw->manager.foreground; values.font = mw->matrix.label_font->fid; ! values.stipple = createInsensitivePixmap( mw ); mw->matrix.label_gc = XCreateGC(XtDisplay(mw), GC_PARENT_WINDOW(mw), mask, &values); --- 905,911 ---- */ values.foreground = mw->manager.foreground; values.font = mw->matrix.label_font->fid; ! values.stipple = createInsensitivePixmap(mw); mw->matrix.label_gc = XCreateGC(XtDisplay(mw), GC_PARENT_WINDOW(mw), mask, &values); *************** *** 923,929 **** */ values.foreground = mw->manager.foreground; values.font = mw->matrix.label_font->fid; ! values.stipple = createInsensitivePixmap( mw ); mw->matrix.label_clip_gc = XCreateGC(XtDisplay(mw), GC_PARENT_WINDOW(mw), mask, &values); --- 923,929 ---- */ values.foreground = mw->manager.foreground; values.font = mw->matrix.label_font->fid; ! values.stipple = createInsensitivePixmap(mw); mw->matrix.label_clip_gc = XCreateGC(XtDisplay(mw), GC_PARENT_WINDOW(mw), mask, &values); *************** *** 1201,1207 **** /* * Free each row of XtPointer pointers */ ! if( !mw->matrix.selected_cells ) return; for (i = 0; i < mw->matrix.rows; i++) --- 1201,1207 ---- /* * Free each row of XtPointer pointers */ ! if (!mw->matrix.selected_cells) return; for (i = 0; i < mw->matrix.rows; i++) *************** *** 1221,1227 **** { int i; ! if( !mw->matrix.highlighted_cells ) return; /* --- 1221,1227 ---- { int i; ! if (!mw->matrix.highlighted_cells) return; /* Index: Xbae/src/Draw.c diff -c Xbae/src/Draw.c:1.9 Xbae/src/Draw.c:1.10 *** Xbae/src/Draw.c:1.9 Thu Mar 13 19:22:25 1997 --- Xbae/src/Draw.c Sun Jul 6 21:44:04 1997 *************** *** 20,26 **** * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT- * ING TO THE SOFTWARE. * ! * $Id: Draw.c,v 1.9 1997/03/13 08:22:25 lister Exp $ */ #include --- 20,26 ---- * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT- * ING TO THE SOFTWARE. * ! * $Id: Draw.c,v 1.10 1997/07/06 11:44:04 lister Exp $ */ #include *************** *** 67,73 **** Widget w; unsigned char alignment = mw->matrix.column_alignments ? mw->matrix.column_alignments[ column ] : XmALIGNMENT_BEGINNING; ! Display *display = XtDisplay( mw ); GC gc; Window win = xbaeGetCellWindow(mw, &w, row, column); --- 67,73 ---- Widget w; unsigned char alignment = mw->matrix.column_alignments ? mw->matrix.column_alignments[ column ] : XmALIGNMENT_BEGINNING; ! Display *display = XtDisplay(mw); GC gc; Window win = xbaeGetCellWindow(mw, &w, row, column); *************** *** 83,89 **** gc = mw->matrix.pixmap_gc; ! XSetForeground( display, gc, bg); #if XmVersion >= 1002 /* --- 83,89 ---- gc = mw->matrix.pixmap_gc; ! XSetForeground(display, gc, bg); #if XmVersion >= 1002 /* *************** *** 99,106 **** } #endif ! XFillRectangle( display, win, gc, x, y, ! COLUMN_WIDTH(mw, column), ROW_HEIGHT(mw) ); XSetForeground(display, gc, fg); XSetBackground(display, gc, bg); --- 99,106 ---- } #endif ! XFillRectangle(display, win, gc, x, y, ! COLUMN_WIDTH(mw, column), ROW_HEIGHT(mw)); XSetForeground(display, gc, fg); XSetBackground(display, gc, bg); *************** *** 110,158 **** * y value.... */ dest_y = y; ! if( height > cell_height ) { /* Adjust the starting location in the src image */ ! src_y = ( height - cell_height ) / 2; copy_height = cell_height; } else { /* Adjust the destination point */ src_y = 0; ! dest_y += ( ( cell_height - height ) / 2 ); copy_height = height; } /* * Adjust the x value, paying attention to the columnAlignment */ ! if( width > cell_width ) copy_width = cell_width; else copy_width = width; ! switch( alignment ) { case XmALIGNMENT_BEGINNING: src_x = 0; break; case XmALIGNMENT_CENTER: ! if( width > cell_width ) ! src_x = ( width - cell_width ) / 2; else { src_x = 0; ! dest_x += ( ( cell_width - width ) / 2 ); } break; case XmALIGNMENT_END: ! if( width > cell_width ) src_x = width - cell_width; else { src_x = 0; ! dest_x = x + COLUMN_WIDTH( mw, column ) - TEXT_WIDTH_OFFSET( mw ) - width; } break; --- 110,158 ---- * y value.... */ dest_y = y; ! if (height > cell_height) { /* Adjust the starting location in the src image */ ! src_y = (height - cell_height) / 2; copy_height = cell_height; } else { /* Adjust the destination point */ src_y = 0; ! dest_y += ((cell_height - height) / 2); copy_height = height; } /* * Adjust the x value, paying attention to the columnAlignment */ ! if (width > cell_width) copy_width = cell_width; else copy_width = width; ! switch (alignment) { case XmALIGNMENT_BEGINNING: src_x = 0; break; case XmALIGNMENT_CENTER: ! if (width > cell_width) ! src_x = (width - cell_width) / 2; else { src_x = 0; ! dest_x += ((cell_width - width) / 2); } break; case XmALIGNMENT_END: ! if (width > cell_width) src_x = width - cell_width; else { src_x = 0; ! dest_x = x + COLUMN_WIDTH(mw, column) - TEXT_WIDTH_OFFSET(mw) - width; } break; *************** *** 161,191 **** /* * Draw the pixmap. Clip it, if necessary */ ! if( pixmap ) { ! if( depth > 1 ) /* A pixmap using xpm */ { ! if( mask ) { ! XSetClipMask( display, gc, mask ); ! XSetClipOrigin( display, gc, dest_x - src_x, dest_y - src_y ); } ! XCopyArea( display, pixmap, win, gc, src_x, src_y, copy_width, ! copy_height, dest_x, dest_y ); ! if( mask ) ! XSetClipMask( display, gc, None ); } else /* A plain old bitmap */ ! XCopyPlane( display, pixmap, win, gc, src_x, src_y, copy_width, ! copy_height, dest_x, dest_y, 1L ); } /* * If we need to fill the rest of the space, do so */ if (mw->matrix.grid_type == XmGRID_COLUMN_SHADOW && ! row == mw->matrix.rows - 1 && NEED_VERT_FILL( mw )) { int ax, ay; int fill_width, fill_height; --- 161,191 ---- /* * Draw the pixmap. Clip it, if necessary */ ! if (pixmap) { ! if (depth > 1) /* A pixmap using xpm */ { ! if (mask) { ! XSetClipMask(display, gc, mask); ! XSetClipOrigin(display, gc, dest_x - src_x, dest_y - src_y); } ! XCopyArea(display, pixmap, win, gc, src_x, src_y, copy_width, ! copy_height, dest_x, dest_y); ! if (mask) ! XSetClipMask(display, gc, None); } else /* A plain old bitmap */ ! XCopyPlane(display, pixmap, win, gc, src_x, src_y, copy_width, ! copy_height, dest_x, dest_y, 1L); } /* * If we need to fill the rest of the space, do so */ if (mw->matrix.grid_type == XmGRID_COLUMN_SHADOW && ! row == mw->matrix.rows - 1 && NEED_VERT_FILL(mw)) { int ax, ay; int fill_width, fill_height; *************** *** 195,202 **** */ xbaeCalcVertFill(mw, win, x, y, row, column, &ax, &ay, &fill_width, &fill_height); ! XFillRectangle( XtDisplay(mw), XtWindow(mw), gc, ! ax, ay, fill_width, fill_height ); } else if (mw->matrix.grid_type == XmGRID_ROW_SHADOW && column == mw->matrix.columns - 1 && NEED_HORIZ_FILL(mw)) --- 195,202 ---- */ xbaeCalcVertFill(mw, win, x, y, row, column, &ax, &ay, &fill_width, &fill_height); ! XFillRectangle(XtDisplay(mw), XtWindow(mw), gc, ! ax, ay, fill_width, fill_height); } else if (mw->matrix.grid_type == XmGRID_ROW_SHADOW && column == mw->matrix.columns - 1 && NEED_HORIZ_FILL(mw)) *************** *** 206,213 **** xbaeCalcHorizFill(mw, win, x, y, row, column, &ax, &ay, &fill_width, &fill_height); ! XFillRectangle( XtDisplay(mw), XtWindow(mw), gc, ! ax, ay, fill_width, fill_height ); } #if XmVersion >= 1002 --- 206,213 ---- xbaeCalcHorizFill(mw, win, x, y, row, column, &ax, &ay, &fill_width, &fill_height); ! XFillRectangle(XtDisplay(mw), XtWindow(mw), gc, ! ax, ay, fill_width, fill_height); } #if XmVersion >= 1002 *************** *** 218,225 **** cell_height, HIGHLIGHTING_SOMETHING); } #endif ! xbaeDrawCellShadow( mw, win, row, column, x, y, cell_width, ! cell_height, False, False, False ); } /* --- 218,225 ---- cell_height, HIGHLIGHTING_SOMETHING); } #endif ! xbaeDrawCellShadow(mw, win, row, column, x, y, cell_width, ! cell_height, False, False, False); } /* *************** *** 261,269 **** * * Make sure y coordinate is valid */ ! if ( (win == XtWindow(mw)) && ! ( (y > ( CLIP_VERT_VISIBLE_SPACE(mw) + ROW_LABEL_OFFSET(mw) - 1) ) || ! (y < ROW_LABEL_OFFSET(mw)) ) ) return; #endif gc = mw->matrix.draw_gc; --- 261,269 ---- * * Make sure y coordinate is valid */ ! if ((win == XtWindow(mw)) && ! ((y > (CLIP_VERT_VISIBLE_SPACE(mw) + ROW_LABEL_OFFSET(mw) - 1)) || ! (y < ROW_LABEL_OFFSET(mw)))) return; #endif gc = mw->matrix.draw_gc; *************** *** 286,303 **** * without duplicating work below */ if ((XtWindow(mw) != win) || ! ( !((XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ! ((mw->matrix.rows - 1) == row) && NEED_VERT_FILL( mw )) && ! !((XmGRID_ROW_SHADOW == mw->matrix.grid_type) && ! ((mw->matrix.columns - 1) == column) && NEED_HORIZ_FILL( mw )) ) ) ! XFillRectangle( XtDisplay(mw), win, gc, x, y, ! column_width, row_height ); /* * If we need to fill the rest of the space, do so */ if ((XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ! ((mw->matrix.rows - 1) == row) && NEED_VERT_FILL( mw )) { int ax, ay; int fill_width, fill_height; --- 286,303 ---- * without duplicating work below */ if ((XtWindow(mw) != win) || ! (!((XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ! ((mw->matrix.rows - 1) == row) && NEED_VERT_FILL(mw)) && ! !((XmGRID_ROW_SHADOW == mw->matrix.grid_type) && ! ((mw->matrix.columns - 1) == column) && NEED_HORIZ_FILL(mw)))) ! XFillRectangle(XtDisplay(mw), win, gc, x, y, ! column_width, row_height); /* * If we need to fill the rest of the space, do so */ if ((XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ! ((mw->matrix.rows - 1) == row) && NEED_VERT_FILL(mw)) { int ax, ay; int fill_width, fill_height; *************** *** 307,314 **** */ xbaeCalcVertFill(mw, win, x, y, row, column, &ax, &ay, &fill_width, &fill_height); ! XFillRectangle( XtDisplay(mw), XtWindow(mw), gc, ! ax, ay, fill_width, fill_height ); } else if (mw->matrix.grid_type == XmGRID_ROW_SHADOW && column == mw->matrix.columns - 1 && NEED_HORIZ_FILL(mw)) --- 307,314 ---- */ xbaeCalcVertFill(mw, win, x, y, row, column, &ax, &ay, &fill_width, &fill_height); ! XFillRectangle(XtDisplay(mw), XtWindow(mw), gc, ! ax, ay, fill_width, fill_height); } else if (mw->matrix.grid_type == XmGRID_ROW_SHADOW && column == mw->matrix.columns - 1 && NEED_HORIZ_FILL(mw)) *************** *** 318,325 **** xbaeCalcHorizFill(mw, win, x, y, row, column, &ax, &ay, &fill_width, &fill_height); ! XFillRectangle( XtDisplay(mw), XtWindow(mw), gc, ! ax, ay, fill_width, fill_height ); } /* --- 318,325 ---- xbaeCalcHorizFill(mw, win, x, y, row, column, &ax, &ay, &fill_width, &fill_height); ! XFillRectangle(XtDisplay(mw), XtWindow(mw), gc, ! ax, ay, fill_width, fill_height); } /* *************** *** 343,350 **** } #endif ! xbaeDrawCellShadow( mw, win, row, column, x, y, COLUMN_WIDTH(mw, column), ! ROW_HEIGHT(mw), False, False, False ); } #if CELL_WIDGETS /* --- 343,350 ---- } #endif ! xbaeDrawCellShadow(mw, win, row, column, x, y, COLUMN_WIDTH(mw, column), ! ROW_HEIGHT(mw), False, False, False); } #if CELL_WIDGETS /* *************** *** 371,380 **** */ xbaeRowColToXY(mw, row, column, &x, &y); ! gc = mw->matrix.draw_gc); XSetForeground(XtDisplay(mw), gc, bg); ! XFillRectangle( XtDisplay(mw), win, gc, x, y, ! COLUMN_WIDTH(mw, column), ROW_HEIGHT(mw) ); /* * Draw the widget in the cell. --- 371,380 ---- */ xbaeRowColToXY(mw, row, column, &x, &y); ! gc = mw->matrix.draw_gc; XSetForeground(XtDisplay(mw), gc, bg); ! XFillRectangle(XtDisplay(mw), win, gc, x, y, ! COLUMN_WIDTH(mw, column), ROW_HEIGHT(mw)); /* * Draw the widget in the cell. *************** *** 385,392 **** y + mw->matrix.cell_shadow_thickness + mw->matrix.cell_highlight_thickness); ! xbaeDrawCellShadow( mw, win, row, column, x, y, COLUMN_WIDTH(mw, column), ! ROW_HEIGHT(mw), False, clipped, False ); } #endif --- 385,392 ---- y + mw->matrix.cell_shadow_thickness + mw->matrix.cell_highlight_thickness); ! xbaeDrawCellShadow(mw, win, row, column, x, y, COLUMN_WIDTH(mw, column), ! ROW_HEIGHT(mw), False, clipped, False); } #endif *************** *** 398,404 **** (fs)->default_char : \ (c) - \ (fs)->min_char_or_byte2)].width : \ ! (fs)->min_bounds.width) /* --- 398,404 ---- (fs)->default_char : \ (c) - \ (fs)->min_char_or_byte2)].width : \ ! (fs)->min_bounds.width) /* *************** *** 407,419 **** */ void #if NeedFunctionPrototypes ! xbaeDrawString( XbaeMatrixWidget mw, Window win, GC gc, String string, ! int length, int x, int y, int maxlen, unsigned char alignment, ! Boolean highlight, Boolean bold, Boolean rowLabel, ! Boolean colLabel, Pixel color ) #else ! xbaeDrawString( mw, win, gc, string, length, x, y, maxlen, alignment, ! highlight, bold, rowLabel, colLabel, color ) XbaeMatrixWidget mw; Window win; GC gc; --- 407,419 ---- */ void #if NeedFunctionPrototypes ! xbaeDrawString(XbaeMatrixWidget mw, Window win, GC gc, String string, ! int length, int x, int y, int maxlen, unsigned char alignment, ! Boolean highlight, Boolean bold, Boolean rowLabel, ! Boolean colLabel, Pixel color) #else ! xbaeDrawString(mw, win, gc, string, length, x, y, maxlen, alignment, ! highlight, bold, rowLabel, colLabel, color) XbaeMatrixWidget mw; Window win; GC gc; *************** *** 435,441 **** Boolean choppedStart = False; Boolean choppedEnd = False; ! if( rowLabel || colLabel ) font = mw->matrix.label_font; else font = mw->matrix.font; --- 435,441 ---- Boolean choppedStart = False; Boolean choppedEnd = False; ! if (rowLabel || colLabel) font = mw->matrix.label_font; else font = mw->matrix.font; *************** *** 444,453 **** */ start = 0; ! if( !rowLabel ) ! maxwidth = maxlen * FONT_WIDTH(mw); ! else ! maxwidth = maxlen * LABEL_WIDTH(mw); width = XTextWidth(font, string, length); --- 444,453 ---- */ start = 0; ! if (!rowLabel) ! maxwidth = maxlen * FONT_WIDTH(mw); ! else ! maxwidth = maxlen * LABEL_WIDTH(mw); width = XTextWidth(font, string, length); *************** *** 572,610 **** */ XSetForeground(XtDisplay(mw), gc, color); ! if( mw->matrix.show_arrows && choppedEnd ) { XPoint points[ 3 ]; ! points[ 0 ].x = points[ 1 ].x = x + width - FONT_WIDTH( mw ); points[ 0 ].y = y + mw->matrix.font->max_bounds.descent; points[ 1 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT( mw ); points[ 2 ].x = x + width; points[ 2 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT( mw ) / 2; ! XFillPolygon( XtDisplay(mw), win, gc, points, 3, ! Convex, CoordModeOrigin ); /* Reduce the length to allow for our foreign character */ length--; } ! if( mw->matrix.show_arrows && choppedStart ) { XPoint points[ 3 ]; ! points[ 0 ].x = points[ 1 ].x = x + FONT_WIDTH( mw ); points[ 0 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT( mw ); points[ 1 ].y = y + mw->matrix.font->max_bounds.descent; points[ 2 ].x = x; points[ 2 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT( mw ) / 2; ! XFillPolygon( XtDisplay(mw), win, gc, points, 3, ! Convex, CoordModeOrigin ); /* Offset the start point so as to not draw on the triangle */ ! x += FONT_WIDTH( mw ); start++; length--; } --- 572,610 ---- */ XSetForeground(XtDisplay(mw), gc, color); ! if (mw->matrix.show_arrows && choppedEnd) { XPoint points[ 3 ]; ! points[ 0 ].x = points[ 1 ].x = x + width - FONT_WIDTH(mw); points[ 0 ].y = y + mw->matrix.font->max_bounds.descent; points[ 1 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT(mw); points[ 2 ].x = x + width; points[ 2 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT(mw) / 2; ! XFillPolygon(XtDisplay(mw), win, gc, points, 3, ! Convex, CoordModeOrigin); /* Reduce the length to allow for our foreign character */ length--; } ! if (mw->matrix.show_arrows && choppedStart) { XPoint points[ 3 ]; ! points[ 0 ].x = points[ 1 ].x = x + FONT_WIDTH(mw); points[ 0 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT(mw); points[ 1 ].y = y + mw->matrix.font->max_bounds.descent; points[ 2 ].x = x; points[ 2 ].y = y + mw->matrix.font->max_bounds.descent - ! TEXT_HEIGHT(mw) / 2; ! XFillPolygon(XtDisplay(mw), win, gc, points, 3, ! Convex, CoordModeOrigin); /* Offset the start point so as to not draw on the triangle */ ! x += FONT_WIDTH(mw); start++; length--; } *************** *** 641,654 **** Pixel *fg, *bg; { Boolean alt = mw->matrix.alt_row_count ? ! ( row / mw->matrix.alt_row_count ) % 2 : False; /* * Compute the background and foreground colours of the cell */ if (mw->matrix.selected_cells && mw->matrix.selected_cells[row][column]) ! if( mw->matrix.reverse_select ) ! if( mw->matrix.colors ) *bg = mw->matrix.colors[ row ][ column ]; else *bg = mw->manager.foreground; --- 641,654 ---- Pixel *fg, *bg; { Boolean alt = mw->matrix.alt_row_count ? ! (row / mw->matrix.alt_row_count) % 2 : False; /* * Compute the background and foreground colours of the cell */ if (mw->matrix.selected_cells && mw->matrix.selected_cells[row][column]) ! if (mw->matrix.reverse_select) ! if (mw->matrix.colors) *bg = mw->matrix.colors[ row ][ column ]; else *bg = mw->manager.foreground; *************** *** 667,680 **** } if (mw->matrix.selected_cells && mw->matrix.selected_cells[row][column]) ! if( mw->matrix.reverse_select ) ! if (mw->matrix.cell_background ) *fg = mw->matrix.cell_background[row][column]; else *fg = mw->core.background_pixel; else *fg = mw->matrix.selected_foreground; ! else if( mw->matrix.colors ) *fg = mw->matrix.colors[ row ][ column ]; else *fg = mw->manager.foreground; --- 667,680 ---- } if (mw->matrix.selected_cells && mw->matrix.selected_cells[row][column]) ! if (mw->matrix.reverse_select) ! if (mw->matrix.cell_background) *fg = mw->matrix.cell_background[row][column]; else *fg = mw->core.background_pixel; else *fg = mw->matrix.selected_foreground; ! else if (mw->matrix.colors) *fg = mw->matrix.colors[ row ][ column ]; else *fg = mw->manager.foreground; *************** *** 688,694 **** Pixel bg, fg; String string; ! if( mw->matrix.disable_redisplay ) return; xbaeComputeCellColors(mw, row, column, &fg, &bg); --- 688,694 ---- Pixel bg, fg; String string; ! if (mw->matrix.disable_redisplay) return; xbaeComputeCellColors(mw, row, column, &fg, &bg); *************** *** 696,726 **** #if CELL_WIDGETS if (mw->matrix.cell_widgets[row][column]) xbaeDrawCellWidget(mw, row, column, ! mw->matrix.cell_widgets[row][column], bg, fg ); else #endif ! if( !mw->matrix.draw_cell_callback ) ! { ! string = mw->matrix.cells ? mw->matrix.cells[row][column] : ""; ! xbaeDrawCellString(mw, row, column, string, bg, fg); ! } ! else ! { ! Pixmap pixmap; ! Pixmap mask; ! XbaeCellType type; ! int width, height; ! int depth; ! ! type = xbaeGetDrawCellValue( mw, row, column, &string, &pixmap, ! &mask, &width, &height, &bg, &fg, &depth); ! if ( type == XbaeString) xbaeDrawCellString(mw, row, column, string, bg, fg); ! else if( type == XbaePixmap ) ! xbaeDrawCellPixmap(mw, row, column, pixmap, mask, width, ! height, bg, fg, depth); ! } } XbaeCellType --- 696,726 ---- #if CELL_WIDGETS if (mw->matrix.cell_widgets[row][column]) xbaeDrawCellWidget(mw, row, column, ! mw->matrix.cell_widgets[row][column], bg, fg); else #endif ! if (!mw->matrix.draw_cell_callback) ! { ! string = mw->matrix.cells ? mw->matrix.cells[row][column] : ""; xbaeDrawCellString(mw, row, column, string, bg, fg); ! } ! else ! { ! Pixmap pixmap; ! Pixmap mask; ! XbaeCellType type; ! int width, height; ! int depth; ! ! type = xbaeGetDrawCellValue(mw, row, column, &string, &pixmap, ! &mask, &width, &height, &bg, &fg, &depth); ! if (type == XbaeString) ! xbaeDrawCellString(mw, row, column, string, bg, fg); ! else if (type == XbaePixmap) ! xbaeDrawCellPixmap(mw, row, column, pixmap, mask, width, ! height, bg, fg, depth); ! } } XbaeCellType *************** *** 757,776 **** *mask = cbd.mask; *string = cbd.string ? cbd.string : ""; /* Handle NULL strings */ ! if( mw->matrix.reverse_select && mw->matrix.selected_cells && ! mw->matrix.selected_cells[row][column] ) { /* * if colours were set by the draw cell callback, handle reverse * selection */ ! if( *bg != cbd.background ) { if (*fg != cbd.foreground) *bg = cbd.foreground; *fg = cbd.background; } ! else if( *fg != cbd.foreground ) *bg = cbd.foreground; } else --- 757,776 ---- *mask = cbd.mask; *string = cbd.string ? cbd.string : ""; /* Handle NULL strings */ ! if (mw->matrix.reverse_select && mw->matrix.selected_cells && ! mw->matrix.selected_cells[row][column]) { /* * if colours were set by the draw cell callback, handle reverse * selection */ ! if (*bg != cbd.background) { if (*fg != cbd.foreground) *bg = cbd.foreground; *fg = cbd.background; } ! else if (*fg != cbd.foreground) *bg = cbd.foreground; } else *************** *** 783,798 **** if (cbd.type == XbaePixmap) { ! if( *mask == XmUNSPECIFIED_PIXMAP || *mask == BadPixmap ) cbd.mask = 0; ! if( *pixmap == XmUNSPECIFIED_PIXMAP || *pixmap == BadPixmap ) { XtAppWarningMsg( XtWidgetToApplicationContext((Widget)mw), "drawCellCallback", "Pixmap", "XbaeMatrix", "XbaeMatrix: Bad pixmap passed from drawCellCallback", ! NULL, 0 ); cbd.type = XbaeString; *string = ""; } --- 783,798 ---- if (cbd.type == XbaePixmap) { ! if (*mask == XmUNSPECIFIED_PIXMAP || *mask == BadPixmap) cbd.mask = 0; ! if (*pixmap == XmUNSPECIFIED_PIXMAP || *pixmap == BadPixmap) { XtAppWarningMsg( XtWidgetToApplicationContext((Widget)mw), "drawCellCallback", "Pixmap", "XbaeMatrix", "XbaeMatrix: Bad pixmap passed from drawCellCallback", ! NULL, 0); cbd.type = XbaeString; *string = ""; } *************** *** 804,813 **** unsigned int border_width_return; unsigned int depth_return; ! if( XGetGeometry( XtDisplay( mw ), *pixmap, &root_return, ! &x_return, &y_return, &width_return, ! &height_return, &border_width_return, ! &depth_return ) ) { *width = width_return; *height = height_return; --- 804,813 ---- unsigned int border_width_return; unsigned int depth_return; ! if (XGetGeometry(XtDisplay(mw), *pixmap, &root_return, ! &x_return, &y_return, &width_return, ! &height_return, &border_width_return, ! &depth_return)) { *width = width_return; *height = height_return; *************** *** 824,830 **** */ void #if NeedFunctionPrototypes ! xbaeDrawColumnLabel( XbaeMatrixWidget mw, int column, Boolean pressed) #else xbaeDrawColumnLabel(mw, column, pressed) XbaeMatrixWidget mw; --- 824,830 ---- */ void #if NeedFunctionPrototypes ! xbaeDrawColumnLabel(XbaeMatrixWidget mw, int column, Boolean pressed) #else xbaeDrawColumnLabel(mw, column, pressed) XbaeMatrixWidget mw; *************** *** 898,904 **** { XSetForeground(XtDisplay(mw), gc, mw->matrix.button_label_background); XFillRectangle(XtDisplay(mw), win, gc, buttonX, HORIZ_SB_OFFSET(mw), ! COLUMN_WIDTH(mw, column), COLUMN_LABEL_HEIGHT(mw) ); } XSetForeground(XtDisplay(mw), gc, mw->matrix.column_label_color); --- 898,904 ---- { XSetForeground(XtDisplay(mw), gc, mw->matrix.button_label_background); XFillRectangle(XtDisplay(mw), win, gc, buttonX, HORIZ_SB_OFFSET(mw), ! COLUMN_WIDTH(mw, column), COLUMN_LABEL_HEIGHT(mw)); } XSetForeground(XtDisplay(mw), gc, mw->matrix.column_label_color); *************** *** 909,931 **** if (label[ 0 ] != '\0') for (i = 0; i < mw->matrix.column_label_lines[column].lines; i++) { ! xbaeDrawString( mw, XtWindow(mw), gc, label, ! mw->matrix.column_label_lines[column].lengths[i], ! labelX, labelY, mw->matrix.column_widths[column], ! mw->matrix.column_label_alignments ? ! mw->matrix.column_label_alignments[column] : ! XmALIGNMENT_BEGINNING, False, ! mw->matrix.bold_labels, False, True, ! mw->matrix.column_label_color ); labelY += LABEL_HEIGHT(mw); label += mw->matrix.column_label_lines[column].lengths[i] + 1; } if (button) ! xbaeDrawCellShadow( mw, XtWindow(mw), -1, column, ! buttonX, HORIZ_SB_OFFSET(mw), ! COLUMN_WIDTH( mw, column ), ! COLUMN_LABEL_HEIGHT(mw), True, clipped, pressed ); } /* --- 909,931 ---- if (label[ 0 ] != '\0') for (i = 0; i < mw->matrix.column_label_lines[column].lines; i++) { ! xbaeDrawString(mw, XtWindow(mw), gc, label, ! mw->matrix.column_label_lines[column].lengths[i], ! labelX, labelY, mw->matrix.column_widths[column], ! mw->matrix.column_label_alignments ? ! mw->matrix.column_label_alignments[column] : ! XmALIGNMENT_BEGINNING, False, ! mw->matrix.bold_labels, False, True, ! mw->matrix.column_label_color); labelY += LABEL_HEIGHT(mw); label += mw->matrix.column_label_lines[column].lengths[i] + 1; } if (button) ! xbaeDrawCellShadow(mw, XtWindow(mw), -1, column, ! buttonX, HORIZ_SB_OFFSET(mw), ! COLUMN_WIDTH(mw, column), ! COLUMN_LABEL_HEIGHT(mw), True, clipped, pressed); } /* *************** *** 934,940 **** */ void #if NeedFunctionPrototypes ! xbaeDrawRowLabel( XbaeMatrixWidget mw, int row, Boolean pressed ) #else xbaeDrawRowLabel(mw, row, pressed) XbaeMatrixWidget mw; --- 934,940 ---- */ void #if NeedFunctionPrototypes ! xbaeDrawRowLabel(XbaeMatrixWidget mw, int row, Boolean pressed) #else xbaeDrawRowLabel(mw, row, pressed) XbaeMatrixWidget mw; *************** *** 945,950 **** --- 945,952 ---- int y; GC gc; Window win = XtWindow(mw); + Boolean clipped = (row >= (int)mw->matrix.fixed_rows && + row < TRAILING_VERT_ORIGIN(mw)); Boolean button = mw->matrix.button_labels || (mw->matrix.row_button_labels && mw->matrix.row_button_labels[row]); *************** *** 966,979 **** y = ROW_LABEL_OFFSET(mw) + ROW_HEIGHT(mw) * (row - VERT_ORIGIN(mw)) + LABEL_Y_OFFSET(mw); ! gc = mw->matrix.label_gc; if (button) { XSetForeground(XtDisplay(mw), gc, mw->matrix.button_label_background); XFillRectangle(XtDisplay(mw), win, gc, VERT_SB_OFFSET(mw), y - TEXT_Y_OFFSET(mw), ROW_LABEL_WIDTH(mw), ! ROW_HEIGHT(mw) ); } XSetForeground(XtDisplay(mw), gc, mw->matrix.row_label_color); --- 968,984 ---- y = ROW_LABEL_OFFSET(mw) + ROW_HEIGHT(mw) * (row - VERT_ORIGIN(mw)) + LABEL_Y_OFFSET(mw); ! if (clipped) ! gc = mw->matrix.label_clip_gc; ! else ! gc = mw->matrix.label_gc; if (button) { XSetForeground(XtDisplay(mw), gc, mw->matrix.button_label_background); XFillRectangle(XtDisplay(mw), win, gc, VERT_SB_OFFSET(mw), y - TEXT_Y_OFFSET(mw), ROW_LABEL_WIDTH(mw), ! ROW_HEIGHT(mw)); } XSetForeground(XtDisplay(mw), gc, mw->matrix.row_label_color); *************** *** 990,996 **** mw->matrix.row_label_color); if (button) ! xbaeDrawCellShadow( mw, win, row, -1, VERT_SB_OFFSET(mw), ! y - TEXT_Y_OFFSET(mw), ROW_LABEL_WIDTH(mw), ! ROW_HEIGHT(mw), True, False, pressed ); } --- 995,1001 ---- mw->matrix.row_label_color); if (button) ! xbaeDrawCellShadow(mw, win, row, -1, VERT_SB_OFFSET(mw), ! y - TEXT_Y_OFFSET(mw), ROW_LABEL_WIDTH(mw), ! ROW_HEIGHT(mw), True, clipped, pressed); } Index: Xbae/src/Macros.h diff -c Xbae/src/Macros.h:1.9 Xbae/src/Macros.h:1.10 *** Xbae/src/Macros.h:1.9 Sat May 3 11:15:50 1997 --- Xbae/src/Macros.h Thu Jul 10 18:08:05 1997 *************** *** 21,27 **** * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT- * ING TO THE SOFTWARE. * ! * $Id: Macros.h,v 1.9 1997/05/03 01:15:50 lister Exp $ */ /* --- 21,27 ---- * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT- * ING TO THE SOFTWARE. * ! * $Id: Macros.h,v 1.10 1997/07/10 08:08:05 lister Exp $ */ /* *************** *** 210,216 **** #define FILL_VERT_HEIGHT(mw) ( mw->core.height - VISIBLE_HEIGHT(mw) - \ TRAILING_FIXED_ROW_HEIGHT(mw) - \ - HORIZ_SB_SPACE(mw) - \ FIXED_ROW_LABEL_OFFSET(mw) - \ mw->manager.shadow_thickness ) --- 210,215 ---- Index: Xbae/src/Methods.c diff -c Xbae/src/Methods.c:1.16 Xbae/src/Methods.c:1.17 *** Xbae/src/Methods.c:1.16 Sat Jun 14 14:04:18 1997 --- Xbae/src/Methods.c Thu Jul 10 18:09:36 1997 *************** *** 20,26 **** * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT- * ING TO THE SOFTWARE. * ! * $Id: Methods.c,v 1.16 1997/06/14 04:04:18 lister Exp $ */ /* --- 20,26 ---- * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT- * ING TO THE SOFTWARE. * ! * $Id: Methods.c,v 1.17 1997/07/10 08:09:36 lister Exp $ */ /* *************** *** 3107,3112 **** --- 3107,3114 ---- haveVSB = XtIsManaged(VertScrollChild(mw)); haveHSB = XtIsManaged(HorizScrollChild(mw)); + + maxlines = mw->matrix.column_label_maxlines; /* * Delete the new columns from the internal cells/labels data structure. Index: Xbae/src/ScrollMgr.c diff -c Xbae/src/ScrollMgr.c:1.9 Xbae/src/ScrollMgr.c:1.10 *** Xbae/src/ScrollMgr.c:1.9 Thu Mar 13 19:23:55 1997 --- Xbae/src/ScrollMgr.c Thu Jul 10 18:06:01 1997 *************** *** 20,26 **** * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT- * ING TO THE SOFTWARE. * ! * $Id: ScrollMgr.c,v 1.9 1997/03/13 08:23:55 lister Exp $ */ /* --- 20,26 ---- * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT- * ING TO THE SOFTWARE. * ! * $Id: ScrollMgr.c,v 1.10 1997/07/10 08:06:01 lister Exp $ */ /* *************** *** 347,354 **** /* * Clear the trailing filled rows, if necessary */ ! if ( (XmGRID_ROW_SHADOW == mw->matrix.grid_type) && ! NEED_HORIZ_FILL( mw ) ) XClearArea(XtDisplay(mw), XtWindow(mw), trailing_fixed_column_label_offset + trailing_fixed_column_width, --- 347,354 ---- /* * Clear the trailing filled rows, if necessary */ ! if ((XmGRID_ROW_SHADOW == mw->matrix.grid_type) && ! NEED_HORIZ_FILL(mw)) XClearArea(XtDisplay(mw), XtWindow(mw), trailing_fixed_column_label_offset + trailing_fixed_column_width, *************** *** 446,457 **** mw->matrix.draw_gc, vert_sb_offset, src_y, row_label_width, height, ! 0, dest_y); /* * Copy trailing filled portion of the rows if necessary */ ! if ( (XmGRID_ROW_SHADOW == mw->matrix.grid_type) && ! NEED_HORIZ_FILL( mw ) ) { XCopyArea(XtDisplay(mw), XtWindow(mw), XtWindow(mw), mw->matrix.draw_gc, --- 446,457 ---- mw->matrix.draw_gc, vert_sb_offset, src_y, row_label_width, height, ! vert_sb_offset, dest_y); /* * Copy trailing filled portion of the rows if necessary */ ! if ((mw->matrix.grid_type == XmGRID_ROW_SHADOW) && ! NEED_HORIZ_FILL(mw)) { XCopyArea(XtDisplay(mw), XtWindow(mw), XtWindow(mw), mw->matrix.draw_gc, *************** *** 467,480 **** */ if (XtIsManaged(LeftClip(mw))) XClearArea(XtDisplay(mw), XtWindow(LeftClip(mw)), ! vert_sb_offset, y_clear, 0 /* Full Width */, ClipChild(mw)->core.height - height, False); /* * Clear newly scrolled chunk of trailing fixed columns on RightClip */ if (XtIsManaged(RightClip(mw))) XClearArea(XtDisplay(mw), XtWindow(RightClip(mw)), ! vert_sb_offset, y_clear, 0 /* Full Width */, ClipChild(mw)->core.height - height, False); /* * Translate coordinates for row labels on Matrix --- 467,480 ---- */ if (XtIsManaged(LeftClip(mw))) XClearArea(XtDisplay(mw), XtWindow(LeftClip(mw)), ! 0, y_clear, 0 /* Full Width */, ClipChild(mw)->core.height - height, False); /* * Clear newly scrolled chunk of trailing fixed columns on RightClip */ if (XtIsManaged(RightClip(mw))) XClearArea(XtDisplay(mw), XtWindow(RightClip(mw)), ! 0, y_clear, 0 /* Full Width */, ClipChild(mw)->core.height - height, False); /* * Translate coordinates for row labels on Matrix *************** *** 487,499 **** XClearArea(XtDisplay(mw), XtWindow(mw), vert_sb_offset, y_clear, row_label_width, ! CLIP_VERT_VISIBLE_SPACE(mw), False); /* * Clear the trailing filled rows if necessary ! if ( (XmGRID_ROW_SHADOW == mw->matrix.grid_type) && ! NEED_HORIZ_FILL( mw ) ) { XClearArea(XtDisplay(mw), XtWindow(mw), trailing_fixed_column_label_offset + --- 487,500 ---- XClearArea(XtDisplay(mw), XtWindow(mw), vert_sb_offset, y_clear, row_label_width, ! CLIP_VERT_VISIBLE_SPACE(mw) + ! mw->manager.shadow_thickness, False); /* * Clear the trailing filled rows if necessary ! if ((XmGRID_ROW_SHADOW == mw->matrix.grid_type) && ! NEED_HORIZ_FILL(mw)) { XClearArea(XtDisplay(mw), XtWindow(mw), trailing_fixed_column_label_offset + *************** *** 643,649 **** * Clear the trailing fixed rows */ if ((XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ! NEED_VERT_FILL( mw )) XClearArea(XtDisplay(mw), XtWindow(mw), fixed_column_label_offset, trailing_fixed_row_label_offset + --- 644,650 ---- * Clear the trailing fixed rows */ if ((XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ! NEED_VERT_FILL(mw)) XClearArea(XtDisplay(mw), XtWindow(mw), fixed_column_label_offset, trailing_fixed_row_label_offset + *************** *** 738,745 **** /* * Copy trailing filled portion of the columns if necessary */ ! if ( (XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ! NEED_VERT_FILL( mw ) ) { XCopyArea(XtDisplay(mw), XtWindow(mw), XtWindow(mw), mw->matrix.draw_gc, --- 739,746 ---- /* * Copy trailing filled portion of the columns if necessary */ ! if ((XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ! NEED_VERT_FILL(mw)) { XCopyArea(XtDisplay(mw), XtWindow(mw), XtWindow(mw), mw->matrix.draw_gc, *************** *** 749,755 **** dest_x, trailing_fixed_row_label_offset + trailing_fixed_row_height); } - /* * Clear newly scrolled chunk of fixed rows on TopClip */ --- 750,755 ---- *************** *** 784,791 **** /* * Clear the bottom filled columns if necessary ! if ( (XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ! NEED_VERT_FILL( mw ) ) { XClearArea(XtDisplay(mw), XtWindow(mw), x_clear, trailing_fixed_row_label_offset + --- 784,791 ---- /* * Clear the bottom filled columns if necessary ! if ((XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ! NEED_VERT_FILL(mw)) { XClearArea(XtDisplay(mw), XtWindow(mw), x_clear, trailing_fixed_row_label_offset + *************** *** 866,872 **** */ if ((!set_mask) && (XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ((mw->matrix.rows - 1) == i) && ! NEED_VERT_FILL( mw )) { set_mask = True; xbaeSetClipMask(mw, CLIP_TRAILING_FIXED_ROWS); --- 866,872 ---- */ if ((!set_mask) && (XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ((mw->matrix.rows - 1) == i) && ! NEED_VERT_FILL(mw)) { set_mask = True; xbaeSetClipMask(mw, CLIP_TRAILING_FIXED_ROWS); *************** *** 1420,1426 **** if (!(clip_reason & CLIP_TRAILING_FIXED_ROWS) && (XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ((mw->matrix.rows - 1) == i) && ! NEED_VERT_FILL( mw )) { clip_reason |= CLIP_FIXED_COLUMNS | CLIP_TRAILING_FIXED_ROWS; --- 1420,1426 ---- if (!(clip_reason & CLIP_TRAILING_FIXED_ROWS) && (XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ((mw->matrix.rows - 1) == i) && ! NEED_VERT_FILL(mw)) { clip_reason |= CLIP_FIXED_COLUMNS | CLIP_TRAILING_FIXED_ROWS; *************** *** 1556,1562 **** if (!(clip_reason & CLIP_TRAILING_FIXED_ROWS) && (XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ((mw->matrix.rows - 1) == i) && ! NEED_VERT_FILL( mw )) { clip_reason |= CLIP_TRAILING_FIXED_COLUMNS | CLIP_TRAILING_FIXED_ROWS; --- 1556,1562 ---- if (!(clip_reason & CLIP_TRAILING_FIXED_ROWS) && (XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ((mw->matrix.rows - 1) == i) && ! NEED_VERT_FILL(mw)) { clip_reason |= CLIP_TRAILING_FIXED_COLUMNS | CLIP_TRAILING_FIXED_ROWS; Index: Xbae/src/Utils.c diff -c Xbae/src/Utils.c:1.10 Xbae/src/Utils.c:1.11 *** Xbae/src/Utils.c:1.10 Sat May 3 11:03:33 1997 --- Xbae/src/Utils.c Thu Jul 10 18:09:11 1997 *************** *** 22,28 **** * * MatrixWidget Author: Andrew Wason, Bellcore, aw@bae.bellcore.com * ! * $Id: Utils.c,v 1.10 1997/05/03 01:03:33 lister Exp $ */ /* --- 22,28 ---- * * MatrixWidget Author: Andrew Wason, Bellcore, aw@bae.bellcore.com * ! * $Id: Utils.c,v 1.11 1997/07/10 08:09:11 lister Exp $ */ /* *************** *** 58,64 **** { *left_column = xbaeXtoCol(mw, FIXED_COLUMN_WIDTH(mw) + HORIZ_ORIGIN(mw)); *right_column = xbaeXtoCol(mw, FIXED_COLUMN_WIDTH(mw) + HORIZ_ORIGIN(mw) + ! VISIBLE_WIDTH(mw) - 1); } /* --- 58,64 ---- { *left_column = xbaeXtoCol(mw, FIXED_COLUMN_WIDTH(mw) + HORIZ_ORIGIN(mw)); *right_column = xbaeXtoCol(mw, FIXED_COLUMN_WIDTH(mw) + HORIZ_ORIGIN(mw) + ! VISIBLE_WIDTH(mw) - 1); } /* *************** *** 90,102 **** int visible_width = VISIBLE_WIDTH(mw); int dynamic_columns; ! if( visible_width < 0 ) /* will happen on initialisation */ return; /* Adjust the column if it is out of bounds */ dynamic_columns = mw->matrix.columns - mw->matrix.fixed_columns - ! mw->matrix.trailing_fixed_columns; if (mw->matrix.left_column < 0) mw->matrix.left_column = 0; --- 90,102 ---- int visible_width = VISIBLE_WIDTH(mw); int dynamic_columns; ! if (visible_width < 0) /* will happen on initialisation */ return; /* Adjust the column if it is out of bounds */ dynamic_columns = mw->matrix.columns - mw->matrix.fixed_columns - ! mw->matrix.trailing_fixed_columns; if (mw->matrix.left_column < 0) mw->matrix.left_column = 0; *************** *** 111,129 **** HORIZ_ORIGIN(mw) = 0; xbaeRowColToXY(mw, mw->matrix.fixed_rows, mw->matrix.left_column + mw->matrix.fixed_columns, ! &mw->matrix.horiz_origin, &y ); /* Check how much space is remaining */ ! for( i = mw->matrix.left_column + mw->matrix.fixed_columns; ! i < mw->matrix.columns - mw->matrix.trailing_fixed_columns; i++ ) { ! required_width += COLUMN_WIDTH( mw, i ); ! if( required_width >= visible_width ) break; } ! if( required_width < visible_width ) mw->matrix.left_column--; } ! while( required_width < visible_width ); } /* --- 111,129 ---- HORIZ_ORIGIN(mw) = 0; xbaeRowColToXY(mw, mw->matrix.fixed_rows, mw->matrix.left_column + mw->matrix.fixed_columns, ! &mw->matrix.horiz_origin, &y); /* Check how much space is remaining */ ! for (i = mw->matrix.left_column + mw->matrix.fixed_columns; ! i < mw->matrix.columns - mw->matrix.trailing_fixed_columns; i++) { ! required_width += COLUMN_WIDTH(mw, i); ! if (required_width >= visible_width) break; } ! if (required_width < visible_width) mw->matrix.left_column--; } ! while (required_width < visible_width); } /* *************** *** 180,188 **** /* * Make sure y coord is valid */ ! if ( (win == XtWindow(mw)) && ! ( (y > ( CLIP_VERT_VISIBLE_SPACE(mw) + ROW_LABEL_OFFSET(mw) - 1) ) || ! (y < ROW_LABEL_OFFSET(mw)) ) ) return; XClearArea(XtDisplay(mw), win, x, y, COLUMN_WIDTH(mw, column), --- 180,188 ---- /* * Make sure y coord is valid */ ! if ((win == XtWindow(mw)) && ! ((y > (CLIP_VERT_VISIBLE_SPACE(mw) + ROW_LABEL_OFFSET(mw) - 1)) || ! (y < ROW_LABEL_OFFSET(mw)))) return; XClearArea(XtDisplay(mw), win, x, y, COLUMN_WIDTH(mw, column), *************** *** 210,216 **** if (row >= VERT_ORIGIN(mw)) { if (row < (((int)(ClipChild(mw)->core.height) / ! ROW_HEIGHT(mw)) + VERT_ORIGIN(mw)) + 1) return True; if (ClipChild(mw)->core.height > TEXT_HEIGHT_OFFSET(mw) && --- 210,216 ---- if (row >= VERT_ORIGIN(mw)) { if (row < (((int)(ClipChild(mw)->core.height) / ! ROW_HEIGHT(mw)) + VERT_ORIGIN(mw)) /*+ 1*/) return True; if (ClipChild(mw)->core.height > TEXT_HEIGHT_OFFSET(mw) && *************** *** 389,397 **** XbaeMatrixWidget mw; int row, column; { ! if (!xbaeIsRowVisible(mw, row )) xbaeMakeRowVisible(mw, row); ! if (!xbaeIsColumnVisible(mw, column )) xbaeMakeColumnVisible(mw, column); } --- 389,397 ---- XbaeMatrixWidget mw; int row, column; { ! if (!xbaeIsRowVisible(mw, row)) xbaeMakeRowVisible(mw, row); ! if (!xbaeIsColumnVisible(mw, column)) xbaeMakeColumnVisible(mw, column); } *************** *** 404,411 **** XbaeMatrixWidget mw; unsigned int clip_reason; { ! XRectangle r; ! /* * Set new clip reason */ --- 404,411 ---- XbaeMatrixWidget mw; unsigned int clip_reason; { ! XRectangle r[2]; ! int n = 1; /* * Set new clip reason */ *************** *** 416,478 **** */ if ((CLIP_FIXED_COLUMNS & clip_reason) && mw->matrix.fixed_columns) { ! r.x = COLUMN_LABEL_OFFSET(mw); ! r.width = FIXED_COLUMN_WIDTH(mw); } else if ((CLIP_TRAILING_FIXED_COLUMNS & clip_reason) && (mw->matrix.trailing_fixed_columns || mw->matrix.fill)) { ! r.x = TRAILING_FIXED_COLUMN_LABEL_OFFSET(mw); ! r.width = TRAILING_FIXED_COLUMN_WIDTH(mw); ! if ( NEED_HORIZ_FILL(mw) ) ! r.width += FILL_HORIZ_WIDTH(mw); } else { ! r.x = FIXED_COLUMN_LABEL_OFFSET(mw); ! r.width = ClipChild(mw)->core.width; ! if ( NEED_HORIZ_FILL(mw) ) ! r.width += FILL_HORIZ_WIDTH(mw); } if (CLIP_VISIBLE_HEIGHT & clip_reason) { ! r.y = ROW_LABEL_OFFSET(mw); ! r.height = ClipChild(mw)->core.height + FIXED_ROW_HEIGHT(mw) + TRAILING_FIXED_ROW_HEIGHT(mw); ! if ( NEED_VERT_FILL(mw) ) ! r.height += FILL_VERT_HEIGHT(mw); } else if ((CLIP_TRAILING_FIXED_ROWS & clip_reason) && (mw->matrix.trailing_fixed_rows || mw->matrix.fill)) { ! r.y = TRAILING_FIXED_ROW_LABEL_OFFSET(mw); ! r.height = TRAILING_FIXED_ROW_HEIGHT(mw); ! if ( NEED_VERT_FILL(mw) ) ! r.height += FILL_VERT_HEIGHT(mw); } else if (CLIP_BETWEEN_FIXED_ROWS & clip_reason) { ! r.y = FIXED_ROW_LABEL_OFFSET(mw); ! r.height = ClipChild(mw)->core.height; } else /* clip fixed rows & clip_reason */ { ! r.y = 0; ! r.height = FIXED_ROW_LABEL_OFFSET(mw); } - /* * Reset the clip_mask in our clipping GCs */ XSetClipRectangles(XtDisplay(mw), mw->matrix.cell_grid_line_gc, ! 0, 0, &r, 1, Unsorted); XSetClipRectangles(XtDisplay(mw), mw->matrix.cell_top_shadow_clip_gc, ! 0, 0, &r, 1, Unsorted); XSetClipRectangles(XtDisplay(mw), mw->matrix.cell_bottom_shadow_clip_gc, ! 0, 0, &r, 1, Unsorted); XSetClipRectangles(XtDisplay(mw), mw->matrix.label_clip_gc, ! 0, 0, &r, 1, Unsorted); } --- 416,485 ---- */ if ((CLIP_FIXED_COLUMNS & clip_reason) && mw->matrix.fixed_columns) { ! r[0].x = COLUMN_LABEL_OFFSET(mw); ! r[0].width = FIXED_COLUMN_WIDTH(mw); } else if ((CLIP_TRAILING_FIXED_COLUMNS & clip_reason) && (mw->matrix.trailing_fixed_columns || mw->matrix.fill)) { ! r[0].x = TRAILING_FIXED_COLUMN_LABEL_OFFSET(mw); ! r[0].width = TRAILING_FIXED_COLUMN_WIDTH(mw); ! if (NEED_HORIZ_FILL(mw)) ! r[0].width += FILL_HORIZ_WIDTH(mw); } else { ! r[0].x = FIXED_COLUMN_LABEL_OFFSET(mw); ! r[0].width = ClipChild(mw)->core.width; ! if (NEED_HORIZ_FILL(mw)) ! r[0].width += FILL_HORIZ_WIDTH(mw); } if (CLIP_VISIBLE_HEIGHT & clip_reason) { ! r[0].y = ROW_LABEL_OFFSET(mw); ! r[0].height = ClipChild(mw)->core.height + FIXED_ROW_HEIGHT(mw) + TRAILING_FIXED_ROW_HEIGHT(mw); ! if (NEED_VERT_FILL(mw)) ! r[0].height += FILL_VERT_HEIGHT(mw); } else if ((CLIP_TRAILING_FIXED_ROWS & clip_reason) && (mw->matrix.trailing_fixed_rows || mw->matrix.fill)) { ! r[0].y = TRAILING_FIXED_ROW_LABEL_OFFSET(mw); ! r[0].height = TRAILING_FIXED_ROW_HEIGHT(mw); ! if (NEED_VERT_FILL(mw)) ! r[0].height += FILL_VERT_HEIGHT(mw); } else if (CLIP_BETWEEN_FIXED_ROWS & clip_reason) { ! r[0].y = FIXED_ROW_LABEL_OFFSET(mw); ! r[0].height = ClipChild(mw)->core.height; } else /* clip fixed rows & clip_reason */ { ! r[0].y = HORIZ_SB_OFFSET(mw); ! r[0].height = FIXED_ROW_LABEL_OFFSET(mw); ! } ! if (mw->matrix.row_labels) ! { ! r[1].x = VERT_SB_OFFSET(mw); ! r[1].y = FIXED_ROW_LABEL_OFFSET(mw); ! r[1].width = ROW_LABEL_WIDTH(mw); ! r[1].height = ClipChild(mw)->core.height; ! n = 2; } /* * Reset the clip_mask in our clipping GCs */ XSetClipRectangles(XtDisplay(mw), mw->matrix.cell_grid_line_gc, ! 0, 0, r, n, Unsorted); XSetClipRectangles(XtDisplay(mw), mw->matrix.cell_top_shadow_clip_gc, ! 0, 0, r, n, Unsorted); XSetClipRectangles(XtDisplay(mw), mw->matrix.cell_bottom_shadow_clip_gc, ! 0, 0, r, n, Unsorted); XSetClipRectangles(XtDisplay(mw), mw->matrix.label_clip_gc, ! 0, 0, r, n, Unsorted); } *************** *** 830,836 **** * might not be a fixed cell. */ if (!inBox && (XmGRID_ROW_SHADOW == mw->matrix.grid_type) && ! NEED_HORIZ_FILL(mw) ) { int rx = TRAILING_FIXED_COLUMN_LABEL_OFFSET(mw) + TRAILING_FIXED_COLUMN_WIDTH(mw); --- 837,843 ---- * might not be a fixed cell. */ if (!inBox && (XmGRID_ROW_SHADOW == mw->matrix.grid_type) && ! NEED_HORIZ_FILL(mw)) { int rx = TRAILING_FIXED_COLUMN_LABEL_OFFSET(mw) + TRAILING_FIXED_COLUMN_WIDTH(mw); *************** *** 846,852 **** FIXED_ROW_LABEL_OFFSET(mw) - 1); if (INBOX(rect, *x, *y)) inBox = CLIP_TRAILING_HORIZ_FILL | ! CLIP_FIXED_ROWS; } /* --- 853,859 ---- FIXED_ROW_LABEL_OFFSET(mw) - 1); if (INBOX(rect, *x, *y)) inBox = CLIP_TRAILING_HORIZ_FILL | ! CLIP_FIXED_ROWS; } /* *************** *** 861,867 **** TRAILING_FIXED_ROW_HEIGHT(mw) - 1); if (INBOX(rect, *x, *y)) inBox = CLIP_TRAILING_HORIZ_FILL | ! CLIP_TRAILING_FIXED_ROWS; } /* --- 868,874 ---- TRAILING_FIXED_ROW_HEIGHT(mw) - 1); if (INBOX(rect, *x, *y)) inBox = CLIP_TRAILING_HORIZ_FILL | ! CLIP_TRAILING_FIXED_ROWS; } /* *************** *** 883,889 **** * Trailing vertical fill */ if (!inBox && (XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ! NEED_VERT_FILL(mw) ) { int ry = TRAILING_FIXED_ROW_LABEL_OFFSET(mw) + TRAILING_FIXED_ROW_HEIGHT(mw); --- 890,896 ---- * Trailing vertical fill */ if (!inBox && (XmGRID_COLUMN_SHADOW == mw->matrix.grid_type) && ! NEED_VERT_FILL(mw)) { int ry = TRAILING_FIXED_ROW_LABEL_OFFSET(mw) + TRAILING_FIXED_ROW_HEIGHT(mw); *************** *** 899,905 **** ry + FILL_VERT_HEIGHT(mw) - 1); if (INBOX(rect, *x, *y)) inBox = CLIP_TRAILING_VERT_FILL | ! CLIP_FIXED_COLUMNS; } /* --- 906,912 ---- ry + FILL_VERT_HEIGHT(mw) - 1); if (INBOX(rect, *x, *y)) inBox = CLIP_TRAILING_VERT_FILL | ! CLIP_FIXED_COLUMNS; } /* *************** *** 914,920 **** ry + FILL_VERT_HEIGHT(mw) - 1); if (INBOX(rect, *x, *y)) inBox = CLIP_TRAILING_VERT_FILL | ! CLIP_TRAILING_FIXED_COLUMNS; } /* --- 921,927 ---- ry + FILL_VERT_HEIGHT(mw) - 1); if (INBOX(rect, *x, *y)) inBox = CLIP_TRAILING_VERT_FILL | ! CLIP_TRAILING_FIXED_COLUMNS; } /* *************** *** 941,949 **** /* * Translate the point to rect's coord system */ ! if ( mw->matrix.fixed_columns && ! ( CLIP_TRAILING_FIXED_ROWS == inBox || ! CLIP_FIXED_ROWS == inBox ) ) *x -= COLUMN_LABEL_OFFSET(mw); else *x -= rect.x1; --- 948,956 ---- /* * Translate the point to rect's coord system */ ! if (mw->matrix.fixed_columns && ! (CLIP_TRAILING_FIXED_ROWS == inBox || ! CLIP_FIXED_ROWS == inBox)) *x -= COLUMN_LABEL_OFFSET(mw); else *x -= rect.x1; *************** *** 961,967 **** } else *row = YtoRow(mw, *y) + ! ((((CLIP_FIXED_COLUMNS & inBox ) || (CLIP_TRAILING_FIXED_COLUMNS & inBox))) && !((CLIP_FIXED_ROWS & inBox) || (CLIP_TRAILING_FIXED_ROWS & inBox)) --- 968,974 ---- } else *row = YtoRow(mw, *y) + ! ((((CLIP_FIXED_COLUMNS & inBox) || (CLIP_TRAILING_FIXED_COLUMNS & inBox))) && !((CLIP_FIXED_ROWS & inBox) || (CLIP_TRAILING_FIXED_ROWS & inBox)) *************** *** 975,1003 **** *column = xbaeXtoTrailingCol(mw, *x); else *column = xbaeXtoCol( ! mw, *x + ( (CLIP_FIXED_COLUMNS & inBox) ? 0 : ! HORIZ_ORIGIN(mw)) ); /* * Sanity check the result, making sure it is in fixed location */ ! if ( ( (*row < 0) || (*column < 0) ) || ! ( ( ( mw->matrix.fixed_rows && ! (*row >= (int)mw->matrix.fixed_rows) && ! ( !mw->matrix.trailing_fixed_rows || ! ( mw->matrix.trailing_fixed_rows && ! (*row < TRAILING_VERT_ORIGIN(mw)) ) ) ) || ! ( !mw->matrix.fixed_rows && ! mw->matrix.trailing_fixed_rows && ! (*row < TRAILING_VERT_ORIGIN(mw)) ) ) && ! ( ( mw->matrix.fixed_columns && ! (*column >= (int)mw->matrix.fixed_columns) && ! ( !mw->matrix.trailing_fixed_columns || ! ( mw->matrix.trailing_fixed_columns && ! (*column < TRAILING_HORIZ_ORIGIN(mw)) ) ) ) || ! ( !mw->matrix.fixed_columns && ! mw->matrix.trailing_fixed_columns && ! (*column < TRAILING_HORIZ_ORIGIN(mw)) ) ) ) ) return False; /* --- 982,1010 ---- *column = xbaeXtoTrailingCol(mw, *x); else *column = xbaeXtoCol( ! mw, *x + ((CLIP_FIXED_COLUMNS & inBox) ? 0 : ! HORIZ_ORIGIN(mw))); /* * Sanity check the result, making sure it is in fixed location */ ! if (((*row < 0) || (*column < 0)) || ! (((mw->matrix.fixed_rows && ! (*row >= (int)mw->matrix.fixed_rows) && ! (!mw->matrix.trailing_fixed_rows || ! (mw->matrix.trailing_fixed_rows && ! (*row < TRAILING_VERT_ORIGIN(mw))))) || ! (!mw->matrix.fixed_rows && ! mw->matrix.trailing_fixed_rows && ! (*row < TRAILING_VERT_ORIGIN(mw)))) && ! ((mw->matrix.fixed_columns && ! (*column >= (int)mw->matrix.fixed_columns) && ! (!mw->matrix.trailing_fixed_columns || ! (mw->matrix.trailing_fixed_columns && ! (*column < TRAILING_HORIZ_ORIGIN(mw))))) || ! (!mw->matrix.fixed_columns && ! mw->matrix.trailing_fixed_columns && ! (*column < TRAILING_HORIZ_ORIGIN(mw)))))) return False; /* *************** *** 1028,1041 **** { /* Check the various regions of the matrix to make sure we get the correct row label */ ! if( mw->matrix.fixed_rows ) { SETRECT(rect, VERT_SB_OFFSET(mw), ROW_LABEL_OFFSET(mw), ROW_LABEL_WIDTH(mw) + VERT_SB_OFFSET(mw), FIXED_ROW_LABEL_OFFSET(mw) - 1); ! if( INBOX( rect, *x, *y ) ) inBox = CLIP_ROW_LABELS | ! CLIP_FIXED_ROWS; } if (!inBox && mw->matrix.trailing_fixed_rows) --- 1035,1048 ---- { /* Check the various regions of the matrix to make sure we get the correct row label */ ! if (mw->matrix.fixed_rows) { SETRECT(rect, VERT_SB_OFFSET(mw), ROW_LABEL_OFFSET(mw), ROW_LABEL_WIDTH(mw) + VERT_SB_OFFSET(mw), FIXED_ROW_LABEL_OFFSET(mw) - 1); ! if (INBOX(rect, *x, *y)) inBox = CLIP_ROW_LABELS | ! CLIP_FIXED_ROWS; } if (!inBox && mw->matrix.trailing_fixed_rows) *************** *** 1052,1058 **** } /* check the rows in the non fixed regions */ ! if( !inBox ) { SETRECT(rect, VERT_SB_OFFSET(mw), --- 1059,1065 ---- } /* check the rows in the non fixed regions */ ! if (!inBox) { SETRECT(rect, VERT_SB_OFFSET(mw), *************** *** 1060,1070 **** ROW_LABEL_WIDTH(mw) + VERT_SB_OFFSET(mw), TRAILING_FIXED_ROW_LABEL_OFFSET(mw) - 1); ! if( INBOX( rect, *x, *y ) ) inBox = CLIP_ROW_LABELS; } } ! if( CLIP_ROW_LABELS & inBox ) { *y -= ROW_LABEL_OFFSET(mw); *row = YtoRow(mw, *y); --- 1067,1077 ---- ROW_LABEL_WIDTH(mw) + VERT_SB_OFFSET(mw), TRAILING_FIXED_ROW_LABEL_OFFSET(mw) - 1); ! if (INBOX(rect, *x, *y)) inBox = CLIP_ROW_LABELS; } } ! if (CLIP_ROW_LABELS & inBox) { *y -= ROW_LABEL_OFFSET(mw); *row = YtoRow(mw, *y); *************** *** 1082,1088 **** } /* Sanity check - make sure we don't over step the mark */ ! if( *row >= mw->matrix.rows || *column >= mw->matrix.columns ) { *row = -1; *column = -1; --- 1089,1095 ---- } /* Sanity check - make sure we don't over step the mark */ ! if (*row >= mw->matrix.rows || *column >= mw->matrix.columns) { *row = -1; *column = -1; *************** *** 1096,1145 **** case ColumnLabelCell: if (!inBox && mw->matrix.column_labels) { ! if( mw->matrix.fixed_columns ) { SETRECT(rect, COLUMN_LABEL_OFFSET(mw), HORIZ_SB_OFFSET(mw), FIXED_COLUMN_LABEL_OFFSET(mw) - 1, ! COLUMN_LABEL_HEIGHT(mw) + HORIZ_SB_OFFSET(mw) ); ! if( INBOX( rect, *x, *y ) ) inBox = CLIP_FIXED_COLUMNS | ! CLIP_COLUMN_LABELS; } ! if( !inBox && mw->matrix.trailing_fixed_columns ) { SETRECT(rect, TRAILING_FIXED_COLUMN_LABEL_OFFSET(mw), HORIZ_SB_OFFSET(mw), TRAILING_FIXED_COLUMN_LABEL_OFFSET(mw) + TRAILING_FIXED_COLUMN_WIDTH(mw) - 1, ! COLUMN_LABEL_HEIGHT(mw) + HORIZ_SB_OFFSET(mw) ); ! if( INBOX( rect, *x, *y ) ) inBox = CLIP_COLUMN_LABELS | ! CLIP_TRAILING_FIXED_COLUMNS; } /* check the columns in the non fixed regions */ ! if( !inBox ) { SETRECT(rect, FIXED_COLUMN_LABEL_OFFSET(mw), HORIZ_SB_OFFSET(mw), TRAILING_FIXED_COLUMN_LABEL_OFFSET(mw), ! COLUMN_LABEL_HEIGHT(mw) + HORIZ_SB_OFFSET(mw) ); ! if( INBOX( rect, *x, *y ) ) inBox = CLIP_COLUMN_LABELS; } } ! if( CLIP_COLUMN_LABELS & inBox ) { *x -= COLUMN_LABEL_OFFSET(mw); ! if( CLIP_TRAILING_FIXED_COLUMNS & inBox ) ! *column = xbaeXtoTrailingCol( mw, *x ); else ! *column = xbaeXtoCol( mw, *x + ! ( (CLIP_FIXED_COLUMNS & inBox) ? 0 : ! HORIZ_ORIGIN(mw)) ); *row = -1; } else --- 1103,1152 ---- case ColumnLabelCell: if (!inBox && mw->matrix.column_labels) { ! if (mw->matrix.fixed_columns) { SETRECT(rect, COLUMN_LABEL_OFFSET(mw), HORIZ_SB_OFFSET(mw), FIXED_COLUMN_LABEL_OFFSET(mw) - 1, ! COLUMN_LABEL_HEIGHT(mw) + HORIZ_SB_OFFSET(mw)); ! if (INBOX(rect, *x, *y)) inBox = CLIP_FIXED_COLUMNS | ! CLIP_COLUMN_LABELS; } ! if (!inBox && mw->matrix.trailing_fixed_columns) { SETRECT(rect, TRAILING_FIXED_COLUMN_LABEL_OFFSET(mw), HORIZ_SB_OFFSET(mw), TRAILING_FIXED_COLUMN_LABEL_OFFSET(mw) + TRAILING_FIXED_COLUMN_WIDTH(mw) - 1, ! COLUMN_LABEL_HEIGHT(mw) + HORIZ_SB_OFFSET(mw)); ! if (INBOX(rect, *x, *y)) inBox = CLIP_COLUMN_LABELS | ! CLIP_TRAILING_FIXED_COLUMNS; } /* check the columns in the non fixed regions */ ! if (!inBox) { SETRECT(rect, FIXED_COLUMN_LABEL_OFFSET(mw), HORIZ_SB_OFFSET(mw), TRAILING_FIXED_COLUMN_LABEL_OFFSET(mw), ! COLUMN_LABEL_HEIGHT(mw) + HORIZ_SB_OFFSET(mw)); ! if (INBOX(rect, *x, *y)) inBox = CLIP_COLUMN_LABELS; } } ! if (CLIP_COLUMN_LABELS & inBox) { *x -= COLUMN_LABEL_OFFSET(mw); ! if (CLIP_TRAILING_FIXED_COLUMNS & inBox) ! *column = xbaeXtoTrailingCol(mw, *x); else ! *column = xbaeXtoCol(mw, *x + ! ((CLIP_FIXED_COLUMNS & inBox) ? 0 : ! HORIZ_ORIGIN(mw))); *row = -1; } else *************** *** 1148,1154 **** *column = -1; } /* Sanity check - make sure we don't overstep the mark */ ! if( *row >= mw->matrix.rows || *column >= mw->matrix.columns ) { *row = -1; *column = -1; --- 1155,1161 ---- *column = -1; } /* Sanity check - make sure we don't overstep the mark */ ! if (*row >= mw->matrix.rows || *column >= mw->matrix.columns) { *row = -1; *column = -1; *************** *** 1239,1247 **** *y -= FIXED_ROW_LABEL_OFFSET(mw); } else if (event->xbutton.window == XtWindow(mw)) ! if( *x < COLUMN_LABEL_OFFSET( mw ) && *x > VERT_SB_OFFSET(mw) ) *cell = RowLabelCell; ! else if( *y < ROW_LABEL_OFFSET(mw) && *y > HORIZ_SB_OFFSET(mw) ) *cell = ColumnLabelCell; else *cell = FixedCell; --- 1246,1254 ---- *y -= FIXED_ROW_LABEL_OFFSET(mw); } else if (event->xbutton.window == XtWindow(mw)) ! if (*x < COLUMN_LABEL_OFFSET(mw) && *x > VERT_SB_OFFSET(mw)) *cell = RowLabelCell; ! else if (*y < ROW_LABEL_OFFSET(mw) && *y > HORIZ_SB_OFFSET(mw)) *cell = ColumnLabelCell; else *cell = FixedCell; *************** *** 1292,1298 **** * I have seen cases where this function returned mw->matrix.columns * causing a crash as array bounds are read - AL */ ! if( i > mw->matrix.columns ) return mw->matrix.columns - 1; return i - 1; --- 1299,1305 ---- * I have seen cases where this function returned mw->matrix.columns * causing a crash as array bounds are read - AL */ ! if (i > mw->matrix.columns) return mw->matrix.columns - 1; return i - 1; *************** *** 1325,1331 **** * fixed cells, or the clip window for non-fixed). */ void ! xbaeRowColToXY(mw, row, column, x, y ) XbaeMatrixWidget mw; int row; int column; --- 1332,1338 ---- * fixed cells, or the clip window for non-fixed). */ void ! xbaeRowColToXY(mw, row, column, x, y) XbaeMatrixWidget mw; int row; int column; *************** *** 1341,1347 **** /* * Ignore horiz_origin if we are in a fixed column */ ! if( (column < (int)mw->matrix.fixed_columns) ) { if (row < mw->matrix.fixed_rows || row >= TRAILING_VERT_ORIGIN(mw)) *x = COLUMN_LABEL_OFFSET(mw) + COLUMN_POSITION(mw, column); --- 1348,1354 ---- /* * Ignore horiz_origin if we are in a fixed column */ ! if ((column < (int)mw->matrix.fixed_columns)) { if (row < mw->matrix.fixed_rows || row >= TRAILING_VERT_ORIGIN(mw)) *x = COLUMN_LABEL_OFFSET(mw) + COLUMN_POSITION(mw, column); *************** *** 1361,1367 **** else if (row < mw->matrix.fixed_rows || row >= TRAILING_VERT_ORIGIN(mw)) *x = (COLUMN_POSITION(mw, column) - COLUMN_POSITION(mw, mw->matrix.fixed_columns)) - ! HORIZ_ORIGIN(mw); else *x = COLUMN_LABEL_OFFSET(mw) + COLUMN_POSITION(mw, column) - HORIZ_ORIGIN(mw); --- 1368,1374 ---- else if (row < mw->matrix.fixed_rows || row >= TRAILING_VERT_ORIGIN(mw)) *x = (COLUMN_POSITION(mw, column) - COLUMN_POSITION(mw, mw->matrix.fixed_columns)) - ! HORIZ_ORIGIN(mw); else *x = COLUMN_LABEL_OFFSET(mw) + COLUMN_POSITION(mw, column) - HORIZ_ORIGIN(mw); *************** *** 1369,1375 **** /* * Ignore vert_origin if we are in a fixed row */ ! if( (row < (int)mw->matrix.fixed_rows) ) { if (column < mw->matrix.fixed_columns || column >= TRAILING_HORIZ_ORIGIN(mw)) --- 1376,1382 ---- /* * Ignore vert_origin if we are in a fixed row */ ! if ((row < (int)mw->matrix.fixed_rows)) { if (column < mw->matrix.fixed_columns || column >= TRAILING_HORIZ_ORIGIN(mw))