Sunday, January 3, 2010

Capabilities skeleton code

As there is a work for migrating to WPF interface, I've tried to make better the migration. I've found a bit of disappointment that there is no property grid implementation (that works) that is free excluding the Windows.Forms implementation that is already used by NaroCAD. There is a TreeView with WPF, but if I will migrate the code of TreeView, I will need to migrate also search (filtering). Because I was not sure if and what to do exactly (I will ask some advices to bxtrx), I've made a capability framework for now.
What is it about? Is much less that the name pretends but can have nice usages like: right click or to set a custom icon in treeview, or populate nicely the sections in property grid.
So how should work: it works like a dictionary that you say for an object in dictionary if is related with other object and which attributes does it have. This dictionary will test the attributes if they exist regardless of they are in the object itself or in any object related to. By this, if you will want to create an object, like Sphere, you can say that is a shape, is a solid, have no plane faces. By this the Property Grid will be able to show (if the code will be moved in the capabilities frame) the Shape properties (like Transform), the right click can show: boolean operations, but will not show the Extrude because have no plane face.
That is all about. Hope that the concept to work and to improve in the next day and to work along with the WPF integration.

No comments: