1. Win32lib problem
- Posted by "Philip Deets" <philip1987 at hotmail.com> Dec 01, 2003
- 939 views
I'm making a programming editor with win32lib. I found a problem and simplified the program so that this program recreates the error. When you click on the child window, Eu shows the result of getMouseRelPos(). The problem is, when you click the top-left pixel of the child window, getMouseRelPos( child ) should return {1,1}; instead, it returns {1,-29}. It seems that for the Y position, it returns the correct answer minus the width of the toolbar. --source code without warning include Win32Lib.ew constant win = create( Window, "win", 0, Default, Default, 300, 300, 0 ), tb = create( ToolBar, "", win, 0, 0, 0, 30, 0 ), child = create( Window, "", win, 50, 50, 100, 100, {WS_CHILD, WS_VISIBLE, WS_BORDER} ) procedure click( integer self, integer event, sequence parms ) ? getPointerRelPos( child ) end procedure setHandler( child, w32HClick, routine_id("click") ) WinMain( win, Normal ) --end source code Is this a win32lib bug? Thanks, Phil
2. Re: Win32lib problem
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Dec 01, 2003
- 821 views
----- Original Message ----- From: "Philip D." <philip1987 at hotmail.com> To: <EUforum at topica.com> Subject: Win32lib problem > > > I'm making a programming editor with win32lib. I found a problem and > simplified the program so that this program recreates the error. When you > click on the child window, Eu shows the result of getMouseRelPos(). The > problem is, when you click the top-left pixel of the child window, > getMouseRelPos( child ) should return {1,1}; instead, it returns {1,-29}. > It seems that for the Y position, it returns the correct answer minus the > width of the toolbar. > I do not get this result. On my system, I get the *correct* value of {0,0}. What version of win32lib are you using? What version of Windows are you using? -- Derek
3. Re: Win32lib problem
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Dec 01, 2003
- 817 views
----- Original Message ----- From: "Philip D." <philip1987 at hotmail.com> To: <EUforum at topica.com> Subject: Win32lib problem > > > I'm making a programming editor with win32lib. I found a problem and > simplified the program so that this program recreates the error. When you > click on the child window, Eu shows the result of getMouseRelPos(). The > problem is, when you click the top-left pixel of the child window, > getMouseRelPos( child ) should return {1,1}; instead, it returns {1,-29}. > It seems that for the Y position, it returns the correct answer minus the > width of the toolbar. > Also, does the wrong value change if you change the toolbar specifications? -- Derek
4. Re: Win32lib problem
- Posted by "Philip Deets" <philip1987 at hotmail.com> Dec 02, 2003
- 818 views
>>I'm making a programming editor with win32lib. I found a problem and >>simplified the program so that this program recreates the error. When you >>click on the child window, Eu shows the result of getMouseRelPos(). The >>problem is, when you click the top-left pixel of the child window, >>getMouseRelPos( child ) should return {1,1}; instead, it returns {1,-29}. >>It seems that for the Y position, it returns the correct answer minus the >>width of the toolbar. > >I do not get this result. On my system, I get the *correct* value of {0,0}. > >What version of win32lib are you using? 0.59.01 > >What version of Windows are you using? Windows XP Pro sp1 > >Also, does the wrong value change if you change the toolbar specifications? Yes, when I change the toolbar to 50 width, I get {0, -50}. > >-- >Derek Sorry about saying correct was {1,1}, it's {0,0}, but I guess that doesn't matter. Phil
5. Re: Win32lib problem
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Dec 02, 2003
- 807 views
----- Original Message ----- From: "Philip D." <philip1987 at hotmail.com> To: <EUforum at topica.com> Subject: Re: Win32lib problem > > > >>I'm making a programming editor with win32lib. I found a problem and > >>simplified the program so that this program recreates the error. When you > >>click on the child window, Eu shows the result of getMouseRelPos(). The > >>problem is, when you click the top-left pixel of the child window, > >>getMouseRelPos( child ) should return {1,1}; instead, it returns {1,-29}. > >>It seems that for the Y position, it returns the correct answer minus the > >>width of the toolbar. > > > >I do not get this result. On my system, I get the *correct* value of {0,0}. > > > >What version of win32lib are you using? > 0.59.01 > > > >What version of Windows are you using? > Windows XP Pro sp1 I just used 0.59.2K (which is virtually the same for this function), on Windows 2000 and it works just fine. > >Also, does the wrong value change if you change the toolbar specifications? > Yes, when I change the toolbar to 50 width, I get {0, -50}. Try this variation of your code. This shows clicks for all three controls plus is shows the absolute position, the control's Top Left absolute position and the mouse's relative position. All seem to work okay on my systems. --source code without warning include Win32Lib.ew constant win = create( Window, "win", 0, 0, 0, 300, 300, 0 ), tb = create( ToolBar, "", win, 0, 0, 0, 30, 0 ), child = create( Window, "", win, 50, 50, 100, 100, {WS_CHILD, WS_VISIBLE, WS_BORDER} ) procedure click( integer self, integer event, sequence parms ) ? self & getPointerPos() & ClientToScreen(self, 0, 0) & getPointerRelPos( self ) end procedure setHandler( {win,tb,child}, w32HClick, routine_id("click") ) WinMain( win, Normal ) -- Derek
6. Re: Win32lib problem
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Dec 02, 2003
- 803 views
----- Original Message ----- From: "Philip D." <philip1987 at hotmail.com> To: <EUforum at topica.com> Subject: RE: Win32lib problem > > > Derek Parnell wrote: > > > > Philip Deets wrote: > > > > > > > > > >I'm making a programming editor with win32lib. I found a > > > > >problem and simplified the program so that this program > > > > >recreates the error. When you click on the child window, Eu > > > > >shows the result of getMouseRelPos(). The problem is, when > > > > >you click the top-left pixel of the child window, > > > > >getMouseRelPos( child ) should return {1,1}; instead, it > > > > >returns {1,-29}. It seems that for the Y position, it > > > > >returns the correct answer minus the width of the toolbar. > > > > > > > >I do not get this result. On my system, I get the *correct* > > > >value of {0,0}. > > > > > > > >What version of win32lib are you using? > > > 0.59.01 > > > > > > > >What version of Windows are you using? > > > Windows XP Pro sp1 > > > > > > I just used 0.59.2K (which is virtually the same for this > > function), on Windows 2000 and it works just fine. > > > > > >Also, does the wrong value change if you change the toolbar > > > >specifications? > > > Yes, when I change the toolbar to 50 width, I get {0, -50}. > > > > Try this variation of your code. This shows clicks for all three > > >controls plus is shows the absolute position, the control's Top >Left > > absolute position and the mouse's relative position. All seem >to work > > okay on my systems. > > > > --source code > > > > without warning > > include Win32Lib.ew > > > > constant win = create( Window, "win", 0, 0, 0, 300, 300, 0 ), > > tb = create( ToolBar, "", win, 0, 0, 0, 30, 0 ), > > child = create( Window, "", win, 50, 50, 100, 100, {WS_CHILD, > > WS_VISIBLE, WS_BORDER} ) > > > > procedure click( integer self, integer event, sequence parms ) > > ? self & getPointerPos() & ClientToScreen(self, 0, 0) & > > getPointerRelPos( self ) > > end procedure > > setHandler( {win,tb,child}, w32HClick, routine_id("click") ) > > > > WinMain( win, Normal ) > > > > -- > > Derek > > > > > I get {17,55,111,55,111,0,-30}. > Found it! There was a bug in the old version (the one you are using) of getPointerRelPosition(). You can fix it quickly by going to this function inside win32lib and changing the call to "getClientPoint" to "ClientToScreen". It uses the same parameters. -- Derek
7. Re: Win32lib problem
- Posted by "Philip Deets" <philip1987 at hotmail.com> Dec 02, 2003
- 803 views
>> Derek Parnell wrote: >> > >> > Philip Deets wrote: >> > >> > > >> > > > >I'm making a programming editor with win32lib. I found a >> > > > >problem and simplified the program so that this program >> > > > >recreates the error. When you click on the child window, Eu >> > > > >shows the result of getMouseRelPos(). The problem is, when >> > > > >you click the top-left pixel of the child window, >> > > > >getMouseRelPos( child ) should return {1,1}; instead, it >> > > > >returns {1,-29}. It seems that for the Y position, it >> > > > >returns the correct answer minus the width of the toolbar. >> > > > >> > > >I do not get this result. On my system, I get the *correct* >> > > >value of {0,0}. >> > > > >> > > >What version of win32lib are you using? >> > > 0.59.01 >> > > > >> > > >What version of Windows are you using? >> > > Windows XP Pro sp1 >> > >> > >> > I just used 0.59.2K (which is virtually the same for this >> > function), on Windows 2000 and it works just fine. >> > >> > > >Also, does the wrong value change if you change the toolbar >> > > >specifications? >> > > Yes, when I change the toolbar to 50 width, I get {0, -50}. >> > >> > Try this variation of your code. This shows clicks for all three >> > controls plus is shows the absolute position, the control's Top Left >> > absolute position and the mouse's relative position. All seem to work >> > okay on my systems. >> > >> > --source code >> > >> > without warning >> > include Win32Lib.ew >> > >> > constant win = create( Window, "win", 0, 0, 0, 300, 300, 0 ), >> > tb = create( ToolBar, "", win, 0, 0, 0, 30, 0 ), >> > child = create( Window, "", win, 50, 50, 100, 100, {WS_CHILD, >> > WS_VISIBLE, WS_BORDER} ) >> > >> > procedure click( integer self, integer event, sequence parms ) > > > ? self & getPointerPos() & ClientToScreen(self, 0, 0) & > > > getPointerRelPos( self ) > > > end procedure >> > setHandler( {win,tb,child}, w32HClick, routine_id("click") ) >> > >> > WinMain( win, Normal ) >> > >> > -- >> > Derek >> > > > > > > I get {17,55,111,55,111,0,-30}. > > > >Found it! There was a bug in the old version (the one you are using) of >getPointerRelPosition(). >You can fix it quickly by going to this function >inside win32lib and changing the call >to "getClientPoint" to >"ClientToScreen". It uses the same parameters. > >-- >Derek Thanks a lot! Is the newer version available yet? Phil
8. Win32lib problem
- Posted by alojz.hancic at siol.net Mar 03, 2001
- 805 views
------=_NextPart_000_0015_01C0A427.4B6BA700 charset="iso-8859-1" Hi all! I got some problems with win32lib (I doun't know what it isI have download it but I doun't know what to do with it ( I have = download it beocus olmoust in every .doc or .html file it says: you must = have win32lib
Tell me where to unzip the win32lib.zip file, and what I coud do with it = then. I have some problems with the editor's (MEdit, Jfe and others
. I = write a code for a simple window and then I wont to ru the program.But = the editor dosen't run the program (I have write the code 100% right
= is this related to win32lib? Please tell me what is wrong! Lep Pozdrav Jan Slovenia ------=_NextPart_000_0015_01C0A427.4B6BA700 charset="iso-8859-1" <!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 5.50.4522.1800" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Hi all!</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>I got some problems with win32lib (I = doun't know=20 what it is
</FONT></DIV> <DIV><FONT face=3DArial size=3D2>I have download it but I doun't know = what to do=20 with it ( I have download it beocus olmoust in every .doc or .html file = it says:=20 you must have win32lib
</FONT></DIV> <DIV><FONT face=3DArial size=3D2>Tell me where to unzip the win32lib.zip = file, and=20 what I coud do with it then.</FONT></DIV> <DIV><FONT face=3DArial size=3D2>I have some problems with the = editor's (MEdit,=20 Jfe and others
. I write a code for a simple window and then I wont = to ru=20 the program.But the editor dosen't run the program (I have = write the=20 code 100% right
is this related to win32lib?</FONT></DIV> <DIV><FONT face=3DArial size=3D2>Please tell me what is = wrong!</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Lep Pozdrav</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Jan</FONT></DIV> <DIV><FONT face=3DArial size=3D2>Slovenia</FONT></DIV> ------=_NextPart_000_0015_01C0A427.4B6BA700--
9. Re: Win32lib problem
- Posted by Kat <gertie at PELL.NET> Mar 03, 2001
- 801 views
On 3 Mar 2001, at 12:46, alojz.hancic at siol.net wrote: > Hi all! > > I got some problems with win32lib (I doun't know what it is> I have download it but I doun't know what to do with it ( I have download it > beocus > olmoust in every .doc or .html file it says: you must have win32lib
Tell > me where to > unzip the win32lib.zip file, and what I coud do with it then. I have some > problems with > the editor's (MEdit, Jfe and others
. I write a code for a simple window > and then I > wont to ru the program.But the editor dosen't run the program (I have write > the code 100% > right
is this related to win32lib? Please tell me what is wrong! Editors don't run the program, they pass it to the interpreter to run it. Did you tell the editor where the interpreter is? Did you try using the mouse to drop the file onto the interpreter directly? Kat
10. Re: Win32lib problem
- Posted by Derek Parnell <ddparnell at bigpond.com> Mar 03, 2001
- 827 views
Hi Jan, > I got some problems with win32lib (I doun't know what it isIt is a tool for helping with writing programs for Windows. >I have download it but I doun't know what to >do with it ( I have download it beocus olmoust >in every .doc or .html file it says: you must >have win32lib
You only use it if you are going to write Windows programs. And no one "needs" it, its just a tool. You can write Windows programs without it, but win32lib.ew makes things a lot easier. >Tell me where to unzip the win32lib.zip file, >and what I coud do with it then. Can I suggest that you don't start with Windows programs yet. Try to learn Euphoria using the DOS version. DOS is a much simpler environment to learn Euphoria. ------ Derek Parnell Melbourne, Australia "To finish a job quickly, go slower."
11. Win32lib problem
- Posted by DB James <larches at comcast.net> Mar 30, 2007
- 821 views
Hi, I am getting a type-check failure when I use win32lib's getRandInt() function This function calls machine.e procedure below: global procedure set_rand(integer seed) -- Reset the random number generator. -- A given value of seed will cause the same series of -- random numbers to be generated from the rand() function machine_proc(M_SET_RAND, seed) end procedure But getRandInt() sends an atom as a seed in its call to set_rand() [set_rand(w32Seed)] and that triggers the error: [global atom w32Seed w32Seed = #30000000 + rand(#FFFFFFF)]. I'll use rand() meanwhile... --Quark
12. Re: Win32lib problem
- Posted by Derek Parnell <ddparnell at bigpond.com> Mar 30, 2007
- 843 views
DB James wrote: > But getRandInt() sends an atom as a seed in its call to > set_rand() [set_rand(w32Seed)] and that triggers the error: You are correct. Even though the w32Seed is kept as a 32-bit integer, the Euphoria set_rand() expects no more than 30-bit positive integers. Add this line just before the calls to set_rand() in getRandInt... w32Seed = remainder(w32Seed, #1F000000) This will constain the seed value to positive integers up to 30-bits long. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell
13. Re: Win32lib problem
- Posted by DB James <larches at comcast.net> Mar 30, 2007
- 834 views
Derek Parnell wrote: > > DB James wrote: > > > But getRandInt() sends an atom as a seed in its call to > > set_rand() [set_rand(w32Seed)] and that triggers the error: > > You are correct. Even though the w32Seed is kept as a 32-bit integer, the > Euphoria > set_rand() expects no more than 30-bit positive integers. > > Add this line just before the calls to set_rand() in getRandInt... > > w32Seed = remainder(w32Seed, #1F000000) > > This will constain the seed value to positive integers up to 30-bits long. > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell Hi Derek, Thanks for the fast reply and the fix -- will use it! --Quark
14. Win32lib problem
- Posted by Florian Perget <florian.perget at wanadoo.fr> Apr 09, 2001
- 813 views
Hi everyone, this question may have been asked many times, but I watched all the forum since I joined, and I don't find. My problem is : when I try to start any program wich use Win32lib , I get the following error : "Common controls could not be initialised". I watched a little through Win32lib's code and I thonk that it use comctl32.dll, that I own. I own Win32lib version 0.55.1 under Windows 95 and Euphoria 2.2 Thanks for any feedbak. Florian
15. Re: Win32lib problem
- Posted by Derek Parnell <ddparnell at bigpond.com> Apr 09, 2001
- 837 views
Hi Florian, Sorry but Win32lib v0.55.1 does not support ancient versions of Windows. However, improved support will be available in the next version (out real soon). The problem you have found is that win32lib initialises all the common control types that are to be found in Win98 and if one doesn't initialise it aborts. The next release only initialises the common control type if you try to create one. This means that you still can't create a FlatToolBar in Win95 but you'll at least be able to run the library. ------ Derek Parnell Melbourne, Australia "To finish a job quickly, go slower." ----- Original Message ----- From: "Florian Perget" <florian.perget at wanadoo.fr> To: "EUforum" <EUforum at topica.com> Sent: Monday, April 09, 2001 6:20 PM Subject: Win32lib problem > > > Hi everyone, > this question may have been asked many times, but I watched all the > forum since I joined, and I don't find. > > My problem is : > when I try to start any program wich use Win32lib , I get the > following error : "Common controls could not be initialised". > I watched a little through Win32lib's code and I thonk that it use > comctl32.dll, that I own. > > I own Win32lib version 0.55.1 under Windows 95 and Euphoria 2.2 > > Thanks for any feedbak. > > Florian > > > > >