diff --git a/cmd/xfe/Microline3.0/XmL/Grid.c b/cmd/xfe/Microline3.0/XmL/Grid.c index a9cbd3754f5..30270a293ea 100644 --- a/cmd/xfe/Microline3.0/XmL/Grid.c +++ b/cmd/xfe/Microline3.0/XmL/Grid.c @@ -9421,6 +9421,28 @@ XmLGridDeleteColumns(Widget w, } redraw = 0; + if (XtHasCallbacks(w, XmNdeleteCallback) == XtCallbackHasSome) + for (i = position; i < position + count; i++) + { + rowCount = XmLArrayGetCount(g->grid.rowArray); + for (j = 0; j < rowCount; j++) + { + row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, j); + cbs.reason = XmCR_DELETE_CELL; + cbs.rowType = RowPosToType(g, j); + cbs.row = RowPosToTypePos(g, cbs.rowType, i); + cbs.columnType = type; + cbs.column = RowPosToTypePos(g, cbs.columnType, j); + cbs.object = XmLArrayGet(XmLGridRowCells(row), i); + XtCallCallbackList(w, g->grid.deleteCallback, (XtPointer)&cbs); + } + cbs.reason = XmCR_DELETE_COLUMN; + cbs.columnType = type; + cbs.column = RowPosToTypePos(g, cbs.columnType, i); + cbs.object = XmLArrayGet(g->grid.colArray, i); + XtCallCallbackList(w, g->grid.deleteCallback, (XtPointer)&cbs); + } + /* adjust count */ if (type == XmHEADING) { @@ -9444,24 +9466,7 @@ XmLGridDeleteColumns(Widget w, g->grid.hiddenColCount--; redraw |= ColIsVisible(g, i); } - if (XtHasCallbacks(w, XmNdeleteCallback) == XtCallbackHasSome) - for (i = position; i < position + count; i++) - { - rowCount = XmLArrayGetCount(g->grid.rowArray); - for (j = 0; j < rowCount; j++) - { - row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, j); - cbs.reason = XmCR_DELETE_CELL; - cbs.rowType = RowPosToType(g, j); - cbs.columnType = type; - cbs.object = XmLArrayGet(XmLGridRowCells(row), i); - XtCallCallbackList(w, g->grid.deleteCallback, (XtPointer)&cbs); - } - cbs.reason = XmCR_DELETE_COLUMN; - cbs.columnType = type; - cbs.object = XmLArrayGet(g->grid.colArray, i); - XtCallCallbackList(w, g->grid.deleteCallback, (XtPointer)&cbs); - } + /* delete columns */ for (i = position; i < position + count; i++) { @@ -9542,6 +9547,28 @@ XmLGridDeleteRows(Widget w, } redraw = 0; + if (XtHasCallbacks(w, XmNdeleteCallback) == XtCallbackHasSome) + for (i = position; i < position + count; i++) + { + row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, i); + colCount = XmLArrayGetCount(g->grid.colArray); + for (j = 0; j < colCount; j++) + { + cbs.reason = XmCR_DELETE_CELL; + cbs.rowType = type; + cbs.row = RowPosToTypePos(g, cbs.rowType, i); + cbs.columnType = ColPosToType(g, j); + cbs.column = ColPosToTypePos(g, cbs.columnType, j); + cbs.object = XmLArrayGet(XmLGridRowCells(row), j); + XtCallCallbackList(w, g->grid.deleteCallback, (XtPointer)&cbs); + } + cbs.reason = XmCR_DELETE_ROW; + cbs.rowType = type; + cbs.row = RowPosToTypePos(g, cbs.rowType, i); + cbs.object = (void *)row; + XtCallCallbackList(w, g->grid.deleteCallback, (XtPointer)&cbs); + } + /* adjust count */ if (type == XmHEADING) { @@ -9565,24 +9592,7 @@ XmLGridDeleteRows(Widget w, g->grid.hiddenRowCount--; redraw |= RowIsVisible(g, i); } - if (XtHasCallbacks(w, XmNdeleteCallback) == XtCallbackHasSome) - for (i = position; i < position + count; i++) - { - row = (XmLGridRow)XmLArrayGet(g->grid.rowArray, i); - colCount = XmLArrayGetCount(g->grid.colArray); - for (j = 0; j < colCount; j++) - { - cbs.reason = XmCR_DELETE_CELL; - cbs.rowType = type; - cbs.columnType = ColPosToType(g, j); - cbs.object = XmLArrayGet(XmLGridRowCells(row), j); - XtCallCallbackList(w, g->grid.deleteCallback, (XtPointer)&cbs); - } - cbs.reason = XmCR_DELETE_ROW; - cbs.rowType = type; - cbs.object = (void *)row; - XtCallCallbackList(w, g->grid.deleteCallback, (XtPointer)&cbs); - } + /* delete rows and cells */ for (i = position; i < position + count; i++) { diff --git a/cmd/xfe/Microline3.0/XmL/Makefile b/cmd/xfe/Microline3.0/XmL/Makefile index d6fabe4df94..5f13da798b2 100644 --- a/cmd/xfe/Microline3.0/XmL/Makefile +++ b/cmd/xfe/Microline3.0/XmL/Makefile @@ -44,14 +44,11 @@ LIBRARY_NAME = XmL ifdef XFE_WIDGETS_BUILD_UNUSED UNUSED_CSRCS = \ Progress.c \ - Tree.c \ $(NULL) UNUSED_EXPORTS = \ Progress.h \ ProgressP.h \ - Tree.h \ - TreeP.h \ $(NULL) endif @@ -59,6 +56,7 @@ CSRCS = \ $(UNUSED_CSRCS) \ Folder.c \ Grid.c \ + Tree.c \ XmL.c \ $(NULL) @@ -70,7 +68,10 @@ EXPORTS = \ FolderP.h \ Grid.h \ GridP.h \ + Tree.h \ + TreeP.h \ XmL.h \ $(NULL) include $(DEPTH)/config/rules.mk +include $(DEPTH)/cmd/xfe/XfeWidgets/XfeWidgets.mk diff --git a/cmd/xfe/Microline3.0/XmL/Tree.c b/cmd/xfe/Microline3.0/XmL/Tree.c index 0fd15e70ad9..0db68e7315c 100644 --- a/cmd/xfe/Microline3.0/XmL/Tree.c +++ b/cmd/xfe/Microline3.0/XmL/Tree.c @@ -1319,3 +1319,35 @@ XmLTreeAddRows(Widget w, XmNlayoutFrozen, False, NULL); } + + + +void +XmLTreeDeleteChildren(Widget w, + int row) +{ + XmLTreeWidget t; + XmLTreeRow rowp; + int ii, jj, level, rows; + + t = WidgetToTree(w, "XmLTreeDeleteChildren()"); + + rowp = (XmLTreeRow)XmLGridGetRow(w, XmCONTENT, row); + level = rowp->tree.level; + + rows = t->grid.rowCount; + + ii = row + 1; + while (ii < rows) + { + rowp = (XmLTreeRow)XmLGridGetRow(w, XmCONTENT, ii); + if (rowp->tree.level <= level) + break; + ii++; + } + jj = ii - row - 1; + + if (jj > 0) + XmLGridDeleteRows(w, XmCONTENT, row + 1, jj); +} + diff --git a/cmd/xfe/Microline3.0/XmL/Tree.h b/cmd/xfe/Microline3.0/XmL/Tree.h index 8720790477e..6791bb15779 100644 --- a/cmd/xfe/Microline3.0/XmL/Tree.h +++ b/cmd/xfe/Microline3.0/XmL/Tree.h @@ -48,6 +48,7 @@ void XmLTreeAddRow(Widget w, int level, Boolean expands, Boolean isExpaned, int position, Pixmap pixmap, Pixmap pixmask, XmString string); void XmLTreeAddRows(Widget w, XmLTreeRowDefinition *rows, int count, int position); +void XmLTreeDeleteChildren(Widget w, int position); #ifdef XmL_CPP }