Non-Rectangular buttons Topic is solved
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
Non-Rectangular buttons
How to have elliptical buttons?
-
- Earned some good credits
- Posts: 109
- Joined: Fri Sep 03, 2004 9:30 am
- Location: Brescia, Italy
Re: Non-Rectangular buttons
You have to write your own button class, deriving from wxControl, drawing the button in the pressed/released states and handle mouse/keyboard events.priyank_bolia wrote:How to have elliptical buttons?
But I'm sure you find something already done, this was a common question.
Sandro Sigala - Kynosoft, Brescia
- T-Rex
- Moderator
- Posts: 1248
- Joined: Sat Oct 23, 2004 9:58 am
- Location: Zaporizhzhya, Ukraine
- Contact:
I had the same problem some time ago.
I managed how to implement round buttons using ::SetWindowRgn WinAPI function but I have no idea how to do it under GTK and it seems that noone could help me (all GTK samples with round buttons that I found in Internet don't work correctly with wx ).
At least you can use the source of wxTopLevelWindowMSW::SetShape to do this under Windows
I managed how to implement round buttons using ::SetWindowRgn WinAPI function but I have no idea how to do it under GTK and it seems that noone could help me (all GTK samples with round buttons that I found in Internet don't work correctly with wx ).
At least you can use the source of wxTopLevelWindowMSW::SetShape to do this under Windows
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
Well I don't have linux and didn't seen MAC & Unix in my life and no hope in the future also, but the client requirement is cross portability. So, I would like something from wxWidgets or its derivative. Also, as the whole GUI has to be custom one, I would like a already written and tested thing to do my work quickly.
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
I just have a mask image and in the left button down of the derived class from wxBitmapButton:
Its done.
Code: Select all
void wxCustomButton::OnLeftDown(wxMouseEvent& evt)
{
wxPoint pt = evt.GetPosition();
if(m_maskBitmap.GetRed(pt.x, pt.y))
evt.Skip();
}