Skip to content

Commit

Permalink
Merge pull request OpenCPN#28 from jongough/cursor_jump
Browse files Browse the repository at this point in the history
Cursor jump
  • Loading branch information
jongough committed May 23, 2015
2 parents 88e8b2f + 76bc604 commit 9769bea
Show file tree
Hide file tree
Showing 33 changed files with 3,369 additions and 638 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ SET(CPACK_PACKAGE_CONTACT "Jon Gough")

SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "3")
SET(VERSION_PATCH "0050")
SET(VERSION_DATE "21/05/2015")
SET(VERSION_PATCH "0100")
SET(VERSION_DATE "23/05/2015")

SET(BUNDLE_DATA FALSE)

Expand Down Expand Up @@ -180,6 +180,7 @@ SET(OCPNHDRS
ocpninclude/Sentence.hpp
ocpninclude/statwin.h
ocpninclude/styles.h
ocpninclude/TexFont.h
ocpninclude/timers.h
ocpninclude/undo.h
ocpninclude/vector2D.h
Expand Down
6 changes: 3 additions & 3 deletions Forms/ODPropertiesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ODPropertiesDialog::ODPropertiesDialog( wxWindow* parent, wxWindowID id, const w
bSizerOCPNPoint->Add( m_SizerNameIcon, 0, wxEXPAND, 5 );

wxFlexGridSizer* fgSizer3;
fgSizer3 = new wxFlexGridSizer( 2, 2, 0, 0 );
fgSizer3 = new wxFlexGridSizer( 5, 2, 0, 0 );
fgSizer3->AddGrowableCol( 0 );
fgSizer3->SetFlexibleDirection( wxBOTH );
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
Expand Down Expand Up @@ -107,7 +107,7 @@ ODPropertiesDialog::ODPropertiesDialog( wxWindow* parent, wxWindowID id, const w
m_notebookProperties->AddPage( m_panelPoint, wxT("OCPN Point"), true );
m_panelPath = new wxPanel( m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizerPathSettings;
fgSizerPathSettings = new wxFlexGridSizer( 2, 2, 0, 0 );
fgSizerPathSettings = new wxFlexGridSizer( 6, 2, 0, 0 );
fgSizerPathSettings->SetFlexibleDirection( wxBOTH );
fgSizerPathSettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );

Expand Down Expand Up @@ -177,7 +177,7 @@ ODPropertiesDialog::ODPropertiesDialog( wxWindow* parent, wxWindowID id, const w
m_notebookProperties->AddPage( m_panelPath, wxT("Path"), false );
m_panelBoundary = new wxPanel( m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizerBoundarySettings;
fgSizerBoundarySettings = new wxFlexGridSizer( 2, 2, 0, 0 );
fgSizerBoundarySettings = new wxFlexGridSizer( 6, 2, 0, 0 );
fgSizerBoundarySettings->SetFlexibleDirection( wxBOTH );
fgSizerBoundarySettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );

Expand Down
6 changes: 3 additions & 3 deletions Forms/ODPropertiesDialog.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@
<property name="name">fgSizer3</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">2</property>
<property name="rows">5</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
Expand Down Expand Up @@ -1097,7 +1097,7 @@
<property name="name">fgSizerPathSettings</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">2</property>
<property name="rows">6</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
Expand Down Expand Up @@ -1822,7 +1822,7 @@
<property name="name">fgSizerBoundarySettings</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">2</property>
<property name="rows">6</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
Expand Down
18 changes: 16 additions & 2 deletions ocpninclude/AISTargetQueryDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
#define __AISTARGETQUERYDIALOG_H__

#include <wx/dialog.h>
#include <wx/sizer.h>

#include "ocpn_types.h"

class wxHtmlWindow;
class AIS_Target_Data;

class AISTargetQueryDialog: public wxDialog
{
Expand Down Expand Up @@ -63,12 +65,17 @@ DECLARE_EVENT_TABLE()
void OnIdWptCreateClick( wxCommandEvent& event );
void OnIdTrkCreateClick( wxCommandEvent& event );
void OnMove( wxMoveEvent& event );

void AdjustBestSize(AIS_Target_Data *td);
void CreateControls();

void RenderHTMLQuery(AIS_Target_Data *td);

void SetText(const wxString &text_string);
void SetColorScheme(ColorScheme cs);

void RecalculateSize( void );
void SetAutoCentre( bool bval ){ m_bautoCentre = bval;}
void SetAutoSize( bool bval ){ m_bautosize = bval;}

void UpdateText(void);
void SetMMSI(int mmsi){ m_MMSI = mmsi; }
int GetMMSI(void){ return m_MMSI; }
Expand All @@ -82,6 +89,13 @@ DECLARE_EVENT_TABLE()
wxButton *m_okButton;
wxButton *m_createWptBtn;
wxButton *m_createTrkBtn;
bool m_bsize_set;
int m_adjustedFontSize;
int m_control_font_size;
wxFont *m_basefont;
wxWindow *m_parent;
bool m_bautoCentre;
bool m_bautosize;
};

#endif
4 changes: 4 additions & 0 deletions ocpninclude/ConnectionParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,15 @@ class ConnectionParams
wxString GetFiltersStr();
wxString GetDSPort();
wxString GetLastDSPort();
wxString GetPortStr(){ return Port; }
void SetPortStr( wxString str ){ Port = str; }


bool Valid;
bool b_IsSetup;
private:
wxString FilterTypeToStr(ListType type, FilterDirection dir);

};

WX_DEFINE_ARRAY(ConnectionParams *, wxArrayOfConnPrm);
Expand Down
16 changes: 16 additions & 0 deletions ocpninclude/OCPNPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class OCPNPlatform
static bool hasInternalBT(wxString profile = _T("")); // Bluetooth
bool startBluetoothScan();
wxArrayString getBluetoothScanResults();
bool stopBluetoothScan();

// Per-Platform initialization support

Expand All @@ -66,6 +67,20 @@ class OCPNPlatform
static void OnExit_2( void );


void SetDefaultOptions( void );

//--------------------------------------------------------------------------
// Platform Display Support
//--------------------------------------------------------------------------
void ShowBusySpinner( void );
void HideBusySpinner( void );
double getFontPointsperPixel( void );
wxSize getDisplaySize();
double GetDisplaySizeMM();

wxFileDialog *AdjustFileDialogFont(wxWindow *container, wxFileDialog *dlg);
wxDirDialog *AdjustDirDialogFont(wxWindow *container, wxDirDialog *dlg);

//--------------------------------------------------------------------------
// Per-Platform file/directory support
//--------------------------------------------------------------------------
Expand All @@ -80,6 +95,7 @@ class OCPNPlatform
wxString *GetPluginDirPtr();
wxString *GetSharedDataDirPtr();
wxString *GetPrivateDataDirPtr();
wxString &GetLogFileName(){ return mlog_file; }

bool InitializeLogFile( void );
void CloseLogFile( void );
Expand Down
2 changes: 2 additions & 0 deletions ocpninclude/Quilt.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ class Quilt

int m_lost_refchart_dbIndex;
bool m_b_hidef;

bool m_bquiltskew;
};

#endif
4 changes: 3 additions & 1 deletion ocpninclude/Route.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Route : public wxObject
void CloneAddedRoutePoint(RoutePoint *ptargetpoint, RoutePoint *psourcepoint);
void ClearHighlights(void);
void RenderSegment(ocpnDC& dc, int xa, int ya, int xb, int yb, ViewPort &VP, bool bdraw_arrow, int hilite_width = 0);
void RenderSegmentArrowsGL( int xa, int ya, int xb, int yb, ViewPort &VP);
void RenderSegmentArrowsGL( float xa, float ya, float xb, float yb, ViewPort &VP);

bool CrossesIDL(){ return m_bcrosses_idl; }
void SetVisible(bool visible = true, bool includeWpts = true);
Expand Down Expand Up @@ -137,6 +137,8 @@ class Route : public wxObject
int m_hiliteWidth;

private:
void DrawGLLines( ViewPort &VP, ocpnDC *dc = NULL );

bool m_bNeedsUpdateBBox;
wxBoundingBox RBBox;

Expand Down
10 changes: 4 additions & 6 deletions ocpninclude/RoutePoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
#include <wx/clrpicker.h>
#include "Hyperlink.h"
#include "gpxdocument.h"
#include "bbox.h"
#include "viewport.h"
#include "OCPNRegion.h"

class ocpnDC;
class wxDC;
Expand Down Expand Up @@ -155,14 +152,15 @@ class RoutePoint
wxColour m_wxcWaypointRangeRingsColour;

#ifdef ocpnUSE_GL
void DrawGL( ViewPort &vp, OCPNRegion &region );
void DrawGL( ViewPort &vp, OCPNRegion &region, bool use_cached_screen_coords=false );
unsigned int m_iTextTexture;
int m_iTextTextureWidth, m_iTextTextureHeight;

LLBBox m_wpBBox;
double m_wpBBox_chart_scale, m_wpBBox_rotation;
double m_wpBBox_view_scale_ppm, m_wpBBox_rotation;

static bool s_bUpdateWaypointsDisplayList;
bool m_pos_on_screen;
wxPoint2DDouble m_screen_pos; // cached for arrows and points
#endif

double m_WaypointArrivalRadius;
Expand Down
3 changes: 3 additions & 0 deletions ocpninclude/S57QueryDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class S57QueryDialog: public wxDialog

void CreateControls();
void OnSize(wxSizeEvent& event);
void RecalculateSize( void );

void OnClose(wxCloseEvent& event);

// Overrides
Expand All @@ -68,6 +70,7 @@ class S57QueryDialog: public wxDialog

// Data
wxHtmlWindow *m_phtml;
wxSize m_createsize;

};

Expand Down
80 changes: 80 additions & 0 deletions ocpninclude/TexFont.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/***************************************************************************
*
* Project: OpenCPN
* Purpose: OpenGL text rendering
* Author: Sean D'Epagnier
*
***************************************************************************
* Copyright (C) 2014 Sean D'Epagnier *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
**************************************************************************/

#ifndef __TEXFONT_H__
#define __TEXFONT_H__

/* support ascii plus degree symbol for now pack font in a single texture 16x8 */
#define DEGREE_GLYPH 127
#define MIN_GLYPH 32
#define MAX_GLYPH 128

#define NUM_GLYPHS (MAX_GLYPH - MIN_GLYPH)

#define COLS_GLYPHS 16
#define ROWS_GLYPHS ((NUM_GLYPHS / COLS_GLYPHS)+1)

#ifndef DECL_EXP
#ifdef __WXMSW__
# define DECL_EXP __declspec(dllexport)
#else
# define DECL_EXP
#endif
#endif

struct TexGlyphInfo {
int x, y, width, height;
float advance;
};

class DECL_EXP TexFont {
public:
TexFont();
~TexFont();

void Build( wxFont &font, bool blur = false );
void Delete();

void GetTextExtent( const char *string, int len, int *width, int *height);
void GetTextExtent( const wxString &string, int *width, int *height);
void RenderString( const char *string, int x=0, int y=0 );
void RenderString( const wxString &string, int x=0, int y=0 );


private:
void RenderGlyph( int c );

wxFont m_font;
bool m_blur;

TexGlyphInfo tgi[MAX_GLYPH];

unsigned int texobj;
int tex_w, tex_h;
int m_maxglyphw;
int m_maxglyphh;

};
#endif //guard
15 changes: 14 additions & 1 deletion ocpninclude/chart1.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,22 @@ enum

#define N_STATUS_BAR_FIELDS_MAX 20

#ifdef __OCPN__ANDROID__
#define STAT_FIELD_COUNT 2
#define STAT_FIELD_TICK -1
#define STAT_FIELD_SOGCOG 0
#define STAT_FIELD_CURSOR_LL -1
#define STAT_FIELD_CURSOR_BRGRNG -1
#define STAT_FIELD_SCALE 1
#else
#define STAT_FIELD_COUNT 5
#define STAT_FIELD_TICK 0
#define STAT_FIELD_SOGCOG 1
#define STAT_FIELD_CURSOR_LL 2
#define STAT_FIELD_CURSOR_BRGRNG 3
#define STAT_FIELD_SCALE 4
#endif


// Define a constant GPS signal watchdog timeout value
#define GPS_TIMEOUT_SECONDS 6
Expand Down Expand Up @@ -378,6 +389,8 @@ class MyFrame: public wxFrame
void SubmergeToolbar(void);
void SubmergeToolbarIfOverlap(int x, int y, int margin = 0);
void SurfaceToolbar(void);
void ToggleToolbar( bool b_smooth = false );

void SetToolbarScale(void);

void HandlePianoClick(int selected_index, int selected_dbIndex);
Expand Down Expand Up @@ -409,7 +422,7 @@ class MyFrame: public wxFrame
bool CheckGroup(int igroup);
double GetTrueOrMag(double a);


void DestroyPersistentDialogs();
void TouchAISActive(void);
void UpdateAISTool(void);

Expand Down
Loading

0 comments on commit 9769bea

Please sign in to comment.