1. Win4Eu update

A little update on the progress of Win4Eu:

Today I've managed to show a window, which does absolutely nothing.
This doesn't seem very exciting, but I find it very exciting. I've
been working on Win4Eu for a few weeks now, and it's the first time
I see more than a message box or a console test.

The code to show this window looks like this:
include win4eu.ew

constant win = create(Window, "win", {10, 10, 300, 200})
start(Application)


--
tommy online: http://users.telenet.be/tommycarlier
tommy.blog: http://tommycarlier.blogspot.com
Euphoria Message Board: http://uboard.proboards32.com
Empire for Euphoria: http://empire.iwireweb.com

new topic     » topic index » view message » categorize

2. Re: Win4Eu update

Tommy Carlier wrote:

> Today I've managed to show a window, which does absolutely nothing.

That's very exciting, Tommy! :)

Let me know when you want a release-candidate tester. :D

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

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

3. Re: Win4Eu update

Tommy Carlier wrote:
> 
> A little update on the progress of Win4Eu:
> 
> }}}
<eucode>
> include win4eu.ew
> 
> constant win = create(Window, "win", {10, 10, 300, 200})
> start(Application)
> </eucode>
{{{

> 

Tommy I don't see anything new except you have no parent
and no style; You can already do this using my w32engin.ew or win32lib.

include w32engin.ew
 
constant win = create(Window, "win", 0, 10, 10, 300, 200,0)
WinMain(win,Normal)


Bernie
My files in archive:
http://www.rapideuphoria.com/w32engin.zip
http://www.rapideuphoria.com/mixedlib.zip
http://www.rapideuphoria.com/eu_engin.zip
http://www.rapideuphoria.com/win32eru.zip

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

4. Re: Win4Eu update

Bernard Ryan wrote:
> 
> Tommy Carlier wrote:
> > 
> > A little update on the progress of Win4Eu:
> > 
> > }}}
<eucode>
> > include win4eu.ew
> > 
> > constant win = create(Window, "win", {10, 10, 300, 200})
> > start(Application)
> > </eucode>
{{{

> > 
> 
> Tommy I don't see anything new except you have no parent
> and no style; You can already do this using my w32engin.ew or win32lib.
> 
>  }}}
<eucode>
>  include w32engin.ew
>  
> constant win = create(Window, "win", 0, 10, 10, 300, 200,0)
> WinMain(win,Normal)
> </eucode>
{{{

> 
While Bernie is correct, I suspect there are more wonders to be revealed
yet in Tommy's approach.

BTW in win32lib, this could be done with ...

include win32lib.ew
createForm("Window, win, at=(10,10), size=(300,200)")
include w32start.ew


-- 
Derek Parnell
Melbourne, Australia

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

5. Re: Win4Eu update

Bernard Ryan wrote:
> Tommy Carlier wrote:
> > A little update on the progress of Win4Eu:
> > 
> > }}}
<eucode>
> > include win4eu.ew
> > 
> > constant win = create(Window, "win", {10, 10, 300, 200})
> > start(Application)
> > </eucode>
{{{

> Tommy I don't see anything new except you have no parent
> and no style; You can already do this using my w32engin.ew or win32lib.
> 
>  }}}
<eucode>
>  include w32engin.ew
>  
> constant win = create(Window, "win", 0, 10, 10, 300, 200,0)
> WinMain(win,Normal)
> </eucode>
{{{


You're absolutely right. What it does, is just create a window, and
show it. I forgot to mention that Win4Eu will be able to do more than
that blink

The difference with w32Engine and Win32Lib, will not be what it can do,
but the programming interface, the architecture. Win4Eu is a (limited)
object-oriented architecture, with inheritance, properties and events.
One other difference: I'm trying to hide the technical details of
Windows programming even more than in the currently used libraries.
Why do you start the event-loop of an application with 'WinMain'?
Probably because it's like that in C/C++. I'm taking a different
approach: wanna start the application? Call the start-verb and pass
it the Application-object: start(Application). Wanna move a window?
Set the location: set(win, "Location", {x, y}) or even shorter:
move(win, {x, y})
Although Win4Eu hides the low-level stuff for regular users, you can
still access all the low-level features. An example: structures. You
can create structures, like you create regular objects, with the 
create-verb. Here's a simple definition of a structure, and how you
create an instance:
constant POINT = defineStructure("POINT", {
   {"x", Int},
   {"y", Int}
})

integer pt, size
atom address
pt = create(POINT, "pt", {})
pokeField(pt, "x", 0, 100)
pokeField(pt, "y", 0, 100)
size = getStructureSize(pt) -- get the size in bytes
address = getStructureAddress(pt) -- get the physical address

destroy(pt) -- release the memory


I will try to make it as easy as possible for people to create
Windows applications. And another advantage of the object-oriented
architecture is extensibility: it will be easy to create new controls
and treat them exactly the same as regular controls (what I earlier
tried to do with EuControls). 

--
tommy online: http://users.telenet.be/tommycarlier
tommy.blog: http://tommycarlier.blogspot.com
Euphoria Message Board: http://uboard.proboards32.com
Empire for Euphoria: http://empire.iwireweb.com

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

6. Re: Win4Eu update

Not sure why win4Eu needs its own structs library. It'd make more
sense to me if you either used a structs library that already existed,
or had the structs part modular enough to use separately.


 Tommy Carlier wrote:
 
 <SNIP>
 
 > Although Win4Eu hides the low-level stuff for regular users, you can
 > still access all the low-level features. An example: structures. You
 > can create structures, like you create regular objects, with the
 > create-verb. Here's a simple definition of a structure, and how you
 > create an instance:
 > }}}
