Irregular Windows

new topic     » topic index » view thread      » older message » newer message

--part1_16f.1ecb40f.28ee8039_boundary

Hi All,
I wish to use the irreg. window routine but don't know what I have done 
wrong. Follow is my test program which does open an oval window but will not 
display a bit map or close when clicked on, I have to alt/F4 to close it.

What am I doing wrong.

Also the was an example posted to the mailing list some time back (by mistake 
I think) I would appreciate a copy to view if the author doesn't mind.

-- start code
-- Modified example of irregular window

include win32lib.ew
include Irregular.ew
without warning

constant ShapedWin = create( Window, "Irregular", 0, Default, Default, 300, 
100, {WS_BORDER , WS_POPUP} )

procedure onLoad_ShapedWin()
    atom Region
    atom hBitmap
    
    Region = CreateEllipticRgn(0,0,300,100)
    SetWindowRgn(getHandle(ShapedWin),Region)

   -- load the bitmap
   hBitmap = loadBitmapFromFile( "Logo.bmp" )

   -- display the bitmap in TheWindow at {1,1}
   drawBitmap( ShapedWin, hBitmap, 1, 1 )
end procedure

procedure onClick_ShapedWin()
    --It's good to have a way to exit if we hide the close button
    closeWindow(ShapedWin)
end procedure

onClick[ ShapedWin ] = routine_id("onClick_ShapedWin")
onOpen [ ShapedWin ] = routine_id("onLoad_ShapedWin" )

WinMain( ShapedWin, Modal )


--part1_16f.1ecb40f.28ee8039_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

<HTML><FONT FACE=arial,helvetica><BODY BGCOLOR="#ffffff"><FONT  SIZE=2>Hi All,
<BR>I wish to use the irreg. window routine but don't know what I have done
wrong. Follow is my test program which does open an oval window but will not
display a bit map or close when clicked on, I have to alt/F4 to close it.
<BR>
<BR>What am I doing wrong.
<BR>
<BR>Also the was an example posted to the mailing list some time back (by
mistake I think) I would appreciate a copy to view if the author doesn't mind.
<BR>
<BR>-- start code
<BR>-- Modified example of irregular window
<BR>
<BR>include win32lib.ew
<BR>include Irregular.ew
<BR>without warning
<BR>
<BR>constant ShapedWin = create( Window, "Irregular", 0, Default, Default, 300,
100, {WS_BORDER , WS_POPUP} )
<BR>
<BR>procedure onLoad_ShapedWin()
<BR> &nbsp;&nbsp;&nbsp;atom Region
<BR> &nbsp;&nbsp;&nbsp;atom hBitmap
<BR> &nbsp;&nbsp;&nbsp;
<BR> &nbsp;&nbsp;&nbsp;Region = CreateEllipticRgn(0,0,300,100)
<BR> &nbsp;&nbsp;&nbsp;SetWindowRgn(getHandle(ShapedWin),Region)
<BR>
<BR> &nbsp;&nbsp;-- load the bitmap
<BR> &nbsp;&nbsp;hBitmap = loadBitmapFromFile( "Logo.bmp" )
<BR>
<BR> &nbsp;&nbsp;-- display the bitmap in TheWindow at {1,1}
<BR> &nbsp;&nbsp;drawBitmap( ShapedWin, hBitmap, 1, 1 )
<BR>end procedure
<BR>
<BR>procedure onClick_ShapedWin()
<BR> &nbsp;&nbsp;&nbsp;--It's good to have a way to exit if we hide the close
button
<BR> &nbsp;&nbsp;&nbsp;closeWindow(ShapedWin)
<BR>end procedure
<BR>
<BR>onClick[ ShapedWin ] = routine_id("onClick_ShapedWin")
<BR>onOpen [ ShapedWin ] = routine_id("onLoad_ShapedWin" )
<BR>
<BR>WinMain( ShapedWin, Modal )

--part1_16f.1ecb40f.28ee8039_boundary--

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu