1. Help Closing Euphoria Windows
- Posted by Matthew Anderson <andy at anders98.freeserve.co.uk> Nov 16, 2002
- 429 views
This is a multi-part message in MIME format. ------=_NextPart_000_0004_01C28D9B.A17D83C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=20 If I close a window by clicking top right, I want to be able = to change my mind if I then select YES in a message box. Program win32lib\i= de.exw does something similar with an onClose routine but there the window = closing process has already started and a new SAVEDATA window is opened. I = want to keep working in the old window. How can I do this? Also can someone please tell me how to access the version number of a Windo= ws DLL file using a Euphoria routine? Thanks Matthew =3D=3D^= ^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D rds at RapidEuphoria.com b2kUNk.= cmRzQFJh =3D=3D^= ^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ------=_NextPart_000_0004_01C28D9B.A17D83C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-1" http-equiv=3DContent-Type= > <META content=3D"MSHTML 5.00.3314.2100" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <PRE>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 </PRE> <DIV><FONT size=3D2>If I close a window by clicking top right, I want to be= able=20 to change my mind if I then select YES in a message box. Program=20 win32lib\ide.exw does something similar with an onClose routine but there t= he=20 window closing process has already started and a new SAVEDATA window is ope= ned.=20 I want to keep working in the old window. How can I do this?</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>Also can someone please tell me how to access the versi= on=20 number of a Windows DLL file using a Euphoria routine?</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>Thanks</FONT></DIV> <DIV><FONT size=3D2>Matthew</FONT></DIV> <PRE>=3D=3D^= =3D=3D^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D rds at RapidEuphoria.com b2kUNk.= cmRzQFJh">http://topica.com/u/?b1dd66.= b2kUNk.= cmRzQFJh</A> com/partner/tag02/register</A> =3D=3D^= =3D=3D^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</PRE> </BODY></HTML> ------=_NextPart_000_0004_01C28D9B.A17D83C0--
2. Re: Help Closing Euphoria Windows
- Posted by Derek Parnell <ddparnell at bigpond.com> Nov 17, 2002
- 424 views
This is a multi-part message in MIME format. ------=_NextPart_000_000F_01C28DF9.A2CFDDA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=20 To prevent closing a window (using win32lib), do something li= ke this... procedure onClose_mywindow(integer self, integer event, sequence parms) if I_dont_want_to_close then returnValue(-1) end if end procedure setHandler(mywindow, w32HClose, routine_id("onClose_mywindow")) ---------------- cheers, Derek Parnell ----- Original Message -----=20 From: Matthew Anderson=20 To: EUforum=20 Sent: Sunday, November 17, 2002 5:11 AM Subject: Help Closing Euphoria Windows If I close a window by clicking top right, I want to be able to change my m= ind if I then select YES in a message box. Program win32lib\ide.exw does so= mething similar with an onClose routine but there the window closing proces= s has already started and a new SAVEDATA window is opened. I want to keep w= orking in the old window. How can I do this? Also can someone please tell me how to access the version number of a Win= dows DLL file using a Euphoria routine? Thanks Matthew =3D=3D^= ^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D rds at RapidEuphoria.com b2kUNk.= cmRzQFJh =3D=3D^= ^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ------=_NextPart_000_000F_01C28DF9.A2CFDDA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1"= > <META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <PRE>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 </PRE> <DIV><FONT face=3DArial size=3D2>To prevent closing a window (using win32li= b), do=20 something like this...</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>procedure onClose_mywindow(integer self, integer event,= =20 sequence parms)</FONT></DIV> <DIV><FONT size=3D2> if I_dont_want_to_close then</FONT></DIV> <DIV><FONT face=3DArial size=3D2> =20 returnValue(-1)</FONT></DIV> <DIV><FONT size=3D2> end if</FONT></DIV> <DIV><FONT size=3D2>end procedure</FONT></DIV> <DIV><FONT size=3D2>setHandler(mywindow, w32HClose,=20 routine_id("onClose_mywindow"))</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV>----------------<BR>cheers,<BR>Derek Parnell</DIV> <BLOCKQUOTE dir=3Dltr=20 style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LE= FT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV> <DIV=20 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>Fro= m:</B>=20 <A title=3Dandy at anders98.freeserve.co.uk=20 href=3D"mailto:andy at anders98.freeserve.co.uk">Matthew Anderson</A> </DIV>= =20 <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Sunday, November 17, 2002 5:= 11=20 AM</DIV> <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Help Closing Euphoria=20 Windows</DIV> <DIV><BR></DIV><PRE>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mai= ling List =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 </PRE> <DIV><FONT size=3D2>If I close a window by clicking top right, I want to = be able=20 to change my mind if I then select YES in a message box. Program=20 win32lib\ide.exw does something similar with an onClose routine but there= the=20 window closing process has already started and a new SAVEDATA window is= =20 opened. I want to keep working in the old window. How can I do=20 this?</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>Also can someone please tell me how to access the ver= sion=20 number of a Windows DLL file using a Euphoria routine?</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>Thanks</FONT></DIV> <DIV><FONT size=3D2>Matthew</FONT></DIV></BLOCKQUOTE> <PRE>=3D=3D^= =3D=3D^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D rds at RapidEuphoria.com b2kUNk.= cmRzQFJh">http://topica.com/u/?b1dd66.= b2kUNk.= cmRzQFJh</A> com/partner/tag02/register</A> =3D=3D^= =3D=3D^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</PRE> </BODY></HTML> ------=_NextPart_000_000F_01C28DF9.A2CFDDA0--
3. Re: Help Closing Euphoria Windows
- Posted by Matthew Anderson <andy at anders98.freeserve.co.uk> Nov 18, 2002
- 388 views
This is a multi-part message in MIME format. ------=_NextPart_000_0004_01C28F1D.A1DAF4A0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0005_01C28F1D.A1DAF4A0" ------=_NextPart_001_0005_01C28F1D.A1DAF4A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=20 Hi Derek, Thanks for your help, but for some reason the returnValue(-1) thing didn't = work, so I have attached the routine I am trying. After selecting YES in th= e message box the program immediately closes. The program uses a number of = onEvent routines which all work fine. I hope you can spot my, no doubt, sil= ly mistake. I'm using an old version of Euphoria, prior to win32lib-055, be= cause I found that some of my existing programs didn't work with the new ve= rsion. I suppose you would recommend that ' I bite the bullet ' and ditch m= y old Euphoria library and get the current version ? What is the difference between the setHandler call (post 055) and the OnEve= nt call which I'm using? Please bear with me guys. Matthew=20 ----- Original Message -----=20 From: Derek Parnell=20 To: EUforum=20 Sent: 16 November 2002 18:24 Subject: Re: Help Closing Euphoria Windows =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=20 To prevent closing a window (using win32lib), do something like this... =20=20=20 procedure onClose_mywindow(integer self, integer event, sequence parms) if I_dont_want_to_close then returnValue(-1) end if end procedure setHandler(mywindow, w32HClose, routine_id("onClose_mywindow")) =20=20=20 ---------------- cheers, Derek Parnell ----- Original Message -----=20 From: Matthew Anderson=20 To: EUforum=20 Sent: Sunday, November 17, 2002 5:11 AM Subject: Help Closing Euphoria Windows =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=20 If I close a window by clicking top right, I want to be able to change = my mind if I then select YES in a message box. Program win32lib\ide.exw doe= s something similar with an onClose routine but there the window closing pr= ocess has already started and a new SAVEDATA window is opened. I want to ke= ep working in the old window. How can I do this? Also can someone please tell me how to access the version number of a W= indows DLL file using a Euphoria routine? Thanks Matthew =3D=3D^= ^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D rds at RapidEuphoria.com b2kUNk.= cmRzQFJh =3D=3D^= ^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ------=_NextPart_001_0005_01C28F1D.A1DAF4A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-1" http-equiv=3DContent-Type= > <META content=3D"MSHTML 5.00.3314.2100" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <PRE>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 </PRE> <DIV><FONT size=3D2>Hi Derek,</FONT></DIV> <DIV><FONT size=3D2>Thanks for your help, but for some reason the returnVal= ue(-1)=20 thing didn't work, so I have attached the routine I am trying. After select= ing=20 YES in the message box the program immediately closes. The program uses a n= umber=20 of onEvent routines which all work fine. I hope you can spot my, no doubt, = silly=20 mistake. I'm using an old version of Euphoria, prior to win32lib-055, becau= se I=20 found that some of my existing programs didn't work with the new version. I= =20 suppose you would recommend that ' I bite the bullet ' and ditch my old Eup= horia=20 library and get the current version ?</FONT></DIV> <DIV><FONT size=3D2>What is the difference between the setHandler call (pos= t 055)=20 and the OnEvent call which I'm using?</FONT></DIV> <DIV><FONT size=3D2>Please bear with me guys.</FONT></DIV> <DIV><FONT size=3D2>Matthew</FONT> </DIV> <BLOCKQUOTE=20 style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0p= x; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"> <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV> <DIV=20 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>Fro= m:</B>=20 <A href=3D"mailto:ddparnell at bigpond.com" title=3Dddparnell at bigpond.com>De= rek=20 Parnell</A> </DIV> <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A href=3D"mailto:EUforum@topi= ca.com"=20 <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> 16 November 2002 18:24</DIV>= <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: Help Closing Euphoria= =20 Windows</DIV> <DIV><BR></DIV><PRE>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mai= ling List =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 </PRE> <DIV><FONT face=3DArial size=3D2>To prevent closing a window (using win32= lib), do=20 something like this...</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>procedure onClose_mywindow(integer self, integer even= t,=20 sequence parms)</FONT></DIV> <DIV><FONT size=3D2> if I_dont_want_to_close then</FONT></DIV= > <DIV><FONT face=3DArial size=3D2> =20 returnValue(-1)</FONT></DIV> <DIV><FONT size=3D2> end if</FONT></DIV> <DIV><FONT size=3D2>end procedure</FONT></DIV> <DIV><FONT size=3D2>setHandler(mywindow, w32HClose,=20 routine_id("onClose_mywindow"))</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV>----------------<BR>cheers,<BR>Derek Parnell</DIV> <BLOCKQUOTE dir=3Dltr=20 style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: = 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"> <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV> <DIV=20 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>F= rom:</B>=20 <A href=3D"mailto:andy at anders98.freeserve.co.uk"=20 title=3Dandy at anders98.freeserve.co.uk>Matthew Anderson</A> </DIV> <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A href=3D"mailto:EUforum@to= pica.com"=20 <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Sunday, November 17, 2002 = 5:11=20 AM</DIV> <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Help Closing Euphoria= =20 Windows</DIV> <DIV><BR></DIV><PRE>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria M= ailing List =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 </PRE> <DIV><FONT size=3D2>If I close a window by clicking top right, I want t= o be=20 able to change my mind if I then select YES in a message box. Program= =20 win32lib\ide.exw does something similar with an onClose routine but the= re=20 the window closing process has already started and a new SAVEDATA windo= w is=20 opened. I want to keep working in the old window. How can I do=20 this?</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>Also can someone please tell me how to access the v= ersion=20 number of a Windows DLL file using a Euphoria routine?</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>Thanks</FONT></DIV> <DIV><FONT size=3D2>Matthew</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE> <PRE>=3D=3D^= =3D=3D^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D rds at RapidEuphoria.com b2kUNk.= cmRzQFJh">http://topica.com/u/?b1dd66.= b2kUNk.= cmRzQFJh</A> com/partner/tag02/register</A> =3D=3D^= =3D=3D^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</PRE> </BODY></HTML> ------=_NextPart_001_0005_01C28F1D.A1DAF4A0-- ------=_NextPart_000_0004_01C28F1D.A1DAF4A0 Content-Type: text/plain; name="onClose.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="onClose.txt" procedure Close_MainWindow() if changes = TRUE then -- give message and exit if IDYES = message_box("Database has not been updated\n" & "to reflect new data or changes\n" & "Update Database before Closing?", "Closing DLLFIND Program", MB_ICONQUESTION+MB_YESNO ) then returnValue(-1) end if end if end procedure -- setHandler(MainWindow,w32HClose,routine_id("Close_MainWindow")) onClose[MainWindow] = routine_id("Close_MainWindow") ------=_NextPart_000_0004_01C28F1D.A1DAF4A0--
4. Re: Help Closing Euphoria Windows
- Posted by Derek Parnell <ddparnell at bigpond.com> Nov 19, 2002
- 392 views
>----- Original Message ----- >From: Matthew Anderson >To: EUforum >Sent: Tuesday, November 19, 2002 3:14 AM >Subject: Re: Help Closing Euphoria Windows > > > >Hi Derek, >Thanks for your help, but for some reason the returnValue(-1) >thing didn't work, so I have attached the routine I am trying. >After selecting YES in the message box the program >immediately closes. The program uses a number of onEvent >routines which all work fine. I hope you can spot my, no >doubt, silly mistake. Sorry to disappoint you, but the code you sent works just fine on my system - using both v0.55 and the current release. I press the YES button and the window stays open; I press NO button and it closes. Here is the code I used to test... -------------------- include win32lib.ew without warning constant MainWindow = create(Window, "", 0, 0, 0, 300, 300, 0) integer changes changes = True --procedure Close_MainWindow(integer self, integer event, sequence parms) procedure Close_MainWindow() if changes = True then -- give message and exit if IDYES = message_box("Database has not been updated\n" & "to reflect new data or changes\n" & "Update Database before Closing?", "Closing DLLFIND Program", MB_ICONQUESTION+MB_YESNO ) then returnValue(-1) end if end if end procedure --setHandler(MainWindow,w32HClose,routine_id("Close_MainWindow")) onClose[MainWindow] = routine_id("Close_MainWindow") WinMain(MainWindow,0) -------------------- >I'm using an old version of Euphoria, >prior to win32lib-055, because I found that some of my >existing programs didn't work with the new version. Why didn't they work? Is there something I can do to make win32lib more backward compatible? >I suppose >you would recommend that ' I bite the bullet ' and ditch my >old Euphoria library and get the current version ? Of course! >What is the difference between the setHandler call (post 055) >and the OnEvent call which I'm using? The differences are mainly technical rather than functional, but in a nutshell, the onXXX is less flexible to use and implement. With the setHandler() approach, I can support multiple handlers per id-event combination, permit changes to the parameters passed without you having to change your code, change the internals of win32lib (for whatever reason) without you having to change your code, and stuff like that. The onXXX style enables you to alter something internal to win32lib with out the library knowing and this means that I have some limits about what I can do in future. As a general principle, the internals of a library (ie, how its functionality is implmented) should not be exposed to external programs as this strengthens the coupling between the library and its callers. Strong coupling means higher maintenance impacts. This principle has been espoused and proven for at least thirty years now so it not a new one. The onXXX style will be phased out with the v1.00 release, so I'm giving everyone plenty of time to change over. >Please bear with me guys. No problem. But is it alright if you use non-HTML email in future. Some people don't use email clients that can understand HTML and the message looks pretty messy. ---------------- cheers, Derek Parnell
5. Re: Help Closing Euphoria Windows
- Posted by Matthew Anderson <andy at anders98.freeserve.co.uk> Nov 19, 2002
- 403 views
This is a multi-part message in MIME format. ------=_NextPart_000_0002_01C28FD3.1C2121C0 charset="iso-8859-1" Hi Derek, Thanks, now we are getting somewhere! The test program doesn't work with the pre 055 win32lib.ew but works OK if I run it from inside the win32lib 055 folder where the include statement accesses that folder's win32lib.ew file. The only difference I noticed was that the window background was grey whereas the old library gives me white as a default. How do I change this? I now have two choices: 1. Ditch the old win32 folder and keep the win32lib-055 transferring the required library files into my Include folder or , 2. Ditch the whole Euphoria system except my files and download Euphoria version 2.3. One worry I have is the test program didn't work with the onClose call commented out and the setHandler line brought into play - I got lots of Windows call back errors when I selected window closed, see attached error file. I have not attempted to understand this because the reason may be obvious to you. If I am to change over to setHandler calls where do I find out the name of the second parameter (e.g W32HClose in the case above) for each of the onEvent calls I use? I enjoy programming in Euphoria but I find I struggle a bit probably because I have no experience of 'C' or 'VB' which would probably help me with windows programming. Matthew ------=_NextPart_000_0002_01C28FD3.1C2121C0 Content-Type: application/octet-stream; name="ex.err" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ex.err" C:\Program Files\EUPHORIA\WIN32LIB_055\win32lib.ew:4287 in procedure = invokeHandler()=20 Close_MainWindow() needs 0 arguments, not 3=20 id =3D 3 event =3D 14 params =3D {} lRoutines =3D {37'%'} lCallType =3D 1 i =3D 1 ... called from C:\Program Files\EUPHORIA\WIN32LIB_055\win32lib.ew:10050 = in function fDoClose() =20 id =3D 3 hWnd =3D 3500 iMsg =3D 16 wParam =3D 0 lParam =3D 0 pReturn =3D -2761 idStyle =3D <no value> idDepth =3D <no value> ... called from C:\Program Files\EUPHORIA\WIN32LIB_055\win32lib.ew:10395 = in function WndProc() =20 hWnd =3D 3500 iMsg =3D 16 wParam =3D 0 lParam =3D 0 id =3D 3 lHandledEvent =3D 25 result =3D <no value> ^^^ call-back from Windows ... called from C:\Program Files\EUPHORIA\WIN32LIB_055\win32lib.ew:414 = in function w32Func() =20 funcid =3D 25 parms =3D {3500,274,61536,721180} lRC =3D <no value> libfunc =3D <no value> lFuncDef =3D 21 linked =3D <no value> ... called from C:\Program Files\EUPHORIA\WIN32LIB_055\win32lib.ew:10390 = in function WndProc() =20 hWnd =3D 3500 iMsg =3D 274 wParam =3D 61536 lParam =3D 721180 id =3D 3 lHandledEvent =3D 0 result =3D <no value> ^^^ call-back from Windows ... called from C:\Program Files\EUPHORIA\WIN32LIB_055\win32lib.ew:414 = in function w32Func() =20 funcid =3D 25 parms =3D {3500,161,20,721180} lRC =3D <no value> libfunc =3D <no value> lFuncDef =3D 21 linked =3D <no value> ... called from C:\Program Files\EUPHORIA\WIN32LIB_055\win32lib.ew:10390 = in function WndProc() =20 hWnd =3D 3500 iMsg =3D 161 wParam =3D 20 lParam =3D 721180 id =3D 3 lHandledEvent =3D 0 result =3D <no value> ^^^ call-back from Windows ... called from C:\Program Files\EUPHORIA\WIN32LIB_055\win32lib.ew:449 = in procedure w32Proc() =20 funcid =3D 21 parms =3D {7676008} libfunc =3D <no value> lFuncDef =3D 34'"' ... called from C:\Program Files\EUPHORIA\WIN32LIB_055\win32lib.ew:10551 = in procedure eventLoop() =20 id =3D 0 Flag =3D -1 msg =3D 7676008 hWnd =3D 0 getRC =3D 1 inc =3D 0 el =3D 1 ... called from C:\Program Files\EUPHORIA\WIN32LIB_055\win32lib.ew:10596 = in procedure WinMain() =20 id =3D 3 style =3D 0 ... called from test.exw:26=20 Global & Local Variables C:\PROGRA~1\EUPHORIA\INCLUDE\msgbox.e: lib =3D 3220504576 msgbox_id =3D 0 get_active_id =3D 1 C:\PROGRA~1\EUPHORIA\INCLUDE\file.e: my_dir =3D -2 C:\PROGRA~1\EUPHORIA\INCLUDE\get.e: input_file =3D <no value> input_string =3D <no value> string_next =3D <no value> ch =3D <no value> C:\PROGRA~1\EUPHORIA\INCLUDE\image.e: fn =3D <no value> error_code =3D <no value> numXPixels =3D <no value> numYPixels =3D <no value> bitCount =3D <no value> numRowBytes =3D <no value> startXPixel =3D <no value> startYPixel =3D <no value> endYPixel =3D <no value> C:\Program Files\EUPHORIA\WIN32LIB_055\tk_mem.e: pAbortRtn =3D 0 pAllocationCounter =3D 3 pAllocated =3D {{0},{{7675916,7675940,7676008}}} pAllotted =3D 0 pStringSet =3D 0 pHeap =3D 6619136 pPeekStringBufSize =3D 256 C:\Program Files\EUPHORIA\WIN32LIB_055\win32lib.ew: VOID =3D 0 vWinMainState =3D 1 myId =3D {3} myReturn =3D {0} riCleanUp =3D 36'$' ri_getClientRect =3D 3 riPause =3D -1 riBreak =3D -1 showWarnings =3D 1 xUserCleanUp =3D -1 vMsgsToIgnore =3D {} vAppName =3D {87'W',105'i',110'n',51'3',50'2',76'L',105'i',98'b',32' = ', 65'A',112'p',112'p',87'W',105'i',110'n',100'd',111'o',119'w'} vw32Libraries =3D = {{{1,3220504576},{117'u',115's',101'e',114'r',51'3', 50'2',46'.',100'd',108'l',108'l'}},{{1,3220307968},{103'g',100'd',105'i',= 51'3',50'2',46'.',100'd',108'l',108'l'}},{{0,0},{119'w',105'i',110'n', 109'm',109'm',46'.',100'd',108'l',108'l'}},{{0,0},{99'c',111'o',109'm', 100'd',108'l',103'g',51'3',50'2',46'.',100'd',108'l',108'l'}},{{1,3216441= 344}, {99'c',111'o',109'm',99'c',116't',108'l',51'3',50'2',46'.',100'd',108'l',= 108'l'}},{{0,0},{107'k',101'e',114'r',110'n',101'e',108'l',51'3',50'2', 46'.',100'd',108'l',108'l'}},{{0,0},{115's',104'h',101'e',108'l',108'l', 51'3',50'2',46'.',100'd',108'l',108'l'}},{{1,1207959552},{{114'r',105'i',= 99'c',104'h',101'e',100'd',50'2',48'0',46'.',100'd',108'l',108'l'},{114'r= ', 105'i',99'c',104'h',101'e',100'd',51'3',50'2',46'.',100'd',108'l',108'l'}=vw32Routines =3D = {10,16,18,{-1,{85'U',110'n',114'r',101'e',103'g',105'i', 115's',116't',101'e',114'r',67'C',108'l',97'a',115's',115's',65'A'},{3355= 4436, 33554436},16777220},19,29,30,{-1,{83'S',101'e',116't',70'F',111'o',114'r'= , 101'e',103'g',114'r',111'o',117'u',110'n',100'd',87'W',105'i',110'n', 100'd',111'o',119'w'},{33554436},33554436},17,{-1,{83'S',101'e',116't', 67'C',117'u',114'r',115's',111'o',114'r'},{33554436},16777220},{-1,{83'S'= , 101'e',116't',67'C',117'u',114'r',115's',111'o',114'r',80'P',111'o',115's= '}, {16777220,16777220}},{-1,{109'm',111'o',117'u',115's',101'e',95'_',101'e'= , 118'v',101'e',110'n',116't'},{16777220,16777220,16777220,16777220,1677722= 0}}, {-1,{83'S',104'h',111'o',119'w',67'C',117'u',114'r',115's',111'o',114'r'}= , {16777220},16777220},{-1,{67'C',114'r',101'e',97'a',116't',101'e',67'C', 117'u',114'r',115's',111'o',114'r'},{33554436,16777220,16777220,16777220,=
16777220,33554436,33554436},33554436},{-1,{68'D',101'e',115's',116't', 114'r',111'o',121'y',67'C',117'u',114'r',115's',111'o',114'r'},{33554436}= , 16777220},{-1,{71'G',101'e',116't',67'C',108'l',97'a',115's',115's',76'L'= , 111'o',110'n',103'g',65'A'},{33554436,16777220},33554436},24,{-1,{80'P', 101'e',101'e',107'k',77'M',101'e',115's',115's',97'a',103'g',101'e',65'A'= }, {33554436,33554436,33554436,33554436,33554436},16777220},32' ',33'!', 34'"',26,{-1,{71'G',101'e',116't',67'C',108'l',105'i',101'e',110'n',116't= ', 82'R',101'e',99'c',116't'},{33554436,33554436},16777220},{-1,{68'D',114'r= ', 97'a',119'w',84'T',101'e',120'x',116't',65'A'},{33554436,33554436,1677722= 0, 33554436,33554436}},21,11,15,{-1,{66'B',101'e',103'g',105'i',110'n',80'P'= , 97'a',105'i',110'n',116't'},{33554436,33554436},16777220},{-1,{69'E', 110'n',100'd',80'P',97'a',105'i',110'n',116't'},{33554436,33554436}}, {-1,{71'G',101'e',116't',85'U',112'p',100'd',97'a',116't',101'e',82'R',..= . vNextRtn =3D 238 WC_RICHEDIT =3D = {82'R',73'I',67'C',72'H',69'E',68'D',73'I',84'T',50'2', 48'0',65'A'} classes =3D 50'2' Screen =3D 1 Printer =3D 2 className =3D {{},{98'b',117'u',116't',116't',111'o',110'n'},{98'b', 117'u',116't',116't',111'o',110'n'},{98'b',117'u',116't',116't',111'o', 110'n'},{98'b',117'u',116't',116't',111'o',110'n'},{98'b',117'u',116't', 116't',111'o',110'n'},{98'b',117'u',116't',116't',111'o',110'n'},{108'l',=
105'i',115's',116't',98'b',111'o',120'x'},{108'l',105'i',115's',116't', 98'b',111'o',120'x'},{99'c',111'o',109'm',98'b',111'o',98'b',111'o',120'x= '}, {99'c',111'o',109'm',98'b',111'o',98'b',111'o',120'x'},{99'c',111'o', 109'm',98'b',111'o',98'b',111'o',120'x'},{99'c',111'o',109'm',98'b',111'o= ', 98'b',111'o',120'x'},{101'e',100'd',105'i',116't'},{101'e',100'd',105'i',=
116't'},{115's',116't',97'a',116't',105'i',99'c'},{115's',116't',97'a', 116't',105'i',99'c'},{115's',116't',97'a',116't',105'i',99'c'},{115's', 99'c',114'r',111'o',108'l',108'l',98'b',97'a',114'r'},{115's',99'c',114'r= ', 111'o',108'l',108'l',98'b',97'a',114'r'},{115's',116't',97'a',116't', 105'i',99'c'},{115's',116't',97'a',116't',105'i',99'c'},{},{},{},{},{84'T= ', 111'o',111'o',108'l',98'b',97'a',114'r',87'W',105'i',110'n',100'd',111'o'= , 119'w',51'3',50'2'},{109'm',115's',99'c',116't',108'l',115's',95'_',115's= ', 116't',97'a',116't',117'u',115's',98'b',97'a',114'r',51'3',50'2'},{98'b',=
117'u',116't',116't',111'o',110'n'},{98'b',117'u',116't',116't',111'o', 110'n'},{98'b',117'u',116't',116't',111'o',110'n'},{109'm',115's',99'c', 116't',108'l',115's',95'_',116't',114'r',97'a',99'c',107'k',98'b',97'a', 114'r',51'3',50'2'},{109'm',115's',99'c',116't',108'l',115's',95'_',116't= ', 114'r',97'a',99'c',107'k',98'b',97'a',114'r',51'3',50'2'},{83'S',121'y', 115's',84'T',97'a',98'b',67'C',111'o',110'n',116't',114'r',111'o',108'l',=
51'3',50'2'},0,{109'm',115's',99'c',116't',108'l',115's',95'_',112'p', 114'r',111'o',103'g',114'r',101'e',115's',115's',51'3',50'2'},{83'S',... classType =3D {0,1,1,1,1,1,1,4,4,2,2,2,2,3,3,6,6,6,5,5,6,6,7,8,9,10, 11,11,1,1,1,11,11,11,0,11,11,0,11,11,11,11,11,0,11,11,1,11,0,0} classStyle =3D = {13565952,1342242816,1342242817,1342242819,1342242822, 1342242825,1342177287,1352728577,1352728579,1344340482,1344340738,1342243= 331, 1344340483,1350631552,1353777156,1342177280,1342177282,1342177281,1342242= 816, 1342242817,1342177283,1342177294,0,0,0,0,1417674757,1409286147,1342242944= , 1342246915,1342247043,1342242849,1342242851,1375797248,0,1342177280,13506= 31488, 0,1350631424,1352769604,1350631424,1342177280,1451294752,0,1,1350633733, 1,1342243842,0,0} classStyleEx =3D = {16,0,0,0,0,0,0,528,528,512,512,512,512,528,528,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,512,0,512,512,1,0,512,0,8,1,0,0, 0,0} classAttr =3D = {1,0,0,0,0,0,1,1,1,1,1,1,1,0,8,0,0,0,0,0,0,0,2,2,2,2,3, 3,4,0,4,1,1,1,0,1,1,0,0,8,0,0,2,0,2,3,3,1,2,2} classBGColor =3D = {12632256,12632256,12632256,12632256,12632256,12632256, 12632256,16777215,16777215,16777215,16777215,16777215,16777215,16777215, 16777215,12632256,12632256,12632256,12632256,12632256,12632256,12632256, 12632256,12632256,12632256,12632256,12632256,12632256,12632256,12632256, 12632256,12632256,12632256,12632256,12632256,12632256,16777215,12632256, 16777215,16777215,12632256,12632256,12632256,12632256,12632256,12632256, 12632256,16777215,12632256,12632256} vWindowClassStyle =3D {2,1} lv_id =3D {} lvitem_data =3D {} lvsort_column =3D {} il_id =3D <no value> icon_list =3D <no value> lv_allowsort =3D {} lvitem_owner =3D {} ilicon_list =3D {} ILlarge =3D 0 ILsmall =3D 0 tv_id =3D {} tvitem_data =3D {} tvitem_owner =3D {} tvitem_parent =3D {} tvitem_handle =3D {} himlFTBDefault =3D 0 himlFTBHot =3D 0 himlFTBDisabled =3D 0 FTB_images =3D {} WndProcAddress =3D 8799880 SubProcAddress =3D 8799984 onMouse =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onClick =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onKeyPress =3D = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onKeyUp =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onKeyDown =3D = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onResize =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onChange =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onGotFocus =3D = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onLostFocus =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1} onScroll =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onOpen =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onActivate =3D = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onClose =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onDestroy =3D = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onTimer =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onPaint =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} onDragAndDrop =3D = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1} onEvent =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} mainWindow =3D 3 modalWindow =3D 0 modalStyle =3D 0 modalDepth =3D 0 modalhWnd =3D 0 modalStack =3D {} paintDC =3D {} window_handle =3D = {-1,-1,3500,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1} window_handle_type =3D {-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1} window_destroyed =3D = {0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1} window_func =3D {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1} window_class =3D {-1,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1} window_type =3D = {49'1',50'2',1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1} window_focus_order =3D = {{},{},{},-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1} window_focus =3D = {0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} window_owner =3D = {0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} window_menu =3D {0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} window_toolbar =3D {0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1} window_statusbar =3D = {0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1} window_tooltip =3D {{},{},{},-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1} window_font =3D = 97'a',114'r',105'i',97'a',108'l'},10,0,0},{{97'a', 114'r',105'i',97'a',108'l'},10,0,0},{{},10,0,0},-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1} window_fcolor =3D = {0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} window_bcolor =3D = {12632256,12632256,12632256,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1} window_pen =3D = {{0,0,0,13,1,1,12632256},{0,0,0,13,1,1,12632256},{0,0, 0,13,1,1,12632256},-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} window_x =3D {0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} window_y =3D {0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} window_scroll =3D = {{1,10},{1,10},{1,10},-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1} window_range =3D = {{0,100'd'},{0,100'd'},{0,100'd'},-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1} window_tabitems =3D = {{},{},{},-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1} window_group =3D = {{},{},{},-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1} window_cursor =3D = {0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} window_hotkey_keys =3D = {{},{},{},-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1} window_hotkey_ids =3D {{},{},{},-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1} window_textalign =3D = {0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1} window_closed =3D = {1,1,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} window_tabenabled =3D {1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1} window_eventhandler =3D {{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1},{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,37'%',-1,-1,-1,-1,-1, -1},-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} window_bbrush =3D = {0,0,1842,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1} tooltipControl =3D 0 transColor =3D 16711935 DefaultFontID =3D 144 heldResource =3D {} heldCursor =3D {} vFontWeight =3D 700 vStockResources =3D = {144,1866,1858,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14, 15,16} i =3D 16 printerDC =3D 0 grabbedHDC =3D {1922} vShowChars =3D 0 stream =3D {} regCount =3D 2 vEmptySlots =3D 16 customColors =3D 7675940 i =3D 63'?' vTabKeyCodes =3D {9} hintFontSize =3D 8 hintFontAttrib =3D 0 hintFontName =3D {77'M',83'S',32' ',83'S',97'a',110'n',115's',32' ', 83'S',101'e',114'r',105'i',102'f'} dragData =3D {} vLMB_id =3D {-1,-1,-1,-1} vMaxClickTime =3D 0.5 vMaxClickXDelta =3D 3 vMaxClickYDelta =3D 3 ActiveEL =3D {0} vEventsHandled =3D = {512,513,516,514,517,515,518,5,7,8,256,258,257,273, 563,15,277,276,275,21,309,312,307,308,16,2,78'N',260,53425} vHandler =3D {17,17,17,17,17,17,17,18,19,20,21,21,21,22,23,24,25,25, 26,27,28,28,28,28,29,30,31,32' ',33'!'} xpmErrFlag =3D <no value> transTuple =3D {255,0,255} pm =3D 0 test.exw: changes =3D 1 Traced lines leading up to the failure: C:\PROGRA~1\EUPHORIA\INCLUDE\file.e:96 my_dir =3D DEFAULT -- it's = better not to use routine_id() here, ------=_NextPart_000_0002_01C28FD3.1C2121C0--
6. Re: Help Closing Euphoria Windows
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Nov 19, 2002
- 404 views
My turn to butt in: On Tue, 19 Nov 2002 13:53:59 -0000, Matthew Anderson <andy at anders98.freeserve.co.uk> wrote: >The only difference I noticed was that the window background was grey >whereas the old library gives me white as a default. How do I change this? I don't know why the change, but this should fix it: setWindowBackColor(<window>,getSysColor( COLOR )) where COLOR is one of: COLOR_SCROLLBAR,COLOR_BACKGROUND,COLOR_DESKTOP, COLOR_ACTIVECAPTION,COLOR_INACTIVECAPTION, COLOR_MENU,COLOR_WINDOW,COLOR_WINDOWFRAME, COLOR_MENUTEXT,COLOR_WINDOWTEXT,COLOR_CAPTIONTEXT COLOR_ACTIVEBORDER,COLOR_INACTIVEBORDER COLOR_APPWORKSPACE,COLOR_HIGHLIGHT COLOR_HIGHLIGHTTEXT,COLOR_BTNFACE COLOR_BTNSHADOW,COLOR_GRAYTEXT,COLOR_BTNTEXT COLOR_INACTIVECAPTIONTEXT, COLOR_BTNHIGHLIGHT COLOR_3DDKSHADOW,COLOR_3DLIGHT, COLOR_INFOTEXT COLOR_INFOBK >Windows call back errors when I selected window closed, see attached error >file. I have not attempted to understand this because the reason may be Using setHandler instead of (eg) onClose[] uses/requires standard parameters(integer id, integer event, sequence params) for each routine specified by routine_id("<name>") passed as a parameter to setHandler. So, change procedure onCloseMyWindow() ... onClose[MyWindow]=3Droutine_id("onCloseMyWindow") to procedure onCloseMyWindow(integer id, integer event, sequence params) ... setHandler(MyWindow,w32HClose,routine_id("onCloseMyWindow") You can also replace eg: onKeyDown[Button1]=3Droutine_id("onKeyDownInWindow") onKeyDown[Button2]=3Droutine_id("onKeyDownInWindow") onKeyDown[Button3]=3Droutine_id("onKeyDownInWindow") onKeyDown[Button4]=3Droutine_id("onKeyDownInWindow") onKeyDown[Button5]=3Droutine_id("onKeyDownInWindow") with: setHandler({Button1,Button2,Button3,Button4,Button5}, w32KeyDown,routine_id("onKeyDownInWindow")) HTH Pete
7. Re: Help Closing Euphoria Windows
- Posted by Derek Parnell <ddparnell at bigpond.com> Nov 19, 2002
- 415 views
On Tue, 19 Nov 2002 13:53:59 -0000, Matthew Anderson <andy at anders98.freeserve.co.uk> wrote: > > Hi Derek, > Thanks, now we are getting somewhere! The test program doesn't work with > the > pre 055 win32lib.ew but works OK if I run it from inside the win32lib 055 > folder where the include statement accesses that folder's win32lib.ew > file. That is correct. This functionality was added at v0.55. > The only difference I noticed was that the window background was grey > whereas the old library gives me white as a default. How do I change > this? This is because the "default" window colour has been changed from COLOR_WINDOW to COLOR_BTNFACE. Use either setWindowBackColor(mywindow, BrightWhite) or setWindowBackColor(mywindow, getSysColor(COLOR_WINDOW) ) > I now have two choices: 1. Ditch the old win32 folder and keep the > win32lib-055 transferring the required library files into my Include > folder > or , 2. Ditch the whole Euphoria system except my files and download > Euphoria version 2.3. I don't quite see it as two alternative choices. I think that you should do both. That is, use a later version of win32lib and use the latest Euphoria (v2.3). If you select to v2.3 you can add a EUINC environment variable that points to the win32lib folder. That way you don't have to keep 3rd party libraries inside RDS's Euphoria\Include folder. > One worry I have is the test program didn't work with the onClose call > commented out and the setHandler line brought into play - I got lots of > Windows call back errors when I selected window closed, see attached > error > file. I have not attempted to understand this because the reason may be > obvious to you. The errors were because the parameters required for onClose[] and setHandler(...) are different. All events indicated by a setHandler() call always take exactly three parameters. The ID of the control that had the event (integer), the win32lib event number (integer) and a list of zero or more parameters that are specific to that event (sequence). The old onXXX interface used a different set of parameters for each event type, making it harder to write some generic event handlers. I recommend something like this for each event handler you need... procedure on<xxx>_<control> ( integer self, integer event, sequence parms) . . . end procedure However, because setHandler can be used to set up a single hander proc for multiple events and controls, this naming convention is only a guide. > If I am to change over to setHandler calls where do I find > out the name of the second parameter (e.g W32HClose in the case above) > for > each of the onEvent calls I use? To make it easier to remember, I named the events as w32H<xxx> for each on<xxx> event. Thus there is w32HClose, w32HKeyPress, w32HClick, ... and so on. There is also a few w32H<xxx> events that are not supported by on<xxx> syntax. See the latest documentation for details. > I enjoy programming in Euphoria but I find I struggle a bit probably > because > I have no experience of 'C' or 'VB' which would probably help me with > windows programming. I can see your reasons for mentioning VB as that is very similar to win32lib coding, but a knowledge of C itself wouldn't be much use. ------------------- cheers, Derek Parnell