1. Win32Lib

David,

I've been examining the listbox program somewhat closer. It seems to me t=
he
bug appears when getItem() is called with a text of 12 characters long.
But shouldn't you add LBS_HASSTRINGS when creating listboxes that are
supposed to get text input?

Another 2 eurocents,

Ad Rienks

new topic     » topic index » view message » categorize

2. Win32Lib

David,

Are Generic.exw and EX12.exw your start towards making EE for Windows? If
so, I'd like to see you continue. Also, EX18a.exw aborts with:

Canvas has not been declared
    WinCanvas   =  create( Canvas, "", 0, 0, 0, 250, 300, 0 ),
                                ^

I seem to remember a mailing list item sometime ago about the Canvas
command changing... but I can't remember to what?

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

3. Re: Win32Lib

Gary Dumer wrote:

> Are Generic.exw and EX12.exw your start towards
> making EE for Windows? If so, I'd like to see you
> continue.

Generic is just a small demo program. It uses a native multi-line edit
control, which is limited to 64K of data. Since it's native, it's not
possible to add things like text color coding.

I *had* started an editor written in Win32Lib some months ago, but I seem to
have lost the code. Perhaps Robert or someone has a backup - I doubt it,
since I never officially released it.

I'm slowly building emulated controls for Llama. One of these controls will
obviously need to be a multi-line text editor. It should be possible to
build an editor from that. Right now, the emulated control classes are
highly experimental, and the code changes on a regular basis. At the moment,
I'm looking at basing them on the Qt classes.

> Also, EX18a.exw aborts with:

Ooops. You've got an old copy of the code. The 18a demo was an attempt to
rewrite the code using the Canvas class, but I got distracted and never
finished it. The file should never have made it into the distribution.

The Canvas class is now called a Pixmap.

Thanks!

-- David Cuny

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

4. Re: Win32Lib

David Cuny writes:
> I *had* started an editor written in Win32Lib some
> months ago, but I seem to have lost the code. Perhaps
> Robert or someone has a backup - I doubt it, since I never
> officially released it.

I've got it.
I'll send it to you via personal e-mail.

Regards,
     Rob Craig
     Rapid Deployment Software
     http://members.aol.com/FilesEu/

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

5. Win32Lib

------=_NextPart_000_0000_01C01E3C.D32A2700
        charset="iso-8859-1"

Sorry, Forgot to attache the ex.err file to the last message

Glen
------=_NextPart_000_0000_01C01E3C.D32A2700
        name="ex.err"
Content-Transfer-Encoding: quoted-printable

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

6. Re: Win32Lib

er, what last message?

Dan

----- Original Message -----
From: "Glen Brown" <gbrown7777 at YAHOO.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Thursday, September 14, 2000 1:13 AM
Subject: Win32Lib


> Sorry, Forgot to attache the ex.err file to the last message
>
> Glen

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

7. Win32Lib

Just a few random notes on Win32Lib. Jiri, you can ignore everything until
the last section, where I start complaining about how code should be
indented. At that point, feel free to mock me. blink

1. I got a note from someone who had trouble with the initCommonControls
routine. I don't have documentation on the routine, but I'm guessing that
it's failing because he doesn't have things like the coolbar and such
installed on his machine. These are typically installed when a person
installs IE (one of Microsoft's many abhorant practices).

I'm a bit leery about requiring things like this to be on a machine, even if
they are fairly standard. Should Win32Lib really fail if a non-baseline
libraries are not included? Much of the world (myself included) continues to
use Win95.

Perhaps it would be better if, if the routine failed, it set a flag so that
dependant classes would issue a warning. That way, you could run Win32Lib
applications, even if you didn't have the complete set of Windows bells and
whistles on your machine.

2. Passing the font color to a RichText control by using { color, FaceName }
in the setFont routine seems to me a Bad Idea. It really should use the
color set in setTextColor.

3. The LimitText routine should probably be called setTextLimit, to make it
more consistant with the other routine names.

4. If you really want tab_direction is to be made global (do you?), it
should probably be with the global wrappers setTabForward() and
setTabBack().

5. I'm too lazy to test this - does setHintFont still work? I _suspect_ that
it's now broken, and can be removed, along with associated variables that
are still scattered throughout the code.

6. What's the purpose of hitTestTV? I mean, for the general user?


Now the issue of coding style. I didn't intend to get onto this subject, but
I ran into a block of code that looks very, very different from the code
around it. This isn't to say that the code doesn't work, or the coding style
is inherently wrong. But it's distractingly different, and I think that it
would be a Good Thing if the library code adhered to a common coding style.

Obviously, I'm biased toward my own coding style, and I think that it's the
One True Way. And I'd far and away prefer code that doesn't follow the rules
to people deciding not to add to the project because they don't like my
coding style.

Finally, I'm no longer in charge of the project, so these are just requests,
not requirements!

With those caveat in mind, here are some examples where other coders differ
from me:

   sequence vLMB_id
   vLMB_id = {-1, -1, -1, -1}

   atom
         vMaxClickTime
   integer
         vMaxClickXDelta
       , vMaxClickYDelta

   vMaxClickTime   = 0.5
   vMaxClickXDelta = 3
   vMaxClickYDelta = 3

It's too bad Euphoria doesn't have the concept of persistant variables in
routines, since it leads to code like this (and I'm just as bad as anyone
else). These variables should be placed *immediately* before the routine
that they are used in. In the above example, they precede wmScroll, but are
actually used in setMouseClick.

*Always* add comments explaining what groups of variables are, no matter how
obvious they are to you, along with your name, and the version of Win32Lib
that you are altering. That way, if people report that code added after some
particular release breaks things, it becomes relatively easy to figure out
what code is suspect.

And please, write put the commas in constant declarations *immediately*
after the expression, *not* on the next line:

   integer
         vMaxClickXDelta,
         vMaxClickYDelta

Yes, I know that it makes it more difficult to comment out, but it makes the
code *much* more readable.

More code snippets. Again, the coding isn't intrinsically bad, it just
doesn't match my own style (which is 60% of the library):

   ----------------------------------------------------
   function fDoMouse(integer id, atom hWnd, atom iMsg, atom wParam, ...
   ----------------------------------------------------
   integer
         mouseX
       , mouseY
       , action
   sequence
        lRC

      lRC = {pReturn}

Here's my rewrite.

   ---( 80 chars wide )---------------------------------------------
   function fDoMouse(integer id, atom hWnd, atom iMsg,
                      atom wParam,  ... )

      -- Add comments explaining what the function does here!

      integer
         mouseX,   -- mouse x position
         mouseY,   -- mouse y position
         action       -- mouse action

If the code doesn't fit on 80 lines, break it (the API linking routines are
the exception).  This makes it easy to scan the code, and find the start of
each routine. If the routine is global, the explanation of the routine comes
immediately after.

I should explain here a bit: I initially placed documentation comments
*inside* the code that was being documented, but it wasn't a good match, and
made it difficult to see where the routine actually began. So I decided that
the documentation comments should immediately preceed the routine they
document, and that seems to work fairly well.

If the routine is not global, a short explanation of the routine is placed
after the routine declaration, and before the variable declaration.
Everything in the routine - comments, variable declarations, etc. is
indented, so you can clearly see they are part of the routine.Comments
following declared variables, no matter how banal, are appreciated.

In a compound functions, like this:

   if iMsg = WM_LBUTTONUP
   then -- test for a "click" gesture.
     if vLMB_id[1] = id
           and
         time()-vLMB_id[4] < vMaxClickTime
           and
         abs(mouseX - vLMB_id[2]) < vMaxClickXDelta
           and
         abs(mouseY - vLMB_id[3]) < vMaxClickYDelta
     then -- Clicking! Any handler for this?

the 'and' and 'or' clauses are aligned with the prior 'if':

   if iMsg = WM_LBUTTONUP then

     -- test for a "click" gesture.
     if vLMB_id[1] = id
     and time()-vLMB_id[4] < vMaxClickTime
     and abs(mouseX - vLMB_id[2]) < vMaxClickXDelta
     and  abs(mouseY - vLMB_id[3]) < vMaxClickYDelta then

         -- Clicking! Any handler for this?

Comments are placed just above the code they refer to, not after them.
Otherwise, it's too tempting to make the comments even shorter and more
cryptic than they already are.

If three lines of code go by without a comment, you're not commenting
enough! Remember, the more comments you add, the more likely that someone
else will be able to find and fix a bug for you!

Finally, a note about changes. Whenever I made changes to the file, I'd add
a comment (flush with the left margin, so it was easy to see) like this:

   -- NEW! v0.51

I used NEW! because that gave me a keyword to search the file when I wanted
to remove all comments prior to some given release. The version number (as I
mentioned before) is extremely helpful in figuring out if the change might
be related to some newly reported bug.

OK, enough whining about style. If someone wants to explain why I'm wrong,
I'll be glad to hear it.

Thanks again to everyone who's participating in this project!

-- David Cuny

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

8. Re: Win32Lib

< re: David's comments >

> I ran into a block of code that looks very, very different from the code
> around it. This isn't to say that the code doesn't work, or the coding
style
> is inherently wrong. But it's distractingly different, and I think that it
> would be a Good Thing if the library code adhered to a common coding style.
... yes, PLEASE !!
> And please, put the commas in constant declarations *immediately*
> after the expression, *not* on the next line:
... again YES !!
> If the code doesn't fit on 80 character lines, break it (the API linking
routines are
> the exception).  This makes it easy to scan the code, and find the start of
> each routine.
How about 76 character lines. Most  Windows editors, (... using default fixed
fonts... at 640 by 480 ), I've used won't even show 80 characters, because of
the scroll bar !

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

