void WayPointman::SetColorScheme( ColorScheme cs ) { ProcessIcons( g_StyleManager->GetCurrentStyle() ); // Iterate on the RoutePoint list, requiring each to reload icon wxRoutePointListNode *node = m_pWayPointList->GetFirst(); while( node ) { RoutePoint *pr = node->GetData(); pr->ReLoadIcon(); node = node->GetNext(); } }
WayPointman::WayPointman() { m_pWayPointList = new RoutePointList; pmarkicon_image_list = NULL; ocpnStyle::Style* style = g_StyleManager->GetCurrentStyle(); m_pIconArray = new wxArrayPtrVoid(); ProcessIcons( style ); // Load user defined icons. wxString UserIconPath = g_PrivateDataDir; wxChar sep = wxFileName::GetPathSeparator(); if( UserIconPath.Last() != sep ) UserIconPath.Append( sep ); UserIconPath.Append( _T("UserIcons") ); if( wxDir::Exists( UserIconPath ) ) { wxArrayString FileList; wxDir dir( UserIconPath ); int n_files = dir.GetAllFiles( UserIconPath, &FileList ); for( int ifile = 0; ifile < n_files; ifile++ ) { wxString name = FileList.Item( ifile ); wxFileName fn( name ); wxString iconname = fn.GetName(); wxBitmap icon1; if( fn.GetExt().Lower() == _T("xpm") ) { if( icon1.LoadFile( name, wxBITMAP_TYPE_XPM ) ) { ProcessIcon( icon1, iconname, iconname ); } } if( fn.GetExt().Lower() == _T("png") ) { if( icon1.LoadFile( name, wxBITMAP_TYPE_PNG ) ) { ProcessIcon( icon1, iconname, iconname ); } } } } m_nGUID = 0; }
PointMan::PointMan() { m_pODPointList = new ODPointList; pmarkicon_image_list = NULL; //ocpnStyle::Style* style = g_ODStyleManager->GetCurrentStyle(); m_pIconArray = new wxArrayPtrVoid(); ProcessIcons(); m_pFontEnumerator = new wxFontEnumerator(); m_pFontEnumerator->EnumerateFacenames(); m_wxasFontFacenames = wxFontEnumerator::GetFacenames(); m_nGUID = 0; }