/** Helper for loading icons by name. */ IconNode *LoadNamedIconHelper(const char *name, const char *path, char save) { IconNode *result; char *temp; temp = AllocateStack(strlen(name) + strlen(path) + 1); strcpy(temp, path); strcat(temp, name); result = CreateIconFromFile(temp, save); ReleaseStack(temp); return result; }
/*! * Initialisation for tracelogApp */ bool tracelogApp::OnInit() { // Win: Don't remap bitmaps to system colors wxSystemOptions::SetOption(wxT("msw.remap"), 0); // WinXP: Don't draw themed gradients on notebook pages wxSystemOptions::SetOption(wxT("msw.notebook.themed-background"), 0); // Call to base class needed for initializing command line processing if (!wxApp::OnInit()) return false; wxFileSystem::AddHandler(new wxZipFSHandler); wxFileSystem::AddHandler(new wxMemoryFSHandler); wxInitAllImageHandlers(); wxBitmap::InitStandardHandlers(); wxXmlResource::Get()->InitAllHandlers(); const unsigned char *resptr = get_mem_res(); wxMemoryFSHandler::AddFileWithMimeType(wxT("memrsc"), resptr, cnt_mem_res, wxT("application/zip")); { // The following code eliminates a stupid error dialog which shows up // if some .desktop entires (in KDE or GNOME applink dirs) are dangling symlinks. wxLogNull lognull; wxTheMimeTypesManager->GetFileTypeFromExtension(wxT("zip")); } free_mem_res(resptr); m_sResourcePrefix = wxT("memory:memrsc#zip:"); if (!wxXmlResource::Get()->Load(m_sResourcePrefix + wxT("res/tracelog.xrc"))) return false; m_pGrabber = new DebugStringGrabber(); if (!m_pGrabber->IsOk()) return false; m_pLogFrame = new TraceLogFrame(NULL); SetTopWindow(m_pLogFrame); Connect(wxEVT_DEBUGSTRING, wxCommandEventHandler(tracelogApp::OnDebugString)); m_pGrabber->SetHandler(this); m_pTaskBarIcon = new MyTaskBarIcon(); m_pTaskBarIcon->SetIcon(CreateIconFromFile(wxT("res/nx.png")), _("OpenNX")); SetExitOnFrameDelete(true); return true; }
/** Load an icon from a file. */ IconNode *LoadNamedIcon(const char *name, char save, char preserveAspect) { IconPathNode *ip; IconNode *icon; Assert(name); if(name[0] == '/') { return CreateIconFromFile(name, save, preserveAspect); } else { for(ip = iconPaths; ip; ip = ip->next) { icon = LoadNamedIconHelper(name, ip->path, save, preserveAspect); if(icon) { return icon; } } return NULL; } }
wxIcon SupressibleMessageDialog::GetIconResource( const wxString& name ) { // Icon retrieval return CreateIconFromFile(name); }
wxIcon TraceLogFrame::GetIconResource( const wxString& name ) { // Icon retrieval return CreateIconFromFile(name); }
wxIcon XdmPropertyDialog::GetIconResource( const wxString& name ) { // Icon retrieval return CreateIconFromFile(name); }
wxIcon SessionAdmin::GetIconResource( const wxString& name ) { // Icon retrieval return CreateIconFromFile(name); }
wxIcon VncImageSettingsDialog::GetIconResource( const wxString& name ) { // Icon retrieval return CreateIconFromFile(name); }
wxIcon ShareProperties::GetIconResource( const wxString& name ) { // Icon retrieval return CreateIconFromFile(name); }