RE: EuGrid question
- Posted by Jonas Temple <jtemple at yhti.net> Jul 21, 2003
- 444 views
Matt, What version of EuGrid are you using? I whipped up the following code (to help answer your question) and do not get an error EGW_DeleteColumn: Jonas -- code generated by Win32Lib IDE v0.17.0 include Win32Lib.ew without warning include EuGrid.ew atom gridvoid -------------------------------------------------------------------------------- -- Window Window1 global constant Window1 = createEx( Window, "Window1", 0, Default, Default, 550, 504, 0, 0 ) global integer Grid Grid = EGW_CreateGrid( Window1, 24, 8, 504, 412, 1 ) gridvoid = EGW_SetGridProperty( Grid, EGW_ROW_HEADER_DATACOL,EGW_ROWNUM ) gridvoid = EGW_SetGridProperty( Grid, EGW_ROW_HEADER_WIDTH,23 ) gridvoid = EGW_SetGridProperty( Grid, EGW_COL_HEADER_HEIGHT,20 ) gridvoid = EGW_SetGridProperty( Grid, EGW_BACKGROUND_COLOR,16777215 ) gridvoid = EGW_SetGridProperty( Grid, EGW_BACKGROUND_COLOR,16777215 ) global constant LoadB = createEx( PushButton, "Load", Window1, 24, 432, 88, 28, 0, 0 ) global constant ClearB = createEx( PushButton, "Clear", Window1, 128, 432, 88, 28, 0, 0 ) global constant DoneB = createEx( PushButton, "Done", Window1, 232, 432, 88, 28, 0, 0 ) --------------------------------------------------------- -------------------------------------------------------------------------------- atom void -------------------------------------------------------------------------------- procedure LoadB_onClick (integer self, integer event, sequence params)--params is () sequence data, row_num void = EGW_AddColumn(Grid, "Column 1", 100, EGW_LAST, EGW_STATIC, 1) void = EGW_AddColumn(Grid, "Column 2", 100, EGW_LAST, EGW_STATIC, 2) void = EGW_AddColumn(Grid, "Column 3", 100, EGW_LAST, EGW_STATIC, 3) data = {} for i = 1 to 100 do row_num = sprintf("%d",i) data = append(data, {"Row " & row_num & " column 1", "Row " & row_num & " column 2", "Row " & row_num & " column 3"}) end for void = EGW_LoadData(Grid, data, EGW_REPLACE) repaintWindow(Grid) end procedure setHandler( LoadB, w32HClick, routine_id("LoadB_onClick")) -------------------------------------------------------------------------------- procedure ClearB_onClick (integer self, integer event, sequence params)--params is () sequence cols void = EGW_LoadData(Grid, {{}}, EGW_REPLACE) void = EGW_DeleteDataRow(Grid, 1) cols = EGW_EnumColumns(Grid) for i = 1 to length(cols) do void = EGW_DeleteColumn(Grid, cols[i]) end for repaintWindow(Grid) end procedure setHandler( ClearB, w32HClick, routine_id("ClearB_onClick")) -------------------------------------------------------------------------------- procedure DoneB_onClick (integer self, integer event, sequence params)--params is () closeWindow(Window1) end procedure setHandler( DoneB, w32HClick, routine_id("DoneB_onClick")) WinMain( Window1,Normal )