<eucode>
 > constant POINT = defineStructure("POINT", {
 >    {"x", Int},
 >    {"y", Int}
 > })
 >
 > integer pt, size
 > atom address
> pt = create(POINT, "pt", {})
 > pokeField(pt, "x", 0, 100)
 > pokeField(pt, "y", 0, 100)
 > size = getStructureSize(pt) -- get the size in bytes
 > address = getStructureAddress(pt) -- get the physical address
 >
> destroy(pt) -- release the memory
 > </eucode>
{{{

>
> I will try to make it as easy as possible for people to create
 > Windows applications. And another advantage of the object-oriented
 > architecture is extensibility: it will be easy to create new controls
 > and treat them exactly the same as regular controls (what I earlier
 > tried to do with EuControls).


-- 
MrTrick

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

7. Re: Win4Eu update

Tommy Carlier wrote:

[snip]

> The code to show this window looks like this:
> }}}
<eucode>
> include win4eu.ew
> 
> constant win = create(Window, "win", {10, 10, 300, 200})
> start(Application)
> </eucode>
{{{


What about:

include win4eu.ew
 
constant win = make(Window, "win", {10, 10, 300, 200})
start(Application)


The 'create' word is too sublime, lofty amd exalted
for such simple, ordinary and mediocre thing as
doing something like a window for Windows.

Make money, make window - short, simple and clear, I think.
And doesn't conflict with others creators and the Creator.

Good Luck AnyWay!

Regards,
Igor Kachan
kinz at peterlink.ru

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

8. Re: Win4Eu update

Derek Parnell wrote:
> 
> Bernard Ryan wrote:
> > 
> > Tommy Carlier wrote:
> > > 
> > > A little update on the progress of Win4Eu:
> > > 
> > > }}}
<eucode>
> > > include win4eu.ew
> > > 
> > > constant win = create(Window, "win", {10, 10, 300, 200})
> > > start(Application)
> > > </eucode>
{{{

> > > 
> > 
> > Tommy I don't see anything new except you have no parent
> > and no style; You can already do this using my w32engin.ew or win32lib.
> > 
> >  }}}
<eucode>
> >  include w32engin.ew
> >  
> > constant win = create(Window, "win", 0, 10, 10, 300, 200,0)
> > WinMain(win,Normal)
> > </eucode>
{{{

> > 
> While Bernie is correct, I suspect there are more wonders to be revealed
> yet in Tommy's approach.
> 
> BTW in win32lib, this could be done with ...
> 
> }}}
<eucode>
> include win32lib.ew
> createForm("Window, win, at=(10,10), size=(300,200)")
> include w32start.ew
> </eucode>
{{{

> 

And for completeness, here it is in wxEuphoria:
include wxEuphoria.e
constant win = create( wxWindow, {0, -1, 10, 10, 300, 200})

wxMain( win )


Ok, Irv's turn...

Matt Lewis

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

9. Re: Win4Eu update

Matt Lewis wrote:
 
> And for completeness, here it is in wxEuphoria:
> }}}
<eucode>
> include wxEuphoria.e
> constant win = create( wxWindow, {0, -1, 10, 10, 300, 200})
> 
> wxMain( win )
> </eucode>
{{{

> 
> Ok, Irv's turn...

Well, since you asked :)
include wrapper.e
win = window("title")
show(win)
main()


GTK is smart enough to size and place its own windows, and to me, it seems 
easier to do away with the 'new' or 'create' keywords, and just use the 
name of the control you want a new instance of. 

IOW, 'button()' returns a new button instance, 'window()' returns a new 
window instance... etc.

Irv

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

10. Re: Win4Eu update

Tommy Carlier wrote:

<big snip>

> I will try to make it as easy as possible for people to create
> Windows applications. And another advantage of the object-oriented
> architecture is extensibility: it will be easy to create new controls
> and treat them exactly the same as regular controls (what I earlier
> tried to do with EuControls).

Easy and consistent extensibility will be very comfortable and powerful.
Great!

Regards,
   Juergen

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

11. Re: Win4Eu update

irv mullins wrote:
> 
> Matt Lewis wrote:
>  
> > And for completeness, here it is in wxEuphoria:
> > }}}
<eucode>
> > include wxEuphoria.e
> > constant win = create( wxWindow, {0, -1, 10, 10, 300, 200})
> > 
> > wxMain( win )
> > </eucode>
{{{

> > 
> > Ok, Irv's turn...
> 
> Well, since you asked :)
> }}}
<eucode>
> include wrapper.e
> win = window("title")
> show(win)
> main()
> </eucode>
{{{

> 
> GTK is smart enough to size and place its own windows, 

Well if you are not going to follow the spec (create a window with the
exact dimensions specified), win32lib can do that too.

include win32lib.ew
createForm("Window, Title")
include w32Start.ew


>and to me, it seems 
> easier to do away with the 'new' or 'create' keywords, and just use the 
> name of the control you want a new instance of. 
> 
> IOW, 'button()' returns a new button instance, 'window()' returns a new 
> window instance... etc.

How easy does that style make it for third-parties to add new control
types? 

-- 
Derek Parnell
Melbourne, Australia

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

12. Re: Win4Eu update

Derek Parnell wrote:
 
> Well if you are not going to follow the spec (create a window with the
> exact dimensions specified), win32lib can do that too.

When writing GTK apps, it's considered rude to specify window position 
or size (or color, fonts, etc). People may have their own preferences
or special needs, and don't like to have those preferences overridden. 

One of the especially annoying 'features' of Windows that too many people 
use is creating windows which are larger than the screen, with no way to 
resize them so they're small enough so you can click all the buttons. 
I see this sort of thing a lot, since I usually run Windows at 640x400.

Irv

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

13. Re: Win4Eu update

irv mullins wrote:

> One of the especially annoying 'features' of Windows that too many people 
> use is creating windows which are larger than the screen, with no way to 
> resize them so they're small enough so you can click all the buttons. 
> I see this sort of thing a lot, since I usually run Windows at 640x400.

Irv, ditch the 14" monitor and move into the 21st century! :D

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

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

14. Re: Win4Eu update

Tommy Carlier wrote:
> The difference with w32Engine and Win32Lib, will not be what it can do,
> but the programming interface, the architecture. Win4Eu is a (limited)
> object-oriented architecture, with inheritance, properties and events.
> One other difference: I'm trying to hide the technical details of

Al Getz's WinClass OO Library uses object-oriented architecture

> }}}
<eucode>
> constant POINT = defineStructure("POINT", {
>    {"x", Int},
>    {"y", Int}
> })
> 
> integer pt, size
> atom address
> pt = create(POINT, "pt", {})
> pokeField(pt, "x", 0, 100)
> pokeField(pt, "y", 0, 100)
> size = getStructureSize(pt) -- get the size in bytes
> address = getStructureAddress(pt) -- get the physical address
> 
> destroy(pt) -- release the memory
> </eucode>
{{{


structures can be done by using my mixedlib.e in DOS
or w32engin.ew in Windows.

-- the point structure is already predefine so
-- all you need to do to use it.
include w32engin.ew
atom pt
-- create a point structure
-- which will be initailize to all zeros
pt = struc("POINT")
poke4s(pt,{0,100})
-- or use
put(pt,"x", 0)
put(pt,"y",100)
-- or you can create a point structure
-- and initialize it to some values
pt = struc({"POINT",{0,100}})
-- or you can define and create a structure
-- it can contain unions and nested structures.
-- describe it:
record("MY_SPECIAL_STRUCT",
   "field_1 : int    : 1 "&
   "field_2 : string : 25"&
   "union_1 : UNION  : * "&
   "field_1 : long   : . "&
   "field_2 : byte   : . "&
   "field_3 : short  : . "&
   "pt_1    : STRUCT : POINT "& 
   "pt_2    : STRUCT : POINT ") 
-- create it
atom ptr
ptr = struc("MY_SPECIAL_STRUCT")
--
put(ptr,"field_1", 100)
put(ptr,"union_1->field_3",27)
put(ptr,"pt_1->x",0)
put(ptr,"pt_1->y",100)
put(ptr,"pt_2->x",10)
put(ptr,"pt_2->y",300)
-- to get the size of a structure
? sizeof(pt)
-- or
? sizeof("MY_SPECIAL_STRUCT")


Bernie

My files in archive:

http://www.rapideuphoria.com/w32engin.zip
http://www.rapideuphoria.com/mixedlib.zip
http://www.rapideuphoria.com/eu_engin.zip
http://www.rapideuphoria.com/win32eru.zip

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

15. Re: Win4Eu update

whoops !
accessing union should be
put(ptr,"union_1->field_3",27) -- WRONG
put(ptr,"union_1.field_3",27)  -- SHOULD be dot for unions


Bernie
My files in archive:
http://www.rapideuphoria.com/w32engin.zip
http://www.rapideuphoria.com/mixedlib.zip
http://www.rapideuphoria.com/eu_engin.zip
http://www.rapideuphoria.com/win32eru.zip

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

16. Re: Win4Eu update

Derek Parnell wrote:

> include win32lib.ew
> createForm("Window, win, at=(10,10), size=(300,200)")
> include w32start.ew

Derek, I suspect you might have already thought about this, but your
library interface could be transplanted to other GUI libraries, and
probably pretty easily (by their authors). Here's what I mean:

Your Win32Lib code is:

include win32lib.ew
createForm("Window, win, at=(10,10), size=(300,200)")
include w32start.ew

But that procedure, "createForm()," could be used by other libraries
to create controls as well.

include myGUIlib.ew --< user's preferred GUI library
include gui_api.ew  --< the generic GUI API library you're creating ;)
createForm(...)     --< now being sent via gui_api.ew to myGUIlib.ew
include w32start.ew --< user's preferred method of app control

What it looks to me is that you are creating
a generic GUI library API that just happens to use the Windows API. You
could just as easily put GTK behind it, or wxWidgets, or Bernie's code,
etc... Which I think is awesome! :)

What do you think?

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

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

17. Re: Win4Eu update

cklester wrote:
> 
> irv mullins wrote:
> 
> > One of the especially annoying 'features' of Windows that too many people 
> > use is creating windows which are larger than the screen, with no way to 
> > resize them so they're small enough so you can click all the buttons. 
> > I see this sort of thing a lot, since I usually run Windows at 640x400.
> 
> Irv, ditch the 14" monitor and move into the 21st century! :D
> 

His remark is right. That kills compatibility with older computers -
which, in my opinion, should be preserved as long as possible.
I've seen programs/web sites that don't fit in 800x600 and even
1280x1024, though the later are obviously mal-designed ;)
Anyway, my coding laptop has got a 13.3" monitor (beat that! ;)
Though it supports 1024x768.

Regards, Alexander Toresson

Shhh! Be vewy quiet! I'm hunting wuntime ewwows!

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

18. Re: Win4Eu update

Bernard Ryan wrote:
> 
> Al Getz's WinClass OO Library uses object-oriented architecture.

Yes, but my system is not as rich and complete as WinClass OO Library,
and it's not designed as a general-use OO library. It's specifically
designed for the Win4Eu-architecture.

> structures can be done by using my mixedlib.e in DOS
> or w32engin.ew in Windows.

Yes, it can. And it probably has more options, and is probably
faster than my implementation. But the goal of Win4Eu is not
'provide another low-level library for experienced programmers'.
The goal is 'provide an easy interface to create Windows-applications
without knowing the technical details'. 

--
tommy online: http://users.telenet.be/tommycarlier
tommy.blog: http://tommycarlier.blogspot.com
Euphoria Message Board: http://uboard.proboards32.com
Empire for Euphoria: http://empire.iwireweb.com

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

19. Re: Win4Eu update

cklester wrote:
> 
> Derek Parnell wrote:
> 
> > include win32lib.ew
> > createForm("Window, win, at=(10,10), size=(300,200)")
> > include w32start.ew
> 
> Derek, I suspect you might have already thought about this, but your
> library interface could be transplanted to other GUI libraries, and
> probably pretty easily (by their authors).

[snip]

> What do you think?

Maybe, but I'll leave that for somebody else to do. I'm too busy just
getting Windows to behave itself.

-- 
Derek Parnell
Melbourne, Australia

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

Search



Quick Links

User menu

Not signed in.

Misc Menu