Skip to content

Commit

Permalink
Merge pull request #341 from jongough/fixes_1.4
Browse files Browse the repository at this point in the history
Fixes 1.4
  • Loading branch information
jongough authored Jan 2, 2018
2 parents ec30439 + 6e4d09b commit 61de08c
Show file tree
Hide file tree
Showing 10 changed files with 372 additions and 153 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ SET(CPACK_PACKAGE_CONTACT "Jon Gough")

SET(VERSION_MAJOR "1")
SET(VERSION_MINOR "4")
SET(VERSION_PATCH "44")
SET(VERSION_DATE "30/12/2017")
SET(VERSION_PATCH "46")
SET(VERSION_DATE "03/01/2018")

SET(BUNDLE_DATA FALSE)
SET( CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build" )
Expand Down
177 changes: 174 additions & 3 deletions Forms/ODPropertiesDialog.fbp

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions Forms/ODPropertiesDialogDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,21 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c
m_choiceToolbar->SetSelection( 1 );
fgSizer4->Add( m_choiceToolbar, 0, wxALL, 5 );

m_staticTextConfigFileEntriesMsg = new wxStaticText( m_panelGeneral, wxID_ANY, _("Delete current OCPN_Draw config entries (No)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextConfigFileEntriesMsg->Wrap( -1 );
fgSizer4->Add( m_staticTextConfigFileEntriesMsg, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );

m_buttonConfigFileEntries = new wxButton( m_panelGeneral, wxID_ANY, _("Yes"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer4->Add( m_buttonConfigFileEntries, 0, wxALL, 5 );


bSizerGeneral->Add( fgSizer4, 1, wxEXPAND, 5 );


m_panelGeneral->SetSizer( bSizerGeneral );
m_panelGeneral->Layout();
bSizerGeneral->Fit( m_panelGeneral );
m_notebookProperties->AddPage( m_panelGeneral, _("General"), false );
m_notebookProperties->AddPage( m_panelGeneral, _("General"), true );
m_panelBoundary = new wxPanel( m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizerBoundarySettings;
fgSizerBoundarySettings = new wxFlexGridSizer( 0, 1, 0, 0 );
Expand Down Expand Up @@ -605,7 +612,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c
m_panelEBL->SetSizer( m_fgSizerEBLSettings );
m_panelEBL->Layout();
m_fgSizerEBLSettings->Fit( m_panelEBL );
m_notebookProperties->AddPage( m_panelEBL, _("EBL"), true );
m_notebookProperties->AddPage( m_panelEBL, _("EBL"), false );
m_panelDR = new wxPanel( m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizerDRSettings;
fgSizerDRSettings = new wxFlexGridSizer( 0, 1, 0, 0 );
Expand Down Expand Up @@ -1400,6 +1407,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c
this->Layout();

// Connect Events
m_buttonConfigFileEntries->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnClickConfigFileEntries ), NULL, this );
m_buttonTextFont->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnButtonClickFonts ), NULL, this );
m_checkBoxRotateWithBoat->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLRotateWithBoat ), NULL, this );
m_checkBoxEBLFixedEndPosition->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLFixedEndPosition ), NULL, this );
Expand All @@ -1413,6 +1421,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c
ODPropertiesDialogDef::~ODPropertiesDialogDef()
{
// Disconnect Events
m_buttonConfigFileEntries->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnClickConfigFileEntries ), NULL, this );
m_buttonTextFont->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnButtonClickFonts ), NULL, this );
m_checkBoxRotateWithBoat->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLRotateWithBoat ), NULL, this );
m_checkBoxEBLFixedEndPosition->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLFixedEndPosition ), NULL, this );
Expand Down
7 changes: 5 additions & 2 deletions Forms/ODPropertiesDialogDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <wx/spinctrl.h>
#include <wx/slider.h>
#include <wx/choice.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/panel.h>
#include <wx/bitmap.h>
Expand All @@ -30,7 +31,6 @@
#include <wx/radiobox.h>
#include <wx/textctrl.h>
#include <wx/bmpcbox.h>
#include <wx/button.h>
#include <wx/grid.h>
#include <wx/notebook.h>
#include <wx/dialog.h>
Expand Down Expand Up @@ -61,6 +61,8 @@ class ODPropertiesDialogDef : public wxDialog
wxStaticText* m_staticTextInitialEdgePan;
wxSlider* m_sliderInitialEdgePan;
wxStaticText* m_staticTextToolbar;
wxStaticText* m_staticTextConfigFileEntriesMsg;
wxButton* m_buttonConfigFileEntries;
wxPanel* m_panelBoundary;
wxStaticText* m_staticTextActiveBoundayLineColour;
wxColourPickerCtrl* m_colourPickerActiveBoundaryLineColour;
Expand Down Expand Up @@ -281,6 +283,7 @@ class ODPropertiesDialogDef : public wxDialog
wxButton* m_buttonApply;

