Archive for the 'ObjectHandles' Category

Object Handles Spotted?


I might have spotted another use of ObjectHandles over at the AsButtonGen webpage.  Over on the text and image tabs you can add stuff to your button that can be resized/moved using some familiar looking handles and mouse cursors.  Also, I recognize a bug with resizing the left bottom corner that was in previous versions of the library.

If it is ObjectHandles, this would be the second time I just ran into a use of them, that’s pretty cool. Unfortunately, I couldn’t find an email address on that site.

But that aside, the site is neat.  It lets you create some pretty "web 2.0" style buttons with stripes, highlights, etc.

I spent some time on the library yesterday.  I was tyring to get the rotation+resizing thing working better since it’s been somewhat broken for a while.  I’ve never needed that feature so it’s been neglected.  Unfortunately, I’m running into a bit of a brick wall.  I’m still trying to figure out exactly what it should do, nevermind how.  Luckily, most of my Trigonometry from High School is coming back to me since it’s heavy in that department.

Talk tonight on ObjectHandles+Degrafa (Attend online!)

As mentioned in a previous post, I’m giving a talk to the BFAIG group on creating a simple diagramming application in Flex using ObjectHandles and Degrafa.  It’s been delayed until tonight at 7:00pm EST.  If you’re interested in seeing it, this is a joint in-person and online meeting.  I’m actually attending from a remote location, so the online experience should be pretty good.  You can get info about how to attend online at the BFAIG Blog post.

Creating a simple diagramming application

Tonight, I’ll be giving a short talk to BFAIG on using ObjectHandles and Degrafa to make a simple diagramming application.  This application demonstrates the basics of working with Degrafa, and also shows how easy it is to make an interface that allows users to resize and move objects on screen.

The example application has source attached, and is licensed under the MIT license.  I hope someone can take it and make some really great application out of it.  Please drop me an email if you do!

I recorded a practice-run I did, so here it is…

 

New Object Handles release

I just whipped up a new ObjectHandles release.  Couple notable things…

They now automatically remove themselves from the SelectionManager when removed from the stage (they add themselves back when added as well).  This fixes a fairly serious memory leak.

I’m deprecating the useage of the Handle class.  It draws the handles through the drawing API.  Now, instead use the ImageHandle class which draws the handles from an embedded image.  There was some wonky logic in there that turned clipping on or off depending on this setting and that was just plain dumb.  Lets just do it one way.  I included sample .png files to simulate the old look.

I fixed some weird flickering when resizing to the left or up.  It only happened on certain cases, and I’m not sure why.  I think it had to do with delayed execution of the Flex layout manager.  Now, I delay the setting of x,y,width, and height and force a validateNow() right after setting those.  Let me know if this causes any problems in your application.

I still don’t have conditional compile for Flex2/Flex3 in there, so this will only compile under Flex 3.  Does anyone know how to get that conditional compiling to detect Flex version without having to pass an extra compiler param?

 

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.

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

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.

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!

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!