Fix initial position of controls with layout insets in wxOSX.
For such controls (e.g. wxButton, wxChoice, wxGauge), their initial position was different from the one specified when creating them, even though calling SetPosition() later did position them at exactly the position passed as argument. See #16780.
This commit is contained in:
@@ -456,9 +456,16 @@ void wxWindowMac::MacChildAdded()
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxWindowMac::MacPostControlCreate(const wxPoint& WXUNUSED(pos),
|
||||
void wxWindowMac::MacPostControlCreate(const wxPoint& pos,
|
||||
const wxSize& WXUNUSED(size))
|
||||
{
|
||||
// Some controls may have a nonzero layout inset,
|
||||
// so we may need to adjust control position.
|
||||
if ( pos.IsFullySpecified() && GetPosition() != pos )
|
||||
{
|
||||
SetPosition(pos);
|
||||
}
|
||||
|
||||
// todo remove if refactoring works correctly
|
||||
#if 0
|
||||
wxASSERT_MSG( GetPeer() != NULL && GetPeer()->IsOk() , wxT("No valid mac control") ) ;
|
||||
|
Reference in New Issue
Block a user