Results 1 to 8 of 8

Thread: ClanLib 2.2.6 improvements svn patch

  1. #1
    Lesser Knight
    Join Date
    Jan 2011
    Posts
    32

    Post ClanLib 2.2.6 improvements svn patch

    I created a patch, it contains some improvements, optimizations and new functions, please, check it.

    Summary:

    [added] Improved CL_LineEdit::set_text(float), now you can specify the number of decimal places to display.

    [added] Implemented CL_ProgressBar marquee mode, added set_marquee_box_width(), set_marquee_step_size(), get_marquee_box_width(), get_marquee_step_size() methods.

    [fixed] When you disable a checkbox, it becomes unchecked, if it was in indeterminated state.

    [fixed] Error when pasting text containing '\n' to CL_LineEdit.

    [fixed] Fixed memory leak in CL_MenuBar_Impl.

    [fixed] Removed unnecessary timer from CL_Slider.

    [fixed] CL_Slider: now callbacks are called only when its actual position changed.

    [improved] Now CL_Exception::get_stack_trace() and CL_Exception::get_message_and_stack_trace() methods have const modifier, so all exceptions are now catched as
    Code:
    catch(const CL_Exception& e)
    for better optimization.

    [improved] added virtual keyword to CL_Exception and CL_WebserviceException classes, as they extend std::exception class, which has a virtual destructor.

    [improved] Improved some exception re-throws.

    [improved] Improved GUI themes.

    [improved] Improved GUI example.


    ------------------
    changes2.patch
    ------------------

    [improved] Improved CL_LineEdit scrolling when there's a lot of text in textbox and the user is deleting it some way.

    [fixed] CL_ListView: when some listview field is editable and the user adds a lot of text to it, its width becomes much greater than listview width.
    Attached Files Attached Files
    Last edited by user; 01-18-2011 at 05:30 PM. Reason: forgot something...

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Very nice. In my opinion, it should all be applied to ClanLib 2.3 SVN

    Some of the patches cannot be applied to the 2.2 branch, because it contains breaking changes. Some API function definitions have changed, which would mean the applications would require recompiling (else shared libraries would not link)

    See - http://www.rtsoft.com/forums/showthr...sioning-scheme

    Note, I did break this rule in 2.2.5, because of a critical bug in the API
    (... This version is not binary compatible with the Version 2.2.4. Your application will need recompiled. There was a multithreading problem with CL_SharedPtr.... )

    Maybe we should not have fixed this. As far as I know, distros currently do not use 2.2.4 or below, so I think that's okay.

    One last note....

    Code:
    -	~CL_Exception() throw() {}
    +	virtual ~CL_Exception() throw() {}
    <--- I thought that in C++, if a base class has a virtual function, it automatically implies that inherited class function, is also virtual
    Last edited by rombust; 01-17-2011 at 10:06 PM. Reason: minor fixes

  3. #3
    Lesser Knight
    Join Date
    Jan 2011
    Location
    Vienna, Austria
    Posts
    30

    Default

    One last note....

    Code:
    -	~CL_Exception() throw() {}
    +	virtual ~CL_Exception() throw() {}
    <--- I thought that in C++, if a base class has a virtual function, it automatically implies that inherited class function, is also virtual
    http://www.parashift.com/c++-faq-lit....html#faq-20.7
    Note: in a derived class, if your base class has a virtual destructor, your own destructor is automatically virtual. You might need an explicit destructor for other reasons, but there's no need to redeclare a destructor simply to make sure it is virtual. No matter whether you declare it with the virtual keyword, declare it without the virtual keyword, or don't declare it at all, it's still virtual.

  4. #4
    Lesser Knight
    Join Date
    Jan 2011
    Posts
    32

    Default

    I memorize, that I catched a bug in my program caused by non-virtual destructor in one of derived classes, but I can't repeat it anymore, probably it was my own mistake... Well, it seems that there is really no need for explicit virtual destructor. But you can add 'virtual' keywords just to let other developers know, that all CL_*** exception classes have virtual destructors

  5. #5
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    I will apply the patch as it stands to ClanLib 2.3 SVN
    Then, apply the non API breaking changes part of the patch to the ClanLib 2.2 SVN.

    (Later this week, if I have time)

  6. #6
    Lesser Knight
    Join Date
    Jan 2011
    Posts
    32

    Lightbulb Some more changes...

    I added two additional changes to the patch, attached and commented in the first post.

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

    Default

    Thanks for yet another nice patch

  8. #8
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Patch applied. Many thanks.

    For ClanLib 2.3 SVN, the patch was applied exactly (except minor alterations, due to the slightly different codebase)

    For ClanLib 2.2 SVN, I did not apply the CL_Exception modifications due to it breaking library binary compatibility when dynamically linking on linux.

    Also for ClanLib 2.2 SVN, I modified the GUI lineedit function as follows:
    set_text(float number) --> calls set_text(number, 6);
    set_text(float number, int num_decimal_places); --> Removed the "=6"

Similar Threads

  1. CL_TextStyler patch (clanlib 1.0)
    By gpmfuchs in forum Official ClanLib SDK Forums
    Replies: 12
    Last Post: 03-20-2010, 05:01 PM
  2. Patch [Clanlib 8.1] alsafailsegfault
    By gpmfuchs in forum Official ClanLib SDK Forums
    Replies: 11
    Last Post: 12-02-2008, 02:21 AM
  3. ClanLib 0.9 pacman example patch
    By rombust in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 12-01-2008, 04:09 PM
  4. 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
  5. 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

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
  •