1. Questions!

Hello All!

I've got a couple of questions about win32lib.ew
0.50c++ as I busily work on my IDE, as well as
some other questions ...

1.  Problem with getPrinter().
When I call to getPrinter(), the "Print Dialogue"
form does not appear, and the value returned from
the function indicates that the user pressed the
CANCEL button, although he was never given the
chance to! smile  Now, I remember reading some time
back that someone else mentioned the problem, but
I'll be darned if I can find the exact message.
It seems to me that Mr. Lewis had said that he
had fixed the problem, but then again, my
memory's not that sharp.  Mr. Lewis:  have you
fixed this problem?  (I got my copy from
SourceForge yesterday, 5-sep-00.)  Or is it
implemented differently in this version of
win32lib?


2.  RichEdit
Trying to use RichEdit, I was unable to open any
file and put it into the RichEdit component if
that file was larger than ~3k.  To attempt this,
I used a slightly modified version of the sample
program RichEdit.exw, which I've included below.
The reason that I was wanting to use RichEdit in
the IDE was to give it the capability of opening
files larger than 32k.  To have a size limit that
low, I'm pretty sure that the problem here isn't
with the tool, but with the operator.  If someone
could find my boo-boo, it would be much
appreciated.


3.  Documentation Formatting
At the risk of starting a flame war here, what
would be the preferred format for documentation?
Text?  Html?  Or other?  I personally thought
HTML, because I figure that if they download the
program off the Net, they more than likely have
the facilities to read the HTML documentation.
There is also the hyperlinks, to make things
easier to find.  But I've noticed that
documentation for Euphoria programs are generally
in ASCII format, save the "official"
documentation from RDS and the reference for
win32lib, which is HTML.  Any thoughts?


Well, that's it for now!  Thanks everybody!


God bless and Blessed Be,
Travis Beaty
Claude, Texas


-- My very slightly altered version of
RichEdit.exw.  All of the event
-- handlers have been removed for brevity ...

without warning

include win32lib.ew

constant
Win = create( Window, "RichEdit Demo", 0,
Default, Default, 400, 460, 0 ),
RE = create( RichEdit, "", Win , 20, 20, 360,
200, ES_NOHIDESEL),
CF = create( PushButton, "Change Font", Win,
20,250, 110, 30, 0),
GF = create( PushButton, "Get Font", Win,
140,250, 110, 30, 0),
GT = create( PushButton, "Get Text", Win,
260,250, 110, 30, 0),
SB = create( PushButton, "Bullet", Win, 20,290,
110, 30, 0),
FT = create( PushButton, "Find/Replace", Win,
140,290, 110, 30, 0),
UN = create( PushButton, "Undo", Win, 260,290,
110, 30, 0),
SI = create( PushButton, "Stream In", Win, 20,
330, 110, 30, 0)

procedure defaulttext()
    sequence rich
    atom fn, c
    fn = open( "font.e", "r" )  -- font.e was
copied into this file's
    if fn != -1 then            -- home directory
so that no path was
        rich = {}               -- needed.  The
form opened; however,
        c = 0                   -- there was no
text in the RichEdit
        while c != -1 do        -- component.
When "RichEdit.exw" was
            c = getc( fn )      -- opened, the
text was successfully
            rich &= c           -- copied into RE!
        end while
        rich = rich[1..length(rich)-1]
        putStream( RE, StreamText, rich )  --
changed from StreamRich to
        close( fn )                        --
SteamText, as I'll be using
    end if                                 --
standard Windows color and
end procedure                              -- one
font in the RichEdit.

setTabs( RE, {0, 100,125} )
setIndent( RE, 100, {}, {})
defaulttext()

WinMain( Win, Normal )



______________________________________________________
Get your free web-based email at http://www.xoom.com
Birthday? Anniversary? Send FREE animated greeting
cards for any occasion at http://greetings.xoom.com

new topic     » topic index » view message » categorize

2. Re: Questions!

----- Original Message -----
From: "Travis Beaty" <atora at xoommail.com>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Thursday, September 07, 2000 4:59 AM
Subject: Questions!