9. Re: Win32Lib

David Cuny wrote:

<snip>


> Now the issue of coding style. I didn't intend to get onto this subject,
but
> I ran into a block of code that looks very, very different from the code
> around it. This isn't to say that the code doesn't work, or the coding
style
> is inherently wrong. But it's distractingly different, and I think that it
> would be a Good Thing if the library code adhered to a common coding
style.
> With those caveat in mind, here are some examples where other coders
differ
> from me:

</snip>

Perhaps Win32Lib should have one team member as editor in charge of
style--let the contributors write code however it comes naturally and the
editor will restyle it as needed to conform to the project coding standards.

I used a similar approch in a C class in which we produced programs as teams
and I was on a team with a fellow who wrote brilliant but unreadable
code--we got A' every time--the instructor couldn't understand his original
code, but obviously thought highly of the restyled code.

-- Mike Nelson

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

10. Re: Win32Lib

On Thu, 28 Sep 2000 01:14:37 -0700, David Cuny gave lessons on coding style,

...and I couldn't agree with you more.  Consistant coding style is key to
the maintainability of such a large library.  (and I'm glad I adopted yours
from day one)

-- Brian

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

11. Re: Win32Lib

Michael Nelson wrote:

> Perhaps Win32Lib should have one team member
> as editor in charge of style--let the contributors
> write code however it comes naturally and the
> editor will restyle it as needed to conform to
> the project coding standards.

I agree that disallowing code that doesn't fit *my* idea of beauty would
certainly be foolish! But there should at least be some sort of published
standard for the project.

There are a lot of places where I'm willing to reconsider my coding style.
For example, one issue is being able to rapidly find the beginning of
routines. I prefer to indent. A typical declaration of mine would look like
this:

   ----------------------------------------------
   function foo()
      -- this is a comment

      ... code goes here ...

   end function

One of the problems with this is that it assumes the coder has a DOS editor.
Robert, on the other hand, prefers to put his routine comments flush to the
left, immediately under the header:

   function foo()
   -- this is a comment

      ... code goes here ...
   end function


Robert's method has the advantage of "fattening" up the beginning of the
routine, so it's fairly easy to spot where the beginning of the routines
start.

But for Win32Lib, the coding style should be as consistant as possible with
the existing code.

-- David Cuny

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

12. Win32Lib

Is there any way to determine if the data in a SLE is alpha or numeric,
and if its alpha is there a way to force it to be all caps? I would
appreciate any help I can get esp. if anybody has all ready done
somthing like this.

                                                            Thanks
                                                                    Bret

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

13. Re: Win32Lib

On Tue, 19 Jan 1999 13:47:11 -0800, Bret Belgarde <BretBelgarde at
WORLDNET.ATT.NET> wrote:

>Is there any way to determine if the data in a SLE is alpha or numeric,
>and if its alpha is there a way to force it to be all caps? I would
>appreciate any help I can get esp. if anybody has all ready done
>somthing like this.
>
>                                                            Thanks
>                                                                    Bret
  Gee, Bret.

That is an easy one.  The routine is upper()
and you must include wildcard.e
 Syntax:
            include wildcard.e
            x2 = upper(x1)
 Description:
            Convert an atom or sequence to upper case.
 Example:
            s = upper("Euphoria")
            -- s is "EUPHORIA"
