Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

wxPGProperty * wxPropertyContainerMethods::CreatePropertyByClass ( const wxString &  classname,
const wxString &  label,
const wxString &  name 
) [static, inherited]

Constructs a property. Class used is given as the first string argument. It may be either normal property class name, such as "wxIntProperty" or a short one such as "Int".

Definition at line 11482 of file propgrid.cpp.

References wxPGPropertyClassInfo::m_constructor.

{
    wxPGHashMapS2P* cis =
        (wxPGHashMapS2P*) &wxPGGlobalVars->m_dictPropertyClassInfo;

    const wxString* pClassname = &classname;
    wxString s;

    // Translate to long name, if necessary
    if ( (pClassname->GetChar(0) != wxT('w') || pClassname->GetChar(1) != wxT('x')) &&
          pClassname->Find(wxT("Property")) < 0 )
    {
        if ( classname != wxT("Category") )
            s.Printf(wxT("wx%sProperty"),pClassname->c_str());
        else
            s = wxT("wxPropertyCategory");
        pClassname = &s;
    }

    wxPGHashMapS2P::iterator it;
    it = cis->find(*pClassname);

    if ( it != cis->end() )
    {
        wxPGPropertyClassInfo* pci = (wxPGPropertyClassInfo*) it->second;
        wxPGProperty* p = pci->m_constructor(label,name);
        return p;
    }
    wxLogError(wxT("No such property class: %s"),pClassname->c_str());
    return (wxPGProperty*) NULL;
}

Generated by  Doxygen 1.6.0   Back to index