1. Ornamental Garden Proggie

Jerry, kudos for another cool app!

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

new topic     » topic index » view message » categorize

2. Re: Ornamental Garden Proggie

cklester wrote:
> 
> Jerry, kudos for another cool app!

The usefulness of ogp will be greatly enhanced when I get the clipboard
feature to work. Then the user will be able to copy a plant and paste it
on Google and get more information about it. But I don't know how to do
clipboard with wxEuphoria.

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

3. Re: Ornamental Garden Proggie

Jerry Story wrote:
> 
> cklester wrote:
> > 
> > Jerry, kudos for another cool app!
> 
> The usefulness of ogp will be greatly enhanced when I get the clipboard
> feature to work. Then the user will be able to copy a plant and paste it
> on Google and get more information about it. But I don't know how to do
> clipboard with wxEuphoria.

You don't need copy and paste... Just have it open their browser with the
URL like

  http://www.google.com/search?hl=en&q=ornamental+garden+plant

when they click on the plant. You can probably use system() to do that...

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

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

4. Re: Ornamental Garden Proggie

Jerry Story wrote:
> 
> cklester wrote:
> > 
> > Jerry, kudos for another cool app!
> 
> The usefulness of ogp will be greatly enhanced when I get the clipboard
> feature to work. Then the user will be able to copy a plant and paste it
> on Google and get more information about it. But I don't know how to do
> clipboard with wxEuphoria.

It works well under windows, however, there are problems under Linux.  The
way to use it is set_clip_text() and get_clip_text().  From the Known Bugs
section in the docs:

"The clipboard isn't very robust. Multiple copy & pastes from a wxEuphoria 
app can lock up. In between these, if you use the clipboard in another app, 
it seems to be fine."

Another alternative might be to have a text box that contains the data for 
the selected item.  The user should be able to use normal cut & paste
operations.

Matt Lewis

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

5. Re: Ornamental Garden Proggie

Jerry Story wrote:
> 
> cklester wrote:
> > 
> > Jerry, kudos for another cool app!
> 
> The usefulness of ogp will be greatly enhanced when I get the clipboard
> feature to work. Then the user will be able to copy a plant and paste it
> on Google and get more information about it. But I don't know how to do
> clipboard with wxEuphoria.
> 

Also, there are some problems with the way you're creating the fonts, 
although this is really my fault, because the wxEuphoria docs are so 
bad for wxFont.  Here's the updated info (basically with some detail 
copied from wx.chm):

Creation parameters:
    * pointSize
    * family
          o wxDEFAULT Chooses a default font.
          o wxDECORATIVE A decorative font.
          o wxROMAN A formal, serif font.
          o wxSCRIPT A handwriting font.
          o wxSWISS A sans-serif font.
          o wxMODERN A fixed pitch font. 
    * style
          o wxNORMAL
          o wxSLANT
          o wxITALIC 
    * weight
          o wxNORMAL
          o wxLIGHT
          o wxBOLD 
    * underline [=0]
    * faceName [=""]
    * encoding [=wxFONTENCODING_DEFAULT]
          o wxFONTENCODING_SYSTEM Default system encoding.
          o wxFONTENCODING_DEFAULT Default application encoding: this is 
            the encoding set by calls to SetDefaultEncoding and which may 
            be set to, say, KOI8 to create all fonts by default with KOI8 
            encoding. Initially, the default application encoding is the 
            same as default system encoding.
          o wxFONTENCODING_ISO8859_1...15 ISO8859 encodings.
          o wxFONTENCODING_KOI8 The standard Russian encoding for Internet.
          o wxFONTENCODING_CP1250...1252 Windows encodings similar to 
            ISO8859 (but not identical). 


Here's how the fonts should be created:
FONT[1] = create( wxFont, {12,wxDEFAULT,wxITALIC,wxNORMAL,0,"Courier New"})
 FONT[2] = create( wxFont, {12,wxDEFAULT,wxNORMAL,wxBOLD,0,"Courier New"})
 FONT[3] = create( wxFont, {12,wxDEFAULT,wxNORMAL,wxNORMAL,0,"Courier New"})


Matt Lewis

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

6. Re: Ornamental Garden Proggie

Jerry Story wrote:
> 
> cklester wrote:
> > 
> > Jerry, kudos for another cool app!
> 
> The usefulness of ogp will be greatly enhanced when I get the clipboard
> feature to work. Then the user will be able to copy a plant and paste it
> on Google and get more information about it. But I don't know how to do
> clipboard with wxEuphoria.
> 

Here's a workaround for the clipboard.  Create a hidden wxTextCtrl (create
it and then call show_window( textctrl, 0 )).  Then you can use the 
following routines to move text from/to the clipboard:
--/topic wxTextCtrl
--/proc copy_text( atom text )
--
--Copies the selected text to the clipboard.
global procedure copy_text( atom text )
	void = call_member( wxTextCtrl_Copy, text, {})
end procedure

--/topic wxTextCtrl
--/proc cut_text( atom text )
--
--Copies the selected text to the clipboard and removes the selection.
global procedure cut_text( atom text )
	void = cpp:call_member( wxTextCtrl_Cut, text, {})
end procedure

--/topic wxTextCtrl
--/proc paste_text( atom text )
--
--Pastes the text from the clipboard to the text item.
global procedure paste_text( atom text )
	void = cpp:call_member( wxTextCtrl_Paste, text, {})
end procedure


Example:

    text = create( wxTextCtrl, parent )
    show_window( text, 0 )

    -- to copy to the clipboard:
    set_text( text, myText )
    select_all_text( text )
    copy( text )
    set_text( text, "" )

    -- to paste from the clipboard:
    set_text( text, "" )
    paste_text( text )
    myText = get_text_value( text )
    set_text( text, "" )


Matt Lewis
PS I'm hoping to release v0.5.0 pretty soon now.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu