Saturday, March 22, 2008

ObjectHandles Demo

Here's a short demo of some of the stuff that ObjectHandles (my Flex library for moving & resizing stuff) can do with a very minimal amount of code.  



The custom things I did:
  • Has a MOVING / RESIZING event handler to show a custom tooltip (hides the tooltip on MOVED / RESIZED)
  • Has custom resize handle images that look like grey horizontal bars
  • Only allows vertical resizing (allowHResize = false).
  • On a MOVED event, the objects have an animation that snaps them to a column.
It's a little hard to see in that video, but the duration & start time in the tooltip update as you move or resize the boxes around.

Labels: ,

Tuesday, December 04, 2007

ObjectHandles 1.0.9 available for download

New version is up. It fixes the selectNone() bug, has the correct
metadata for events, and no longer creates event listeners on the
parent object for every single OH you instantiate.
I also added an updateAfterEvent call when things are getting moved,
it really made the motion a lot smoother, never thought it would
matter much.

http://code.google.com/p/flex-object-handles/downloads/list

ASDocs now posted as well, it's pretty sparse so it looks like I need to add
in a bunch of comments :)

http://rogue-development.com/objecthandles/asdocs/

-Marc

Labels: ,

Thursday, November 22, 2007

New ObjectHandles Build

I posted a new ObjectHandles build yesterday.  It fixes a couple bugs and integrates some patches people have sent me including:

1) Graphical handle support
2) Fixed aspect ratio support
3) Ability to detect transparency & clicks 

There will likely be another build in the next week to integrate another patch and fix a few a performance issue.

Labels: , ,

Monday, July 30, 2007

Object Handles updated

[ObjectHandles is a library to easily manage user movable and resizeable onscreen objects]

It's been a while, as I've been overly busy lately, but there is now a new ObjectHandles release.
This release fixed one bug with non-visible components, and added a new set of mouse cursors as the default. Since my last build, there's a been a bunch of submissions for new mouse cursors. I thank you all! In the near future I'll create a separate swc with them all embedded so developers can pick and choose. But for now I've embedded one of those new options into the library as the default. You can download the new release at

http://code.google.com/p/flex-object-handles/downloads/list

Now, you can also set your own mouse cursors, outside of the library. To do this, implement the OHMouseCursors interface, instantiate your class, and assign it to the ObjectHandles.mouseCursors property. A sample cursor class follows:

package your.package
{
public class YourMouseCursorClass implements OHMouseCursors
{
[Embed("../../../assets
/cursors/set1/resize- v.png")]
protected var sizeNS:Class;
[Embed("../../../assets/cursors/set2/move.png")]
protected var sizeAll:Class;
[Embed("../../../assets/cursors/set1/resize- l.png")]
protected var sizeNESW:Class;
[Embed("../../../assets/cursors/set1/resize-r.png")]
protected var sizeNWSE:Class;
[Embed("../../../assets/cursors/set1/resize- h.png")]
protected var sizeWE:Class;

protected var map:Object = new Object();

public function getCursor(name:String) : MouseCursorDetails
{
return map[name];
}

public function YourMouseCursorClass () : void
{
// Numbers are offsets to the hot-spot of the cursor (the point of the arrow, the middle of the resize bar, etc.)
map["SizeNS"] = new MouseCursorDetails(sizeNS, -5, -8 );
map["SizeAll"] = new MouseCursorDetails(sizeAll, -11, -13 );
map["SizeNWSE"] = new MouseCursorDetails(sizeNESW, -5, -6 );
map["SizeNESW"] = new MouseCursorDetails(sizeNWSE, -5, -6 );
map["SizeWE"] = new MouseCursorDetails(sizeWE, -9, -6 );
}
}
}

Then in your mxml...

<oh:objecthandles mousecursors="{new YourMouseCursorClass()}" allowrotate="false" x="10" y="90" width="307" height="30" minheight="30" minwidth="100">

If you have many ObjectHandles objects around, you can reuse the same cursor class to reduce memory usage.

The OH website, including a sample, is still at
http://www.rogue-development.com/objectHandles.xml

Enjoy!

Labels: ,

Friday, July 06, 2007

Object Handles now availbe from Google Code

I've moved the download location of Object Handles to take advantage of the download functionality of Google Code. This should let me manage versions much easier.

http://code.google.com/p/flex-object-handles/downloads/list

The neat thing is, I used an ant script to automatically post files there!

Labels: , ,