1. How to use XControls?
- Posted by Tony Steward <tony.steward at gmail.com> Jan 25, 2005
- 509 views
- Last edited Jan 26, 2005
Hi Don, Playing with your XControls library. If I split a window and drag the spliter can I trap the resize event? Can I use Autosize.ew from the eu archives with XControls or any other auto resizing tool? -- Regards Tony Steward
2. Re: How to use XControls?
- Posted by Greg Haberek <ghaberek at gmail.com> Jan 26, 2005
- 514 views
> Hi Don, Nope, Greg here! I've been playing with xControls a lot more than Don has been lately. > Playing with your XControls library. > If I split a window and drag the spliter can I trap the resize event? Yes, with setHandler(), event handlers get stacked, so there can be multiple handlers for the same event and control. > Can I use Autosize.ew from the eu archives with XControls or any other > auto resizing tool? Why not use Geometry? It's part of xControls! Look at the Splitter demos and Geometry demos for more details. ~Greg
3. Re: How to use XControls?
- Posted by Tony Steward <tony.steward at gmail.com> Jan 26, 2005
- 530 views
Hi Greg, Please tell me if I plit a window horizontally then split the top pane vertically, how do I call geometry to look after things in the top left pand when that pane is resized. In the example below it resizes with the entire window but not if I adjust the pane. What am I doing wrong. Thanks
constant MainWin = createEx( Window, "", 0, Default, Default, 786, 567, {WS_THICKFRAME, WS_SYSMENU, WS_MINIMIZEBOX, WS_MAXIMIZEBOX}, {WS_EX_DLGMODALFRAME} ) constant hGMID = xControl( Geometry, "", MainWin, 0, 0, 0, 0, 0, 0 ), paneTop = create( Window, "", MainWin, 0, 0, 0, 0, {WS_CHILD,WS_VISIBLE,WS_CLIPSIBLINGS} ), hsplit = xControl( HSplitter, "", MainWin, 0, 280, 0, 0, 0, hGMID ), paneBottom = create( Window, "", MainWin, 0, 0, 0, 0, {WS_CHILD,WS_VISIBLE,WS_CLIPSIBLINGS} ) manage( hGMID, paneTop, {0,0}, {0,0}, {1.0,0}, {hsplit,0} ) manage( hGMID, paneBottom, {0,0}, {hsplit,0}, {1.0,0}, {1.0,0} ) constant vGMID = xControl( Geometry, "", paneTop, 0, 0, 0, 0, 0, 0 ), paneLeft = create( Window, "", paneTop, 0, 0, 0, 0, {WS_CHILD,WS_VISIBLE,WS_CLIPSIBLINGS} ), vsplit = xControl( VSplitter, "", paneTop, 600, 0, 0, 0, 0, vGMID ), paneRight = create( Window, "", paneTop, 0, 0, 0, 0, {WS_CHILD,WS_VISIBLE,WS_CLIPSIBLINGS} ) manage( vGMID, paneLeft, {0,0}, {0,0}, {vsplit,0}, {1.0,0} ) --manage( vGMID, paneLeft, {0,0}, {0,0}, {0,0.75}, {1.0,0} ) manage( vGMID, paneRight, {vsplit,5}, {0,0}, {1.0,0}, {1.0,0} ) manage_now( hGMID ) manage_now( vGMID ) integer KeyGroupGrid KeyGroupGrid = EGW_CreateGrid( paneLeft, 4, 52, 592, 188, 1 ) manage( hGMID, KeyGroupGrid, {0,4}, {0,24}, {0.50,4}, {0.80,0} )
On Tue, 25 Jan 2005 20:15:47 -0500, Greg Haberek <ghaberek at gmail.com> wrote: > > > Hi Don, > > Nope, Greg here! I've been playing with xControls a lot more than Don > has been lately. > > > Playing with your XControls library. > > If I split a window and drag the spliter can I trap the resize event? > > Yes, with setHandler(), event handlers get stacked, so there can be > multiple handlers for the same event and control. > > > Can I use Autosize.ew from the eu archives with XControls or any other > > auto resizing tool? > > Why not use Geometry? It's part of xControls! Look at the Splitter > demos and Geometry demos for more details. > > ~Greg > > -- Regards Tony Steward www.locksdownunder.com IF IT IS TO BE IT IS UP TO ME!
4. Re: How to use XControls?
- Posted by Patrick Barnes <mrtrick at gmail.com> Jan 26, 2005
- 507 views
- Last edited Jan 27, 2005
Hooray, an Autosize user! I think it will work fine.. as long as the Xcontrols are compatible withi win32lib's setRect calls, etc... On Wed, 26 Jan 2005 08:53:03 +1100, Tony Steward <tony.steward at gmail.com> wrote: > > Hi Don, > Playing with your XControls library. > If I split a window and drag the spliter can I trap the resize event? > > Can I use Autosize.ew from the eu archives with XControls or any other > auto resizing tool? > > -- > Regards > Tony Steward > > -- MrTrick
5. Re: How to use XControls?
- Posted by Tony Steward <tony.steward at gmail.com> Jan 27, 2005
- 483 views
No Autosize does not work with XControls. Autosize seems to get it info from the main window not the window in an XContol pane. Still can't figure how to get geometry to size the elements in the windows that have been created with vsplt or hsplit. BTW love Autosize have been using it for a while. Its great. Regards Tony On Thu, 27 Jan 2005 09:39:29 +1100, Patrick Barnes <mrtrick at gmail.com> wrote: > > Hooray, an Autosize user! > > I think it will work fine.. as long as the Xcontrols are compatible > withi win32lib's setRect calls, etc... > > On Wed, 26 Jan 2005 08:53:03 +1100, Tony Steward <tony.steward at gmail.com> > wrote: > > > > Hi Don, > > Playing with your XControls library. > > If I split a window and drag the spliter can I trap the resize event? > > > > Can I use Autosize.ew from the eu archives with XControls or any other > > auto resizing tool? > > > > -- > > Regards > > Tony Steward > > > > > -- > MrTrick > > -- Regards Tony Steward www.locksdownunder.com IF IT IS TO BE IT IS UP TO ME!
6. Re: How to use XControls?
- Posted by Tony Steward <tony.steward at gmail.com> Jan 27, 2005
- 482 views
For some reason when Autosize gets the parent id it gets the Main window not the child window that the item to be attached is on. My window has a three way split. 1st split is horizontal then top pane is split vertically. When is resize the horizontal split it triggers the onwinresize event in Autosize but when I move the vertical slider it does not. Hope this helps you to help me, which in turn may help you. (wow) Thanks guys Tony On Thu, 27 Jan 2005 17:39:21 +1100, Tony Steward <tony.steward at gmail.com> wrote: > > No Autosize does not work with XControls. Autosize seems to get it > info from the main window not the window in an XContol pane. > > Still can't figure how to get geometry to size the elements in the > windows that have been created with vsplt or hsplit. > > BTW love Autosize have been using it for a while. Its great. > > Regards > Tony > > On Thu, 27 Jan 2005 09:39:29 +1100, Patrick Barnes <mrtrick at gmail.com> > wrote: > > > > Hooray, an Autosize user! > > > > I think it will work fine.. as long as the Xcontrols are compatible > > withi win32lib's setRect calls, etc... > > > > On Wed, 26 Jan 2005 08:53:03 +1100, Tony Steward <tony.steward at gmail.com> > > wrote: > > > > > > Hi Don, > > > Playing with your XControls library. > > > If I split a window and drag the spliter can I trap the resize event? > > > > > > Can I use Autosize.ew from the eu archives with XControls or any other > > > auto resizing tool? > > > > > > -- > > > Regards > > > Tony Steward > > > > > > > > -- > > MrTrick > > > > > -- > Regards > Tony Steward > www.locksdownunder.com > > IF IT IS TO BE IT IS UP TO ME! > > -- Regards Tony Steward www.locksdownunder.com IF IT IS TO BE IT IS UP TO ME!
7. Re: How to use XControls?
- Posted by Patrick Barnes <mrtrick at gmail.com> Jan 27, 2005
- 464 views
On Thu, 27 Jan 2005 17:52:45 +1100, Tony Steward <tony.steward at gmail.com> wrote: > For some reason when Autosize gets the parent id it gets the Main > window not the child window that the item to be attached is on. > > My window has a three way split. 1st split is horizontal then top pane > is split vertically. When is resize the horizontal split it triggers > the onwinresize event in Autosize but when I move the vertical slider > it does not. > > Hope this helps you to help me, which in turn may help you. (wow) Hmmm, well... global procedure attach_control(object id, object placement) sequence winSize, objPlacement integer parentwin --If id is a sequence, then recurse. if sequence(id) then for a = 1 to length(id) do attach_control(id[a], placement) end for return end if --Find the window this control is in, if none then fail. parentwin = findParentWindow(id) > > Thanks guys > Tony > > On Thu, 27 Jan 2005 17:39:21 +1100, Tony Steward <tony.steward at gmail.com> > wrote: > > > > No Autosize does not work with XControls. Autosize seems to get it > > info from the main window not the window in an XContol pane. > > > > Still can't figure how to get geometry to size the elements in the > > windows that have been created with vsplt or hsplit. > > > > BTW love Autosize have been using it for a while. Its great. > > > > Regards > > Tony > > > > On Thu, 27 Jan 2005 09:39:29 +1100, Patrick Barnes <mrtrick at gmail.com> > > wrote: > > > > > > Hooray, an Autosize user! > > > > > > I think it will work fine.. as long as the Xcontrols are compatible > > > withi win32lib's setRect calls, etc... > > > > > > On Wed, 26 Jan 2005 08:53:03 +1100, Tony Steward <tony.steward at > > > gmail.com> wrote: > > > > > > > > Hi Don, > > > > Playing with your XControls library. > > > > If I split a window and drag the spliter can I trap the resize event? > > > > > > > > Can I use Autosize.ew from the eu archives with XControls or any other > > > > auto resizing tool? > > > > > > > > -- > > > > Regards > > > > Tony Steward > > > > > > > > > > > -- > > > MrTrick > > > > > > > > -- > > Regards > > Tony Steward > > www.locksdownunder.com > > > > IF IT IS TO BE IT IS UP TO ME! > > > > > -- > Regards > Tony Steward > www.locksdownunder.com > > IF IT IS TO BE IT IS UP TO ME! > > -- MrTrick
8. Re: How to use XControls?
- Posted by Tony Steward <tony.steward at gmail.com> Jan 27, 2005
- 479 views
what does this email mean? Not descriptive! Are you telling me findParentWindow(id) finds the grand parent? On Thu, 27 Jan 2005 18:33:45 +1100, Patrick Barnes <mrtrick at gmail.com> wrote: > > On Thu, 27 Jan 2005 17:52:45 +1100, Tony Steward <tony.steward at gmail.com> > wrote: > > For some reason when Autosize gets the parent id it gets the Main > > window not the child window that the item to be attached is on. > > > > My window has a three way split. 1st split is horizontal then top pane > > is split vertically. When is resize the horizontal split it triggers > > the onwinresize event in Autosize but when I move the vertical slider > > it does not. > > > > Hope this helps you to help me, which in turn may help you. (wow) > > Hmmm, well... > > global procedure attach_control(object id, object placement) > sequence winSize, objPlacement > integer parentwin > > --If id is a sequence, then recurse. > if sequence(id) then > for a = 1 to length(id) do > attach_control(id[a], placement) > end for > return > end if > > --Find the window this control is in, if none then fail. > parentwin = findParentWindow(id) > > > > > Thanks guys > > Tony > > > > On Thu, 27 Jan 2005 17:39:21 +1100, Tony Steward <tony.steward at gmail.com> > > wrote: > > > > > > No Autosize does not work with XControls. Autosize seems to get it > > > info from the main window not the window in an XContol pane. > > > > > > Still can't figure how to get geometry to size the elements in the > > > windows that have been created with vsplt or hsplit. > > > > > > BTW love Autosize have been using it for a while. Its great. > > > > > > Regards > > > Tony > > > > > > On Thu, 27 Jan 2005 09:39:29 +1100, Patrick Barnes <mrtrick at gmail.com> > > > wrote: > > > > > > > > Hooray, an Autosize user! > > > > > > > > I think it will work fine.. as long as the Xcontrols are compatible > > > > withi win32lib's setRect calls, etc... > > > > > > > > On Wed, 26 Jan 2005 08:53:03 +1100, Tony Steward <tony.steward at > > > > gmail.com> wrote: > > > > > > > > > > Hi Don, > > > > > Playing with your XControls library. > > > > > If I split a window and drag the spliter can I trap the resize event? > > > > > > > > > > Can I use Autosize.ew from the eu archives with XControls or any other > > > > > auto resizing tool? > > > > > > > > > > -- > > > > > Regards > > > > > Tony Steward > > > > > > > > > > > > > > -- > > > > MrTrick > > > > > > > > > > > -- > > > Regards > > > Tony Steward > > > www.locksdownunder.com > > > > > > IF IT IS TO BE IT IS UP TO ME! > > > > > > > > -- > > Regards > > Tony Steward > > www.locksdownunder.com > > > > IF IT IS TO BE IT IS UP TO ME! > > > > > -- > MrTrick > > -- Regards Tony Steward www.locksdownunder.com IF IT IS TO BE IT IS UP TO ME!
9. Re: How to use XControls?
- Posted by Patrick Barnes <mrtrick at gmail.com> Jan 27, 2005
- 475 views
On Thu, 27 Jan 2005 17:52:45 +1100, Tony Steward <tony.steward at gmail.com> wrote: > > For some reason when Autosize gets the parent id it gets the Main > window not the child window that the item to be attached is on. > > My window has a three way split. 1st split is horizontal then top pane > is split vertically. When is resize the horizontal split it triggers > the onwinresize event in Autosize but when I move the vertical slider > it does not. Hmmm, I'm not too familiar with Xcontrols, although I've checked out the demos and it looks impressive. The way that Autosize figures out which resizes it should be trapping is just inside the attach_control() procedure:
--Find the window this control is in, if none then fail. parentwin = findParentWindow(id)
So, technically, it's win32lib's fault. 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'.) > Hope this helps you to help me, which in turn may help you. (wow) Sounds like it could be helpful to me, cause it'd make Autosize even better. Should make things fine for Xcontrols, as long as the custom panes still generate onResize events. -- MrTrick
10. Re: How to use XControls?
- Posted by Tony Steward <tony.steward at gmail.com> Jan 27, 2005
- 475 views
Ok a short term solution is I have modified Autosize so I pass the window id that the cotrol is on to Autosize manually. And it works great, On Thu, 27 Jan 2005 18:41:04 +1100, Patrick Barnes <mrtrick at gmail.com> wrote: > > On Thu, 27 Jan 2005 17:52:45 +1100, Tony Steward <tony.steward at gmail.com> > wrote: > > > > For some reason when Autosize gets the parent id it gets the Main > > window not the child window that the item to be attached is on. > > > > My window has a three way split. 1st split is horizontal then top pane > > is split vertically. When is resize the horizontal split it triggers > > the onwinresize event in Autosize but when I move the vertical slider > > it does not. > > Hmmm, I'm not too familiar with Xcontrols, although I've checked out > the demos and it looks impressive. > > The way that Autosize figures out which resizes it should be trapping > is just inside the > attach_control() procedure: > }}} <eucode> > --Find the window this control is in, if none then fail. > parentwin = findParentWindow(id) > </eucode> {{{ > > So, technically, it's win32lib's fault. > 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'.) > > > Hope this helps you to help me, which in turn may help you. (wow) > > Sounds like it could be helpful to me, cause it'd make Autosize even better. > Should make things fine for Xcontrols, as long as the custom panes > still generate onResize events. > > -- > MrTrick > > -- Regards Tony Steward www.locksdownunder.com IF IT IS TO BE IT IS UP TO ME!
11. Re: How to use XControls?
- Posted by Patrick Barnes <mrtrick at gmail.com> Jan 27, 2005
- 488 views
I've been working on fixing Autosize to handle this properly... All you have to do is change 'findParentWindow' to 'findParent', and change the error check below it to check for '<= 0', and it should work. I made a quick demo for this, and encountered a problem for tab controls though...
without warning include win32Lib.ew include autosize.ew --(You have to make the changes to autosize described above) constant win = create( Window, "Demo 5 - Hierarchical Autosizing", 0, Default, Default, 0, 0, 0 ) setClientRect(win, 400,400) constant tab = create( TabControl, "", win, 10,10, 180,180, 0), tab1 = create( TabItem, "Tab 1", tab, 0,0,0,0,0), b1 = create( Button, "B", tab1, 8, 20, 24, 24, 0), b2 = create( Button, "B", tab1, 150, 150, 24, 24, 0) constant group = create( Group, "Group 1", win, 210, 210, 180, 180, 0), b3 = create( Button, "B", group, 8, 15, 24, 24, 0), b4 = create( Button, "B", group, 150, 150, 24, 24, 0) attach_control( tab, {TL, MM} ) attach_control( b1, TL ) attach_control( b2, BR ) attach_control( group, {MM, BR} ) attach_control( b3, TL ) attach_control( b4, BR ) WinMain( win,Normal )
The buttons in the group move correctly, but the buttons in the tab do not. The TabControl picks up the resize events, but it seems the TabItems do not. The parent of the button is the TabItem, not the TabControl. I could work around this by testing if the parent is a TabItem, and if so getting *its* parent, but it seems like a bit of a kludge. Any suggestions as to making it work for things in Tabs? (and, presumably, any Xcontrols that are like this) On Thu, 27 Jan 2005 18:56:47 +1100, Tony Steward <tony.steward at gmail.com> wrote: > Ok a short term solution is I have modified Autosize so I pass the > window id that the cotrol is on to Autosize manually. And it works > great, That is a general solution, I might make this an overloaded function... it's not quite as elegant as the way it's currently done, so I wouldn't make it the norm. Thanks for your suggestions... -- MrTrick
12. Re: How to use XControls?
- Posted by Greg Haberek <ghaberek at gmail.com> Jan 28, 2005
- 472 views
> Still can't figure how to get geometry to size the elements in the > windows that have been created with vsplt or hsplit. You need to create a separate Geometry for each window that contains controls. So if you have 3 panes which are all windows, you'll need a total of 4 Geometry controls. One for the Main window, and one for each pane. It's pretty simple. I supposed I'll add this into the docs for Geometry, HSplitter and VSplitter. ~Greg
13. Re: How to use XControls?
- Posted by Derek Parnell <ddparnell at bigpond.com> Jan 28, 2005
- 485 views
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. > 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
14. Re: How to use XControls?
- Posted by Patrick Barnes <mrtrick at gmail.com> Jan 28, 2005
- 491 views
On Thu, 27 Jan 2005 16:21:11 -0800, Derek Parnell <guest at rapideuphoria.com> wrote: > Yes, I do see the smiley, but in any case, please RTM. Sorry, about 2 minutes after posting that, I found the findParent(id) call. > 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. Yes, that would work... did you read the other post I made about troubles in Autosize? Specifically checking for TabItem seems like a bit of a kludge, I don't suppose there's any way to test whether a control needs to use the grandparent rather than parent? I don't know anything about XControls, is it possible that this problem would exist for any of the XControl types? Sorry for the dig about win32lib... it's more my own laziness that is the cause. -- MrTrick
15. Re: How to use XControls?
- Posted by Derek Parnell <ddparnell at bigpond.com> Jan 28, 2005
- 481 views
Patrick Barnes wrote: [snip] > Specifically checking for TabItem seems like a > bit of a kludge, I don't suppose there's any way to test whether a > control needs to use the grandparent rather than parent? I think that Win32lib should be smart enough to know that if you try to resize a TabItem that the owning TabControl is what really should be resized. I'll think about making this change. -- Derek Parnell Melbourne, Australia
16. Re: How to use XControls?
- Posted by Patrick Barnes <mrtrick at gmail.com> Jan 28, 2005
- 479 views
On Thu, 27 Jan 2005 20:55:29 -0800, Derek Parnell <guest at rapideuphoria.com> wrote: > Patrick Barnes wrote: > [snip] > > > Specifically checking for TabItem seems like a > > bit of a kludge, I don't suppose there's any way to test whether a > > control needs to use the grandparent rather than parent? > > I think that Win32lib should be smart enough to know that if you try to > resize a TabItem that the owning TabControl is what really should be resized. > I'll think about making this change. Well, I'm not particularly concerned about that... When you call 'attach_control' in Autosize, it will (in the new version, at least) resize itself relative to it's parent - listening for when the parent changes size. So I'm talking about the items inside the TabItem, not the TabItem itself. The problem is that the TabItem doesn't receive any w32HResize events, even though visually you could say it changes size. Would you consider triggering resize events in a TabItem when the parent TabControl is resized? -- MrTrick
17. Re: How to use XControls?
- Posted by Derek Parnell <ddparnell at bigpond.com> Jan 28, 2005
- 479 views
Patrick Barnes wrote: > > On Thu, 27 Jan 2005 20:55:29 -0800, Derek Parnell > <guest at rapideuphoria.com> wrote: > > Patrick Barnes wrote: > > [snip] > > > > > Specifically checking for TabItem seems like a > > > bit of a kludge, I don't suppose there's any way to test whether a > > > control needs to use the grandparent rather than parent? > > > > I think that Win32lib should be smart enough to know that if you try to > > resize a TabItem that the owning TabControl is what really should be > > resized. > > I'll think about making this change. > > Well, I'm not particularly concerned about that... > > When you call 'attach_control' in Autosize, it will (in the new > version, at least) resize itself relative to it's parent - listening > for when the parent changes size. So I'm talking about the items > inside the TabItem, not the TabItem itself. > > The problem is that the TabItem doesn't receive any w32HResize events, > even though visually you could say it changes size. Would you consider > triggering resize events in a TabItem when the parent TabControl is > resized? That sounds fine to me. -- Derek Parnell Melbourne, Australia