/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.16
 *
 *     Copyright: (c) 2018 by Total Control Software
 *     License:   wxWindows License
 */

#include "sipAPI_core.h"

        #include <wx/sizer.h>

        #include <wx/gdicmn.h>
        #include <wx/button.h>
        #include <wx/sizer.h>
        #include <wx/window.h>
        #include <wx/sizer.h>
        #include <wx/gdicmn.h>
        #include <wx/sizer.h>
        
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxStdDialogButtonSizer : public  ::wxStdDialogButtonSizer
{
public:
    sipwxStdDialogButtonSizer();
    virtual ~sipwxStdDialogButtonSizer();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    void RecalcSizes() SIP_OVERRIDE;
     ::wxSize CalcMin() SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxStdDialogButtonSizer(const sipwxStdDialogButtonSizer &);
    sipwxStdDialogButtonSizer &operator = (const sipwxStdDialogButtonSizer &);

    char sipPyMethods[2];
};

sipwxStdDialogButtonSizer::sipwxStdDialogButtonSizer():  ::wxStdDialogButtonSizer(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxStdDialogButtonSizer::~sipwxStdDialogButtonSizer()
{
    sipInstanceDestroyedEx(&sipPySelf);
}

void sipwxStdDialogButtonSizer::RecalcSizes()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,SIP_NULLPTR,sipName_RecalcSizes);

    if (!sipMeth)
    {
         ::wxStdDialogButtonSizer::RecalcSizes();
        return;
    }

    extern void sipVH__core_45(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    sipVH__core_45(sipGILState, 0, sipPySelf, sipMeth);
}

 ::wxSize sipwxStdDialogButtonSizer::CalcMin()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,SIP_NULLPTR,sipName_CalcMin);

    if (!sipMeth)
        return  ::wxStdDialogButtonSizer::CalcMin();

    extern  ::wxSize sipVH__core_93(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH__core_93(sipGILState, 0, sipPySelf, sipMeth);
}


PyDoc_STRVAR(doc_wxStdDialogButtonSizer_AddButton, "AddButton(button)\n"
"\n"
"Adds a button to the wxStdDialogButtonSizer.");

