1. C.K. - Bible database
- Posted by Jonas Temple <jtemple at yhti.net> Sep 25, 2003
- 390 views
C.K., Just downloaded the EDB Bible and tried to run the viewer. It's looking for center.ew. Jonas
2. Re: C.K. - Bible database
- Posted by "C. K. Lester" <cklester at yahoo.com> Sep 25, 2003
- 392 views
This is a multi-part message in MIME format. --------------070900000804050003070202 Jonas Temple wrote: > > >C.K., > >Just downloaded the EDB Bible and tried to run the viewer. It's looking >for center.ew. > >Jonas > > Yes, it is, which is a very common include file, no? :) Ah, well! Here it is... --------------070900000804050003070202 Content-Type: text/plain; name="center.ew" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="center.ew" ------------------------------ -- center.ew ----------------- ------------------------------ -- these constants are used in 'getWorkArea' constant xSystemParameters = registerw32Function(user32, "SystemParametersInfoA", {C_UINT, C_UINT, C_POINTER, C_UINT}, C_LONG), SPI_GETWORKAREA = 48 ------------------------------ -- FUNCTION: getWorkArea() -- Returns: sequence containing the coordinates of the work area, -- expressed in virtual screen coordinates {x1,y1, x2,y2} ------------------------------ global function getWorkArea() atom mset, workarea sequence wa_out -- get pointer for RECT structure to receive coordinates mset = new_memset() workarea = acquire_mem( mset, SIZEOF_RECT ) -- call C function from user32.dll if not w32Func( xSystemParameters, {SPI_GETWORKAREA, 0, workarea, 0} ) then warnErr( "getWorkspace:SystemParametersInfo failed" ) end if -- set return sequence wa_out = { fetch( workarea, rectLeft ), fetch( workarea, rectTop ), fetch( workarea, rectRight ), fetch( workarea, rectBottom ) } -- free pointer free( mset ) return wa_out end function ------------------------------ -- FUNCTION: centerWindow -- uses 'getWorkArea' to center window on destop, -- regardless of taskbar location & size -- Parameters: -- id: ID of Window/Pixmap ------------------------------ global procedure centerWindow( integer id ) sequence wa, wa_size, id_size integer winx, winy wa = getWorkArea() wa_size = { wa[3]-wa[1], wa[4]-wa[2] } id_size = getCtlSize( id ) winx = wa[1] + floor( (wa_size[1] - id_size[1])/2 ) winy = wa[2] + floor( (wa_size[2] - id_size[2])/2 ) setRect( id, winx, winy, id_size[1], id_size[2], True ) end procedure ------------------------------ -- end of center.ew ---------- ------------------------------ --------------070900000804050003070202--
3. Re: C.K. - Bible database
- Posted by Derek Parnell <ddparnell at bigpond.com> Sep 26, 2003
- 380 views
On Thu, 25 Sep 2003 17:54:32 -0500 (09/26/03 08:54:32) , C. K. Lester <cklester at yahoo.com> wrote: > > Jonas Temple wrote: > >> >> C.K., >> >> Just downloaded the EDB Bible and tried to run the viewer. It's looking >> for center.ew. >> >> Jonas >> >> > Yes, it is, which is a very common include file, no? :) > > Ah, well! Here it is... > I don't know why you don't just use ... x = create(whatever, "blahblah", parent, Center, Center, width, height, flags) As the keyword 'Center' can be used in either or both the Left and Top parameters in create(). It centers the control relative to the control's parent, or Screen if the control has no parent. -- cheers, Derek Parnell
4. Re: C.K. - Bible database
- Posted by "C. K. Lester" <cklester at yahoo.com> Sep 26, 2003
- 389 views
Derek Parnell wrote: > > On Thu, 25 Sep 2003 17:54:32 -0500 (09/26/03 08:54:32) > , C. K. Lester <cklester at yahoo.com> wrote: > >> >> Jonas Temple wrote: >> >>> >>> C.K., >>> >>> Just downloaded the EDB Bible and tried to run the viewer. It's >>> looking >>> for center.ew. >>> >>> Jonas >>> >>> >> Yes, it is, which is a very common include file, no? :) >> >> Ah, well! Here it is... >> > > I don't know why you don't just use ... > > x = create(whatever, "blahblah", parent, Center, Center, width, > height, flags) > > As the keyword 'Center' can be used in either or both the Left and Top > parameters in create(). It centers the control relative to the > control's parent, or Screen if the control has no parent. I guess back when you supplied me with that center.ew (I think it was you), this particular functionality wasn't available...? However, the new way sounds easy!!! ;) Does the IDE allow me to use the Center keyword? I'll check right now.