Full description at ( http://members.aol.com/FilesEu/lib_u_z.htm )

    Sincerely
        Lucius L. Hilley III

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

14. Win32Lib

I was wondering if it was possible to have sub menus in the menu bar
menus.
Like:
        File  Edit  View  Insert
        +-----------+
        | New       |
        | Open      |
        | Save     +---------+
        | Whatever>|Stuff    |
        +----------|Stuff    |
                   |Stuff    |
                   |Ect..    |
                   +---------+

Any Help Would be greatly appreciated
                            Thanx
                                Bret

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

15. Win32Lib

------ =_NextPart_000_01BCF407.15EAF780

I just thought I'd post a progress report on Win32Lib. I hope to upload a
copy to Irv's site some time later this week, after I've incorporated
logic to handle multiple windows, and window attributes.

What's new:

   1. MENUS. I use the same techniques as Jacques.
   2. TAB KEYS. This require subclassing. Ick.
   3. NEW CONTROLS. I've added RTEXT, CTEXT and COMBOBOX.
   4. NEW EVENTS. I've added onOpen and onClose.

At this point, the library is still a "toy". There are still not enough tools
to do "real" programming, but it's moving along. However, until Robert fixes
BINDW mangling the routine id's, it won't really be useful.

The good news is that you CAN share the single callback between all the windows,
as long as the first thing you do is a test on the window handle. It's also not
that difficult to subclass the controls.

A couple of questions:

1. How are other Win32 coding projects going? I know that Jacques completed his
   Common Controls. VERY slick!

2. Anyone know of a simple way to close/minimize the console?

3. Any votes on library extensions for Win32 code? I vote for ".W" to replace
   ".E". I have been using ".EW", but I'm not too keen on that.

4. Is anyone currently working on a "real" dialog toolkit? I'm going to be addin
g
   modal windows to Win32Lib, so I probably won't be using "real" dialogs. But
   I'm curious to hear if anyone's made a go at it.


-- David Cuny
------ =_NextPart_000_01BCF407.15EAF780

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

16. Re: Win32Lib

At 09:48 AM 11/18/97 -0800, you wrote:
>I just thought I'd post a progress report on Win32Lib. I hope to upload a
>copy to Irv's site some time later this week, after I've incorporated
>logic to handle multiple windows, and window attributes.
>--snip--
I have a question, the file that was sent, winlib32 didn't have an
extension, I assumed it was .ew I renamed it to winlib32.ew and opened it
in notepad to take a look at it, but all I could see was: IPM.Microsoft
Mail.Note, the rest was all garbled, does this have something do with my
mail app (I'm using Eudora) or is it something else?

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

17. Re: Win32Lib

------ =_NextPart_000_01BCF430.0F9D35E0

Grrrr... My e-mail must be messed up.

There were no attachments. I suspect that MS Mail is trying to
send along some clever formatting information with my e-mail.

Of course, it looks fine to *me*, but I guess it's spewing crud to the rest of y
ou folk.

Sorry. I'll try to get it fixed.

-- David Cuny
------ =_NextPart_000_01BCF430.0F9D35E0

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

18. Win32Lib

Anyone who stumbles (or googles) across Win32Lib on sourceforge is 
going to assume that nothing has been done in the past 4 years, 
and there are no obvious links to Derek's website, so they will 
probably decide that the project is dead. 

If it's too much trouble to update the releases, could someone at 
least add a link to the current homepage?

Irv

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

19. Re: Win32Lib

irv mullins wrote:
> 
> 
> Anyone who stumbles (or googles) across Win32Lib on sourceforge is 
> going to assume that nothing has been done in the past 4 years, 
> and there are no obvious links to Derek's website, so they will 
> probably decide that the project is dead. 
> 
> If it's too much trouble to update the releases, could someone at 
> least add a link to the current homepage?

Congratulations Irv! You just volunteered for the job. I'll add you
to the SourceForge site's admin list and then you can go update it
to your heart's content.

-- 
Derek Parnell
Melbourne, Australia

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

20. Re: Win32Lib

Derek Parnell wrote:
> 
> irv mullins wrote:
> > 
> > 
> > Anyone who stumbles (or googles) across Win32Lib on sourceforge is 
> > going to assume that nothing has been done in the past 4 years, 
> > and there are no obvious links to Derek's website, so they will 
> > probably decide that the project is dead. 
> > 
> > If it's too much trouble to update the releases, could someone at 
> > least add a link to the current homepage?
> 
> Congratulations Irv! You just volunteered for the job. I'll add you
> to the SourceForge site's admin list and then you can go update it
> to your heart's content.

OK, that's no problem.

Irv

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

21. Win32Lib

Thanks to everyone for providing timely and accurate answers to my 
questions.

In working with win32Lib, I have scoured the documentation looking for 
info about which flags are available for controls.  It seems to me some 
are listed while others are not.  For instance Combobox shows nothing 
for flags.  Is there somewhere I can get this info without having to go 
through API documentation?

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

22. Re: Win32Lib

Michael Sabal wrote:

> As much as I would like to see win32lib finished, I appreciate
> all the effort you've been putting into the Euphoria community
> as a whole without compensation.  Take care of yourself and
> don't burn yourself out.  Then who would finish it? :)

Thanks. As I mentioned, it's been hard to find blocks of time to work on
stuff. I still owe Greg Harris a minor update to WIn32Lib he sent me a
couple days ago.

I am making good progress on Gnuphoria, although it's far from complete. I'm
aiming just to get it limping along at a little more than the functionality
currently in Petephoria before posting a pre-pre alpha.

I have every intent of "completing" Win32Lib - even if that means stripping
it out and replacing it with Jacques' library, which is not a bad idea at
all. And I'd like to get a Dos32Lib up and running as well, so WinMan won't
be a complete waste.

If people would like to keep Win32Lib alive with updates, I'm all for it! I
need all the help I can get.

Thanks!

-- David Cuny

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

23. Re: Win32Lib

Robert wrote:

> Certainly there's a lot we can do to improve the
> support for the WIN32 platform, and I thank David
> for what he has done so far.

Your quite welcome. smile


> But I really think David has *already* accomplished
> something that the fancy-pants all-singing all-dancing
> GUI IDE Visual programming packages have failed at:
> he's made it really simple for a non-professional
> to write a simple Windows GUI program.

I rather like VB, and still plan on building a VB-like IDE for Win32Lib -
eventually.

But I always thought that the need for a VB DLL was always sort of clunky.
Even the latest version of VB, which creates compiled executables, still
needs the DLL. Ugh.

-- David Cuny

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

24. Win32Lib

> Robert and David were discusing Win32Lib:

>> GUI IDE Visual programming packages have failed at:
>> he's made it really simple for a non-professional
>> to write a simple Windows GUI program.

> I rather like VB, and still plan on building a VB-
> like IDE for Win32Lib -
> eventually.

its a long(ish) shot, but with a bit of modifications, i think the
winedit.exe prog i made for that win.e lib i created could be adjusted
to output WIN32LIB code - i'll have a go at it tonight, and see what
happens :)

Mike :)

