logo

 

     
 
Home
Site Map
Search
 
:: Bitwise Courses ::
 
Bitwise Dusty Archives
 
 
 

rss

 
 

ruby in steel

learn aikido in north devon

Learn Aikido in North Devon

 


Section :: Rants and Raves

- Format For Printing...

Grues, DataGrids and Adobe Flex

When a UI Component is not a UIComponent
Friday 6 November 2009.
 

Most of my time over the past year or so has been spent developing the drag and drop design environment for ‘Amethyst’, my company’s Flex (or ‘Flash Platform’, if you prefer) IDE for Visual Studio.

Embarking on a project of this scale inevitably leads you down some twisty little programming pathways of whose very existence you had been ignorant at the outset. Every so often you stumble into a dark corner and get eaten by slavering grues. Well, at least, that was how it used to happen in the old adventure game, Zork.

In the world of Flex, the grues are called DataGridColumns and they slaver every bit as ferociously as their Zork relations. At least they do if you happen to be developing a drag and drop design environment. As far as I am aware the only people designing drag-and-drop design environments for Flex are hordes of programmers in the basement of Adobe Mansions - and me...

DataGridColumns are, unsurprisingly, columns that live inside DataGrids. In our Designer, Flex components are shown in the Visual Studio Toolbox and when you drag them into the design area, they magically pop into existence. Buttons do it, Canvases do it - even RichText Editors do it. DataGrids do it too - but not DataGrid columns. In the current beta of Amethyst if you try to create DataGrid columns in the visual designer a horde of slavering grues will suddenly appear and gobble them all up.

It took me a while to figure out why that should be the case. Eventually I saw the light (and once I’d lit my light, the grues, as is their wont, fled screaming). Whereas all other (well, most other) UI Components descend, quite logically, from the UIComponent class, DataGrid columns don’t - they descend from (and if you don’t already know, I think it’s a safe bet that you’d never guess) a class called CSSStyleDeclaration. Don’t ask me to explain the logic of this. I have no idea what inspired whim caused the Flex designers to make this decision. In my view, it would have been very nice if DataGridColumn had descended from UIComponent but I rather doubt whether Adobe would take kindly to the idea of rewriting their class library just to please me.

Anyway, if you happen to be interested in Flex or if you just want to gloat over someone else’s problems, you may be interested in an article which I’ve just published on my company’s blog. It’s called Flex UI Components That Aren’t UIComponents and it explains why my hair has suddenly gone grey... ;-)

AddThis Social Bookmark Button


Home