Extract CreateSeparatedSizer() from wxDialog::CreateSeparatedButtonSizer().
Extract the code adding a separating wxStaticLine to the sizer in its own function to be able to reuse it in upcoming commits. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -133,9 +133,16 @@ public:
|
||||
// platforms which have hardware buttons replacing OK/Cancel and such)
|
||||
wxSizer *CreateButtonSizer(long flags);
|
||||
|
||||
// returns a sizer containing the given one and a static line separating it
|
||||
// from the preceding elements if it's appropriate for the current platform
|
||||
wxSizer *CreateSeparatedSizer(wxSizer *sizer);
|
||||
|
||||
// returns the sizer containing CreateButtonSizer() below a separating
|
||||
// static line for the platforms which use static lines for items
|
||||
// separation (i.e. not Mac)
|
||||
//
|
||||
// this is just a combination of CreateButtonSizer() and
|
||||
// CreateSeparatedSizer()
|
||||
wxSizer *CreateSeparatedButtonSizer(long flags);
|
||||
|
||||
#if wxUSE_BUTTON
|
||||
|
@@ -248,9 +248,30 @@ public:
|
||||
|
||||
@note Just like CreateButtonSizer(), this function may return @NULL if
|
||||
no buttons were created.
|
||||
|
||||
This is a combination of CreateButtonSizer() and
|
||||
CreateSeparatedSizer().
|
||||
*/
|
||||
wxSizer* CreateSeparatedButtonSizer(long flags);
|
||||
|
||||
/**
|
||||
Returns the sizer containing the given one with a separating
|
||||
wxStaticLine if necessarily.
|
||||
|
||||
This function is useful for creating the sizer containing footer-like
|
||||
contents in dialog boxes. It will add a separating static line only if
|
||||
it conforms to the current platform convention (currently it is not
|
||||
added under Mac where the use of static lines for grouping is
|
||||
discouraged and is added elsewhere).
|
||||
|
||||
@since 2.9.2
|
||||
|
||||
@param sizer The sizer to wrap, must be non-@NULL.
|
||||
@return The sizer wrapping the input one or possibly the input sizer
|
||||
itself if no wrapping is necessary.
|
||||
*/
|
||||
wxSizer *CreateSeparatedSizer(wxSizer *sizer);
|
||||
|
||||
/**
|
||||
Creates a wxStdDialogButtonSizer with standard buttons. @a flags is a
|
||||
bit list of the following flags: wxOK, wxCANCEL, wxYES, wxNO, wxAPPLY,
|
||||
|
@@ -218,12 +218,8 @@ wxSizer *wxDialogBase::CreateButtonSizer(long flags)
|
||||
#endif // __SMARTPHONE__/!__SMARTPHONE__
|
||||
}
|
||||
|
||||
wxSizer *wxDialogBase::CreateSeparatedButtonSizer(long flags)
|
||||
wxSizer *wxDialogBase::CreateSeparatedSizer(wxSizer *sizer)
|
||||
{
|
||||
wxSizer *sizer = CreateButtonSizer(flags);
|
||||
if ( !sizer )
|
||||
return NULL;
|
||||
|
||||
// Mac Human Interface Guidelines recommend not to use static lines as
|
||||
// grouping elements
|
||||
#if wxUSE_STATLINE && !defined(__WXMAC__)
|
||||
@@ -237,6 +233,15 @@ wxSizer *wxDialogBase::CreateSeparatedButtonSizer(long flags)
|
||||
return sizer;
|
||||
}
|
||||
|
||||
wxSizer *wxDialogBase::CreateSeparatedButtonSizer(long flags)
|
||||
{
|
||||
wxSizer *sizer = CreateButtonSizer(flags);
|
||||
if ( !sizer )
|
||||
return NULL;
|
||||
|
||||
return CreateSeparatedSizer(sizer);
|
||||
}
|
||||
|
||||
#if wxUSE_BUTTON
|
||||
|
||||
wxStdDialogButtonSizer *wxDialogBase::CreateStdDialogButtonSizer( long flags )
|
||||
|
Reference in New Issue
Block a user