==
  o__ ---
 _,>/'_ ---
(_) \(_) ---
Mike Fowler - wildcat_nz at yahoo.com
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

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

25. Win32Lib

Thanks to Mr. Cuny for the new version of Win32Lib.  I love the fact
that all controls are now created by the same style of call.  My
deepest thanks is for the option now to change the fonts of controls.
I happen to not like the previous style that was used.

My only (minor) complaint is having to use setFont() for each control.
 Perhaps I'm control crazy but my lastest program has 52 controls I'd
have to change each via setFont.  Being the lazy guy I am, I wrote
this following procedure and stuck it at the end of Win32Lib.ew:

global procedure setAllFont(sequence faceName, integer points, integer
attrib)

for f=1 to length(window) do
   if window[f][2]>=PushButton and window[f][2]<=CText then
      setFont(f, faceName, points, attrib)
   end if
end for
end procedure

Now I just create my controls as usual and then make one call, usually:

setAllFont("MS Sans Serif",8,0)

and all the controls that display text are changed.

Vince Gonzales
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

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

26. Re: Win32Lib

Vincent Gonzales wrote:

> My only (minor) complaint is having to use setFont() for
> each control.

Perhaps a better option would be to create a procedure:

        setDefaultFont( sequence fontName )

which set the default font for the controls?

Comments?

-- David Cuny

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

Search



Quick Links

User menu

Not signed in.

Misc Menu