Re: Default attributes in new Win32lib

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

Hi Derek,

thank you for the explanations why using WS_CLIPSIBLINGS as a default 
style in Win32lib. They were very helpful for me and I have adapted my 
code so that it will work now as expected.
There is one question which came up. Should repaintWindow() not have the 
same effect in this case as the w32HPaint event?

Regards,
Roland


--  code generated by Win32Lib IDE

include Win32Lib.ew
without warning

--  Window Win
constant Win = createEx( Window, "Window1", 0, 50, 50, 400, 300, 0, 0 )
constant BM = createEx( Bitmap, "Bitmap2", Win, 68, 44, 260, 172, 0, 0 )
setBitmap( BM,"largetiles.bmp")
constant Edit = createEx( EditText, "Hello World",Win,4,156,144,32,0,0)
setHint( Edit,"This is an EditText")
setFont( Edit,"Arial",12,Normal+Bold)
setBitmap( Edit,"largetiles.bmp")
constant PB = createEx( PushButton, "Exit",Win, 268, 64, 104, 36, 0, 0 )
setFont( PB,"Arial",12,Normal+Bold)

procedure Win_onPaint (integer self, integer event, sequence params)
sequence result
   setPenWidth(Win,3)
   drawLine(Win, 10,10,390,260)
   setFont(Win, "Arial", 10, Bold+Italic)
   result=drawText(Win,"Fourscore and twenty years ago, our fathers, ..",
           {5,50, 140, 120}, DT_WORDBREAK, 4, 0, 0)
end procedure
setHandler( Win, w32HPaint, routine_id("Win_onPaint"))

procedure Win_onActivate (integer self, integer event, sequence params)
integer msg
   moveZOrder(BM,HWND_BOTTOM)
   msg = invokeHandler(Win, w32HPaint, {} )
--  repaintWindow(Win)
end procedure
setHandler( Win, w32HActivate, routine_id("Win_onActivate"))

procedure PB_onClick (integer self, integer event, sequence params)
   closeWindow(Win)
end procedure
setHandler( PB, w32HClick, routine_id("PB_onClick"))

WinMain( Win,Normal )

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

Search



Quick Links

User menu

Not signed in.

Misc Menu