1. xControls (Don!)
- Posted by cklester <cklester at yahoo.com> Jul 07, 2004
- 509 views
-- I modified the geometry example to show what I mean: -- why doesn't it take the statusbar into account? -- i looked at the code and it seems to be using -- getClientRect(), which is the right rect, right?! :) -- Don, can you fix this? Thanks!!! 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, 1, 1, {WS_CHILD,WS_VISIBLE} ), ID2 = create( Window, "", main, 0, 0, 1, 1, {WS_CHILD,WS_VISIBLE} ), sbar = create( StatusBar, "", main, 0,0,0,0,0 ), GMID = xControl( Geometry, "", main, 0, 0, 0, 0, 0, 0 ) manage( GMID, ID1, {0.0, 5}, {0, 5}, {0.5, 00}, {1.0 , -5} ) manage( GMID, ID2, {ID1, 5}, {0, 5}, {1.0, -5}, {0.5 , 00} ) procedure ModifyWinColors( integer self, integer event, sequence parms ) setWindowBackColor( ID1, #FF0000 ) setWindowBackColor( ID2, #FF00FF ) end procedure setHandler( main, w32HOpen, routine_id("ModifyWinColors") ) WinMain( main, Normal ) -- end of program -=ck "Programming in a state of EUPHORIA."
2. Re: xControls (Don!)
- Posted by Don <eunexus at yahoo.com> Jul 07, 2004
- 497 views
> -- I modified the geometry example to show what I mean: > -- why doesn't it take the statusbar into account? > -- i looked at the code and it seems to be using > -- getClientRect(), which is the right rect, right?! :) > -- Don, can you fix this? Thanks!!! > > 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, 1, 1, {WS_CHILD,WS_VISIBLE} ), > ID2 = create( Window, "", main, 0, 0, 1, 1, {WS_CHILD,WS_VISIBLE} ), > sbar = create( StatusBar, "", main, 0,0,0,0,0 ), > GMID = xControl( Geometry, "", main, 0, 0, 0, 0, 0, 0 ) > > manage( GMID, ID1, {0.0, 5}, {0, 5}, {0.5, 00}, {1.0 , -5} ) > manage( GMID, ID2, {ID1, 5}, {0, 5}, {1.0, -5}, {0.5 , 00} ) > > procedure ModifyWinColors( integer self, integer event, sequence parms ) > setWindowBackColor( ID1, #FF0000 ) > setWindowBackColor( ID2, #FF00FF ) > end procedure > setHandler( main, w32HOpen, routine_id("ModifyWinColors") ) > > WinMain( main, Normal ) > > -- end of program > > -=ck > "Programming in a state of EUPHORIA." Yeah, actually I wish I could fix this... well actually I *could* but it would be a tremedous hassle and slow it down. GetClientRect itself does not take into account controls in the client area; it does just what the function implies. It returns the whole client rectangle regardless if some portion of the client is "hidden" by a control. And of course a Status Bar is a control. The only way to (currently) get around this is to dynamically modify the geometry object upon resize... glad I coded it in now =) -=-=-=-=-=-=-=-=-=-=-=-=- 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, 1, 1, {WS_CHILD,WS_VISIBLE} ), ID2 = create( Window, "", main, 0, 0, 1, 1, {WS_CHILD,WS_VISIBLE} ), sbar = create( StatusBar, "", main, 0,0,0,0,0 ), GMID = xControl( Geometry, "", main, 0, 0, 0, 0, 0, 0 ) manage( GMID, ID1, {0.0, 5}, {0, 5}, {0.5, 00}, {1, -5} ) manage( GMID, ID2, {ID1, 5}, {0, 5}, {1.0, -5}, {0.5 , 00} ) procedure ModifyWinColors( integer self, integer event, sequence parms ) setWindowBackColor( ID1, #FF0000 ) setWindowBackColor( ID2, #FF00FF ) end procedure setHandler( main, w32HOpen, routine_id("ModifyWinColors") ) -- use this to dynamically change the offset in case the -- size of control changes... procedure AdjustWindow( integer self, integer event, sequence parms ) sequence Size Size = getCtlSize(sbar) manage( GMID, ID1, {0.0, 5}, {0, 5}, {0.5, 00}, {1, -Size[2]-3} ) end procedure setHandler( main, w32HResize, routine_id("AdjustWindow") ) -- force a resize VOID = invokeHandler( main, w32HResize, {0,0,0} ) WinMain( main, Normal ) -=-=-=-=-=-=-=-=-=-=-=-=- Don Phillips - aka Graebel National Instruments mailto: eunexus @ yahoo.com
3. Re: xControls (Don!)
- Posted by cklester <cklester at yahoo.com> Jul 07, 2004
- 505 views
Don wrote: > > > -- I modified the geometry example to show what I mean: > > -- why doesn't it take the statusbar into account? > > -- i looked at the code and it seems to be using > > -- getClientRect(), which is the right rect, right?! :) > > GetClientRect itself does not take into account controls in the client > area; I don't think that's true for v0.60.1... from the docs: [func] getClientRect ( integer ControlId ) Get uncovered portion of the client area. Returns: { left, top, width, height, bottom, right } Category: Attributes Unlike the menu, toolbar and statusbar both occupy space in the window. To determine what part of the window's client area is not covered, use this function. -=ck "Programming in a state of EUPHORIA."
4. Re: xControls (Don!)
- Posted by Don <eunexus at yahoo.com> Jul 07, 2004
- 495 views
> I don't think that's true for v0.60.1... from the docs: > > [func] > getClientRect ( integer ControlId ) > Get uncovered portion of the client area. > Returns: { left, top, width, height, bottom, right } > Category: Attributes > > Unlike the menu, toolbar and statusbar both occupy space > in the window. To determine what part of the window's client > area is not covered, use this function. > > -=ck > "Programming in a state of EUPHORIA." Hmm, I dont have 0.60.1. Im using just a slightly older version. Of course the older version says the exact same thing. I looked at the code and it *seems* like it should be working. On my version it does not. Since you posted to the board asking the quesion I am assuming the same thing happened for your version also =) Don Phillips - aka Graebel National Instruments mailto: eunexus @ yahoo.com
5. Re: xControls (Don!)
- Posted by cklester <cklester at yahoo.com> Jul 07, 2004
- 479 views
Don wrote: > > > I don't think that's true for v0.60.1... from the docs: > > > > [func] > > getClientRect ( integer ControlId ) > > Get uncovered portion of the client area. > > Returns: { left, top, width, height, bottom, right } > > Category: Attributes > > > > Unlike the menu, toolbar and statusbar both occupy space > > in the window. To determine what part of the window's client > > area is not covered, use this function. > > Hmm, I dont have 0.60.1. Im using just a slightly older version. > Of course the older version says the exact same thing. I looked > at the code and it *seems* like it should be working. Yes, getClientRect() works properly for me in other instances. > Since you posted to the board asking the quesion I > am assuming the same thing happened for your version also =) xControls does not seem to consider the statusbar, despite using getClientRect() to determine sizes/positions... I'm having a closer look and I'll see what I can find... :) -=ck "Programming in a state of EUPHORIA."
6. Re: xControls (Don!)
- Posted by Don <eunexus at yahoo.com> Jul 07, 2004
- 482 views
> > Hmm, I dont have 0.60.1. Im using just a slightly older version. > > Of course the older version says the exact same thing. I looked > > at the code and it *seems* like it should be working. > > Yes, getClientRect() works properly for me in other instances. > > > Since you posted to the board asking the quesion I > > am assuming the same thing happened for your version also =) > > xControls does not seem to consider the statusbar, despite using > getClientRect() to determine sizes/positions... I'm having a closer > look and I'll see what I can find... :) > > -=ck > "Programming in a state of EUPHORIA." Bah! I just knew as I was submitting it that it was a mistake =) I just cross referenced the API with GetClientRect and it does seem to take it into account... hmm. I need to poke around with it further. Well at least I gave you a work around... heh Don Phillips - aka Graebel National Instruments mailto: eunexus @ yahoo.com
7. Re: xControls (Don!)
- Posted by Don <eunexus at yahoo.com> Jul 07, 2004
- 481 views
Ok, just posted a new version to RDS. This should squash this status bar bug... anything else let me know... Don Phillips - aka Graebel National Instruments mailto: eunexus @ yahoo.com
8. Re: xControls (Don!)
- Posted by cklester <cklester at yahoo.com> Jul 07, 2004
- 497 views
Don wrote: > > Ok, just posted a new version to RDS. > This should squash this status bar bug... anything > else let me know... What was the problem?! Or is it in the Changes log? Thanks, Don!!! -=ck "Programming in a state of EUPHORIA."
9. Re: xControls (Don!)
- Posted by Don <eunexus at yahoo.com> Jul 08, 2004
- 509 views
> What was the problem?! Or is it in the Changes log? > > Thanks, Don!!! > > -=ck > "Programming in a state of EUPHORIA." Naa, I didnt add it to the changes log. I was using (in the move/ size routines) the lparam from Win32Lib instead of the numbers from GetClientRect... Don Phillips - aka Graebel National Instruments mailto: eunexus @ yahoo.com