Permalink
Browse files

Merge branch 'Dave' of git://github.com/JesperWe/OpenCPN

  • Loading branch information...
ktec committed Jun 20, 2012
2 parents aa3bb0e + eec467a commit 5dbc5004a4eebda824235983bb47102914150f7b
View
@@ -275,6 +275,9 @@ class ChartCanvas: public wxWindow
bool PurgeGLCanvasChartCache(ChartBase *pc);
void RemovePointFromRoute( RoutePoint* point, Route* route );
private:
ViewPort VPoint;
void PositionConsole(void);
@@ -33,6 +33,10 @@ enum {
SORT_ON_NAME
};
enum TrackContextMenu {
TRACK_MERGE = 1,
TRACK_COPY_TEXT
};
class wxButton;
class Route;
@@ -51,6 +55,8 @@ class RouteManagerDialog : public wxDialog {
void UpdateWptListCtrl(RoutePoint *rp_select = NULL, bool b_retain_sort = false);
void UpdateLayListCtrl();
void OnTabSwitch(wxNotebookEvent& event);
static void RouteManagerDialog::WptShowPropertiesDialog( RoutePoint* wp, wxWindow* parent );
private:
void Create();
View
@@ -79,12 +79,16 @@ class HyperlinkList;
#define ID_ROUTEPROP_OK 7007
#define ID_ROUTEPROP_SPLIT 7107
#define ID_ROUTEPROP_EXTEND 7207
#define ID_ROUTEPROP_COPYTXT 7307
#define ID_PLANSPEEDCTL 7008
#define ID_TEXTCTRL4 7009
#define ID_TEXTCTRLDESC 7010
#define ID_STARTTIMECTL 7011
#define ID_TIMEZONESEL 7012
#define ID_TRACKLISTCTRL 7013
#define ID_RCLK_MENU_COPY_TEXT 7014
#define ID_RCLK_MENU_EDIT_WP 7015
#define ID_RCLK_MENU_DELETE 7016
#define ID_MARKPROP 8000
#define SYMBOL_MARKPROP_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
@@ -151,6 +155,9 @@ class RouteProp: public wxDialog
void OnRoutepropListClick( wxListEvent& event );
void OnRoutepropSplitClick( wxCommandEvent& event );
void OnRoutepropExtendClick( wxCommandEvent& event );
void OnRoutepropCopyTxtClick( wxCommandEvent& event );
void OnRoutePropRightClick( wxListEvent &event );
void OnRoutePropMenuSelected( wxCommandEvent &event );
bool IsThisRouteExtendable();
bool IsThisTrackExtendable();
void OnEvtColDragEnd(wxListEvent& event);
@@ -184,6 +191,7 @@ class RouteProp: public wxDialog
wxButton* m_CancelButton;
wxButton* m_OKButton;
wxButton* m_CopyTxtButton;
wxButton* m_ExtendButton;
wxButton* m_SplitButton;
@@ -242,10 +250,10 @@ class LatLonTextCtrl: public wxTextCtrl
///////////////////////////////////////////////////////////////////////////////
/// Class MarkInfoDef
///////////////////////////////////////////////////////////////////////////////
class MarkInfoDef : public wxDialog
class MarkInfoDef : public wxDialog
{
private:
protected:
wxNotebook* m_notebookProperties;
wxPanel* m_panelBasicProperties;
@@ -282,7 +290,7 @@ class MarkInfoDef : public wxDialog
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnPositionCtlUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDescChangedBasic( wxCommandEvent& event ) { event.Skip(); }
@@ -294,18 +302,18 @@ class MarkInfoDef : public wxDialog
virtual void OnDescChangedExt( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMarkInfoCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMarkInfoOKClick( wxCommandEvent& event ) { event.Skip(); }
public:
MarkInfoDef( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Mark Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 450,550 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER );
MarkInfoDef( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Mark Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 450,550 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER );
~MarkInfoDef();
void m_hyperlink17OnContextMenu( wxMouseEvent &event )
{
m_hyperlink17->PopupMenu( m_menuLink, event.GetPosition() );
}
};
///////////////////////////////////////////////////////////////////////////////
@@ -314,28 +322,28 @@ class MarkInfoDef : public wxDialog
class LinkPropDlgDef : public wxDialog
{
private:
protected:
wxStaticText* m_staticTextLinkDesc;
wxStaticText* m_staticTextLinkUrl;
wxButton* m_buttonBrowseLocal;
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnLocalFileClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxTextCtrl* m_textCtrlLinkDescription;
wxTextCtrl* m_textCtrlLinkUrl;
LinkPropDlgDef( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Link Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 468,247 ), long style = wxDEFAULT_DIALOG_STYLE );
~LinkPropDlgDef();
};
class MarkInfoImpl : public MarkInfoDef
View
@@ -41,7 +41,9 @@ enum StyleToolIconTypes
TOOLICON_ACTIVE
};
void bmdump( wxBitmap bm, wxString name );
wxBitmap MergeBitmaps( wxBitmap back, wxBitmap front, wxSize offset );
wxBitmap ConvertTo24Bit( wxColor bgColor, wxBitmap front );
namespace ocpnStyle {
@@ -128,6 +130,7 @@ class Style {
wxBitmap SetBitmapBrightness( wxBitmap& bitmap );
void SetOrientation( long orient );
int GetOrientation();
void SetColorScheme( ColorScheme cs );
void Unload();
View
@@ -180,9 +180,9 @@
<icon name="CompassRoseBlue">
<icon-location x="620" y="60"/>
</icon>
<icon name="polyconic">
<icon-location x="740" y="20"/>
<size x="9" y="13"/>
<icon name="polyprj">
<icon-location x="280" y="160"/>
<size x="13" y="13"/>
</icon>
<icon name="grabber">
<icon-location x="700" y="60"/>
@@ -201,12 +201,12 @@
<size x="" y=""/>
</icon>
<icon name="tmercprj">
<icon-location x="140" y="100"/>
<icon-location x="100" y="100"/>
<size x="13" y="13"/>
</icon>
<icon name="skewprj">
<icon-location x="180" y="100"/>
<size x="13" y="13"/>
<icon-location x="140" y="100"/>
<size x="13" y="12"/>
</icon>
<icon name="sort_asc">
<icon-location x="220" y="100"/>
@@ -606,9 +606,9 @@
<icon name="CompassRoseBlue">
<icon-location x="620" y="60"/>
</icon>
<icon name="polyconic">
<icon-location x="740" y="20"/>
<size x="9" y="13"/>
<icon name="polyprj">
<icon-location x="280" y="160"/>
<size x="13" y="13"/>
</icon>
<icon name="grabber">
<icon-location x="700" y="60"/>
@@ -627,12 +627,12 @@
<size x="" y=""/>
</icon>
<icon name="tmercprj">
<icon-location x="140" y="100"/>
<icon-location x="100" y="100"/>
<size x="13" y="13"/>
</icon>
<icon name="skewprj">
<icon-location x="180" y="100"/>
<size x="13" y="13"/>
<icon-location x="140" y="100"/>
<size x="13" y="12"/>
</icon>
<icon name="sort_asc">
<icon-location x="220" y="100"/>
@@ -1037,7 +1037,7 @@
<icon name="CompassRoseBlue">
<icon-location x="620" y="60"/>
</icon>
<icon name="polyconic">
<icon name="polyprj">
<icon-location x="740" y="20"/>
<size x="9" y="13"/>
</icon>
@@ -1058,11 +1058,11 @@
<size x="" y=""/>
</icon>
<icon name="tmercprj">
<icon-location x="140" y="100"/>
<icon-location x="100" y="100"/>
<size x="13" y="13"/>
</icon>
<icon name="skewprj">
<icon-location x="180" y="100"/>
<icon-location x="140" y="100"/>
<size x="13" y="13"/>
</icon>
<icon name="sort_asc">
Binary file not shown.
Binary file not shown.
View
@@ -635,7 +635,6 @@ void SetSystemColors( ColorScheme cs );
//------------------------------------------------------------------------------
// PNG Icon resources
//------------------------------------------------------------------------------
wxBitmap *_img_polyprj;
#ifdef __WXGTK__
#include "bitmaps/opencpn.xpm"
@@ -2111,8 +2110,6 @@ MyFrame::MyFrame( wxFrame *frame, const wxString& title, const wxPoint& pos, con
m_ulLastNEMATicktime = 0;
m_pStatusBar = NULL;
// g_FloatingCompassDialog = new ocpnFloatingCompassWindow(this);
g_toolbar = NULL;
m_toolbar_scale_tools_shown = false;
@@ -2988,11 +2985,17 @@ void MyFrame::DoSetSize( void )
#ifdef __WXMAC__
font_size = wxMax(10, font_size); // beats me...
#endif
wxFont* templateFont = pFontMgr->GetFont( _("StatusBar"), 11 );
font_size += templateFont->GetPointSize() - 11;
font_size = wxMin( font_size, 11 );
font_size = wxMax( font_size, 5 );
wxFont *pstat_font = wxTheFontList->FindOrCreateFont( font_size, wxFONTFAMILY_DEFAULT,
wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD );
wxFont *pstat_font = wxTheFontList->FindOrCreateFont( font_size,
wxFONTFAMILY_SWISS, templateFont->GetStyle(), templateFont->GetWeight(), false,
templateFont->GetFaceName() );
m_pStatusBar->SetFont( *pstat_font );
}
View
@@ -4249,11 +4249,17 @@ void ChartCanvas::OnRouteLegPopupTimerEvent( wxTimerEvent& event )
DistanceBearingMercator( segShow_point_b->m_lat, segShow_point_b->m_lon,
segShow_point_a->m_lat, segShow_point_a->m_lon, &brg, &dist );
wxString totLen;
totLen.Printf(_T("%5.1f"), pr->m_route_length);
s.Append( _("Route: ") );
if( pr->m_RouteNameString.IsEmpty() ) s.Append( _("(unnamed)") );
else
s.Append( pr->m_RouteNameString );
s.Append( _("\n") );
s.Append( _T("\n") );
s.Append( _("Total Lenght: ") );
s.Append( totLen );
s.Append( _T("\n") );
s.Append( _("Leg: from ") );
s.Append( segShow_point_a->GetName() );
s.Append( _(" to ") );
@@ -7897,7 +7903,7 @@ void ChartCanvas::CanvasPopupMenu( int x, int y, int seltype )
#endif
if( seltype & SELTYPE_TRACKSEGMENT ) {
pdef_menu->Append( ID_TK_MENU_PROPERTIES, _( "Track Properties" ) );
pdef_menu->Append( ID_TK_MENU_PROPERTIES, _( "Track Properties..." ) );
pdef_menu->Append( ID_TK_MENU_DELETE, _( "Delete Track" ) );
pdef_menu->AppendSeparator();
@@ -7910,7 +7916,7 @@ void ChartCanvas::CanvasPopupMenu( int x, int y, int seltype )
pdef_menu->Append( ID_RT_MENU_APPEND, _( "Append Waypoint" ) );
pdef_menu->Append( ID_RT_MENU_DELETE, _( "Delete Route" ) );
pdef_menu->Append( ID_RT_MENU_REVERSE, _( "Reverse Route" ) );
pdef_menu->Append( ID_RT_MENU_PROPERTIES, _( "Route Properties" ) );
pdef_menu->Append( ID_RT_MENU_PROPERTIES, _( "Route Properties..." ) );
if( m_pSelectedRoute ) {
pdef_menu->Enable( ID_RT_MENU_ACTIVATE, !m_pSelectedRoute->m_bRtIsActive );
@@ -8181,6 +8187,28 @@ void ChartCanvas::ShowObjectQueryWindow( int x, int y, float zlat, float zlon )
}
}
void ChartCanvas::RemovePointFromRoute( RoutePoint* point, Route* route ) {
// Rebuild the route selectables
pSelect->DeleteAllSelectableRoutePoints( route );
pSelect->DeleteAllSelectableRouteSegments( route );
route->RemovePoint( point );
// Check for 1 point routes
if( route->GetnPoints() <= 1 ) {
pConfig->DeleteConfigRoute( route );
g_pRouteMan->DeleteRoute( route );
route = NULL;
}
// Add this point back into the selectables
pSelect->AddSelectableRoutePoint( point->m_lat, point->m_lon, point );
if( pRoutePropDialog && ( pRoutePropDialog->IsShown() ) ) {
pRoutePropDialog->SetRouteAndUpdate( route );
pRoutePropDialog->UpdateProperties();
}
}
void ChartCanvas::PopupMenuHandler( wxCommandEvent& event )
{
RoutePoint *pLast;
@@ -8626,36 +8654,7 @@ void ChartCanvas::PopupMenuHandler( wxCommandEvent& event )
case ID_RT_MENU_REMPOINT:
if( m_pSelectedRoute ) {
if( m_pSelectedRoute->m_bIsInLayer ) break;
// Rebuild the route selectables
pSelect->DeleteAllSelectableRoutePoints( m_pSelectedRoute );
pSelect->DeleteAllSelectableRouteSegments( m_pSelectedRoute );
m_pSelectedRoute->RemovePoint( m_pFoundRoutePoint );
// Check for 1 point routes
if( m_pSelectedRoute->GetnPoints() > 1 ) {
/* All this is done by Route::RemovePoint()
pSelect->AddAllSelectableRouteSegments ( m_pSelectedRoute );
pSelect->AddAllSelectableRoutePoints ( m_pSelectedRoute );
pConfig->UpdateRoute ( m_pSelectedRoute );
m_pSelectedRoute->RebuildGUIDList(); // ensure the GUID list is intact and good
*/
} else {
pConfig->DeleteConfigRoute( m_pSelectedRoute );
g_pRouteMan->DeleteRoute( m_pSelectedRoute );
m_pSelectedRoute = NULL;
}
// Add this point back into the selectables
pSelect->AddSelectableRoutePoint( m_pFoundRoutePoint->m_lat,
m_pFoundRoutePoint->m_lon, m_pFoundRoutePoint );
if( pRoutePropDialog && ( pRoutePropDialog->IsShown() ) ) {
pRoutePropDialog->SetRouteAndUpdate( m_pSelectedRoute );
pRoutePropDialog->UpdateProperties();
}
RemovePointFromRoute( m_pFoundRoutePoint, m_pSelectedRoute );
}
break;
Oops, something went wrong.

0 comments on commit 5dbc500

Please sign in to comment.