[haiku-development] Re: RoundRect ButtonFrame

  • From: Clemens Zeidler <clemens.zeidler@xxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 20 Mar 2012 09:56:35 +1300

On Tue, 20 Mar 2012 09:46:26 +1300, John Scipione <jscipione@xxxxxxxxx> wrote:


On Mon, Mar 19, 2012 at 4:42 PM, Clemens Zeidler
<clemens.zeidler@xxxxxxxxxxxxxx> wrote:
just a quick guess but why not implement it in:
http://haiku.it.su.se:8180/source/xref/src/kits/interface/ControlLook.cpp#DrawButtonFrame

Just derive from BControlLook and change it there. Then set be_control_look
to point to your derived class, right?

Clemens,

That is what I am proposing, to implement the feature it in
ControlLook. I am asking for help on how to implement the feature as
it is not obvious to me after a cursory attempt.

Thank you,
John Scipione


think I don't get you problem so here some pseudo code:


class MyControlLook : public BControlLook {
public:
        virtual void DrawButtonFrame(BView* view, BRect& rect,
                                                                        const 
BRect& updateRect,
                                                                        const 
rgb_color& base,
                                                                        const 
rgb_color& background,
                                        uint32 flags = 0,
                                                                        uint32 
borders = B_ALL_BORDERS)
        {
                DrawRoundedRect(rect, ...);
        }
};


then do

MyControlLook look;
be_control_look = &look;

somewhere.

Is that what you meant? Don't edit the default BControlLook directly. Or do you want to add a new button style B_ROUNDED_EDGES?

Cheers,
        Clemens

Other related posts: