1. 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.

--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

new topic     » topic index » view message » categorize

2. Re: Win32lib problem

----- 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

new topic     » goto parent     » topic index » view message » categorize

3. Re: Win32lib problem

----- 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

new topic     » goto parent     » topic index » view message » categorize

4. 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
>
>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

new topic     » goto parent     » topic index » view message » categorize

5. Re: Win32lib problem

----- 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

new topic     » goto parent     » topic index » view message » categorize

6. Re: Win32lib problem

----- 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

new topic     » goto parent     » topic index » view message » categorize

7. 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

Thanks a lot!  Is the newer version available yet?

Phil

new topic     » goto parent     » topic index » view message » categorize

8. Win32lib problem

------=_NextPart_000_0015_01C0A427.4B6BA700
	charset="iso-8859-1"

Hi all!

I got some problems with win32lib (I doun't know what it is smile
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 smile
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 smile. 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 smile =
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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I got some problems with win32lib (I =
doun't know=20
what it is smile</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 smile</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&nbsp;(MEdit,=20
Jfe and others smile. I write a code for a simple window and then I wont =
to ru=20
the&nbsp;program.But&nbsp;the editor dosen't run the program (I have =
write the=20
code 100%&nbsp;right&nbsp;smile 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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Lep Pozdrav</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jan</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Slovenia</FONT></DIV>
------=_NextPart_000_0015_01C0A427.4B6BA700--

new topic     » goto parent     » topic index » view message » categorize

9. Re: Win32lib problem

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 smile
> 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 smile 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 smile. 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 smile 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

new topic     » goto parent     » topic index » view message » categorize

10. Re: Win32lib problem

Hi Jan,

> I got some problems with win32lib (I doun't know what it is smile

It 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 smile

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."

new topic     » goto parent     » topic index » view message » categorize

11. Win32lib problem

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

new topic     » goto parent     » topic index » view message » categorize

12. Re: Win32lib problem

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

new topic     » goto parent     » topic index » view message » categorize

13. Re: Win32lib problem

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

new topic     » goto parent     » topic index » view message » categorize

14. 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

new topic     » goto parent     » topic index » view message » categorize

15. Re: Win32lib problem

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
>
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu