Announcement

Collapse
No announcement yet.

URL-capable edit box?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Frederic Faure
    replied
    Thx! I got it working after reading samples for Delphi programmers. I don't have to play with RTF anymore. Just as well

    Ciao
    FF.


    ------------------

    Leave a comment:


  • Peter Scheutz
    replied
    that's what i'm aiming at:
    http//www.codeguru.com/richedit/richedit20.shtml
    i posted an example in the source code forum: http://www.powerbasic.com/support/pb...ad.php?t=24632


    ------------------
    best regards
    peter scheutz

    Leave a comment:


  • Frederic Faure
    replied
    That was fast

    Is richedit.h part of the SDK?

    That's what I'm aiming at:
    http//www.codeguru.com/richedit/RichEdit20.shtml

    Thx
    FF.



    ------------------

    Leave a comment:


  • Fred Oxenby
    replied
    RICHEDIT.H(145): #define EM_AUTOURLDETECT (WM_USER + 91)

    ------------------
    Fred
    mailto:[email protected][email protected]</A>
    http://www.oxenby.se

    Leave a comment:


  • Frederic Faure
    replied
    %EM_AUTOURLDETECT is not defined in the .INC files, so I guess it's a user-defined equate?

    Should I send this message when the user clicks on any part of the richedit box?

    I'll read your code snippet tonight. I might even figure it out The latest and greatest of Petzold and Rector/Newcomer are on my Amazon wish-list.

    Thx
    FF.

    ------------------

    Leave a comment:


  • Peter Scheutz
    replied
    For Rich Edit 2.0 or later, I belive you just:
    Call SendMessage( hEdit, %EM_AUTOURLDETECT, %True, 0 )

    That should work for these links types:
    http:, file:, mailto:, ftp:, https:,gopher:, nntp:, prospero:, telnet:, news:, wais:

    I think the mouse pointer will change when over the links.

    ------------------
    Best Regards
    Peter Scheutz

    Leave a comment:


  • Frederic Faure
    replied
    For those interested, here's how to add plain text and a URL into a RichEdit text box. It remains to add code in your application to change the cursor to the familiar arrow to show users that (yes) it's a clickable link, parse that token to extract the URL (should be easy thx to PB/DLL 6's regex support), and launch the default browser with the ShellExecute() function:

    {\rtf1\ansi\ansicpg1252\deff0\deflang1033

    {\colortbl;\red0\green0\blue255;}

    {\stylesheet
    {\*\cs15 \additive \ul\cf1 \sbasedon10 Hyperlink;}
    }

    Before URL
    {\par }

    {\field
    {\*\fldinst {HYPERLINK http://www.powerbasic.com } }
    {\fldrslt {\cs15\ul\cf1 http://www.powerbasic.com} }
    }
    {\par }

    After URL

    }

    HTH
    FF.



    ------------------

    Leave a comment:


  • Frederic Faure
    replied
    Thanks to everyone. I checked c:\winnt, and no less than three versions are there: RICHED.DLL, RICHED20.DLL, and RICHED32.DLL (the one I was using). RICHED.DLL doesn't load, though.

    => BTW, does anyone have a pointer to how the 3.2 version supports hyperlinks?

    I looked at an RTF file that I created in Word with just a single URL, and the structure looks pretty daunting. I think it's OK for URLs not to appear when the user sends a message and it's also OK to only supports URL-ready text (ie. the user must either type a link that starts with a "www.", or add "http://" if the URL doesn't include www. as its prefix), but I'll have to turn basic text into RTF so that URL's appear clickable on the receiving end. Since it's freeware, I'd rather do without commercial add-ons.

    More infos on creating RTF text programmatically: http://www.undu.com/Articles/981027d.html

    Thx again
    FF.

    ------------------

    Leave a comment:


  • Peter Scheutz
    replied
    originally posted by frederic faure:
    any idea where that sample is located on the server? i seem to recall it was from peter scheutz.
    the code is here: http://www.powerbasic.com/support/pb...ead.php?t=3970

    it's not quite finished, but shows one way to do it.

    it uses the id field of the charformat2a type to store an index value.
    a global array is used to hold the actual hyperlink.





    ------------------
    best regards
    peter scheutz

    Leave a comment:


  • Edwin Knoppert
    replied
    The newest richedit (v3 i think) supports hyperlinks.


    ------------------

    Leave a comment:


  • Scott Turchin
    replied
    I don't have exactly taht but I have code from here (PBURL) that allows you to do say, a label etc...
    But it basically does a ShellExecute to execute the URL, basically is underlined font with the cursor changing when it goes over it, and when the click message is received that is when the shellexecute occurs...

    But if what you are looking for is a rich edit box that has that built in, way cool...let me know if you find something like that!

    Scott

    ------------------
    Scott Turchin
    MCSE, MCP+I
    Computer Creations Software
    http://www.tngbbs.com/ccs

    Leave a comment:


  • Frederic Faure
    started a topic URL-capable edit box?

    URL-capable edit box?

    Hi,

    I remember d'loading a demo from the server that demonstrated how to turn regular text into hyperlinks, but I can't find it anymore. I guess it was a RichText box. For testing purposes, I edited an RTF document in Word which only had a URL in it, opened it in my app, and sent the input to a RichText box. The text is displayed as a URL would look like, but it's not clickable.

    Any idea where that sample is located on the server? I seem to recall it was from Peter Scheutz.

    Thx
    FF.

    ------------------
Working...
X