Skip to content

Commit 6b46dcb

Browse files
committed
Add S63 plugin panel icon.
1 parent f1392e3 commit 6b46dcb

File tree

3 files changed

+85
-70
lines changed

3 files changed

+85
-70
lines changed

data/s63_panel_icon.png

6.57 KB
Loading

src/s63_pi.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,20 @@ s63_pi::s63_pi(void *ppimgr)
357357
// Create the PlugIn icons
358358
m_pplugin_icon = new wxBitmap(default_pi);
359359

360+
wxString dataLocn = GetPluginDataDir("s63_pi") + wxFileName::GetPathSeparator()
361+
+ _T("data") + wxFileName::GetPathSeparator();
362+
363+
wxImage panelIcon( dataLocn + _T("s63_panel_icon.png"));
364+
if(panelIcon.IsOk()){
365+
m_panelBitmap = wxBitmap(panelIcon);
366+
m_pplugin_icon = &m_panelBitmap;
367+
}
368+
else{
369+
wxLogMessage(_T(" s63 panel icon NOT loaded"));
370+
m_panelBitmap = wxBitmap(default_pi);
371+
m_pplugin_icon = &m_panelBitmap;
372+
}
373+
360374
g_pi = this; // Store a global handle to the PlugIn itself
361375

362376
m_event_handler = new s63_pi_event_handler(this);

src/s63_pi.h

+71-70
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ class s63_pi_event_handler : public wxEvtHandler
8181
void OnImportPermitClick( wxCommandEvent &event );
8282
void OnRemovePermitClick( wxCommandEvent &event );
8383
void OnImportCellsClick( wxCommandEvent &event );
84-
void OnSelectPermit( wxListEvent& event );
85-
void OnNewUserpermitClick( wxCommandEvent& event );
86-
void OnNewInstallpermitClick( wxCommandEvent& event );
84+
void OnSelectPermit( wxListEvent& event );
85+
void OnNewUserpermitClick( wxCommandEvent& event );
86+
void OnNewInstallpermitClick( wxCommandEvent& event );
8787
void OnImportCertClick( wxCommandEvent &event );
8888
void OnNewFPRClick( wxCommandEvent &event );
8989
void OncbLogClick( wxCommandEvent &event );
90-
90+
9191
s63_pi *m_parent;
9292
};
9393

@@ -97,7 +97,7 @@ class Catalog_Entry31
9797
public:
9898
Catalog_Entry31(){};
9999
~Catalog_Entry31(){};
100-
100+
101101
wxString m_filename;
102102
wxString m_comt;
103103
};
@@ -129,7 +129,7 @@ class s63_pi : public opencpn_plugin_116
129129
wxString GetLongDescription();
130130
bool RenderOverlay(wxDC &dc, PlugIn_ViewPort *vp);
131131
bool RenderGLOverlay(wxGLContext *pcontext, PlugIn_ViewPort *vp);
132-
132+
133133
wxArrayString GetDynamicChartClassNameArray();
134134

135135
void OnSetupOptions();
@@ -141,42 +141,43 @@ class s63_pi : public opencpn_plugin_116
141141
int ImportCells( void );
142142
int ImportCert( void );
143143
void Set_FPR();
144-
144+
145145
void EnablePermitRemoveButton(bool benable){ m_buttonRemovePermit->Enable(benable); }
146146
void GetNewUserpermit(void);
147147
void GetNewInstallpermit(void);
148-
148+
149149
bool SaveConfig( void );
150-
150+
151151
wxString GetCertificateDir();
152-
152+
153153
wxStaticText *m_up_text;
154154
wxStaticText *m_ip_text;
155155
wxStaticText *m_fpr_text;
156-
156+
157157
wxScrolledWindow *m_s63chartPanelWinTop;
158158
wxPanel *m_s63chartPanelWin;
159159
wxPanel *m_s63chartPanelKeys;
160160
wxNotebook *m_s63NB;
161-
161+
162162
private:
163163
wxString GetPermitDir();
164-
164+
165165
void CreateCatalog31(const wxString &file31);
166-
166+
167167
int ProcessCellPermit( wxString &permit, bool b_confirm_existing );
168168
int AuthenticateCell( const wxString & cell_file );
169-
169+
170170
bool LoadConfig( void );
171-
171+
172172
int pi_error( wxString msg );
173-
173+
174174
wxArrayString m_class_name_array;
175175

176176
wxBitmap *m_pplugin_icon;
177+
wxBitmap m_panelBitmap;
177178

178179
s63_pi_event_handler *m_event_handler;
179-
180+
180181
OCPNPermitList *m_permit_list;
181182
wxButton *m_buttonImportPermit;
182183
wxButton *m_buttonRemovePermit;
@@ -185,23 +186,23 @@ class s63_pi : public opencpn_plugin_116
185186
wxButton *m_buttonNewIP;
186187
wxButton *m_buttonNewFPR;
187188
wxCheckBox *m_cbLog;
188-
189+
189190
wxFileConfig *m_pconfig;
190191
wxString m_SelectPermit_dir;
191192

192193
wxString m_userpermit;
193-
194+
194195
std::vector<Catalog_Entry31 *> m_catalog;
195196
wxString m_last_enc_root_dir;
196-
197+
197198
OCPNCertificateList *m_cert_list;
198199
wxButton *m_buttonImportCert;
199-
200+
200201
bool m_bSSE26_shown;
201202
TexFont m_TexFontMessage;
202-
203-
204-
203+
204+
205+
205206
};
206207

207208

@@ -211,37 +212,37 @@ class S63ScreenLog : public wxWindow
211212
public:
212213
S63ScreenLog(wxWindow *parent);
213214
~S63ScreenLog();
214-
215+
215216
void LogMessage(wxString &s);
216217
void ClearLog(void);
217218
void ClearLogSeq(void){ m_nseq = 0; }
218-
219+
219220
void OnServerEvent(wxSocketEvent& event);
220221
void OnSocketEvent(wxSocketEvent& event);
221222
void OnSize( wxSizeEvent& event);
222-
223-
224-
private:
223+
224+
225+
private:
225226
wxTextCtrl *m_plogtc;
226227
unsigned int m_nseq;
227-
228+
228229
wxSocketServer *m_server;
229-
230+
230231
DECLARE_EVENT_TABLE()
231-
232+
232233
};
233234

234235
class S63ScreenLogContainer : public wxDialog
235236
{
236237
public:
237238
S63ScreenLogContainer(wxWindow *parent);
238239
~S63ScreenLogContainer();
239-
240+
240241
void LogMessage(wxString &s);
241242
void ClearLog(void);
242243
S63ScreenLog *m_slog;
243-
244-
private:
244+
245+
private:
245246
};
246247

247248

@@ -253,7 +254,7 @@ class OCPNPermitList : public wxListCtrl
253254
public:
254255
OCPNPermitList(wxWindow *parent);
255256
~OCPNPermitList();
256-
257+
257258
void BuildList( const wxString &permit_dir );
258259
wxArrayString m_permit_file_array;
259260
};
@@ -263,7 +264,7 @@ class OCPNCertificateList : public wxListCtrl
263264
public:
264265
OCPNCertificateList(wxWindow *parent);
265266
~OCPNCertificateList();
266-
267+
267268
void BuildList( const wxString &cert_dir );
268269
// wxArrayString m_permit_file_array;
269270
};
@@ -295,7 +296,7 @@ class GetUserpermitDialog: public wxDialog
295296
{
296297
DECLARE_DYNAMIC_CLASS( GetUserpermitDialog )
297298
DECLARE_EVENT_TABLE()
298-
299+
299300
public:
300301
/// Constructors
301302
GetUserpermitDialog( );
@@ -304,33 +305,33 @@ class GetUserpermitDialog: public wxDialog
304305
const wxPoint& pos = SYMBOL_GETUP_POSITION,
305306
const wxSize& size = SYMBOL_GETUP_SIZE,
306307
long style = SYMBOL_GETUP_STYLE );
307-
308+
308309
~GetUserpermitDialog();
309-
310+
310311
/// Creation
311312
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_GETUP_IDNAME,
312313
const wxString& caption = SYMBOL_GETUP_TITLE,
313314
const wxPoint& pos = SYMBOL_GETUP_POSITION,
314315
const wxSize& size = SYMBOL_GETUP_SIZE, long style = SYMBOL_GETUP_STYLE );
315-
316-
316+
317+
317318
void CreateControls();
318-
319+
319320
void OnCancelClick( wxCommandEvent& event );
320321
void OnOkClick( wxCommandEvent& event );
321322
void OnUpdated( wxCommandEvent& event );
322323
void OnTestClick( wxCommandEvent& event );
323-
324+
324325
/// Should we show tooltips?
325326
static bool ShowToolTips();
326-
327+
327328
wxTextCtrl* m_PermitCtl;
328329
wxButton* m_CancelButton;
329330
wxButton* m_OKButton;
330331
wxButton* m_testBtn;
331332
wxStaticText* m_TestResult;
332-
333-
333+
334+
334335
};
335336

