On Friday 05 March 2010 09:15:38 am Paul McNett wrote:
> On 3/5/10 9:05 AM, Larry wrote:
> > On 3/5/2010 11:52 AM, Paul McNett wrote:
> >> On 3/5/10 8:46 AM, Larry wrote:
> >>> We want to bind a control's position to a column in a grid for a grid
> >>> column total.  What property do we need to be looking at?
> >>
> >> What do you intend to do if the user horizontally scrolls the grid in
> >> such a fashion as to make the column invisible?
> >
> > I'm planning to also bind to it's width
>
> Look in dGrid.py, lines 642 - 660 (or search for comment "Thanks Roger
> Binns"). That's the code to get the header rect for painting the column's
> header. The meat of the code finds the left position of the column on
> screen, accounting for the horizontal scrollbar.
>
> If a read-only dColumn.Left property seems desirable, based on this code,
> let me know. Otherwise take the code and modify it to your needs.
>
> Paul

I was able to discover the left by just added all the column widths.  But what 
Larry has discovered is an issue in my mind.  We are using sizers for the 
panel (there are multiple panels with multiple tabs).  We add each object to 
a vertical sizer for each panel.  However, for this one item ( the textbox 
that follows the location of the last column on a grid) we don't explictly 
add the textbox to the panels sizer.  But instead add it to the form 
(self.Form.paidlbl = dabo.ui.dTextBox(self, DynamicPosition=self.pdlblpos, 
DynamicWidth = self.pdlblwidth).  For some reason (unknown to me) the textbox 
appears at the correct location.  

I would have thought that the textbox would have appeared on all tabs (because 
we appear to be adding it to the form and not the panel).  Also in general, 
just adding an object using position on a form that uses sizers seems wrong.  

Are we going the wrong way with this?

Johnf


_______________________________________________
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