IMPLEMENT_DYNAMIC_CLASS_XTI(wxBitmapButton, wxButton,"wx/bmpbuttn.h")
wxBEGIN_PROPERTIES_TABLE(wxBitmapButton)
- wxPROPERTY_FLAGS( WindowStyle , wxBitmapButtonStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
+ wxPROPERTY_FLAGS( WindowStyle , wxBitmapButtonStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxBitmapButton)
m_marginY = wxDEFAULT_BUTTON_MARGIN;
}
- int x = pos.x;
- int y = pos.y;
- int width = size.x;
- int height = size.y;
-
if (id == -1)
m_windowId = NewControlId();
else
m_windowId = id;
- if ( bitmap.Ok() )
- {
- wxSize newSize = DoGetBestSize();
- if ( width == -1 )
- width = newSize.x;
- if ( height == -1 )
- height = newSize.y;
- }
-
long msStyle = WS_VISIBLE | WS_TABSTOP | WS_CHILD | BS_OWNERDRAW ;
if ( m_windowStyle & wxCLIP_SIBLINGS )
// Subclass again for purposes of dialog editing mode
SubclassWin(m_hWnd);
- SetFont(parent->GetFont());
-
- SetSize(x, y, width, height);
+ SetPosition(pos);
+ SetBestSize(size);
return true;
}
best.x = m_bmpNormal.GetWidth() + 2*m_marginX;
best.y = m_bmpNormal.GetHeight() + 2*m_marginY;
}
+
+ // all buttons have at least the standard size unless the user explicitly
+ // wants them to be of smaller size and used wxBU_EXACTFIT style when
+ // creating the button
+ if ( !HasFlag(wxBU_EXACTFIT) )
+ {
+ wxSize sz = GetDefaultSize();
+ if (best.x > sz.x)
+ sz.x = best.x;
+ if (best.y > sz.y)
+ sz.y = best.y;
+ }
+
return best;
}
#endif // wxUSE_BMPBUTTON
+