Draw a rectangle width floating colours? Topic is solved

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
kea_
Experienced Solver
Experienced Solver
Posts: 59
Joined: Wed Oct 17, 2007 7:32 am

Draw a rectangle width floating colours?

Post by kea_ » Wed Sep 03, 2008 8:13 am

Hello together,

I like to write my own button but I don't know how floating the colours for that button.
Assuming I like to have left of the button a red colour and on the right a blue colour. How can I do that?

Part of my source:

void cpTitle::OnPaint(wxPaintEvent &event){
wxBufferedPaintDC dc(this);
PrepareDC(dc);
dc.SetFont(GetFont());
dc.SetBackground(wxBrush(C_TITLE_BACKGROUND, wxSOLID));
dc.Clear();

// Draw a green rectangle outlines in red
dc.SetPen(*wxRED_PEN);
dc.SetBrush(*wxGREEN_BRUSH);

dc.DrawRectangle( 1, 1, 100, 18 );
}

Thank you for your help.
Greetings kea_
Attachments
example.jpg
example.jpg (10.63 KiB) Viewed 1479 times

tan
Moderator
Moderator
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Post by tan » Wed Sep 03, 2008 9:10 am

OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10

kea_
Experienced Solver
Experienced Solver
Posts: 59
Joined: Wed Oct 17, 2007 7:32 am

Post by kea_ » Wed Sep 03, 2008 12:00 pm

Yes, that was what I'm was locking for.
I could not find it but it was in front of my face.

Thank you very much
:D
kea_

orbitcowboy
I live to help wx-kind
I live to help wx-kind
Posts: 178
Joined: Mon Jul 23, 2007 9:01 am

Post by orbitcowboy » Wed Sep 03, 2008 12:05 pm

When you have finished your button, is it possible to share your source with us... it will be helpful for me....

Regards

Orbitcowboy

Post Reply