From ahaas at airmail.net Tue Apr 5 19:02:08 2005 From: ahaas at airmail.net (Art Haas) Date: Tue Apr 5 19:01:21 2005 Subject: [PythonCAD] Entity display work in progress Message-ID: <20050405170208.GC11022@artsapartment.org> Hi. Not much mail on the list lately, so I thought I'd send something out. I've been working on the code responsible for drawing the various entities, and feel like I'm making a bit of progress. Currently the code for drawing is spread around in a couple of files - gtkimage.py, gtktext.py, and gtkdimension.py, plus code in other 'gtk' files as well. What I'm planning to do is consolidate a good bit of the code into the new 'gtkinit.py' file, and also add in draw() and erase() methods to the various entities. The horrible draw_layer() code in the gtkimage.py will eventually go away once the new code works like I want. Also, it is time to address the inelegant way that the program handles the drawing of newly added entities or the deletion of an entity. Currently the DrawingArea widget is repainted by first filling it with the designated background color, and then all the entities in the drawing are redrawn. As this code is some of the earliest PyGTK code I wrote, the lack of a better approach is due to inexperience. I'm added draw() and erase() methods for many of the basic entities, and I'm working on the text drawing now. I'm trying to be a little more clever about things than the current code in gtktext.py, so things are hitting a rough patch. Once again the difficulty in scaling the text is rearing its ugly head, and also the desire to utilize the same draw() routine for displaying the text in dimensions makes for a challenge. I've fixed a number of bugs in the code, some new and some longstanding, and have sent these fixes to the public repository. Also, the subversion binary on that machine was updated recently, so anyone having trouble accessing the repo may want to grab the latest 1.1.X release, or even better get the development code for what will be the 1.2.0 release, as that is what is running on the machine. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ahaas at airmail.net Thu Apr 7 18:34:01 2005 From: ahaas at airmail.net (Art Haas) Date: Thu Apr 7 18:33:51 2005 Subject: [PythonCAD] New drawing routines now in use Message-ID: <20050407163401.GG11022@artsapartment.org> Hi. The new draw() methods I've been working on are now in play thanks to revamping the redraw() method in the gtkimage.py file. At long last the abominable draw_layer() function is gone, replaced by a much smaller, clearer drawLayer() method in the GTKImage class, and it is drawLayer() that invokes the newly added draw() methods. The program still redraws all the entities each time one is added or deleted, and that shortcoming will be addressed in upcoming work. Also, I want to start adding code utilizing the UIManager routines to build the interface, as that approach seems much better and more flexible than the current setup. One difference that the new drawing code makes is in regards to displaying text. The text is larger than had been shown in the past, and I believe that the new way is correct as I found several "odd" bits of code in sizing the text, where the new code is much clearer and easier to follow. Also, a long-standing bug in displaying text is fixed - TextBlocks and Dimensions have not been drawn in the inactive layer color if they were in such a layer. Now they are draw the same color as the other entities in that layer. I'd like to make a release at the end of April, and with the various improvements in the drawing code I think a release is warranted. Comments and suggestions regarding the new display code welcomed, as well as any reports of errors. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ahaas at airmail.net Thu Apr 7 18:36:07 2005 From: ahaas at airmail.net (Art Haas) Date: Thu Apr 7 18:35:57 2005 Subject: [PythonCAD] New drawing routines now in use In-Reply-To: <20050407163401.GG11022@artsapartment.org> References: <20050407163401.GG11022@artsapartment.org> Message-ID: <20050407163607.GH11022@artsapartment.org> Hi. I forgot to say that I've sent the code to the public SVN repo for those wishing to grab it. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ahaas at airmail.net Wed Apr 27 19:33:20 2005 From: ahaas at airmail.net (Art Haas) Date: Wed Apr 27 19:33:26 2005 Subject: [PythonCAD] New menu-creation code in the repo Message-ID: <20050427173320.GL11497@artsapartment.org> Hi. The UI building in PythonCAD has stepped bravely out of the dark ages and is now in, well, the less-dark ages. I've been working on replacing the code that builds the menu structure, and the first batch of work is now complete. When the GTK+ developers released the 2.4 version, they added the UIManager code as the means for building the interface to a program. This feature is built on the new (at the time) Action and ActionGroup classes, and these classes are what PythonCAD now utilizes in building menus. The GTK+ and PyGTK documentation gives numerous examples of how to use these classes, and I think I've cobbled together enough of an understanding to use them and determine that the approach these classes provide to building and handling the interface elements is very slick. The menus in PythonCAD are now much more attuned to the state of the drawing. For example, many of the menu choices for editing or modifying entities can only be chosen when, strangely enough, the active layer contains entities! Also, the menu choices that select all the entities of a certain type are now enabled only if entities of that type are found. Lastly, a few more menu items have been added that had been overlooked have been added. For instance, the selection of all polyline entities is now accesible from the menu. One area to be improved in upcoming releases deals with menu choices that perform operations on selected entities. The new code will activate these menus when some object or objects have been selected, but currently there is not any good means of determining the types of these objects, so menu items for editing operations that cannot be done are still active. The problem to solve deals with providing routines to access what objects are selected, and so expect to see this ability and more menu item control in a future release. All the new Action and ActionGroup class stuff is available in GTK+ from the 2.4 release, and the PyGTK 2.4 release as well. Now, for people still using older GTK+ and PyGTK releases, I've written replacement classes that provide the basic functionality of the Action and ActionGroup classes. This code is in the new 'gtkactions.py' file, and is meant to provide similar if slightly limited functionality as the true GTK+ classes but enough to build the menus, and my limited testing demonstrated it worked well enough. However, the testing is on my machine using the GTK+ 2.6.4 release and the 2.6.1 PyGTK version (both from Debian unstable), so it is likely that I've missed something. As I don't know how many people run PythonCAD on machines using GTK+ and PyGTK releases prior to 2.4, both of which are quite old, I'm not sure if lurking bugs will be found because the code may not be run on these older versions. I'm probably going to make a release tomorrow as I am pleased with the behavior of the new menu code, and the new drawing code has been working out well, too. Plus, a few bug fixes have been applied here and there. Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ahaas at airmail.net Wed Apr 27 23:56:52 2005 From: ahaas at airmail.net (Art Haas) Date: Wed Apr 27 23:56:52 2005 Subject: [PythonCAD] New menu-creation code in the repo In-Reply-To: <20050427173320.GL11497@artsapartment.org> References: <20050427173320.GL11497@artsapartment.org> Message-ID: <20050427215652.GO11497@artsapartment.org> On Wed, Apr 27, 2005 at 12:33:20PM -0500, Art Haas wrote: > All the new Action and ActionGroup class stuff is available in GTK+ > from the 2.4 release, and the PyGTK 2.4 release as well. Now, for people > still using older GTK+ and PyGTK releases, I've written replacement > classes that provide the basic functionality of the Action and > ActionGroup classes. This code is in the new 'gtkactions.py' file, and > is meant to provide similar if slightly limited functionality as the true > GTK+ classes but enough to build the menus, and my limited testing > demonstrated it worked well enough. However, the testing is on my > machine using the GTK+ 2.6.4 release and the 2.6.1 PyGTK version (both > from Debian unstable), so it is likely that I've missed something. As I > don't know how many people run PythonCAD on machines using GTK+ and > PyGTK releases prior to 2.4, both of which are quite old, I'm not sure > if lurking bugs will be found because the code may not be run on these > older versions. I just tried things out on a Fedora Core 3 machine - GTK+ and PyGTK version 2.4 - and found that the use of set_sensitive() method didn't work. A quick check of the PyGTK reveals this call is only valid in PyGTK-2.6, so I've replaced these calls with set_property() calls using 'sensitive' as an argument and things work on the Fedora machine. I guess Fedora Core 2 probably has older GTK+ and PyGTK releases so the gtkaction compatiblity code would be used there. Can anyone confirm this? Art Haas -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From ahaas at airmail.net Thu Apr 28 15:52:05 2005 From: ahaas at airmail.net (Art Haas) Date: Fri Apr 29 02:45:09 2005 Subject: [PythonCAD] [ANNOUNCE] Twenty-fourth release of PythonCAD now available Message-ID: <20050428135205.GS11497@artsapartment.org> I'm pleased to announce the twenty-fourth development release of PythonCAD, a CAD package for open-source software users. As the name implies, PythonCAD is written entirely in Python. The goal of this project is to create a fully scriptable drafting program that will match and eventually exceed features found in commercial CAD software. PythonCAD is released under the GNU Public License (GPL). PythonCAD requires Python 2.2 or newer. The interface is GTK 2.0 based, and uses the PyGTK module for interfacing to GTK. The design of PythonCAD is built around the idea of separating the interface from the back end as much as possible. By doing this, it is hoped that both GNOME and KDE interfaces can be added to PythonCAD through usage of the appropriate Python module. Addition of other PythonCAD interfaces will depend on the availability of a Python module for that particular interface and developer interest and action. The twenty-fourth release contains numerous improvements to the code used for constructing the user interface and the entity drawing routines. This release utilizes the GTK Action and ActionGroup classes for building and controlling the menubar and menus. Using these classes greatly simplifies and enhances the ability to manipulate the menu items, and these features are used extensively in this release. Many menu choices are now activated when the functionality they provide can be used, and deactivated when their use is not possible. More enhancements of this nature will be appearing in future releases. Another significant improvement is the refactoring of the entity drawing routines. These routines are now provided as methods for each entity class, making their usage much clearer and simpler. Changing the drawing routines has allowed significant simplification of the code responsible for drawing as well as fixing several drawing bugs. Future releases of PythonCAD will build on this change to enhance and improve the graphical behavior of the program even further. A number of PyGTK deprecation warnings that slipped by in the previous release have been removed, and a good number of bug fixes and code enhancements are present in this release as well. A mailing list for the development and use of PythonCAD is available. Visit the following page for information about subscribing and viewing the mailing list archive: http://mail.python.org/mailman/listinfo/pythoncad Visit the PythonCAD web site for more information about what PythonCAD does and aims to be: http://www.pythoncad.org/ Come and join me in developing PythonCAD into a world class drafting program! Art Haas -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From w.knol at niwa.co.nz Fri Apr 29 06:51:52 2005 From: w.knol at niwa.co.nz (Wilbert Knol) Date: Fri Apr 29 06:51:58 2005 Subject: [PythonCAD] Re: Twenty-fourth release of PythonCAD now available In-Reply-To: <20050428135205.GS11497@artsapartment.org> References: <20050428135205.GS11497@artsapartment.org> Message-ID: <200504291651.52075.w.knol@niwa.co.nz> Whilst R23 worked OK, R24 causes run-time problems: (best viewed without word-wrap..) [wk@wk PythonCAD-DS1-R24]$ ./gtkpycad.py Traceback (most recent call last): File "./gtkpycad.py", line 350, in ? main() File "./gtkpycad.py", line 328, in main _image = GTKImage() File "/home/wk/Documents/src/PythonCAD-DS1-R24/PythonCAD/Interface/Gtk/gtkimage.py", line 419, in __init__ self.__mdict = fill_menubar(self.__mb, self) File "/home/wk/Documents/src/PythonCAD-DS1-R24/PythonCAD/Interface/Gtk/gtkmenus.py", line 2287, in fill_menubar _act.connect_proxy(_item) File "/home/wk/Documents/src/PythonCAD-DS1-R24/PythonCAD/Interface/Gtk/gtkactions.py", line 294, in connect_proxy widget.set_no_show_all(True) AttributeError: 'gtk.MenuItem' object has no attribute 'set_no_show_all' [wk@wk PythonCAD-DS1-R24]$ My system is probably to blame; it has been butchered around a bit. Wilbert.