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

#include "sipAPI_grid.h"

        #include <wx/grid.h>

        #include <wx/control.h>
        #include <wx/event.h>
        #include <wx/grid.h>
        #include <wx/gdicmn.h>
        #include <wx/dc.h>
        #include <wx/grid.h>
        #include <wx/window.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:
     ::wxString GetValue() const 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[14];
};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if (!sipMeth)
        return;

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

    sipVH__grid_7(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[6],sipPySelf,SIP_NULLPTR,sipName_PaintBackground);

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

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

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

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

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

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

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

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

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

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

    if (!sipMeth)
        return;

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

    sipVH__grid_4(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[9],sipPySelf,sipName_GridCellEditor,sipName_EndEdit);

    if (!sipMeth)
        return 0;

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

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

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

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

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

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

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

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

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

    if (!sipMeth)
        return;

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

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

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

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

    if (!sipMeth)
        return 0;

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

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

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

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

    if (!sipMeth)
        return;

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

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


PyDoc_STRVAR(doc_wxGridCellEditor_BeginEdit, "BeginEdit(row, col, grid)\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;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    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);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_Create, "Create(parent, id, evtHandler)\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;
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_Destroy, "Destroy()\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;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    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;
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_ApplyEdit, "ApplyEdit(row, col, grid)\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;
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_HandleReturn, "HandleReturn(event)\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;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    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);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_PaintBackground, "PaintBackground(dc, rectCell, attr)\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;
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_Reset, "Reset()\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;
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_SetSize, "SetSize(rect)\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;
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_Show, "Show(show, attr=None)\n"
"\n"
"Show or hide the edit control, use the specified attributes to set\n"
"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;
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_StartingClick, "StartingClick()\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;
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_StartingKey, "StartingKey(event)\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;
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_GetValue, "GetValue() -> String\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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_GetValue, 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;

    {
        const  ::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);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellEditor_SetControl, "SetControl(control)\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;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_GridCellEditor, sipName_SetControl, 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_wxClientDataContainer)
        return static_cast< ::wxClientDataContainer *>(sipCpp);

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

    return sipCppV;
}


/* 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[] = {{4, 0, 0}, {21, 0, 1}};


static PyMethodDef methods_wxGridCellEditor[] = {
    {SIP_MLNAME_CAST(sipName_ApplyEdit), SIP_MLMETH_CAST(meth_wxGridCellEditor_ApplyEdit), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxGridCellEditor_ApplyEdit)},
    {SIP_MLNAME_CAST(sipName_BeginEdit), SIP_MLMETH_CAST(meth_wxGridCellEditor_BeginEdit), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxGridCellEditor_BeginEdit)},
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxGridCellEditor_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxGridCellEditor_Clone)},
    {SIP_MLNAME_CAST(sipName_Create), SIP_MLMETH_CAST(meth_wxGridCellEditor_Create), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxGridCellEditor_Create)},
    {SIP_MLNAME_CAST(sipName_Destroy), meth_wxGridCellEditor_Destroy, METH_VARARGS, SIP_MLDOC_CAST(doc_wxGridCellEditor_Destroy)},
    {SIP_MLNAME_CAST(sipName_EndEdit), SIP_MLMETH_CAST(meth_wxGridCellEditor_EndEdit), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxGridCellEditor_EndEdit)},
    {SIP_MLNAME_CAST(sipName_GetControl), meth_wxGridCellEditor_GetControl, METH_VARARGS, SIP_MLDOC_CAST(doc_wxGridCellEditor_GetControl)},
    {SIP_MLNAME_CAST(sipName_GetValue), meth_wxGridCellEditor_GetValue, METH_VARARGS, SIP_MLDOC_CAST(doc_wxGridCellEditor_GetValue)},
    {SIP_MLNAME_CAST(sipName_HandleReturn), SIP_MLMETH_CAST(meth_wxGridCellEditor_HandleReturn), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxGridCellEditor_HandleReturn)},
    {SIP_MLNAME_CAST(sipName_IsCreated), meth_wxGridCellEditor_IsCreated, METH_VARARGS, SIP_MLDOC_CAST(doc_wxGridCellEditor_IsCreated)},
    {SIP_MLNAME_CAST(sipName_PaintBackground), SIP_MLMETH_CAST(meth_wxGridCellEditor_PaintBackground), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxGridCellEditor_PaintBackground)},
    {SIP_MLNAME_CAST(sipName_Reset), meth_wxGridCellEditor_Reset, METH_VARARGS, SIP_MLDOC_CAST(doc_wxGridCellEditor_Reset)},
    {SIP_MLNAME_CAST(sipName_SetControl), SIP_MLMETH_CAST(meth_wxGridCellEditor_SetControl), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxGridCellEditor_SetControl)},
    {SIP_MLNAME_CAST(sipName_SetSize), SIP_MLMETH_CAST(meth_wxGridCellEditor_SetSize), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxGridCellEditor_SetSize)},
    {SIP_MLNAME_CAST(sipName_Show), SIP_MLMETH_CAST(meth_wxGridCellEditor_Show), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxGridCellEditor_Show)},
    {SIP_MLNAME_CAST(sipName_StartingClick), meth_wxGridCellEditor_StartingClick, METH_VARARGS, SIP_MLDOC_CAST(doc_wxGridCellEditor_StartingClick)},
    {SIP_MLNAME_CAST(sipName_StartingKey), SIP_MLMETH_CAST(meth_wxGridCellEditor_StartingKey), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxGridCellEditor_StartingKey)}
};

sipVariableDef variables_wxGridCellEditor[] = {
    {PropertyVariable, sipName_Value, &methods_wxGridCellEditor[7], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Control, &methods_wxGridCellEditor[6], &methods_wxGridCellEditor[12], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxGridCellEditor, "GridCellEditor()\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},
        17, methods_wxGridCellEditor,
        0, SIP_NULLPTR,
        2, 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,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxGridCellEditor,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxGridCellEditor,
    cast_wxGridCellEditor,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
