How to delete rows,columns and table's?

Started by fdb, December 16, 2013, 02:00:07 PM

Previous topic - Next topic

fdb

How can i delete rows and/or columns in a gs:table? there seems to be only the option to add them..or am i missing something?  Furthermore i cannot delete a gs:table when i try to do so with gs:dispose i get the message

dispose cannot be applied to MAIN:row-table

Lutz

#1
Only entire containers created with gs:window, gs:frame and gs:dialog can be used with gs:dispose - this has now been added to the documentation.



At the moment there is no API to delete table rows or columns. For other dialog components use gs:remove-from, or use gs:delete-tag to remove 2D drawn objects.



Se also:  http://www.newlisp.org/guiserver/guiserver.lsp.html">http://www.newlisp.org/guiserver/guiserver.lsp.html

fdb

#2
Thx for the reply, i'll dispose the frame and rebuilt it after i've recalculated the UI.



I also saw there seemed to be  no option to have a table without column headers, but you can actually achieve this with an empty string "" as the column header so
(gs:table 'row-table 'gs:no-action "" "") will give you a table with two columns but you don't see the column header.

Lutz

#3
Currently when adding columns using gs:table-add-column, the column number will be added as a label when specifying an empty string.



In the next version of guiserver.jar the header will be suppressed if an empty string is used with gs:table-add-column. This will make it possible to add columns to header-less tables created with a gs:table statement using empty string headers.



See: http://www.newlisp.org/downloads/development/inprogress/">http://www.newlisp.org/downloads/develo ... nprogress/">http://www.newlisp.org/downloads/development/inprogress/

fdb

#4
Great! Are you also planning to add the ability to delete rows and columns? At the moment i dispose  the frame and then recalc and recreate the frame , which doesn't matter too much because i have to recalc  all the tables (6) anyway but it does of course means flickering.

fdb

#5
Hi , i've added the ability to delete rows and columns in a table in a build i made in 10.5.4

I have added the following methods to Dispatcher.java:

methods.put("table-remove-row", "tableRemoveRow"); //deleting of a row
methods.put("table-set-column-name", "tableSetColumnIdentifiers");//add/delete/update
methods.put("table-set-rows", "tableSetRowCount"); //adding /deleting rows

and implemented them in TableWidget.java.



Then i've coded the new functions in newlisp in guiserver.lsp.

After compiling the java stuff and make /make build, everything seems to work!



I was surprised how easy this was and am very impressed by the documentation and the clean code, everything 'just works' ;-)



Be aware that i'm not a professional programmer so who knows what errors I made but if Lutz is interested i'll be more then happy to share my code to include this in future versions.

Lutz

#6
Thanks very much fdb.



You can package TableWidget.java, guiserver.lsp and table-demo.lsp into a .zip or a .tgz file and mail it to me at lutz@nuevatec.com or publish the files else if you prefer.



Keep the description in guiserver.lsp short but add buttons and input to table-demo.lsp showing the new functionality. This way people have an example to work off and it also can be used to test the new functionality.

abaddon1234

#7
Thanks very much.

https://thbacara168.wordpress.com/2016/02/24/baccarat-online-2/">ไพ่ออนไลน์