336337
/*!
@@ -359,7 +360,7 @@ class GetInstallpermitDialog: public wxDialog
359360
{
360361
DECLARE_DYNAMIC_CLASS( GetInstallpermitDialog )
361362
DECLARE_EVENT_TABLE()
362-
363+
363364
public:
364365
/// Constructors
365366
GetInstallpermitDialog( );
@@ -368,63 +369,63 @@ class GetInstallpermitDialog: public wxDialog
368369
const wxPoint& pos = SYMBOL_GETIP_POSITION,
369370
const wxSize& size = SYMBOL_GETIP_SIZE,
370371
long style = SYMBOL_GETIP_STYLE );
371-
372+
372373
~GetInstallpermitDialog();
373-
374+
374375
/// Creation
375376
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_GETIP_IDNAME,
376377
const wxString& caption = SYMBOL_GETIP_TITLE,
377378
const wxPoint& pos = SYMBOL_GETIP_POSITION,
378379
const wxSize& size = SYMBOL_GETIP_SIZE, long style = SYMBOL_GETIP_STYLE );
379-
380-
380+
381+
381382
void CreateControls();
382-
383+
383384
void OnCancelClick( wxCommandEvent& event );
384385
void OnOkClick( wxCommandEvent& event );
385386
void OnUpdated( wxCommandEvent& event );
386387
void OnTestClick( wxCommandEvent& event );
387-
388+
388389
/// Should we show tooltips?
389390
static bool ShowToolTips();
390-
391+
391392
wxTextCtrl* m_PermitCtl;
392393
wxButton* m_CancelButton;
393394
wxButton* m_OKButton;
394395
wxButton* m_testBtn;
395396
wxStaticText* m_TestResult;
396-
397-
397+
398+
398399
};
399400

400401
class InfoWin: public wxWindow
401402
{
402403
public:
403404
InfoWin( wxWindow *parent, const wxString&s = _T(""), bool show_gauge = true );
404405
~InfoWin();
405-
406+
406407
void SetString(const wxString &s);
407408
const wxString& GetString(void) { return m_string; }
408-
409+
409410
void SetPosition( wxPoint pt ){ m_position = pt; }
410411
void SetWinSize( wxSize sz ){ m_size = sz; }
411412
void Realize( void );
412413
wxSize GetWinSize( void ){ return m_size; }
413414
void OnPaint( wxPaintEvent& event );
414415
void OnEraseBackground( wxEraseEvent& event );
415416
void OnTimer( wxTimerEvent& event );
416-
417+
417418
wxStaticText *m_pInfoTextCtl;
418419
wxGauge *m_pGauge;
419420
wxTimer m_timer;
420-
421+
421422
private:
422-
423+
423424
wxString m_string;
424425
wxSize m_size;
425426
wxPoint m_position;
426427
bool m_bGauge;
427-
428+
428429
DECLARE_EVENT_TABLE()
429430
};
430431

@@ -433,29 +434,29 @@ class InfoWinDialog: public wxDialog
433434
public:
434435
InfoWinDialog( wxWindow *parent, const wxString&s = _T(""), bool show_gauge = true );
435436
~InfoWinDialog();
436-
437+
437438
void SetString(const wxString &s);
438439
const wxString& GetString(void) { return m_string; }
439-
440+
440441
void SetPosition( wxPoint pt ){ m_position = pt; }
441442
void SetWinSize( wxSize sz ){ m_size = sz; }
442443
void Realize( void );
443444
wxSize GetWinSize( void ){ return m_size; }
444445
void OnPaint( wxPaintEvent& event );
445446
void OnEraseBackground( wxEraseEvent& event );
446447
void OnTimer( wxTimerEvent& event );
447-
448+
448449
wxStaticText *m_pInfoTextCtl;
449450
wxGauge *m_pGauge;
450451
wxTimer m_timer;
451-
452+
452453
private:
453-
454+
454455
wxString m_string;
455456
wxSize m_size;
456457
wxPoint m_position;
457458
bool m_bGauge;
458-
459+
459460
DECLARE_EVENT_TABLE()
460461
};
461462

0 commit comments

Comments
 (0)