[flexcoders] SetStyleAction - clear style?

2007-11-26 Thread rkettrey
With respect to styles, you can setStyle() or clearStyle().  There is 
an effect, SetStyleAction, that allows you to accomplish the setStyle().

Is there some way of accomplishing clearStyle() as an effect?  Using a 
SetStyleAction with a value of null does not work, as the style is 
still there, and for ints a null style value is often interpreted as 0.

At this stage I am thinking of making a custom effect, which seems easy 
enough, but did not want to re-invent the wheel.

-Ryan



[flexcoders] Dragging - ListBase.dragImageOffsets?

2007-11-08 Thread rkettrey
ListBase defines two overrideable (protected) getters:

dragImage
dragImageOffsets

It looks to me like the design was to allow subclasses to override 
the drag image and the offset of it, which is great.  However, if you 
check out ListBase.dragStartHandler, it only ever looks at 
dragImage.  Shouldn't this line:

DragManager.doDrag(this, dragSource, event, dragImage,
   0, 0, 0.5, dragMoveEnabled);
 
actually be this line:

var pt:Point = dragImageOffsets;
DragManager.doDrag(this, dragSource, event, dragImage,
   pt.x, pt.y, 0.5, dragMoveEnabled);

I don't even see dragImageOffsets being used anywhere, so I am 
assuming it was a partially implement design.

Thoughts?



[flexcoders] Re: Flex 3 Custom Drag Proxies Broken?

2007-11-08 Thread rkettrey
It worked.  Not sure why, but thanks.

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Try setting width/height instead of calling setActualSize().
> 
>  
> 
> If that doesn't work, make a small test case, file a bug and let me 
know
> the bug #.
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of rkettrey
> Sent: Wednesday, November 07, 2007 8:33 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Flex 3 Custom Drag Proxies Broken?
> 
>  
> 
> I have a very simple app with a List that displays a custom drag 
> proxy. It works just fine in Flex 2, but in Flex 3 the custom drag 
> proxy does not show.
> 
> I simply override the protected ListBase.dragImage getter to return 
> my custom drag image (I am pulling the image source out of the 
> currently selected row) like such:
> 
> var renderer:CustomItemRenderer = 
> this.indexToItemRenderer(this.selectedIndex) as CustomItemRenderer;
> var actualImage:Image = renderer.thumbImage;
> var dragProxy:Image = new Image();
> 
> dragProxy.source = actualImage.source;
> dragProxy.setActualSize(actualImage.width, actualImage.height);
> 
> return dragProxy;
> 
> I see the custom drag proxy moving around fine in Flex 2, but 
nothing 
> is drawn in Flex 3. I do get the drag indicator (red X when not 
over 
> a drop target), and when I drop the image it does show up. It is 
> just that the custom drag proxy does not show while dragging.
> 
> Any ideas?
>




[flexcoders] Flex 3 Custom Drag Proxies Broken?

2007-11-07 Thread rkettrey
I have a very simple app with a List that displays a custom drag 
proxy.  It works just fine in Flex 2, but in Flex 3 the custom drag 
proxy does not show.

I simply override the protected ListBase.dragImage getter to return  
my custom drag image (I am pulling the image source out of the 
currently selected row) like such:

var renderer:CustomItemRenderer = 
  this.indexToItemRenderer(this.selectedIndex) as CustomItemRenderer;
var actualImage:Image = renderer.thumbImage;
var dragProxy:Image = new Image();

dragProxy.source = actualImage.source;
dragProxy.setActualSize(actualImage.width, actualImage.height);

return dragProxy;


I see the custom drag proxy moving around fine in Flex 2, but nothing 
is drawn in Flex 3.  I do get the drag indicator (red X when not over 
a drop target), and when I drop the image it does show up.  It is 
just that the custom drag proxy does not show while dragging.

Any ideas?



[flexcoders] Re: DateField FlexEvent.ENTER Event?

2007-10-18 Thread rkettrey
I got it working.  The final solution is:

1. override focusInHandler leave defaultButtonEnabled = true
2. when the drop down (date picker in this case) is shown, set 
defaultButtonEnabled = false when it is shown, true otherwise

Just my opinion, but I think this should have been the implementation 
for ComboBase to begin with.  The only reason I can see wanting to 
disable the defaut button is so that when a drop down (date picker or 
list) is displayed, ENTER works against  that drop down.  Otherwise, 
ENTER should cause default button processing.  Anyway my change makes 
it work this way now.

