I try to explain my problem better and in the mean time I have cleaned up my code a bit, especially all the toolbar creation and handling code.
Would now also like to re-factor the move/resize code and need to add delete functionality for 'rackUnits' and 'bottles' but not the triangle objects.
I really don't get it how I would make use of GUIMode(s), i.e. what confuses me is that move, resize, delete all need a select object "mode".
The questions I have:- Should I have a "Select Mode" which depending on object selected enables the use of other modes - seems a bit user "un-friendly" e.g. select "select mode" select object, select "other mode" do other thing.
- Should each mode have the same "select" code.- Can/should one switch mode in an event? Or is the mode always selected from using a toolbar button or similar. - Or should I have some variables in the objects ("deleteAllowed", "moveAllowed", "resizeAllowed" etc) and depending on these call additional methods within the common event code.
- Is there a standard to indicate that an object is selected.I am looking for pointers, but would very much appreciate some sample code which makes use of GUIMode, but a bit more advanced then the one sample I found in the demo. Maybe a sample which shows switching resize of e.g. a rectangle and moving it.
Looking into the code in GUIMode there is a "move" mode which moves everything on the canvas. Is there plans or has someone already done an "object move" mode?
The attached code (as a 7z zip file, just for reference) includes the persistence mixins, but I commented the import of amara (the XML tool I use), so clicking the last toolbar button will just through an exception. Will need to clean up the images for the toolbar but they are already better then the "black splotches" I had before.
Werner
floatcanvastests.7z
Description: Binary data
_______________________________________________ FloatCanvas mailing list [email protected] http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
