1. centered [2]

--part1_47.1b34fcfa.29e3d56f_boundary

Ooops!

       Forgot to mention that I am using win32lib.

Thanks again.

--part1_47.1b34fcfa.29e3d56f_boundary

<HTML><FONT FACE=arial,helvetica><FONT  SIZE=2>Ooops!
<BR>
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Forgot to mention that I am using
win32lib.
<BR>

--part1_47.1b34fcfa.29e3d56f_boundary--

new topic     » topic index » view message » categorize

2. Re: centered [2]

This is a multi-part message in MIME format.

------=_NextPart_000_0078_01C1DF60.3D870D80
	charset="iso-8859-1"

-- Center Window ----------------------------------------------------
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

-- example of use!
constant hWnd = createEx( Window, "WinName", 0, centerX(642), centerY(528), 642,
528, { WS_DLGFRAME }, 0)


-- Note: these are same for x1 & x2 also y1 & y2
centerX(642), centerY(528), 642, 528
             x1                 y1     x2   y2


Hope it helps and it hasnt been changed to a better routine in the last two
years..blink
(Ive been out of the Win32lib loop for a long time)

Euman
euman at bellsouth.net

5 2 1 - 1 - n - 5  The Doors  
  ----- Original Message ----- 
  From: Robsz2 at aol.com 
  To: EUforum 
  Sent: Tuesday, April 09, 2002 12:26 AM
  Subject: centered [2]



  Ooops! 

        Forgot to mention that I am using win32lib. 

  Thanks again. 

------=_NextPart_000_0078_01C1DF60.3D870D80
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2715.400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>-- Center Window 
----------------------------------------------------<BR>global <BR>integer&nbsp;
xScreen, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
yScreen</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>xScreen = getSystemMetrics(SM_CXSCREEN) -- screen 
width<BR>yScreen = getSystemMetrics(SM_CYSCREEN) -- screen height</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>global function centerX(integer cx)<BR>&nbsp; -- 
returns the LEFT value of a window that is to be centered<BR>&nbsp; return 
(floor(xScreen/2) - floor(cx/2))<BR>end function</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>global function centerY(integer cy)<BR>&nbsp; -- 
returns the TOP value of a window that is to be centered<BR>&nbsp; return 
(floor(yScreen/2) - floor(cy/2))<BR>end function<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>-- example of use!</DIV></FONT>
<DIV><FONT face=Arial size=2>constant hWnd = createEx( Window, "WinName", 0, 
centerX(642), centerY(528), 642, 528, { WS_DLGFRAME }, 0)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>-- Note: these are&nbsp;same for x1 &amp; 
x2&nbsp;also y1 &amp; y2</FONT></DIV>
<DIV><FONT face=Arial size=2>centerX(642), centerY(528), 642, 528</FONT></DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
x1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
y1&nbsp;&nbsp;&nbsp;&nbsp; x2&nbsp;&nbsp; y2</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Hope it helps and it hasnt been changed to a better
routine in the last two years..blink</FONT></DIV>
<DIV><FONT face=Arial size=2>(Ive been out of the Win32lib loop for a long 
time)</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;</DIV></FONT>
<DIV>Euman<BR><A href="mailto:euman at bellsouth.net">euman at
bellsouth.net</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>5 2 1 - 1 - n - 5&nbsp; The Doors&nbsp; </DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT:
#000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
<A title=Robsz2 at aol.com href="mailto:Robsz2 at aol.com">Robsz2 at
  aol.com</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=EUforum at topica.com 
  href="mailto:EUforum at topica.com">EUforum</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, April 09, 2002 12:26 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> centered [2]</DIV>
  <DIV><BR></DIV><PRE>============ The Euphoria Mailing List ============ 
</PRE><FONT face=arial,helvetica><FONT size=2>Ooops! 
  <BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Forgot to mention that I am using 

------=_NextPart_000_0078_01C1DF60.3D870D80--

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

Search



Quick Links

User menu

Not signed in.

Misc Menu