BUG report - wrong decompilation output

4 posts, 0 answers
  1. F
    F avatar
    2 posts
    Member since:
    Jun 2011

    Posted 01 Jun 2011 Link to this post

    I wanted to check out the OnPaint override of System.Windows.Forms BaseButton, and I got this:

    Rectangle rectangle2;
    if (this.AutoEllipsis)
    {
        Size preferredSize = base.PreferredSize;
        Rectangle clientRectangle = this.ClientRectangle.ShowToolTip =  // (this.ClientRectangle.ShowToolTip - WTF?)
            (rectangle2.Width < preferredSize.Width ? 1 : clientRectangle.Height < preferredSize.Height);
    }
     
    Something got mixed up... It should be this (according to ILSpy):
    if (this.AutoEllipsis)
        {
            Size preferredSize = base.PreferredSize;
            this.ShowToolTip = (base.ClientRectangle.Width < preferredSize.Width || base.ClientRectangle.Height < preferredSize.Height);
        }
  2. Tsviatko Yovtchev
    Admin
    Tsviatko Yovtchev avatar
    409 posts

    Posted 07 Jun 2011 Link to this post

    Hi there,

     I assume it is DevExpress BaseButton class you are trying to decompile 'cause I could not find anything like this in System.Windows.Forms. 

    We know about this problem and some steps have already been taken to fix it. The chances are the version of JD we released on June the 3rd does much better in that case. Could you give it a try and let me know how it works for you?

    Regards,
    Tsviatko Yovtchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. DevCraft banner
  4. F
    F avatar
    2 posts
    Member since:
    Jun 2011

    Posted 09 Jun 2011 Link to this post

    Hi.

    Sorry, it's ButtonBase (not BaseButton, my bad...) - System.Windows.Forms.Button directly derives from it.
    Anyway, gave the new version a try (Beta 2011.1.603.5), and it's almost exactly the same (the relevant lines are in bold):
    protected override void OnPaint(PaintEventArgs pevent)
    {
        Rectangle rectangle;
        if (this.AutoEllipsis)
        {
            Size preferredSize = base.PreferredSize;
            Rectangle clientRectangle = this.ClientRectangle.ShowToolTip = (rectangle.Width < preferredSize.Width ? 1 : clientRectangle.Height < preferredSize.Height);
        }
        else
        {
            this.ShowToolTip = false;
        }
        if (base.GetStyle(ControlStyles.UserPaint))
        {
            this.Animate();
            ImageAnimator.UpdateFrames();
            this.PaintControl(pevent);
        }
        base.OnPaint(pevent);
    }
  5. Tsviatko Yovtchev
    Admin
    Tsviatko Yovtchev avatar
    409 posts

    Posted 16 Jun 2011 Link to this post

    Alright, that makes sense. And it seems to be problem indeed. Thanks for letting us know. 

    You should be able to monitor the progress of this issue in our internal system. So, please, stay tuned.

    All the best,
    Tsviatko Yovtchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top