I've made a simple modification to the keybinding system that preserves your intent IMHO with minimal modifications. Mouse button presses/releases are mapped to those of rarely used function keys F30 & up. Mouse buttons are not modifiers anymore, this seemed unused. This takes care of #2 on my previous mail. #1 (menus) will wait for now. I've got your code to use Qt's key identifiers and key modifiers directly, removing most of code that dealt with massaging keywstate, key names, etc -- this all uses Qt now.
I've got it to properly switch to wire drawing mode when you click on the "wire" toolbar icon, and you can click on the area, start the wire, and drag it. Snap, etc, works -- this uses your code as-is. Further button presses are ignored, so you can't set intermediate points on the wire, but that's a bug somewhere that I will work on tomorrow. You can see it in action at <http://home.wowway.com/~mandasoft/xcircuit-2.png>. I've also uploaded the source code svn repository to <http://home.wowway.com/xcircuit-2.tar.gz> (this a file-based svn repo, not a tarball). The code is of course not ready for anything besides deep hacking, so this is more for preservation rather than anything else at this moment. All of that uses your code with minimal modifications; callbacks, events and timers all work a-la Xt, and your function dispatch code is used. Once I figure out all the kinks with function dispatch properly switching states, I will get to cleaning up all of the drawing. The code is already getting simpler, since only the common window redraw is used and there is no painting done whatsoever during mouse/key events -- I'm getting rid of all the input-event-based drawing code; Qt does not allow painting to widgets outside of the repaint (expose) event anyway. Optimizations upon this (minimizing redraw area) are best done by porting the elements.c code to QGraphicsView -- this uses binary space partitioning and is guaranteed to redraw only within the topmost bounding box. This would be done sometime in the future. For now, I'm not focusing on any major changes for their own sake, only changing stuff over to Qt's way of doing things when it makes it easier to get the code to work. Thus porting from C-style to C++ will happen, just not now. Cheers, Kuba _______________________________________________ Xcircuit-dev mailing list [email protected] http://www.opencircuitdesign.com/mailman/listinfo/xcircuit-dev
