On Sep 30, 2009, at 5:50 PM, Ricardo Aráoz wrote:

> So now I have a DropdownList with 3 values set to ValueMode =  
> position.
> And the following:
> --------------------------------------------------------------------------------
> def onInteractiveChange(self, evt):
>    dictValuePage = {0:{'Pagina':self.Form.pgDateTextBox,
> 'Control':self.Form.dDateTextBox}
>                                , 1:{'Pagina':self.Form.pgEditBox,
> 'Control':self.Form.dEditBox}
>                                , 2:{'Pagina':self.Form.pgListBox,
> 'Control':self.Form.dListBox}
>                                }
>    self.Form.PgFrmOMs.SelectedPage = dictValuePage[self.Value] 
> ['Pagina']
>    dictValuePage[self.Value]['Control'].setFocus()
> --------------------------------------------------------------------------------

        You could probably simplify this quite a bit by using data binding to  
directly link the dropdown to the page control:

ddown = dabo.ui.dDropdownList(self, ValueMode="Position",  
DataSource="ControlFrame", DataField="SelectedPageNumber")

        Now when the user changes the dropdown, the SelectedPageNumber of the  
paged control will also change. Now all you need in the  
InteractiveChange handler is the setFocus() call.

> And besides it the PageFrameNoTabs with three Pages with different
> controls in them. Now when I run it and select a value in the
> DropdownList I keep seeing Page 0. And the PageFrameNoTabs does not  
> grow
> to accomodate the controls in the pages (Page 0 has a Label and a
> DateTextBox and the DateTextBox is partially hidden whilst the page  
> has
> scroll bars).
> Any hints?


        Have you tried adding a call to the control's layout() method?


-- Ed Leafe





_______________________________________________
Post Messages to: [email protected]
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/[email protected]

Reply via email to