On Thu, 06 Oct 2005 12:56:08 -0700, Paul McNett wrote:
> Adi J. Sieker wrote:
>>> I don't see us doing this at all. After all, what does this
>>> 'stock button' give us?
>>>
>
>> It let's the OS handle the labeling.
>> If you create the stock "Cancel" button it'll always be called
>> "Abbrechen" in a German version of Windows.
>>
> It also automatically includes a nice bitmap.
>>
>>
>>> btn = dButton(self, Caption="Preferences")
>>> btn = dButton(self, Stock="Preferences")
>>>
>>> ??
>>>
>> That looks nice. Although I think naming the parameter Standard
>> would be more little more intuitive.
>>
> A different approach would be to provide actual subclasses, like:
>
> dButtonPreferences
> dButtonOK
> dButtonCancel
>
> etc. etc. Not sure I like this idea or not, I'd have to see some
> discussion on it first, but thought I'd mention it.
I also thought of:
import dabo.ui.dStandardButtons
btn = dabo.ui.dStandardButtons.get("OK")
or something like this, which doesn't work, but I think would be cool:
In StandardButtons.py:
stockIDs = {
"Add" : wx.ID_ADD,
"Apply" : wx.ID_APPLY,
}
def getButton(val):
return dabo.ui.Button(id=stockIDs[val])
for s in stockIDs:
s.key() = property(_getButton)
then you should be able todo:
import StandardButtons
btn = StandardButtons.Add
but this doesn't allow for user properties to the constructor.
adi
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users