--- In flexcoders@yahoogroups.com, "rkettrey" <[EMAIL PROTECTED]> wrote:
>
> Thanks for the reply, it got me going in the right direction.  
> Instead of my original code, I simply overrode DataField's 
> focusInHandler (actually implemented in ComboBase) and changed the 
> line:
> 
> fm.defaultButtonEnabled = false;
> 
> to
> 
> fm.defaultButtonEnabled = true;
> 
> Now pressing ENTER in the DateField works, with one caveat.  When 
the 
> date picker is up, ENTER should only make the picker close.  This 
> case is being checked currently in ComboBase.keyDownHandler, and I 
> was expecting the existing call in that function to 
> event.stopPropogation (after checking the picker is up and closing 
> it) would stop the ENTER key from being process by the focus sub-
> system.  It does not apparently.  I also tried overriding it and 
> changing it to event.stopImmediatePropogation for the heck of it, 
but 
> it does the same thing.
> 
> What is going on here and any ideas how I can make it eat the event 
> from the focusManager point of view when the picker is up?
> 
> --- In flexcoders@yahoogroups.com, "Alex Harui"  wrote:
> >
> > defaultButtonEnabled also need to be changed.
> > 
> >  
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com 
> [mailto:[EMAIL PROTECTED] On
> > Behalf Of rkettrey
> > Sent: Wednesday, October 17, 2007 1:24 PM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] DateField FlexEvent.ENTER Event?
> > 
> >  
> > 
> > TextInput controls will broadcast the FlexEvent.ENTER event when 
> the 
> > enter key is pressed to simulate the default button being pressed 
> for a 
> > form.
> > 
> > I'd like this same thing to happen on my DateFields. I know that 
> > DateField wants to handle the enter key to do its parsing and 
> closing 
> > of the "drop down" (inherits from ComboBase for the date picker), 
> which 
> > is fine. If it is only handling parsing, though, I would like the 
> > control to broadcast the enter event.
> > 
> > After looking at what the TextInput does, I overrode the 
> keyDownHandler 
> > function in DateField where it handles the ENTER key. At the end 
of 
> > the ENTER key handling scope I added:
> > 
> > dispatchEvent(new FlexEvent(FlexEvent.ENTER));
> > 
> > Everything compiles and it appears to broadcast the event. 
However, 
> > the default button handling does not occur.
> > 
> > Any thoughts?
> >
>




[flexcoders] Re: DateField FlexEvent.ENTER Event?

2007-10-18 Thread rkettrey
Thanks for the reply, it got me going in the right direction.  
Instead of my original code, I simply overrode DataField's 
focusInHandler (actually implemented in ComboBase) and changed the 
line:

fm.defaultButtonEnabled = false;

to

fm.defaultButtonEnabled = true;

Now pressing ENTER in the DateField works, with one caveat.  When the 
date picker is up, ENTER should only make the picker close.  This 
case is being checked currently in ComboBase.keyDownHandler, and I 
was expecting the existing call in that function to 
event.stopPropogation (after checking the picker is up and closing 
it) would stop the ENTER key from being process by the focus sub-
system.  It does not apparently.  I also tried overriding it and 
changing it to event.stopImmediatePropogation for the heck of it, but 
it does the same thing.

What is going on here and any ideas how I can make it eat the event 
from the focusManager point of view when the picker is up?

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> defaultButtonEnabled also need to be changed.
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of rkettrey
> Sent: Wednesday, October 17, 2007 1:24 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] DateField FlexEvent.ENTER Event?
> 
>  
> 
> TextInput controls will broadcast the FlexEvent.ENTER event when 
the 
> enter key is pressed to simulate the default button being pressed 
for a 
> form.
> 
> I'd like this same thing to happen on my DateFields. I know that 
> DateField wants to handle the enter key to do its parsing and 
closing 
> of the "drop down" (inherits from ComboBase for the date picker), 
which 
> is fine. If it is only handling parsing, though, I would like the 
> control to broadcast the enter event.
> 
> After looking at what the TextInput does, I overrode the 
keyDownHandler 
> function in DateField where it handles the ENTER key. At the end of 
> the ENTER key handling scope I added:
> 
> dispatchEvent(new FlexEvent(FlexEvent.ENTER));
> 
> Everything compiles and it appears to broadcast the event. However, 
> the default button handling does not occur.
> 
> Any thoughts?
>




[flexcoders] DateField FlexEvent.ENTER Event?

2007-10-17 Thread rkettrey
TextInput controls will broadcast the FlexEvent.ENTER event when the 
enter key is pressed to simulate the default button being pressed for a 
form.

I'd like this same thing to happen on my DateFields.  I know that 
DateField wants to handle the enter key to do its parsing and closing 
of the "drop down" (inherits from ComboBase for the date picker), which 
is fine.  If it is only handling parsing, though, I would like the 
control to broadcast the enter event.

After looking at what the TextInput does, I overrode the keyDownHandler 
function in DateField where it handles the ENTER key.  At the end of 
the ENTER key handling scope I added:

dispatchEvent(new FlexEvent(FlexEvent.ENTER));

Everything compiles and it appears to broadcast the event.  However, 
the default button handling does not occur.

Any thoughts?