예제 #1
0
wxsProject::~wxsProject()
{
    delete m_GUI;
    m_GUI = 0;

    for ( size_t i=m_Resources.Count(); i-->0; )
    {
        delete m_Resources[i];
        m_Resources[i] = 0;
    }
    m_Resources.Clear();

    wxsTree()->Delete(m_TreeItem);
    wxsTree()->Refresh();
}
예제 #2
0
wxsResourceItemId wxsProject::GetResourceTypeTreeId(const wxString& Name)
{
    if ( m_ResBrowserIds.find(Name) != m_ResBrowserIds.end() )
    {
        return m_ResBrowserIds[Name];
    }
    return m_ResBrowserIds[Name] = wxsTree()->AppendItem(m_TreeItem,Name,wxsResourceFactory::ResourceTreeIcon(Name));
}
예제 #3
0
void wxsResource::BuildTreeEntry(const wxsResourceItemId& Parent)
{
    m_TreeItemId = wxsTree()->AppendItem(
        Parent,
        GetResourceName(),
        OnGetTreeIcon(), OnGetTreeIcon(),
        new wxsResourceRootTreeItemData(this));
}
void wxsExtResManager::DeleteAll()
{
    m_ClosingAll = true;

    for ( FilesMapI i = m_Files.begin(); i!=m_Files.end(); ++i )
    {
        delete i->second;
    }
    m_Files.clear();
    wxsTree()->DeleteExternalResourcesId();

    m_ClosingAll = false;
}
예제 #5
0
wxsProject::wxsProject(cbProject* Project):
    m_Project(Project),
    m_GUI(0),
    m_UnknownConfig("unknown_config"),
    m_UnknownResources("unknown_resource"),
    m_WasModifiedDuringLoad(false)
{
    // Creating resource tree entery for this project
    m_TreeItem = wxsTree()->NewProjectItem(GetCBProject()->GetTitle(),this);

    // Building paths
    wxFileName PathBuilder(Project->GetFilename());
    m_ProjectPath = PathBuilder.GetPath(wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR);
}
예제 #6
0
wxsResource::~wxsResource()
{
    if ( m_Editor )
    {
        wxsEditor* EditorStore = m_Editor;
        m_Editor = 0;
        EditorStore->Close();
    }

    if ( m_TreeItemId.IsOk() )
    {
        wxsTree()->Delete(m_TreeItemId);
    }
}
bool wxsExtResManager::Open(const wxString& FileName)
{
    if ( m_Files.find(FileName) == m_Files.end() )
    {
        wxsResource* NewResource = wxsResourceFactory::BuildExternal(FileName);
        if ( !NewResource ) return false;
        NewResource->BuildTreeEntry(wxsTree()->ExternalResourcesId());
        m_Files[FileName] = NewResource;
        NewResource->EditOpen();
        return true;
    }

    m_Files[FileName]->EditOpen();
    return true;
}
void wxsExtResManager::EditorClosed(wxsResource* Res)
{
    if ( m_ClosingAll ) return;

    for ( FilesMapI i = m_Files.begin(); i!=m_Files.end(); ++i )
    {
        if ( i->second == Res )
        {
            m_Files.erase(i);
            // wxsResource dtor calls "wxsTree()->Delete(m_TreeItemId);" itself
            // no need to call it here, outside the class
            // (which will crash if following line is uncommented)
            //wxsTree()->Delete(Res->GetTreeItemId());
            delete Res;
            if ( m_Files.empty() )
            {
                wxsTree()->DeleteExternalResourcesId();
            }
            return;
        }
    }
}