Irregular Windows
- Posted by Tony Steward <tony at locksdownunder.com> Oct 04, 2001
- 398 views
--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> atom Region <BR> atom hBitmap <BR> <BR> Region = CreateEllipticRgn(0,0,300,100) <BR> SetWindowRgn(getHandle(ShapedWin),Region) <BR> <BR> -- load the bitmap <BR> hBitmap = loadBitmapFromFile( "Logo.bmp" ) <BR> <BR> -- display the bitmap in TheWindow at {1,1} <BR> drawBitmap( ShapedWin, hBitmap, 1, 1 ) <BR>end procedure <BR> <BR>procedure onClick_ShapedWin() <BR> --It's good to have a way to exit if we hide the close button <BR> 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--