Re: How to use XControls?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Patrick Barnes wrote:

[snip]
> }}}
<eucode>
> 	--Find the window this control is in, if none then fail.
> 	parentwin = findParentWindow(id)
> </eucode>
{{{

> 
> So, technically, it's win32lib's fault. smile
> If there's a way to get the parent (not necissarily a window) of the
> control, then that'd be a simple drop-in replacement of that line,
> that would work with Xcontrols, with an added bonus of making Autosize
> automatically heirarchical (So that you could use Autosize to manage
> controls relative to a 'group' or a 'tab control'.)

Yes, I do see the smiley, but in any case, please RTM. 

  findParentWindow(id)  --> Locates a Window type control that the id is in.
  findTopLevelWindow(id)  --> Locates topmost Window control that the id is in.
  findParent(id) --> Locates the owning control for id.

There may also be some special processing involved with TabItems. When you
call findParent() on an id that is in a TabItem, Win32Lib returns the
TabItem's id, but Microsoft does regard the TabItem as a real control. So
you can't simply resize a TabItem, instead you need to resize the TabControl
that the TabItem belongs to.

So if findParent() returns the id of a TabItem, you need to do an additional
findParent() to get the TabControl's id.

   par = findParent(id)
   if getControlInfo(par, CONTROLINFO_type) = TabItem then
      par = findParent(par)
   end if
   setRect( par, newLeft, newTop, newWidth, newHeight, w32True )

Hope this helps.
 
-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu