Results 1 to 8 of 8

Thread: A patch to ClanLib 8.0: added RichEdit, remaked InputBox and some other issues.

  1. #1

    Default A patch to ClanLib 8.0: added RichEdit, remaked InputBox and some other issues.

    Hi to all,

    In the patch there are following changes:

    1) Added RichEdit control.
    2) Remaked InputBox functionality.
    3) Proposed to add CL_XXX_StyleBase classes to refrain from code repetition in CL_XXX_Silver and other styles' classes. See CL_InputBox_StyleBase for example.
    4) Added a VS7 solution for all examples (it makes easier to compile and run these examples instead of opening a lot of studios).
    5) Changed font_black.tga from the Silver style - added white background, to make it possible to colorize a text (see the GUIRichEdit example). And after it we can remove font_gray.tga at all, and just apply a gray color to the main font.
    6) Added get_thread_handle() method to CL_NetComputer class.
    7) Some other little issues.

    And there is also the separate archive with GUIRichEdit example. Please, extract it in the Examples folder when testing.

    Regards,
    Alexey.
    Attached Files Attached Files
    Last edited by ValkaVALES; 07-03-2007 at 09:54 AM. Reason: Not ClanLib 8.0, but 0.8 :) Sorry for this misprint.

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,343

    Default

    Great, thanks!

    I've added this patch, but I didn't include the VS projects because VS 2005 had some errors opening/upgrading them.. (see pic) and because the filename is the same, it wouldn't allow me to open the vc6 ones to upgrade.. so I'll just not include them for now, as opening the vc6 ones and converting them is very easy anyway.

    I did some other small changes:

    * Changed some paths to relative to match the rest of clanlib, otherwise I couldn't compile without adding more includes
    * Added support for OSX key combos to the new edit box
    * Removed edit box's internal clipboard code, had it call CL_Clipboard instead (so it will support osx, and for less code duplication)
    * Adjusted makefile.am's for the new files so linux builds will work
    * Had to include sprite.h in one place for GCC to compile
    * Updated the OSX XCode 2.X project

    The GUIRichEdit example was crashing with "vector subscript out of range error", I fixed it (?) by changing something in richedit_paragraph.cpp.

    I also couldn't open it's project, so I just didn't add that yet.. maybe we'll need GUIRichEdit_vs2003 (if that's what you use?) and GUIRichEdit_vs2005 separately or something, strange.

    I just noticed the cut and paste keys are not working right on osx, will check it out later.

    Anyway, very nice work, hope you keep working on the RichEdit, what's there is already pretty cool.
    Attached Images Attached Images  
    Seth A. Robinson
    Robinson Technologies

  3. #3
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    Tried compiling this under Windows, but hit a few snags:

    - resources.xml is missing
    - it won't load the JPEG images. Don't know why, when I changed them to PNG they worked fine..
    - I couldn't do any editing - not sure if that is disabled or implemented?
    - The font doesn't display any colored text - all text is black.

    Otherwise, looks really cool. I've uploaded a screenshot for those interested:
    http://clanlib.org/~sphair/RichEdit.png

  4. #4

    Default

    Hi Seth and sphair!

    Thank you for trying my code and your comments to it.

    Seth,
    The GUIRichEdit example was crashing with "vector subscript out of range error"
    Yes, the richedit_paragraph.cpp contained a problem (it is strange that on my machine there was no exception in that place, even in Release mode). But the problem was in the CL_RichEdit_Paragraph::update() function. I fixed it.

    Changed some paths to relative to match the rest of clanlib, otherwise I couldn't compile without adding more includes
    Sorry for that relative paths in my code.. I forgot to change it.

    Sphair,
    - resources.xml is missing
    It is strange - resources.xml was in my GUIRichEdit.zip. Anyway, it is in my today's pack too.

    - it won't load the JPEG images.
    Hmm.. All is working good on my machine. Maybe, the problem was in resource.xml file?..

    - I couldn't do any editing - not sure if that is disabled or implemented?
    Yes, for now it is just a "read-only" RichEdit. I wrote about it in http://www.rtsoft.com/forums/showthread.php?t=1718 . Sorry for this temporarily absense of functionality, I'll try to improve this when I get more free time. (For my game purposes an editing is not needed in RichEdit, because I'm using it as just a chat-log window).

    - The font doesn't display any colored text - all text is black.
    Yes. The problem is in the old font_black.tga used in Resources/GUIStyleSilver. It has a black background, and for colorizing it should have a white one. In my new pack you can found updated tga file and (if you found it good) commit it to the ClanLib.


    Regards,
    Alexey.

  5. #5

    Default The pack update

    Some files in this new little pack:

    resources.xml
    GUIRichEdit_vs2003.sln
    GUIRichEdit_vs2003.vcproj

    font_black.tga (with white background)

    richedit_paragraph.cpp (fixed problem with indexes).
    Attached Files Attached Files

  6. #6
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,343

    Default

    Oops, my bad on the resource.xml... I've added that and updated SVN with the other new files.

    But, I think the bugfix is still not correct, because now I don't see the girl anymore.. a one-off error somewhere perhaps?
    Attached Images Attached Images  
    Seth A. Robinson
    Robinson Technologies

  7. #7

    Default

    Oops, yes, there was one extra 'if' in the CL_RichEdit_Paragraph::generate_line_info().

    The corrected richedit_paragraph.cpp is in the attachment.

    Regards,
    Alexey.
    Attached Files Attached Files

  8. #8
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,343

    Default

    Thanks, applied.

    Also, you are using the SVN version now, correct? Might want to SVN->update a lot and use SVN patches from now on, in case someone else makes some modifications to RichEdit or the examples. (I might removes warnings on GCC, or fix OSX-specific issues for instance)
    Seth A. Robinson
    Robinson Technologies

Similar Threads

  1. InputBox in 0.8 - fixed some bugs and added functionality
    By ValkaVALES in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 07-03-2007, 09:47 AM
  2. Patch for ClanLib 0.9 svn 368 (Linux compatibility)
    By rombust in forum Official ClanLib SDK Forums
    Replies: 7
    Last Post: 05-16-2007, 08:02 AM
  3. Patch to ClanLib-0.9 svn rev 365
    By rombust in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 05-09-2007, 01:08 PM
  4. Patch to ClanLib-0.8 svn rev 364
    By rombust in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 05-06-2007, 01:14 PM
  5. Issues
    By Dorian1 in forum RTsoft Tavern
    Replies: 1
    Last Post: 09-09-2004, 09:07 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •