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

#include "sipAPI_grid.h"
        #include <wx/grid.h>
        #include <wx/grid.h>
        #include <wx/grid.h>
        #include <wx/grid.h>
        #include <wx/control.h>
        #include <wx/window.h>
        #include <wx/event.h>
        #include <wx/grid.h>
        #include <wx/gdicmn.h>
        #include <wx/dc.h>
        #include <wx/event.h>
    PyObject* _wxGridCellEditor_EndEdit(wxGridCellEditor* self, int row, int col, const wxGrid* grid, const wxString* oldval)
    {
        bool rv;
        wxString newval;
        rv = self->EndEdit(row, col, grid, *oldval, &newval);
        if (rv) {
            return wx2PyString(newval);
        }
        else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }


class sipwxGridCellEditor : public ::wxGridCellEditor
{
public:
    sipwxGridCellEditor();
    virtual ~sipwxGridCellEditor();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    void DoActivate(int, int, ::wxGrid*) SIP_OVERRIDE;
    ::wxGridActivationResult TryActivate(int, int, ::wxGrid*, const ::wxGridActivationSource&) SIP_OVERRIDE;
    ::wxString GetValue() const SIP_OVERRIDE;
    bool IsAcceptedKey(::wxKeyEvent&) SIP_OVERRIDE;
    void StartingKey(::wxKeyEvent&) SIP_OVERRIDE;
    void StartingClick() SIP_OVERRIDE;
    void Show(bool, ::wxGridCellAttr*) SIP_OVERRIDE;
    void SetSize(const ::wxRect&) SIP_OVERRIDE;
    void Reset() SIP_OVERRIDE;
    void PaintBackground(::wxDC&, const ::wxRect&, const ::wxGridCellAttr&) SIP_OVERRIDE;
    void HandleReturn(::wxKeyEvent&) SIP_OVERRIDE;
    void ApplyEdit(int, int, ::wxGrid*) SIP_OVERRIDE;
    bool EndEdit(int, int, const ::wxGrid*, const ::wxString&, ::wxString*) SIP_OVERRIDE;
    void Destroy() SIP_OVERRIDE;
    void Create(::wxWindow*, ::wxWindowID, ::wxEvtHandler*) SIP_OVERRIDE;
    ::wxGridCellEditor* Clone() const SIP_OVERRIDE;
    void BeginEdit(int, int, ::wxGrid*) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[17];
};

sipwxGridCellEditor::sipwxGridCellEditor(): ::wxGridCellEditor(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

void sipwxGridCellEditor::DoActivate(int row, int col, ::wxGrid*grid)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
        ::wxGridCellEditor::DoActivate(row, col, grid);
        return;
    }

    extern void sipVH__grid_6(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, ::wxGrid*);

    sipVH__grid_6(sipGILState, 0, sipPySelf, sipMeth, row, col, grid);
}

::wxGridActivationResult sipwxGridCellEditor::TryActivate(int row, int col, ::wxGrid*grid, const ::wxGridActivationSource& actSource)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxGridCellEditor::TryActivate(row, col, grid, actSource);

    extern ::wxGridActivationResult sipVH__grid_17(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, ::wxGrid*, const ::wxGridActivationSource&);

    return sipVH__grid_17(sipGILState, 0, sipPySelf, sipMeth, row, col, grid, actSource);
}

::wxString sipwxGridCellEditor::GetValue() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[2]), const_cast<sipSimpleWrapper **>(&sipPySelf), sipName_GridCellEditor, sipName_GetValue);

    if (!sipMeth)
        return ::wxString();

    extern ::wxString sipVH__grid_16(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

bool sipwxGridCellEditor::IsAcceptedKey(::wxKeyEvent& event)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[3], &sipPySelf, SIP_NULLPTR, sipName_IsAcceptedKey);

    if (!sipMeth)
        return ::wxGridCellEditor::IsAcceptedKey(event);

    extern bool sipVH__grid_15(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxKeyEvent&);

    return sipVH__grid_15(sipGILState, 0, sipPySelf, sipMeth, event);
}

void sipwxGridCellEditor::StartingKey(::wxKeyEvent& event)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[4], &sipPySelf, SIP_NULLPTR, sipName_StartingKey);

    if (!sipMeth)
    {
        ::wxGridCellEditor::StartingKey(event);
        return;
    }

    extern void sipVH__grid_11(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxKeyEvent&);

    sipVH__grid_11(sipGILState, 0, sipPySelf, sipMeth, event);
}

void sipwxGridCellEditor::StartingClick()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[5], &sipPySelf, SIP_NULLPTR, sipName_StartingClick);

    if (!sipMeth)
    {
        ::wxGridCellEditor::StartingClick();
        return;
    }

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

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

void sipwxGridCellEditor::Show(bool show, ::wxGridCellAttr*attr)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[6], &sipPySelf, SIP_NULLPTR, sipName_Show);

    if (!sipMeth)
    {
        ::wxGridCellEditor::Show(show, attr);
        return;
    }

    extern void sipVH__grid_14(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, bool, ::wxGridCellAttr*);

    sipVH__grid_14(sipGILState, 0, sipPySelf, sipMeth, show, attr);
}

void sipwxGridCellEditor::SetSize(const ::wxRect& rect)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[7], &sipPySelf, SIP_NULLPTR, sipName_SetSize);

    if (!sipMeth)
    {
        ::wxGridCellEditor::SetSize(rect);
        return;
    }

    extern void sipVH__grid_13(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxRect&);

    sipVH__grid_13(sipGILState, 0, sipPySelf, sipMeth, rect);
}

void sipwxGridCellEditor::Reset()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[8], &sipPySelf, sipName_GridCellEditor, sipName_Reset);

    if (!sipMeth)
        return;

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

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

void sipwxGridCellEditor::PaintBackground(::wxDC& dc, const ::wxRect& rectCell, const ::wxGridCellAttr& attr)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[9], &sipPySelf, SIP_NULLPTR, sipName_PaintBackground);

    if (!sipMeth)
    {
        ::wxGridCellEditor::PaintBackground(dc, rectCell, attr);
        return;
    }

    extern void sipVH__grid_12(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxDC&, const ::wxRect&, const ::wxGridCellAttr&);

    sipVH__grid_12(sipGILState, 0, sipPySelf, sipMeth, dc, rectCell, attr);
}

void sipwxGridCellEditor::HandleReturn(::wxKeyEvent& event)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[10], &sipPySelf, SIP_NULLPTR, sipName_HandleReturn);

    if (!sipMeth)
    {
        ::wxGridCellEditor::HandleReturn(event);
        return;
    }

    extern void sipVH__grid_11(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxKeyEvent&);

    sipVH__grid_11(sipGILState, 0, sipPySelf, sipMeth, event);
}

void sipwxGridCellEditor::ApplyEdit(int row, int col, ::wxGrid*grid)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[11], &sipPySelf, sipName_GridCellEditor, sipName_ApplyEdit);

    if (!sipMeth)
        return;

    extern void sipVH__grid_6(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, ::wxGrid*);

    sipVH__grid_6(sipGILState, 0, sipPySelf, sipMeth, row, col, grid);
}

bool sipwxGridCellEditor::EndEdit(int row, int col, const ::wxGrid*grid, const ::wxString& oldval, ::wxString*newval)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[12], &sipPySelf, sipName_GridCellEditor, sipName_EndEdit);

    if (!sipMeth)
        return 0;

    extern bool sipVH__grid_10(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, const ::wxGrid*, const ::wxString&, ::wxString*);

    return sipVH__grid_10(sipGILState, 0, sipPySelf, sipMeth, row, col, grid, oldval, newval);
}

void sipwxGridCellEditor::Destroy()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[13], &sipPySelf, SIP_NULLPTR, sipName_Destroy);

    if (!sipMeth)
    {
        ::wxGridCellEditor::Destroy();
        return;
    }

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

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

void sipwxGridCellEditor::Create(::wxWindow*parent, ::wxWindowID id, ::wxEvtHandler*evtHandler)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[14], &sipPySelf, sipName_GridCellEditor, sipName_Create);

    if (!sipMeth)
        return;

    extern void sipVH__grid_8(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxWindow*, ::wxWindowID, ::wxEvtHandler*);

    sipVH__grid_8(sipGILState, 0, sipPySelf, sipMeth, parent, id, evtHandler);
}

::wxGridCellEditor* sipwxGridCellEditor::Clone() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[15]), const_cast<sipSimpleWrapper **>(&sipPySelf), sipName_GridCellEditor, sipName_Clone);

    if (!sipMeth)
        return 0;

    extern ::wxGridCellEditor* sipVH__grid_7(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

void sipwxGridCellEditor::BeginEdit(int row, int col, ::wxGrid*grid)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[16], &sipPySelf, sipName_GridCellEditor, sipName_BeginEdit);

    if (!sipMeth)
        return;

    extern void sipVH__grid_6(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, ::wxGrid*);

    sipVH__grid_6(sipGILState, 0, sipPySelf, sipMeth, row, col, grid);
}


PyDoc_STRVAR(doc_wxGridCellEditor_BeginEdit, "BeginEdit(row, col, grid) -> None\n"
"\n"
"Fetch the value from the table and prepare the edit control to begin\n"
"editing.");

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

    {
        int row;
        int col;
        ::wxGrid* grid;
        ::wxGridCellEditor *sipCpp;

        static const char *sipKwdList[] = {
            sipName_row,
            sipName_col,
            sipName_grid,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BiiJ8", &sipSelf, sipType_wxGridCellEditor, &sipCpp, &row, &col, sipType_wxGrid, &grid))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_GridCellEditor, sipName_BeginEdit);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->BeginEdit(row, col, grid);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_BeginEdit, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_Clone, "Clone() -> GridCellEditor\n"
"\n"
"Create a new object which is the copy of this one.");

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

    {
        const ::wxGridCellEditor *sipCpp;

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

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_GridCellEditor, sipName_Clone);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->Clone();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_Clone, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_Create, "Create(parent, id, evtHandler) -> None\n"
"\n"
"Creates the actual edit control.");

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

    {
        ::wxWindow* parent;
        ::wxWindowID id;
        ::wxEvtHandler* evtHandler;
        ::wxGridCellEditor *sipCpp;

        static const char *sipKwdList[] = {
            sipName_parent,
            sipName_id,
            sipName_evtHandler,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8iJ8", &sipSelf, sipType_wxGridCellEditor, &sipCpp, sipType_wxWindow, &parent, &id, sipType_wxEvtHandler, &evtHandler))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_GridCellEditor, sipName_Create);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Create(parent, id, evtHandler);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_Create, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_Destroy, "Destroy() -> None\n"
"\n"
"Final cleanup.");

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

    {
        ::wxGridCellEditor *sipCpp;

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

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCellEditor::Destroy() : sipCpp->Destroy());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_Destroy, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_EndEdit, "EndEdit(row, col, grid, oldval)\n"
"\n"
"End editing the cell.\n"
"\n"
"This function must check if the current value of the editing cell\n"
"is valid and different from the original value in its string\n"
"form. If not then simply return None.  If it has changed then\n"
"this method should save the new value so that ApplyEdit can\n"
"apply it later and the string representation of the new value\n"
"should be returned.\n"
"\n"
"Notice that this method shoiuld not modify the grid as the\n"
"change could still be vetoed.");

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

    {
        int row;
        int col;
        const ::wxGrid* grid;
        const ::wxString* oldval;
        int oldvalState = 0;
        ::wxGridCellEditor *sipCpp;

        static const char *sipKwdList[] = {
            sipName_row,
            sipName_col,
            sipName_grid,
            sipName_oldval,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BiiJ8J1", &sipSelf, sipType_wxGridCellEditor, &sipCpp, &row, &col, sipType_wxGrid, &grid, sipType_wxString, &oldval, &oldvalState))
        {
            PyObject * sipRes = SIP_NULLPTR;
            int sipIsErr = 0;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_GridCellEditor, sipName_EndEdit);
                return SIP_NULLPTR;
            }
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxGridCellEditor_EndEdit(sipCpp, row, col, grid, oldval);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;
            sipReleaseType(const_cast< ::wxString *>(oldval), sipType_wxString, oldvalState);

            if (sipIsErr)
                return 0;

            return sipRes;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_EndEdit, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_ApplyEdit, "ApplyEdit(row, col, grid) -> None\n"
"\n"
"Effectively save the changes in the grid.");

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

    {
        int row;
        int col;
        ::wxGrid* grid;
        ::wxGridCellEditor *sipCpp;

        static const char *sipKwdList[] = {
            sipName_row,
            sipName_col,
            sipName_grid,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BiiJ8", &sipSelf, sipType_wxGridCellEditor, &sipCpp, &row, &col, sipType_wxGrid, &grid))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_GridCellEditor, sipName_ApplyEdit);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->ApplyEdit(row, col, grid);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_ApplyEdit, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_HandleReturn, "HandleReturn(event) -> None\n"
"\n"
"Some types of controls on some platforms may need some help with the\n"
"Return key.");

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

    {
        ::wxKeyEvent* event;
        ::wxGridCellEditor *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGridCellEditor, &sipCpp, sipType_wxKeyEvent, &event))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCellEditor::HandleReturn(*event) : sipCpp->HandleReturn(*event));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_HandleReturn, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_IsCreated, "IsCreated() -> bool\n"
"\n"
"Returns true if the edit control has been created.");

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

    {
        ::wxGridCellEditor *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridCellEditor, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->IsCreated();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_IsCreated, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_PaintBackground, "PaintBackground(dc, rectCell, attr) -> None\n"
"\n"
"Draws the part of the cell not occupied by the control: the base class\n"
"version just fills it with background colour from the attribute.");

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

    {
        ::wxDC* dc;
        const ::wxRect* rectCell;
        int rectCellState = 0;
        const ::wxGridCellAttr* attr;
        ::wxGridCellEditor *sipCpp;

        static const char *sipKwdList[] = {
            sipName_dc,
            sipName_rectCell,
            sipName_attr,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9J1J9", &sipSelf, sipType_wxGridCellEditor, &sipCpp, sipType_wxDC, &dc, sipType_wxRect, &rectCell, &rectCellState, sipType_wxGridCellAttr, &attr))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCellEditor::PaintBackground(*dc, *rectCell, *attr) : sipCpp->PaintBackground(*dc, *rectCell, *attr));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxRect *>(rectCell), sipType_wxRect, rectCellState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_PaintBackground, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_Reset, "Reset() -> None\n"
"\n"
"Reset the value in the control back to its starting value.");

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

    {
        ::wxGridCellEditor *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridCellEditor, &sipCpp))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_GridCellEditor, sipName_Reset);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Reset();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_Reset, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_SetSize, "SetSize(rect) -> None\n"
"\n"
"Size and position the edit control.");

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

    {
        const ::wxRect* rect;
        int rectState = 0;
        ::wxGridCellEditor *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxGridCellEditor, &sipCpp, sipType_wxRect, &rect, &rectState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCellEditor::SetSize(*rect) : sipCpp->SetSize(*rect));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxRect *>(rect), sipType_wxRect, rectState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_SetSize, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_Show, "Show(show, attr=None) -> None\n"
"\n"
"Show or hide the edit control, use the specified attributes to set colours/fonts for it.");

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

    {
        bool show;
        ::wxGridCellAttr* attr = 0;
        ::wxGridCellEditor *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bb|J8", &sipSelf, sipType_wxGridCellEditor, &sipCpp, &show, sipType_wxGridCellAttr, &attr))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCellEditor::Show(show, attr) : sipCpp->Show(show, attr));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_Show, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_StartingClick, "StartingClick() -> None\n"
"\n"
"If the editor is enabled by clicking on the cell, this method will be\n"
"called.");

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

    {
        ::wxGridCellEditor *sipCpp;

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

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCellEditor::StartingClick() : sipCpp->StartingClick());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_StartingClick, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_StartingKey, "StartingKey(event) -> None\n"
"\n"
"If the editor is enabled by pressing keys on the grid, this will be\n"
"called to let the editor do something about that first key if desired.");

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

    {
        ::wxKeyEvent* event;
        ::wxGridCellEditor *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGridCellEditor, &sipCpp, sipType_wxKeyEvent, &event))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCellEditor::StartingKey(*event) : sipCpp->StartingKey(*event));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_StartingKey, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_IsAcceptedKey, "IsAcceptedKey(event) -> bool\n"
"\n"
"Return true to allow the given key to start editing: the base class\n"
"version only checks that the event has no modifiers.");

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

    {
        ::wxKeyEvent* event;
        ::wxGridCellEditor *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGridCellEditor, &sipCpp, sipType_wxKeyEvent, &event))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxGridCellEditor::IsAcceptedKey(*event) : sipCpp->IsAcceptedKey(*event));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_IsAcceptedKey, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_GetValue, "GetValue() -> str\n"
"\n"
"Returns the value currently in the editor control.");

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

    {
        const ::wxGridCellEditor *sipCpp;

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

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_GridCellEditor, sipName_GetValue);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxString(sipCpp->GetValue());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_GetValue, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_GetWindow, "GetWindow() -> wx.Window\n"
"\n"
"Get the edit window used by this editor.");

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

    {
        const ::wxGridCellEditor *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetWindow();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromType(sipRes, sipType_wxWindow, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_GetWindow, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_SetWindow, "SetWindow(window) -> None\n"
"\n"
"Set the wxWindow that will be used by this cell editor for editing the\n"
"value.");

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

    {
        ::wxWindow* window;
        ::wxGridCellEditor *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxGridCellEditor, &sipCpp, sipType_wxWindow, &window))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetWindow(window);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_SetWindow, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_GetControl, "GetControl() -> wx.Control\n"
"\n"
"Get the wxControl used by this editor.");

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

    {
        ::wxGridCellEditor *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetControl();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromType(sipRes, sipType_wxControl, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_GetControl, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_SetControl, "SetControl(control) -> None\n"
"\n"
"Set the wxControl that will be used by this cell editor for editing\n"
"the value.");

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

    {
        ::wxControl* control;
        ::wxGridCellEditor *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxGridCellEditor, &sipCpp, sipType_wxControl, &control))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetControl(control);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_SetControl, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_TryActivate, "TryActivate(row, col, grid, actSource) -> GridActivationResult\n"
"\n"
"Function allowing to create an \"activatable\" editor.");

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

    {
        int row;
        int col;
        ::wxGrid* grid;
        const ::wxGridActivationSource* actSource;
        ::wxGridCellEditor *sipCpp;

        static const char *sipKwdList[] = {
            sipName_row,
            sipName_col,
            sipName_grid,
            sipName_actSource,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BiiJ8J9", &sipSelf, sipType_wxGridCellEditor, &sipCpp, &row, &col, sipType_wxGrid, &grid, sipType_wxGridActivationSource, &actSource))
        {
            ::wxGridActivationResult*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGridActivationResult((sipSelfWasArg ? sipCpp->::wxGridCellEditor::TryActivate(row, col, grid, *actSource) : sipCpp->TryActivate(row, col, grid, *actSource)));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_TryActivate, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_DoActivate, "DoActivate(row, col, grid) -> None\n"
"\n"
"Function which must be overridden for \"activatable\" editors.");

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

    {
        int row;
        int col;
        ::wxGrid* grid;
        ::wxGridCellEditor *sipCpp;

        static const char *sipKwdList[] = {
            sipName_row,
            sipName_col,
            sipName_grid,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BiiJ8", &sipSelf, sipType_wxGridCellEditor, &sipCpp, &row, &col, sipType_wxGrid, &grid))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCellEditor::DoActivate(row, col, grid) : sipCpp->DoActivate(row, col, grid));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_DoActivate, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxGridCellEditor)
        return sipCppV;

    if (targetType == sipType_wxSharedClientDataContainer)
        return static_cast< ::wxSharedClientDataContainer *>(sipCpp);

    if (targetType == sipType_wxRefCounter)
        return static_cast< ::wxRefCounter *>(sipCpp);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxGridCellEditor *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxGridCellEditor();
            Py_END_ALLOW_THREADS

            *sipOwner = Py_None;

            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_wxGridCellEditor[] = {{26, 0, 0}, {22, 0, 1}};


static PyMethodDef methods_wxGridCellEditor[] = {
    {sipName_ApplyEdit, SIP_MLMETH_CAST(meth_wxGridCellEditor_ApplyEdit), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_ApplyEdit},
    {sipName_BeginEdit, SIP_MLMETH_CAST(meth_wxGridCellEditor_BeginEdit), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_BeginEdit},
    {sipName_Clone, meth_wxGridCellEditor_Clone, METH_VARARGS, doc_wxGridCellEditor_Clone},
    {sipName_Create, SIP_MLMETH_CAST(meth_wxGridCellEditor_Create), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_Create},
    {sipName_Destroy, meth_wxGridCellEditor_Destroy, METH_VARARGS, doc_wxGridCellEditor_Destroy},
    {sipName_DoActivate, SIP_MLMETH_CAST(meth_wxGridCellEditor_DoActivate), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_DoActivate},
    {sipName_EndEdit, SIP_MLMETH_CAST(meth_wxGridCellEditor_EndEdit), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_EndEdit},
    {sipName_GetControl, meth_wxGridCellEditor_GetControl, METH_VARARGS, doc_wxGridCellEditor_GetControl},
    {sipName_GetValue, meth_wxGridCellEditor_GetValue, METH_VARARGS, doc_wxGridCellEditor_GetValue},
    {sipName_GetWindow, meth_wxGridCellEditor_GetWindow, METH_VARARGS, doc_wxGridCellEditor_GetWindow},
    {sipName_HandleReturn, SIP_MLMETH_CAST(meth_wxGridCellEditor_HandleReturn), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_HandleReturn},
    {sipName_IsAcceptedKey, SIP_MLMETH_CAST(meth_wxGridCellEditor_IsAcceptedKey), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_IsAcceptedKey},
    {sipName_IsCreated, meth_wxGridCellEditor_IsCreated, METH_VARARGS, doc_wxGridCellEditor_IsCreated},
    {sipName_PaintBackground, SIP_MLMETH_CAST(meth_wxGridCellEditor_PaintBackground), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_PaintBackground},
    {sipName_Reset, meth_wxGridCellEditor_Reset, METH_VARARGS, doc_wxGridCellEditor_Reset},
    {sipName_SetControl, SIP_MLMETH_CAST(meth_wxGridCellEditor_SetControl), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_SetControl},
    {sipName_SetSize, SIP_MLMETH_CAST(meth_wxGridCellEditor_SetSize), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_SetSize},
    {sipName_SetWindow, SIP_MLMETH_CAST(meth_wxGridCellEditor_SetWindow), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_SetWindow},
    {sipName_Show, SIP_MLMETH_CAST(meth_wxGridCellEditor_Show), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_Show},
    {sipName_StartingClick, meth_wxGridCellEditor_StartingClick, METH_VARARGS, doc_wxGridCellEditor_StartingClick},
    {sipName_StartingKey, SIP_MLMETH_CAST(meth_wxGridCellEditor_StartingKey), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_StartingKey},
    {sipName_TryActivate, SIP_MLMETH_CAST(meth_wxGridCellEditor_TryActivate), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellEditor_TryActivate}
};

sipVariableDef variables_wxGridCellEditor[] = {
    {PropertyVariable, sipName_Window, &methods_wxGridCellEditor[9], &methods_wxGridCellEditor[17], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Value, &methods_wxGridCellEditor[8], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Control, &methods_wxGridCellEditor[7], &methods_wxGridCellEditor[15], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxGridCellEditor, "GridCellEditor() -> None\n"
"\n"
"This class is responsible for providing and manipulating the in-place\n"
"edit controls for the grid.");


sipClassTypeDef sipTypeDef__grid_wxGridCellEditor = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_wxGridCellEditor,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_GridCellEditor,
        {0, 0, 1},
        22, methods_wxGridCellEditor,
        0, SIP_NULLPTR,
        3, variables_wxGridCellEditor,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxGridCellEditor,
    -1,
    -1,
    supers_wxGridCellEditor,
    SIP_NULLPTR,
    init_type_wxGridCellEditor,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGridCellEditor,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxGridCellEditor,
    cast_wxGridCellEditor,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxGridCellEditor),
};
