Re: Win32lib.ew v0.57.1
- Posted by Martin Stachon <martin.stachon at worldonline.cz> Mar 30, 2002
- 445 views
This is a multi-part message in MIME format. ------=_NextPart_000_006D_01C1D80C.347E8AC0 charset="iso-8859-1" tone.skoda at siol.net writes: > 1. Don't complicate things with compressed win32lib.ew and win32lib_full.ew. > Come on, does it really work any faster? I think the reason is to have a small version people can distribute with their apps. > 2. In clock.exw when I put mouse over that clock tooltip it shows hourglas > mouse cursor. > It turns into normal cursor only when I click onto that tooltip. > And if you click somewhere else that clock tooltip disappears but program is > still > running and you can't close it except in Task manager. I am responsible for that. The attached clock.exw should be ok. I always had a taskbar entry for clock.exw, but I added WS_EX_APPWINDOW flag so it now should show always. > 7. Tooltip2.EXW fails: error code 461, Failed to acquire a hWnd when creating > a control, ran it more times allways same. On my machine it is ok. > 9. sample.exw is really unsafe! First time it crashed after running a while > with writing > ex.err. The second time it really messed up my desktop, everything was white, > and I > thought I will have to reboot and lose this message which was open. It > happened when > radio button was selected which causes buttons to change color. I couldn't > even bring up > task manager to kill it. Then after > about two minutes it went back to normal, don't know why. Also ok on my machine...Maybe you have somehow messed OS? Martin ------=_NextPart_000_006D_01C1D80C.347E8AC0 Content-Type: application/octet-stream; name="clock.exw" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="clock.exw" -- Simple Clock by Dan B Moyer -- gets actual time (in 24 hour format) -- Modified by Martin Stachon include win32lib_full.ew without warning sequence size size =3D {90, 25} constant=20 ClockWin =3D createEx( Window, "Clock", 0, Default, Default, size[1], size[2], {WS_BORDER , = WS_POPUP}, WS_EX_APPWINDOW ), myPopup =3D create( Popup, "", ClockWin, 0, 0, 0, 0, 0), closeMenuItem =3D create( MenuItem, "&Close", myPopup, 0, 0, 0, 0, = 0), sep1 =3D create( MenuItem, "-", myPopup, 0, 0, 0, 0, = 0), aboutMenuItem =3D create( MenuItem, "&About...", myPopup, 0, 0, 0, 0, = 0) constant MyTimer =3D 1 -------------------------------------------------------------------------= --- procedure drawTime() sequence TimeAndDate TimeAndDate =3D date() -- display the new clock time: wPuts({ClockWin, 3, 0}, {"%02d:%02d:%02d", {TimeAndDate[4],TimeAndDate[5],TimeAndDate[6]} } ) end procedure procedure onTimer_ClockWin( integer timerId ) if timerId =3D MyTimer then repaintWindow(ClockWin) -- get the time every second drawTime() end if end procedure procedure onPaint_ClockWin(int x1, int y, int x2, int y2) drawTime() end procedure -------------------------------------------------------------------------= --- procedure onClick_closeMenuItem() closeWindow(ClockWin) end procedure procedure onClick_aboutMenuItem() if message_box("Clock Example\n\n" & "Martin Stachon\n" & "Based on example from Dan B Moyer", "About...", 0) then end if end procedure integer moving,relx,rely moving =3D 0 procedure onMouse_ClockWin(integer event, integer x, integer y, integer = shift ) sequence mouse mouse =3D getPointerPos() if event =3D LeftDown then=20 moving =3D 1 relx =3D x -- store relative mouse pos. rely =3D y setMousePointer( ClockWin, SizeAllPointer ) -- change mouse ptr =20 elsif event =3D LeftUp then moving =3D 0 setMousePointer( ClockWin, ArrowPointer ) =20 elsif event =3D MouseMove and moving then -- change the size and repaint setRect( ClockWin, mouse[1]-relx, mouse[2]-rely, size[1], size[2], = True ) =20 elsif event =3D RightDown then popup( myPopup, 20,10) -- show popup moving =3D 0 else moving =3D 0 end if end procedure -------------------------------------------------------------------------= --- procedure onActivate_ClockWin() -- activate the timer to tick each second (1000 ms) setTimer( ClockWin, MyTimer, 1000 ) setFont(ClockWin, "Arial", 15, Bold) onTimer_ClockWin(MyTimer) setMousePointer( ClockWin, ArrowPointer ) end procedure onActivate[ClockWin] =3D routine_id( "onActivate_ClockWin" ) onTimer[ClockWin] =3D routine_id( "onTimer_ClockWin" ) onClick[closeMenuItem] =3D routine_id( "onClick_closeMenuItem" ) onClick[aboutMenuItem] =3D routine_id( "onClick_aboutMenuItem" ) onMouse[ClockWin] =3D routine_id( "onMouse_ClockWin" ) onPaint[ClockWin] =3D routine_id( "onPaint_ClockWin" ) captureMouse(ClockWin) setWindowBackColor(ClockWin, Parchment) WinMain( ClockWin, Normal ) releaseMouse() ------=_NextPart_000_006D_01C1D80C.347E8AC0--