// Virtual event handlers, overide them in your derived class
virtual void OnClickConfigFileEntries( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonClickFonts( wxCommandEvent& event ) { event.Skip(); }
virtual void OnEBLRotateWithBoat( wxCommandEvent& event ) { event.Skip(); }
virtual void OnEBLFixedEndPosition( wxCommandEvent& event ) { event.Skip(); }
Expand All @@ -294,7 +297,7 @@ class ODPropertiesDialogDef : public wxDialog
wxChoice* m_choiceToolbar;
wxGrid* m_gridODWDInteractions;

ODPropertiesDialogDef( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("OCPN Draw Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 591,607 ), long style = wxDEFAULT_DIALOG_STYLE );
ODPropertiesDialogDef( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("OCPN Draw Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 591,607 ), long style = wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP );
~ODPropertiesDialogDef();

};
Expand Down
7 changes: 5 additions & 2 deletions include/ODPropertiesDialogDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <wx/spinctrl.h>
#include <wx/slider.h>
#include <wx/choice.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/panel.h>
#include <wx/bitmap.h>
Expand All @@ -30,7 +31,6 @@
#include <wx/radiobox.h>
#include <wx/textctrl.h>
#include <wx/bmpcbox.h>
#include <wx/button.h>
#include <wx/grid.h>
#include <wx/notebook.h>
#include <wx/dialog.h>
Expand Down Expand Up @@ -61,6 +61,8 @@ class ODPropertiesDialogDef : public wxDialog
wxStaticText* m_staticTextInitialEdgePan;
wxSlider* m_sliderInitialEdgePan;
wxStaticText* m_staticTextToolbar;
wxStaticText* m_staticTextConfigFileEntriesMsg;
wxButton* m_buttonConfigFileEntries;
wxPanel* m_panelBoundary;
wxStaticText* m_staticTextActiveBoundayLineColour;
wxColourPickerCtrl* m_colourPickerActiveBoundaryLineColour;
Expand Down Expand Up @@ -281,6 +283,7 @@ class ODPropertiesDialogDef : public wxDialog
wxButton* m_buttonApply;

// Virtual event handlers, overide them in your derived class
virtual void OnClickConfigFileEntries( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonClickFonts( wxCommandEvent& event ) { event.Skip(); }
virtual void OnEBLRotateWithBoat( wxCommandEvent& event ) { event.Skip(); }
virtual void OnEBLFixedEndPosition( wxCommandEvent& event ) { event.Skip(); }
Expand All @@ -294,7 +297,7 @@ class ODPropertiesDialogDef : public wxDialog
wxChoice* m_choiceToolbar;
wxGrid* m_gridODWDInteractions;

ODPropertiesDialogDef( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("OCPN Draw Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 591,607 ), long style = wxDEFAULT_DIALOG_STYLE );
ODPropertiesDialogDef( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("OCPN Draw Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 591,607 ), long style = wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP );
~ODPropertiesDialogDef();

};
Expand Down
2 changes: 1 addition & 1 deletion include/ODPropertiesDialogImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class ODPropertiesDialogImpl : public ODPropertiesDialogDef
{
protected:
// Handlers for ODPropertiesForm events.
void OnClickConfigFileEntries( wxCommandEvent& event );
void OnODPointComboboxSelected( wxCommandEvent& event );
void OnTextPointIconComboboxSelected( wxCommandEvent& event );
void OnEBLEndIconComboboxSelected( wxCommandEvent& event );
Expand Down Expand Up @@ -93,7 +94,6 @@ class ODPropertiesDialogImpl : public ODPropertiesDialogDef
int m_iCOGValidator;
wxColour m_cRed;
wxColour m_cGreen;

};

#endif // __ODPropertiesDialogImpl__
5 changes: 3 additions & 2 deletions include/ocpn_draw_pi.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ class ocpn_draw_pi : public opencpn_plugin_113
void ProcessTimerEvent(wxTimerEvent& ev);
void PopupMenuHandler(wxCommandEvent& ev);

void SaveConfig();
void SaveConfig( void );

void AlphaBlending( ODDC &dc, int x, int y, int size_x, int size_y, float radius, wxColour color, unsigned char transparency );

Expand Down Expand Up @@ -460,7 +460,8 @@ class ocpn_draw_pi : public opencpn_plugin_113
double m_view_scale;

ODicons *m_pODicons;


bool m_bRecreateConfig;

private:
void OnTimer(wxTimerEvent& ev);
Expand Down
13 changes: 11 additions & 2 deletions src/ODPropertiesDialogDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,21 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c
m_choiceToolbar->SetSelection( 1 );
fgSizer4->Add( m_choiceToolbar, 0, wxALL, 5 );

m_staticTextConfigFileEntriesMsg = new wxStaticText( m_panelGeneral, wxID_ANY, _("Delete current OCPN_Draw config entries (No)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextConfigFileEntriesMsg->Wrap( -1 );
fgSizer4->Add( m_staticTextConfigFileEntriesMsg, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );

m_buttonConfigFileEntries = new wxButton( m_panelGeneral, wxID_ANY, _("Yes"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer4->Add( m_buttonConfigFileEntries, 0, wxALL, 5 );


bSizerGeneral->Add( fgSizer4, 1, wxEXPAND, 5 );


m_panelGeneral->SetSizer( bSizerGeneral );
m_panelGeneral->Layout();
bSizerGeneral->Fit( m_panelGeneral );
m_notebookProperties->AddPage( m_panelGeneral, _("General"), false );
m_notebookProperties->AddPage( m_panelGeneral, _("General"), true );
m_panelBoundary = new wxPanel( m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizerBoundarySettings;
fgSizerBoundarySettings = new wxFlexGridSizer( 0, 1, 0, 0 );
Expand Down Expand Up @@ -605,7 +612,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c
m_panelEBL->SetSizer( m_fgSizerEBLSettings );
m_panelEBL->Layout();
m_fgSizerEBLSettings->Fit( m_panelEBL );
m_notebookProperties->AddPage( m_panelEBL, _("EBL"), true );
m_notebookProperties->AddPage( m_panelEBL, _("EBL"), false );
m_panelDR = new wxPanel( m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizerDRSettings;
fgSizerDRSettings = new wxFlexGridSizer( 0, 1, 0, 0 );
Expand Down Expand Up @@ -1400,6 +1407,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c
this->Layout();

// Connect Events
m_buttonConfigFileEntries->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnClickConfigFileEntries ), NULL, this );
m_buttonTextFont->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnButtonClickFonts ), NULL, this );
m_checkBoxRotateWithBoat->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLRotateWithBoat ), NULL, this );
m_checkBoxEBLFixedEndPosition->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLFixedEndPosition ), NULL, this );
Expand All @@ -1413,6 +1421,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c
ODPropertiesDialogDef::~ODPropertiesDialogDef()
{
// Disconnect Events
m_buttonConfigFileEntries->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnClickConfigFileEntries ), NULL, this );
m_buttonTextFont->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnButtonClickFonts ), NULL, this );
m_checkBoxRotateWithBoat->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLRotateWithBoat ), NULL, this );
m_checkBoxEBLFixedEndPosition->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLFixedEndPosition ), NULL, this );
Expand Down
20 changes: 19 additions & 1 deletion src/ODPropertiesDialogImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,8 +1014,13 @@ void ODPropertiesDialogImpl::UpdateProperties( void )
m_textCtrlDRPointInterval->SetValue( wxString::Format( _T("%.3f"), g_dDRPointInterval ) );


if(g_ocpn_draw_pi->m_bRecreateConfig) {
m_buttonConfigFileEntries->SetLabel(_("No"));
m_staticTextConfigFileEntriesMsg->SetLabel("Delete current OCPN_Draw config entries (Yes)");
}

SetDialogSize();

ResetGlobalLocale();

return;
Expand Down Expand Up @@ -1053,3 +1058,16 @@ void ODPropertiesDialogImpl::SetTableCellBackgroundColours()

return;
}

void ODPropertiesDialogImpl::OnClickConfigFileEntries( wxCommandEvent& event )
{
if(!g_ocpn_draw_pi->m_bRecreateConfig) {
g_ocpn_draw_pi->m_bRecreateConfig = true;
m_buttonConfigFileEntries->SetLabel(_("No"));
m_staticTextConfigFileEntriesMsg->SetLabel("Delete current OCPN_Draw config entries (Yes)");
} else {
g_ocpn_draw_pi->m_bRecreateConfig = false;
m_buttonConfigFileEntries->SetLabel(_("Yes"));
m_staticTextConfigFileEntriesMsg->SetLabel("Delete current OCPN_Draw config entries (No)");
}
}
Loading

0 comments on commit 61de08c

Please sign in to comment.