Re: xControls How To
- Posted by Don <eunexus at yahoo.com> Jul 08, 2004
- 509 views
> > I have a control (a child window) in a window. I want > > the bottom of that window to follow the bottom of the > > parent window, up to and not beyond a certain size. > > Is there a way to control that with xControls? I've tried > > using LimitSize with Geometry and can't seem to make > > it work like I want. grrrrr. > > > > -=ck > > "Programming in a state of EUPHORIA." > > Ooo, thats a tough one... lemme poke it around some on my system > and I will see what I can come up with. > > Just the bottom? Dont touch the child windows width? Hows this? Child is a constant 200 pixels... If the parent window is 300 pixels or less, it will stick to the bottom; otherwise it will be a constant height as well... At least I think this is what you were looking for... -=-=-=-=-=-=-=-=-=- without warning include Win32Lib.ew include xControls.ew constant main = create( Window, "", NULL, 0.25, 0.25, 0.5, 0.5, 0 ), ID1 = create( Window, "", main, 0, 0, 0, 0, {WS_CHILD,WS_VISIBLE} ), GMID = xControl( Geometry, "", main, 0, 0, 0, 0, 0, 0 ) manage( GMID, ID1, {0,5}, {0,5}, {ID1,200}, {1,-5} ) procedure ModifyWinColors( integer self, integer event, sequence parms ) setWindowBackColor( ID1, #FF0000 ) end procedure setHandler( main, w32HOpen, routine_id("ModifyWinColors") ) -- dynamically set child window to sticky only when below a certain height procedure DynamicWindow( integer self, integer event, sequence parms ) sequence Rect integer Height Rect = getClientRect( self ) Height = Rect[4] - Rect[2] - 10 -- (10 is the extra two 5 spacings around the child) if Height > 300 then -- constant manage( GMID, ID1, {0,5}, {0,5}, {ID1,200}, {ID1,300} ) else -- sticky manage( GMID, ID1, {0,5}, {0,5}, {ID1,200}, {1,-5} ) end if end procedure setHandler( main, w32HResize, routine_id("DynamicWindow") ) -- force an initial resize VOID = invokeHandler( main, w32HResize, {0,0,0} ) WinMain( main, Normal ) -=-=-=-=-=-=-=-=-=- Don Phillips - aka Graebel National Instruments mailto: eunexus @ yahoo.com