Example #1
0
//     void SetUmask(int mode );
static int LUACALL wxLua_wxFileConfig_SetUmask(lua_State *L)
{
    // int mode
    int mode = (int)wxlua_getintegertype(L, 2);
    // get this
    wxFileConfig * self = (wxFileConfig *)wxluaT_getuserdatatype(L, 1, wxluatype_wxFileConfig);
    // call SetUmask
    self->SetUmask(mode);

    return 0;
}
Example #2
0
// %override wxLua_wxConfigBase_GetNextGroup
// bool GetNextGroup(wxString& str, long& index) const
static int LUACALL wxLua_wxConfigBase_GetNextGroup(lua_State *L)
{
    // only the number is needed
    long     index = (long)wxlua_getintegertype(L, 2);
    wxString str;
    // get this
    wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase);
    // call GetNextGroup
    bool returns = self->GetNextGroup(str, index);
    // push the result number
    lua_pushboolean(L, returns);
    // push the next result string
    wxlua_pushwxString(L, str);
    // push the next index
    lua_pushnumber(L, index);
    // return the number of parameters
    return 3;
}
Example #3
0
// %override wxLua_wxConfigBase_GetFirstGroup
// bool GetFirstGroup(wxString& str, long& index) const
static int LUACALL wxLua_wxConfigBase_GetFirstGroup(lua_State *L)
{
    // get number of arguments
    int argCount = lua_gettop(L);
    // these are optional and are not used anyway
    long     index = (argCount >= 3 ? (long)wxlua_getintegertype(L, 3) : 0);
    wxString str   = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxEmptyString));
    // get this
    wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase);
    // call GetFirstGroup
    bool returns = self->GetFirstGroup(str, index);
    // push the result number
    lua_pushboolean(L, returns);
    // push the result string
    wxlua_pushwxString(L, str);
    // push the next index
    lua_pushnumber(L, index);
    // return the number of parameters
    return 3;
}
Example #4
0
// %override wxLua_wxTextValidator_constructor
// wxTextValidator(long style = wxFILTER_NONE, wxString *valPtr = NULL)
static int LUACALL wxLua_wxTextValidator_constructor(lua_State *L)
{
    wxTextValidator *returns;
    // get number of arguments
    int argCount = lua_gettop(L);
    // long style = wxFILTER_NONE
    long style = (argCount >= 1 ? (long)wxlua_getintegertype(L, 1) : wxFILTER_NONE);

    // call constructor
    if (argCount >= 2)
    {
        wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 2, wxluatype_wxLuaObject);
        returns = new wxTextValidator(style, valPtr->GetStringPtr(L));
    }
    else
        returns = new wxTextValidator(style);

    // push the constructed class pointer
    wxluaT_pushuserdatatype(L, returns, wxluatype_wxTextValidator);
    // return the number of parameters
    return 1;
}
Example #5
0
//     wxFileConfig(const wxString& appName = "", const wxString& vendorName = "", const wxString& localFilename = "", const wxString& globalFilename = "", long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE); //, wxMBConv& conv = wxConvUTF8 );
static int LUACALL wxLua_wxFileConfig_constructor(lua_State *L)
{
    // get number of arguments
    int argCount = lua_gettop(L);
    // long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE
    long style = (argCount >= 5 ? (long)wxlua_getintegertype(L, 5) : wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE);
    // const wxString globalFilename = ""
    const wxString globalFilename = (argCount >= 4 ? wxlua_getwxStringtype(L, 4) : wxString(wxEmptyString));
    // const wxString localFilename = ""
    const wxString localFilename = (argCount >= 3 ? wxlua_getwxStringtype(L, 3) : wxString(wxEmptyString));
    // const wxString vendorName = ""
    const wxString vendorName = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxEmptyString));
    // const wxString appName = ""
    const wxString appName = (argCount >= 1 ? wxlua_getwxStringtype(L, 1) : wxString(wxEmptyString));
    // call constructor
    wxFileConfig* returns = new wxFileConfig(appName, vendorName, localFilename, globalFilename, style);
    // add to tracked memory list
    wxluaO_addgcobject(L, returns, wxluatype_wxFileConfig);
    // push the constructed class pointer
    wxluaT_pushuserdatatype(L, returns, wxluatype_wxFileConfig);

    return 1;
}