1. Centering Windows

Hi all,

Does anyone know how to center win32lib windows no matter what the screen 
resolution is?

Chris

new topic     » topic index » view message » categorize

2. Re: Centering Windows

This is a multi-part message in MIME format.

------=_NextPart_000_000D_01C0E314.8A35B300
	charset="iso-8859-1"

Here you go, Its much smaller than Dereks method
and works for me....

BTW, Thank Wolf, not me.
Euman


----- Original Message ----- 
From: <president at insight-concepts.com>
To: "EUforum" <EUforum at topica.com>
Sent: Tuesday, May 22, 2001 21:33
Subject: RE: Centering Windows 


> 
> 
> Hi All,
> 
> Does anyone know how to center win32lib windows no matter what the 
> screen resolution is?
> 
> Chris
> Long Live Euphoria....
> 
> 
> 
> 
> 
> 

------=_NextPart_000_000D_01C0E314.8A35B300
Content-Type: application/octet-stream;
	name="CenterWindows.ew"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="CenterWindows.ew"

global 
integer  xScreen, 
         yScreen

xScreen = getSystemMetrics(SM_CXSCREEN) -- screen width
yScreen = getSystemMetrics(SM_CYSCREEN) -- screen height

global function centerX(integer cx)
  -- returns the LEFT value of a window that is to be centered
  return (floor(xScreen/2) - floor(cx/2))
end function

global function centerY(integer cy)
  -- returns the TOP value of a window that is to be centered
  return (floor(yScreen/2) - floor(cy/2))
end function

-- Usage:
-- centerX(xScreen) 
-- centerY(yScreen)

-- Example: Win= create(Window,"",0,centerX(500),centerY(350),500,350,0)

-- Note that the initial X and Y values are the same as the X2, Y2 values
-- only have the function wrap (centerX and centerY)
------=_NextPart_000_000D_01C0E314.8A35B300--

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu