Author: OKB (not okblacke)
Posted: 2012-03-30 16:26:39 Link
It seems that the various Dynamic* properties are only updated when
update() is called. I'm not sure exactly when this is. But my question
is, is there any way to get "truly dynamic" (i.e., instant response)
behavior from these properties? What I'd like is, for instance, to have
a button whose DynamicEnabled state depends on values in another
control. I presume I could do this by hooking into various events, but
I'd really like to just have the DynamicEnabled be evaluated as part of
the default handling, so that every change to the form would trigger a
recalculation of Dynamic* properties. Is this possible?
Thanks,
--
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
--author unknown
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/XnsA02693273BEC2OKB@80.91.229.10
On Mar 30, 2012, at 4:26 PM, OKB (not okblacke) wrote:
> It seems that the various Dynamic* properties are only updated when
> update() is called. I'm not sure exactly when this is. But my question
> is, is there any way to get "truly dynamic" (i.e., instant response)
> behavior from these properties? What I'd like is, for instance, to have
> a button whose DynamicEnabled state depends on values in another
> control. I presume I could do this by hooking into various events, but
> I'd really like to just have the DynamicEnabled be evaluated as part of
> the default handling, so that every change to the form would trigger a
> recalculation of Dynamic* properties. Is this possible?
There isn't any framework-wide way to do what you want. The Dynamic* properties were designed to change when the record changes, which is when update() is typically called.
You could add a method to the button that binds to the LostFocus event of the controls that affect it, and call the update() from there, but I've never tried that myself. If you try it, let me know how (if?) it works.
-- Ed Leafe
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/35B70049-E8B0-41BC-8621-03203F9486E4@leafe.com
On 3/30/12 2:26 PM, OKB (not okblacke) wrote:
> It seems that the various Dynamic* properties are only updated when
> update() is called. I'm not sure exactly when this is. But my question
> is, is there any way to get "truly dynamic" (i.e., instant response)
> behavior from these properties? What I'd like is, for instance, to have
> a button whose DynamicEnabled state depends on values in another
> control. I presume I could do this by hooking into various events, but
> I'd really like to just have the DynamicEnabled be evaluated as part of
> the default handling, so that every change to the form would trigger a
> recalculation of Dynamic* properties. Is this possible?
I think we should consider redesigning them to do what you suggest.
VirtualFields work as you desire but that is at the biz layer...
Paul
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4F762E80.1030406@ulmcnett.com
Author: Adrian Klaver
Posted: 2012-03-30 17:14:22 Link
On 03/30/2012 03:06 PM, Paul McNett wrote:
> On 3/30/12 2:26 PM, OKB (not okblacke) wrote:
>> It seems that the various Dynamic* properties are only updated when
>> update() is called. I'm not sure exactly when this is. But my question
>> is, is there any way to get "truly dynamic" (i.e., instant response)
>> behavior from these properties? What I'd like is, for instance, to have
>> a button whose DynamicEnabled state depends on values in another
>> control. I presume I could do this by hooking into various events, but
>> I'd really like to just have the DynamicEnabled be evaluated as part of
>> the default handling, so that every change to the form would trigger a
>> recalculation of Dynamic* properties. Is this possible?
>
> I think we should consider redesigning them to do what you suggest.
Qt's signals and slots mechanism comes to mind.
>
> VirtualFields work as you desire but that is at the biz layer...
>
> Paul
--
Adrian Klaver
adrian.klaver@gmail.com
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4F76303E.4060807@gmail.com
On Friday, March 30, 2012 09:26:39 PM OKB wrote:
> It seems that the various Dynamic* properties are only updated when
> update() is called. I'm not sure exactly when this is. But my question
> is, is there any way to get "truly dynamic" (i.e., instant response)
> behavior from these properties? What I'd like is, for instance, to have
> a button whose DynamicEnabled state depends on values in another
> control. I presume I could do this by hooking into various events, but
> I'd really like to just have the DynamicEnabled be evaluated as part of
> the default handling, so that every change to the form would trigger a
> recalculation of Dynamic* properties. Is this possible?
>
> Thanks,
Larry Long discovered that DynamicXXXXX functions work very well with
controls. For example he created an invoice like screen that required the
totals to follow the grid resizing and used
DynamicPosition=(self.pdlblpos,4), DynamicWidth = (self.pdlblwidth,2)
as part of the controls attributes. Any movement of the grid causes the
DynamicXXXX functions to fire and update the position of the control on the
screen.
Therefore, I think you will be able to do similar bindings with your controls
using any of the events that matter (valuechange, lostfocus, etc..).
Johnf
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/95227856.HiLpZGB4zG@linux-12
Author: OKB (not okblacke)
Posted: 2012-03-30 18:26:21 Link
Paul McNett wrote:
> On 3/30/12 2:26 PM, OKB (not okblacke) wrote:
>> It seems that the various Dynamic* properties are only
>> updated when
>> update() is called. I'm not sure exactly when this is. But my
>> question is, is there any way to get "truly dynamic" (i.e.,
>> instant response) behavior from these properties? What I'd like
>> is, for instance, to have a button whose DynamicEnabled state
>> depends on values in another control. I presume I could do this
>> by hooking into various events, but I'd really like to just have
>> the DynamicEnabled be evaluated as part of the default handling,
>> so that every change to the form would trigger a recalculation of
>> Dynamic* properties. Is this possible?
>
> I think we should consider redesigning them to do what you suggest.
That would certainly be nice.
A possible middle ground would be a way to specify a list of events
and/or controls which a given control would "watch" for purposes of
Dynamic* evaluation. So if my button depended on the value in a certain
spinner control, I could pass "Watch=[thatSpinner]" to the button's
constructor, and it would update itself whenever the thatSpinner object
changed.
--
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
--author unknown
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/XnsA026A772AE4C8OKB@80.91.229.10
Author: Ricardo Araoz
Posted: 2012-03-30 18:49:09 Link
El 30/03/12 19:14, Adrian Klaver escribió:
> On 03/30/2012 03:06 PM, Paul McNett wrote:
>> On 3/30/12 2:26 PM, OKB (not okblacke) wrote:
>>> It seems that the various Dynamic* properties are only updated when
>>> update() is called. I'm not sure exactly when this is. But my question
>>> is, is there any way to get "truly dynamic" (i.e., instant response)
>>> behavior from these properties? What I'd like is, for instance, to have
>>> a button whose DynamicEnabled state depends on values in another
>>> control. I presume I could do this by hooking into various events, but
>>> I'd really like to just have the DynamicEnabled be evaluated as part of
>>> the default handling, so that every change to the form would trigger a
>>> recalculation of Dynamic* properties. Is this possible?
>> I think we should consider redesigning them to do what you suggest.
> Qt's signals and slots mechanism comes to mind.
>
A simple observer pattern.
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4F764675.2070609@gmail.com
On Friday, March 30, 2012 11:26:21 PM OKB wrote:
> Paul McNett wrote:
> > On 3/30/12 2:26 PM, OKB (not okblacke) wrote:
> >> It seems that the various Dynamic* properties are
> >> only
> >> updated when
> >>
> >> update() is called. I'm not sure exactly when this is. But my
> >> question is, is there any way to get "truly dynamic" (i.e.,
> >> instant response) behavior from these properties? What I'd like
> >> is, for instance, to have a button whose DynamicEnabled state
> >> depends on values in another control. I presume I could do this
> >> by hooking into various events, but I'd really like to just have
> >> the DynamicEnabled be evaluated as part of the default handling,
> >> so that every change to the form would trigger a recalculation of
> >> Dynamic* properties. Is this possible?
> >
> > I think we should consider redesigning them to do what you suggest.
>
> That would certainly be nice.
>
> A possible middle ground would be a way to specify a list of events
> and/or controls which a given control would "watch" for purposes of
> Dynamic* evaluation. So if my button depended on the value in a certain
> spinner control, I could pass "Watch=[thatSpinner]" to the button's
> constructor, and it would update itself whenever the thatSpinner object
> changed.
I guess I'm simple minded here! What is wrong with binding the control?
object.bindEvent(dEvents.xxxxxxxx, self._function)
or
.Bind(wx.xxxxxxxx, function)
You can even create your own events.
Johnf
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/1355608.m4pMzUkv6n@linux-12
On 3/30/12 4:49 PM, Ricardo Araoz wrote:
> El 30/03/12 19:14, Adrian Klaver escribió:
>> > On 03/30/2012 03:06 PM, Paul McNett wrote:
>>> >> On 3/30/12 2:26 PM, OKB (not okblacke) wrote:
>>>> >>> It seems that the various Dynamic* properties are only updated when
>>>> >>> update() is called. I'm not sure exactly when this is. But my question
>>>> >>> is, is there any way to get "truly dynamic" (i.e., instant response)
>>>> >>> behavior from these properties? What I'd like is, for instance, to have
>>>> >>> a button whose DynamicEnabled state depends on values in another
>>>> >>> control. I presume I could do this by hooking into various events, but
>>>> >>> I'd really like to just have the DynamicEnabled be evaluated as part of
>>>> >>> the default handling, so that every change to the form would trigger a
>>>> >>> recalculation of Dynamic* properties. Is this possible?
>>> >> I think we should consider redesigning them to do what you suggest.
>> > Qt's signals and slots mechanism comes to mind.
>> >
> A simple observer pattern.
I don't think an observer would even be needed. The dynamic properties are already
properties, with getter methods. So, the evaluation of the dynamic property simply
needs to happen in the dynamic property's getter.
Paul
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4F7679F6.3070804@ulmcnett.com
Author: OKB (not okblacke)
Posted: 2012-03-30 23:04:24 Link
John Fabiani wrote:
> I guess I'm simple minded here! What is wrong with binding the
> control?
> object.bindEvent(dEvents.xxxxxxxx, self._function)
> or
> .Bind(wx.xxxxxxxx, function)
>
> You can even create your own events.
What's wrong with it is it's a lot of boilerplate. Decide the
event, write a function, in the function call update. In general I feel
that if using a feature of the framework is requiring me to write a
bunch of similar, repetitive functions, it's a sign that that
functionality could be abstracted into the framework. That may or may
not work in any individual case, but it's worth looking into.
--
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
--author unknown
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/XnsA026D6972F69AOKB@80.91.229.10