> Hello All!
>
> I've got a couple of questions about win32lib.ew
> 0.50c++ as I busily work on my IDE, as well as
> some other questions ...
>
> 1.  Problem with getPrinter().
> When I call to getPrinter(), the "Print Dialogue"
> form does not appear, and the value returned from
> the function indicates that the user pressed the
> CANCEL button, although he was never given the
> chance to! smile  Now, I remember reading some time
> back that someone else mentioned the problem, but
> I'll be darned if I can find the exact message.
> It seems to me that Mr. Lewis had said that he
> had fixed the problem, but then again, my
> memory's not that sharp.  Mr. Lewis:  have you
> fixed this problem?  (I got my copy from
> SourceForge yesterday, 5-sep-00.)  Or is it
> implemented differently in this version of
> win32lib?
>
>
> 2.  RichEdit
> Trying to use RichEdit, I was unable to open any
> file and put it into the RichEdit component if
> that file was larger than ~3k.  To attempt this,
> I used a slightly modified version of the sample
> program RichEdit.exw, which I've included below.
> The reason that I was wanting to use RichEdit in
> the IDE was to give it the capability of opening
> files larger than 32k.  To have a size limit that
> low, I'm pretty sure that the problem here isn't
> with the tool, but with the operator.  If someone
> could find my boo-boo, it would be much
> appreciated.
>
>
> 3.  Documentation Formatting
> At the risk of starting a flame war here, what
> would be the preferred format for documentation?
> Text?  Html?  Or other?  I personally thought
> HTML, because I figure that if they download the
> program off the Net, they more than likely have
> the facilities to read the HTML documentation.
> There is also the hyperlinks, to make things
> easier to find.  But I've noticed that
> documentation for Euphoria programs are generally
> in ASCII format, save the "official"
> documentation from RDS and the reference for
> win32lib, which is HTML.  Any thoughts?
>
>
> Well, that's it for now!  Thanks everybody!
>
>
> God bless and Blessed Be,
> Travis Beaty
> Claude, Texas
>
>
> -- My very slightly altered version of
> RichEdit.exw.  All of the event
> -- handlers have been removed for brevity ...
>
> without warning
>
> include win32lib.ew
>
> constant
> Win = create( Window, "RichEdit Demo", 0,
> Default, Default, 400, 460, 0 ),
> RE = create( RichEdit, "", Win , 20, 20, 360,
> 200, ES_NOHIDESEL),
> CF = create( PushButton, "Change Font", Win,
> 20,250, 110, 30, 0),
> GF = create( PushButton, "Get Font", Win,
> 140,250, 110, 30, 0),
> GT = create( PushButton, "Get Text", Win,
> 260,250, 110, 30, 0),
> SB = create( PushButton, "Bullet", Win, 20,290,
> 110, 30, 0),
> FT = create( PushButton, "Find/Replace", Win,
> 140,290, 110, 30, 0),
> UN = create( PushButton, "Undo", Win, 260,290,
> 110, 30, 0),
> SI = create( PushButton, "Stream In", Win, 20,
> 330, 110, 30, 0)
>
> procedure defaulttext()
>     sequence rich
>     atom fn, c
>     fn = open( "font.e", "r" )  -- font.e was
> copied into this file's
>     if fn != -1 then            -- home directory
> so that no path was
>         rich = {}               -- needed.  The
> form opened; however,
>         c = 0                   -- there was no
> text in the RichEdit
>         while c != -1 do        -- component.
> When "RichEdit.exw" was
>             c = getc( fn )      -- opened, the
> text was successfully
>             rich &= c           -- copied into RE!
>         end while
>         rich = rich[1..length(rich)-1]
>         putStream( RE, StreamText, rich )  --
> changed from StreamRich to
>         close( fn )                        --
> SteamText, as I'll be using
>     end if                                 --
> standard Windows color and
> end procedure                              -- one
> font in the RichEdit.
>
> setTabs( RE, {0, 100,125} )
> setIndent( RE, 100, {}, {})
> defaulttext()
>
> WinMain( Win, Normal )
>
>
>
> ______________________________________________________
> Get your free web-based email at http://www.xoom.com
> Birthday? Anniversary? Send FREE animated greeting
> cards for any occasion at http://greetings.xoom.com

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

3. Re: Questions!

Hi Travis,
with regards to documentation, I'm releasing an updated version of David
Cuny's MAKEDOC program with the next win32lib "bleeding edge". Hopefully it
will encourage the creation of HTML documentation by making it easier to do.
The updated version is a little more robust, can do automatic
cross-referencing, can build a global index, and supports more HTML
features.

------
cheers,
Derek

----- Original Message -----
From: "Travis Beaty" <atora at xoommail.com>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Thursday, September 07, 2000 4:59 AM
Subject: Questions!
>
> 3.  Documentation Formatting
> At the risk of starting a flame war here, what
> would be the preferred format for documentation?
> Text?  Html?  Or other?  I personally thought
> HTML, because I figure that if they download the
> program off the Net, they more than likely have
> the facilities to read the HTML documentation.
> There is also the hyperlinks, to make things
> easier to find.  But I've noticed that
> documentation for Euphoria programs are generally
> in ASCII format, save the "official"
> documentation from RDS and the reference for
> win32lib, which is HTML.  Any thoughts?
>

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

4. Re: Questions!

Travis wrote:
> 1.  Problem with getPrinter().

This has been fixed, although not in the version you downloaded.  You need
to delete the structure code that appears right above where PRINTDLG is
defined.

>
> 2.  RichEdit
> Trying to use RichEdit, I was unable to open any
> file and put it into the RichEdit component if
> that file was larger than ~3k.  To attempt this,
> I used a slightly modified version of the sample
> program RichEdit.exw, which I've included below.
> The reason that I was wanting to use RichEdit in
> the IDE was to give it the capability of opening
> files larger than 32k.  To have a size limit that
> low, I'm pretty sure that the problem here isn't
> with the tool, but with the operator.  If someone
> could find my boo-boo, it would be much
> appreciated.

This could be a problem with win32lib.  I haven't tried to do anything that
big with a richedit, and my streaming logic could be incorrect.  Your code
looks fine.  I'll see if I can figure out what's wrong.

Matt Lewis

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

5. Re: Questions!

Travis wrote:

> 2.  RichEdit
> Trying to use RichEdit, I was unable to open any
> file and put it into the RichEdit component if
> that file was larger than ~3k.  To attempt this,
> I used a slightly modified version of the sample
> program RichEdit.exw, which I've included below.
> The reason that I was wanting to use RichEdit in
> the IDE was to give it the capability of opening
> files larger than 32k.  To have a size limit that
> low, I'm pretty sure that the problem here isn't
> with the tool, but with the operator.  If someone
> could find my boo-boo, it would be much
> appreciated.

The problem seems to have been with the Win32 help file regarding the stream
callback function (see putStreamCallback() in win32lib), which states:

"The return value depends on direction. If data is streaming in, the return
value is the number of bytes copied to the buffer, or zero if the transfer
is complete."

MSDN states:

"The callback function returns zero to indicate success.
The callback function returns a nonzero value to indicate an error. If an
error occurs, the read or write operation ends and the rich edit control
discards any data in the pbBuff buffer. If the callback function returns a
nonzero value, the rich edit control uses the dwError member of the
EDITSTREAM structure to pass the value back to the application."

The latter is what seems to actually work.  So, the following is what
putStreamCallback() should really look like (I just took out retval, and
made it return 0 every time):

function putStreamCallback(atom dwCookie, atom pbBuff, atom cb,
    atom pcb )

    atom bytes

    if cb > length(stream) then
        bytes = length( stream )
    else
        bytes = cb
    end if
    poke4( pcb, bytes )

    poke( pbBuff, stream[1..bytes] )
    stream = stream[bytes+1..length(stream)]

    return 0
end function
constant pscb = call_back( routine_id( "putStreamCallback" ) )) )

Derek, please make this change on the sourceforge end.

--Matt Lewis

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

6. Re: Questions!

Hey, I got my copy from sourceforge too, and i noticed that only Matt Lewis'
toolbar programs would work!

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

Search



Quick Links

User menu

Not signed in.

Misc Menu