extern "C" {static PyObject *meth_wxStdDialogButtonSizer_AddButton(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxStdDialogButtonSizer_AddButton(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::wxButton* button;
         ::wxStdDialogButtonSizer *sipCpp;

        static const char *sipKwdList[] = {
            sipName_button,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxStdDialogButtonSizer, &sipCpp, sipType_wxButton, &button))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->AddButton(button);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_StdDialogButtonSizer, sipName_AddButton, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxStdDialogButtonSizer_Realize, "Realize()\n"
"\n"
"Rearranges the buttons and applies proper spacing between buttons to\n"
"make them match the platform or toolkit's interface guidelines.");

extern "C" {static PyObject *meth_wxStdDialogButtonSizer_Realize(PyObject *, PyObject *);}
static PyObject *meth_wxStdDialogButtonSizer_Realize(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::wxStdDialogButtonSizer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxStdDialogButtonSizer, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Realize();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_StdDialogButtonSizer, sipName_Realize, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxStdDialogButtonSizer_SetAffirmativeButton, "SetAffirmativeButton(button)\n"
"\n"
"Sets the affirmative button for the sizer.");

extern "C" {static PyObject *meth_wxStdDialogButtonSizer_SetAffirmativeButton(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxStdDialogButtonSizer_SetAffirmativeButton(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::wxButton* button;
         ::wxStdDialogButtonSizer *sipCpp;

        static const char *sipKwdList[] = {
            sipName_button,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxStdDialogButtonSizer, &sipCpp, sipType_wxButton, &button))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetAffirmativeButton(button);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_StdDialogButtonSizer, sipName_SetAffirmativeButton, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxStdDialogButtonSizer_SetCancelButton, "SetCancelButton(button)\n"
"\n"
"Sets the cancel button for the sizer.");

extern "C" {static PyObject *meth_wxStdDialogButtonSizer_SetCancelButton(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxStdDialogButtonSizer_SetCancelButton(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::wxButton* button;
         ::wxStdDialogButtonSizer *sipCpp;

        static const char *sipKwdList[] = {
            sipName_button,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxStdDialogButtonSizer, &sipCpp, sipType_wxButton, &button))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetCancelButton(button);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_StdDialogButtonSizer, sipName_SetCancelButton, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxStdDialogButtonSizer_SetNegativeButton, "SetNegativeButton(button)\n"
"\n"
"Sets the negative button for the sizer.");

extern "C" {static PyObject *meth_wxStdDialogButtonSizer_SetNegativeButton(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxStdDialogButtonSizer_SetNegativeButton(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::wxButton* button;
         ::wxStdDialogButtonSizer *sipCpp;

        static const char *sipKwdList[] = {
            sipName_button,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxStdDialogButtonSizer, &sipCpp, sipType_wxButton, &button))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetNegativeButton(button);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_StdDialogButtonSizer, sipName_SetNegativeButton, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxStdDialogButtonSizer_RecalcSizes, "RecalcSizes()\n"
"\n"
"Implements the calculation of a box sizer's dimensions and then sets\n"
"the size of its children (calling wxWindow::SetSize if the child is a\n"
"window).");

extern "C" {static PyObject *meth_wxStdDialogButtonSizer_RecalcSizes(PyObject *, PyObject *);}
static PyObject *meth_wxStdDialogButtonSizer_RecalcSizes(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
         ::wxStdDialogButtonSizer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxStdDialogButtonSizer, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp-> ::wxStdDialogButtonSizer::RecalcSizes() : sipCpp->RecalcSizes());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_StdDialogButtonSizer, sipName_RecalcSizes, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxStdDialogButtonSizer_CalcMin, "CalcMin() -> Size\n"
"\n"
"Implements the calculation of a box sizer's minimal.");

extern "C" {static PyObject *meth_wxStdDialogButtonSizer_CalcMin(PyObject *, PyObject *);}
static PyObject *meth_wxStdDialogButtonSizer_CalcMin(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
         ::wxStdDialogButtonSizer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxStdDialogButtonSizer, &sipCpp))
        {
             ::wxSize*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxSize((sipSelfWasArg ? sipCpp-> ::wxStdDialogButtonSizer::CalcMin() : sipCpp->CalcMin()));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromNewType(sipRes,sipType_wxSize,SIP_NULLPTR);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_StdDialogButtonSizer, sipName_CalcMin, SIP_NULLPTR);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_wxStdDialogButtonSizer(void *, const sipTypeDef *);}
static void *cast_wxStdDialogButtonSizer(void *sipCppV, const sipTypeDef *targetType)
{
     ::wxStdDialogButtonSizer *sipCpp = reinterpret_cast< ::wxStdDialogButtonSizer *>(sipCppV);

    if (targetType == sipType_wxBoxSizer)
        return static_cast< ::wxBoxSizer *>(sipCpp);

    if (targetType == sipType_wxSizer)
        return static_cast< ::wxSizer *>(sipCpp);

    if (targetType == sipType_wxObject)
        return static_cast< ::wxObject *>(sipCpp);

    return sipCppV;
}


/* Call the instance's destructor. */
extern "C" {static void release_wxStdDialogButtonSizer(void *, int);}
static void release_wxStdDialogButtonSizer(void *sipCppV, int sipState)
{
    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxStdDialogButtonSizer *>(sipCppV);
    else
        delete reinterpret_cast< ::wxStdDialogButtonSizer *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void dealloc_wxStdDialogButtonSizer(sipSimpleWrapper *);}
static void dealloc_wxStdDialogButtonSizer(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipwxStdDialogButtonSizer *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_wxStdDialogButtonSizer(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_wxStdDialogButtonSizer(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_wxStdDialogButtonSizer(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    sipwxStdDialogButtonSizer *sipCpp = SIP_NULLPTR;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxStdDialogButtonSizer();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
            {
                delete sipCpp;
                return SIP_NULLPTR;
            }

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_wxStdDialogButtonSizer[] = {{40, 255, 1}};


static PyMethodDef methods_wxStdDialogButtonSizer[] = {
    {SIP_MLNAME_CAST(sipName_AddButton), SIP_MLMETH_CAST(meth_wxStdDialogButtonSizer_AddButton), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxStdDialogButtonSizer_AddButton)},
    {SIP_MLNAME_CAST(sipName_CalcMin), meth_wxStdDialogButtonSizer_CalcMin, METH_VARARGS, SIP_MLDOC_CAST(doc_wxStdDialogButtonSizer_CalcMin)},
    {SIP_MLNAME_CAST(sipName_Realize), meth_wxStdDialogButtonSizer_Realize, METH_VARARGS, SIP_MLDOC_CAST(doc_wxStdDialogButtonSizer_Realize)},
    {SIP_MLNAME_CAST(sipName_RecalcSizes), meth_wxStdDialogButtonSizer_RecalcSizes, METH_VARARGS, SIP_MLDOC_CAST(doc_wxStdDialogButtonSizer_RecalcSizes)},
    {SIP_MLNAME_CAST(sipName_SetAffirmativeButton), SIP_MLMETH_CAST(meth_wxStdDialogButtonSizer_SetAffirmativeButton), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxStdDialogButtonSizer_SetAffirmativeButton)},
    {SIP_MLNAME_CAST(sipName_SetCancelButton), SIP_MLMETH_CAST(meth_wxStdDialogButtonSizer_SetCancelButton), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxStdDialogButtonSizer_SetCancelButton)},
    {SIP_MLNAME_CAST(sipName_SetNegativeButton), SIP_MLMETH_CAST(meth_wxStdDialogButtonSizer_SetNegativeButton), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxStdDialogButtonSizer_SetNegativeButton)}
};

PyDoc_STRVAR(doc_wxStdDialogButtonSizer, "StdDialogButtonSizer()\n"
"\n"
"This class creates button layouts which conform to the standard button\n"
"spacing and ordering defined by the platform or toolkit's user\n"
"interface guidelines (if such things exist).");


sipClassTypeDef sipTypeDef__core_wxStdDialogButtonSizer = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxStdDialogButtonSizer,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_StdDialogButtonSizer,
        {0, 0, 1},
        7, methods_wxStdDialogButtonSizer,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxStdDialogButtonSizer,
    -1,
    -1,
    supers_wxStdDialogButtonSizer,
    SIP_NULLPTR,
    init_type_wxStdDialogButtonSizer,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxStdDialogButtonSizer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxStdDialogButtonSizer,
    cast_wxStdDialogButtonSizer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
