Esempio n. 1
0
void about::SetColorScheme( void )
{
    DimeControl( this );
    wxColor bg = GetBackgroundColour();
    pAboutHTMLCtl->SetBackgroundColour( bg );
    pLicenseHTMLCtl->SetBackgroundColour( bg );
    pAuthorHTMLCtl->SetBackgroundColour( bg );
    

    // This looks like non-sense, but is needed for __WXGTK__
    // to get colours to propagate down the control's family tree.
    SetBackgroundColour( bg );

#ifdef __WXQT__
    // wxQT has some trouble clearing the background of HTML window...
    wxBitmap tbm( GetSize().x, GetSize().y, -1 );
    wxMemoryDC tdc( tbm );
    tdc.SetBackground( bg );
    tdc.Clear();
    pAboutHTMLCtl->SetBackgroundImage(tbm);
    pLicenseHTMLCtl->SetBackgroundImage(tbm);
    pAuthorHTMLCtl->SetBackgroundImage(tbm);
#endif

}
Esempio n. 2
0
bool AISTargetAlertDialog::Create( int target_mmsi, wxWindow *parent, AIS_Decoder *pdecoder,
                                   bool b_jumpto, bool b_createWP, bool b_ack,
                                   wxWindowID id,  const wxString& caption,
                                   const wxPoint& pos,const wxSize& size, long style )
                     
{
    
    OCPN_AlertDialog::Create(parent, id, caption, pos, size, style);
    m_bjumpto = b_jumpto;
    m_back = b_ack;
    m_bcreateWP = b_createWP;
    
    m_target_mmsi = target_mmsi;
    m_pdecoder = pdecoder;

    wxFont *dFont = FontMgr::Get().GetFont( _("AISTargetAlert"), 12 );
    int font_size = wxMax(8, dFont->GetPointSize());
    wxString face = dFont->GetFaceName();
#ifdef __WXGTK__
    face = _T("Monospace");
#endif
    wxFont *fp_font = FontMgr::Get().FindOrCreateFont( font_size, wxFONTFAMILY_MODERN,
            wxFONTSTYLE_NORMAL, dFont->GetWeight(), false, face );

    SetFont( *fp_font );

    CreateControls();
    if( !g_bopengl && CanSetTransparent() ) SetTransparent( 192 );
    DimeControl( this );
    wxColor bg = GetBackgroundColour();
    m_pAlertTextCtl->SetBackgroundColour( bg );
    SetBackgroundColour( bg );
    
    return true;
}
Esempio n. 3
0
void AISTargetQueryDialog::UpdateText()
{
    wxString html;

    if( !m_pQueryTextCtl ) return;

    DimeControl( this );
    wxColor bg = GetBackgroundColour();
    m_pQueryTextCtl->SetBackgroundColour( bg );
    SetBackgroundColour( bg );

//    if( m_MMSI == 0 ) { //  Faulty MMSI could be reported as 0
    AIS_Target_Data *td = g_pAIS->Get_Target_Data_From_MMSI( m_MMSI );
    if( td )
    {
        if( td->b_PersistTrack )
        {
            m_createTrkBtn->SetLabel(_("Stop Tracking"));
        }
        else
        {
            m_createTrkBtn->SetLabel(_("Record Track"));
        }
        wxFont *dFont = FontMgr::Get().GetFont( _("AISTargetQuery") );
        wxString face = dFont->GetFaceName();
        int sizes[7];
        for( int i=-2; i<5; i++ ) {
            sizes[i+2] = dFont->GetPointSize() + i + (i>0?i:0);
        }

        html.Printf( _T("<html><body bgcolor=#%02x%02x%02x><center>"), bg.Red(), bg.Green(), bg.Blue() );

        html << td->BuildQueryResult();
        html << _T("</center></font></body></html>");

        m_pQueryTextCtl->SetFonts( face, face, sizes );
        m_pQueryTextCtl->SetPage( html );

        // Try to create a min size that works across font sizes.
        wxSize sz;
        if( ! IsShown() ) {
            sz = m_pQueryTextCtl->GetVirtualSize();
            sz.x = 300;
            m_pQueryTextCtl->SetSize( sz );
        }
        m_pQueryTextCtl->Layout();
        wxSize ir(m_pQueryTextCtl->GetInternalRepresentation()->GetWidth(),
                  m_pQueryTextCtl->GetInternalRepresentation()->GetHeight() );
        sz.x = wxMax( m_pQueryTextCtl->GetSize().x, ir.x );
        sz.y = wxMax( m_pQueryTextCtl->GetSize().y, ir.y );
        m_pQueryTextCtl->SetMinSize( sz );
        Fit();
        sz -= wxSize( 200, 200 );
        m_pQueryTextCtl->SetMinSize( sz );

        m_createWptBtn->Enable( td->b_positionOnceValid );
        m_createTrkBtn->Enable( td->b_show_track );
    }
    //  }
}
Esempio n. 4
0
bool S57ExtraQueryInfoDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption,
                             const wxPoint& pos, const wxSize& size, long style )
{
    //    As a display optimization....
    //    if current color scheme is other than DAY,
    //    Then create the dialog ..WITHOUT.. borders and title bar.
    //    This way, any window decorations set by external themes, etc
    //    will not detract from night-vision

    long wstyle = wxDEFAULT_FRAME_STYLE|wxFRAME_FLOAT_ON_PARENT;

    if( ( global_color_scheme != GLOBAL_COLOR_SCHEME_DAY )
            && ( global_color_scheme != GLOBAL_COLOR_SCHEME_RGB ) ) wstyle |= ( wxNO_BORDER );

    if( !wxFrame::Create( parent, id, caption, pos, size, wstyle ) ) return false;

    wxFont *dFont = GetOCPNScaledFont(_("ObjectQuery"));

    SetFont( *dFont );
    CreateControls();
 
    DimeControl( this );
    return true;

}
Esempio n. 5
0
void S57QueryDialog::SetColorScheme( void )
{
    DimeControl( this );
    wxColor bg = GetBackgroundColour();
    m_phtml->SetBackgroundColour( bg );
    SetBackgroundColour( bg );                  // This looks like non-sense, but is needed for __WXGTK__
                                                // to get colours to propagate down the control's family tree.
    
}
Esempio n. 6
0
void about::Update()
{
    pAboutTextCtl->Clear();
    wxString *pAboutString = new wxString( AboutText, wxConvUTF8 );

    pAboutString->Append( OpenCPNVersion );
    pAboutString->Append( wxString( OpenCPNInfo, wxConvUTF8 ) );

    pAboutTextCtl->WriteText( *pAboutString );
    delete pAboutString;

    // Show the user where the log file is going to be
    wxString log = _T("    Logfile location: ");
    log.Append( glog_file );
    pAboutTextCtl->WriteText( log );

    // Show the user where the config file is going to be
    wxString conf = _T("\n    Config file location: ");
    conf.Append( g_Platform->GetConfigFileName() );
    pAboutTextCtl->WriteText( conf );
    pAboutTextCtl->SetInsertionPoint( 0 );
    
    pAuthorTextCtl->Clear();
    wxString *pAuthorsString = new wxString( AuthorText, wxConvUTF8 );
    pAuthorTextCtl->WriteText( *pAuthorsString );
    pAuthorTextCtl->SetInsertionPoint( 0 );
    
    delete pAuthorsString;

    pLicenseTextCtl->Clear();
    wxString license_loc(m_DataLocn );
    license_loc.Append( _T("license.txt") );

    wxTextFile license_file( license_loc );

    if( license_file.Open() ) {
        wxString str;
        str = license_file.GetFirstLine();
        pLicenseTextCtl->WriteText( str );

        while( !license_file.Eof() ) {
            str = license_file.GetNextLine();
            str.Append( _T("\n") );
            pLicenseTextCtl->AppendText( str );
        }
        license_file.Close();
    } else {
        wxString msg( _T("Could not open License file: ") );
        msg.Append( license_loc );
        wxLogMessage( msg );
    }
    pLicenseTextCtl->SetInsertionPoint( 0 );

    DimeControl( this );
}
Esempio n. 7
0
void AISTargetQueryDialog::SetColorScheme( ColorScheme cs )
{
    DimeControl( this );
    wxColor bg = GetBackgroundColour();
    m_pQueryTextCtl->SetBackgroundColour( bg );
    SetBackgroundColour( bg );                  // This looks like non-sense, but is needed for __WXGTK__
    // to get colours to propagate down the control's family tree.

    if( cs != m_colorscheme ) {
        Refresh();
    }
    m_colorscheme = cs;

}
Esempio n. 8
0
void AISTargetAlertDialog::UpdateText()
{
    if( GetAlertText() ) {
        wxColor bg = GetBackgroundColour();
        m_pAlertTextCtl->SetBackgroundColour( bg );

        wxFont *dFont = FontMgr::Get().GetFont( _("AISTargetQuery"), 12 );
        wxString face = dFont->GetFaceName();
        int sizes[7];
        for( int i = -2; i < 5; i++ ) {
            sizes[i + 2] = dFont->GetPointSize() + i + ( i > 0 ? i : 0 );
        }

        wxString html;
        html.Printf( _T("<html><body bgcolor=#%02x%02x%02x><center>"), bg.Red(), bg.Blue(),
                bg.Green() );

        html << m_alert_text;
        html << _T("</center></font></body></html>");

        m_pAlertTextCtl->SetFonts( face, face, sizes );
        m_pAlertTextCtl->SetPage( html );

        // Try to create a min size that works across font sizes.
        wxSize sz;
        if( !IsShown() ) {
            sz = m_pAlertTextCtl->GetVirtualSize();
            sz.x = 300;
            m_pAlertTextCtl->SetSize( sz );
        }
        m_pAlertTextCtl->Layout();
        wxSize ir( m_pAlertTextCtl->GetInternalRepresentation()->GetWidth(),
                m_pAlertTextCtl->GetInternalRepresentation()->GetHeight() );
        sz.x = wxMax( m_pAlertTextCtl->GetSize().x, ir.x );
        sz.y = wxMax( m_pAlertTextCtl->GetSize().y, ir.y );
        m_pAlertTextCtl->SetMinSize( sz );
        Fit();
        sz -= wxSize( 200, 200 );
        m_pAlertTextCtl->SetMinSize( sz );
    }

    DimeControl( this );
    if( !g_bopengl && CanSetTransparent() ) SetTransparent( 192 );
}
Esempio n. 9
0
void AISTargetAlertDialog::SetColorScheme( void )
{
    DimeControl( this );
    wxColor bg = GetBackgroundColour();
    m_pAlertTextCtl->SetBackgroundColour( bg );
    SetBackgroundColour( bg );                  // This looks like non-sense, but is needed for __WXGTK__
    // to get colours to propagate down the control's family tree.
    
#ifdef __WXQT__    
    //  wxQT has some trouble clearing the background of HTML window...
    wxBitmap tbm( GetSize().x, GetSize().y, -1 );
    wxMemoryDC tdc( tbm );
    //    wxColour cback = GetGlobalColor( _T("YELO1") );
    tdc.SetBackground( bg );
    tdc.Clear();
    m_pAlertTextCtl->SetBackgroundImage(tbm);
#endif
    
}
Esempio n. 10
0
bool S57QueryDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption,
                             const wxPoint& pos, const wxSize& size, long style )
{
    //    As a display optimization....
    //    if current color scheme is other than DAY,
    //    Then create the dialog ..WITHOUT.. borders and title bar.
    //    This way, any window decorations set by external themes, etc
    //    will not detract from night-vision

    long wstyle = wxDEFAULT_FRAME_STYLE;
#ifdef __WXOSX__
    wstyle |= wxSTAY_ON_TOP;
#endif
    
    if( ( global_color_scheme != GLOBAL_COLOR_SCHEME_DAY )
            && ( global_color_scheme != GLOBAL_COLOR_SCHEME_RGB ) ) wstyle |= ( wxNO_BORDER );

    if( !wxDialog::Create( parent, id, caption, pos, size, wstyle ) ) return false;

    wxFont *dFont = GetOCPNScaledFont(_("ObjectQuery"));

    SetFont( *dFont );
    CreateControls();

    m_createsize = size;
    /*
// This ensures that the dialog cannot be sized smaller
// than the minimum size
    GetSizer()->SetSizeHints( this );

// Explicitely set the size
    SetSize( size );

// Centre the dialog on the parent or (if none) screen
    Centre();
     */
    RecalculateSize();

    DimeControl( this );
    return true;

}
Esempio n. 11
0
bool AISTargetAlertDialog::Create( int target_mmsi, wxWindow *parent, AIS_Decoder *pdecoder,
        bool b_jumpto, wxWindowID id, const wxString& caption, const wxPoint& pos,
        const wxSize& size, long style )
{
    //    As a display optimization....
    //    if current color scheme is other than DAY,
    //    Then create the dialog ..WITHOUT.. borders and title bar.
    //    This way, any window decorations set by external themes, etc
    //    will not detract from night-vision

    long wstyle = wxDEFAULT_FRAME_STYLE;
    if( ( global_color_scheme != GLOBAL_COLOR_SCHEME_DAY )
            && ( global_color_scheme != GLOBAL_COLOR_SCHEME_RGB ) ) wstyle |= ( wxNO_BORDER );

    m_bjumpto = b_jumpto;

    wxSize size_min = size;
    size_min.IncTo( wxSize( 500, 600 ) );
    if( !wxDialog::Create( parent, id, caption, pos, size_min, wstyle ) ) return false;

    m_target_mmsi = target_mmsi;
    m_pparent = parent;
    m_pdecoder = pdecoder;

    wxFont *dFont = FontMgr::Get().GetFont( _("AISTargetAlert"), 12 );
    int font_size = wxMax(8, dFont->GetPointSize());
    wxString face = dFont->GetFaceName();
#ifdef __WXGTK__
    face = _T("Monospace");
#endif
    wxFont *fp_font = wxTheFontList->FindOrCreateFont( font_size, wxFONTFAMILY_MODERN,
            wxFONTSTYLE_NORMAL, dFont->GetWeight(), false, face );

    SetFont( *fp_font );

    CreateControls();
    if( !g_bopengl && CanSetTransparent() ) SetTransparent( 192 );
    DimeControl( this );

    return true;
}
void AISTargetQueryDialog::UpdateText()
{
    wxString html;

    if( !m_pQueryTextCtl ) return;

    int scroll_x, scroll_y;
    m_pQueryTextCtl->GetViewStart(&scroll_x, &scroll_y);
    
    AIS_Target_Data *td = g_pAIS->Get_Target_Data_From_MMSI( m_MMSI );
    AdjustBestSize(td);
    
    DimeControl( this );
    wxColor bg = GetBackgroundColour();
    m_pQueryTextCtl->SetBackgroundColour( bg );
    SetBackgroundColour( bg );

        if( td )
        {
            if( td->b_PersistTrack )
                m_createTrkBtn->SetLabel(_("Stop Tracking"));
            else
                m_createTrkBtn->SetLabel(_("Record Track"));

            m_createWptBtn->Enable( td->b_positionOnceValid );
            m_createTrkBtn->Enable( td->b_show_track );
            
            RenderHTMLQuery(td);
 
                
        }
  
#ifdef __WXQT__ 
    SetColorScheme( m_colorscheme );
#endif
    
    m_pQueryTextCtl->Scroll(scroll_x, scroll_y);
}
void AISTargetListDialog::SetColorScheme()
{
    DimeControl( this );
}
Esempio n. 14
0
TCWin::TCWin( ChartCanvas *parent, int x, int y, void *pvIDX )
{

    //    As a display optimization....
    //    if current color scheme is other than DAY,
    //    Then create the dialog ..WITHOUT.. borders and title bar.
    //    This way, any window decorations set by external themes, etc
    //    will not detract from night-vision

    m_created = false;
    xSpot = 0;
    ySpot = 0;

    m_pTCRolloverWin = NULL;

    long wstyle = wxCLIP_CHILDREN | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ;
    if( ( global_color_scheme != GLOBAL_COLOR_SCHEME_DAY )
            && ( global_color_scheme != GLOBAL_COLOR_SCHEME_RGB ) ) wstyle |= ( wxNO_BORDER );

#ifdef __WXOSX__
     wstyle |= wxSTAY_ON_TOP;
#endif
   
    pParent = parent;
    m_x = x;
    m_y = y;
    
    RecalculateSize();
     
    wxDialog::Create( parent, wxID_ANY, wxString( _T ( "" ) ), m_position ,
                      m_tc_size, wstyle );

    m_created = true;
    wxFont *qFont = GetOCPNScaledFont(_("Dialog"));
    SetFont( *qFont );
    

    pIDX = (IDX_entry *) pvIDX;
    gpIDXn++;

//    Set up plot type
    if( strchr( "Tt", pIDX->IDX_type ) ) {
        m_plot_type = TIDE_PLOT;
        SetTitle( wxString( _( "Tide" ) ) );
        gpIDX = pIDX;       // remember pointer for routeplan

    } else {
        m_plot_type = CURRENT_PLOT;
        SetTitle( wxString( _( "Current" ) ) );
    }



    int sx, sy;
    GetClientSize( &sx, &sy );
    
//    Figure out this computer timezone minute offset
    wxDateTime this_now = gTimeSource;
    bool cur_time = !gTimeSource.IsValid();

    if (cur_time) {
        this_now = wxDateTime::Now();
    }
    wxDateTime this_gmt = this_now.ToGMT();

#if wxCHECK_VERSION(2, 6, 2)
    wxTimeSpan diff = this_now.Subtract( this_gmt );
#else
    wxTimeSpan diff = this_gmt.Subtract ( this_now );
#endif

    int diff_mins = diff.GetMinutes();

    //  Correct a bug in wx3.0.2
    //  If the system TZ happens to be GMT, with DST active (e.g.summer in London),
    //  then wxDateTime returns incorrect results for toGMT() method
#if wxCHECK_VERSION(3, 0, 2)
    if( diff_mins == 0 && this_now.IsDST() )
        diff_mins +=60;
#endif
    int station_offset = ptcmgr->GetStationTimeOffset( pIDX );

    m_corr_mins = station_offset - diff_mins;
    if( this_now.IsDST() ) m_corr_mins += 60;

//    Establish the inital drawing day as today
    m_graphday = this_now;
    wxDateTime graphday_00 = this_now;
    graphday_00.ResetTime();
    time_t t_graphday_00 = graphday_00.GetTicks();

    //    Correct a Bug in wxWidgets time support
    if( !graphday_00.IsDST() && m_graphday.IsDST() ) t_graphday_00 -= 3600;
    if( graphday_00.IsDST() && !m_graphday.IsDST() ) t_graphday_00 += 3600;

    m_t_graphday_00_at_station = t_graphday_00 - ( m_corr_mins * 60 );

    btc_valid = false;

    wxString* TClist = NULL;
    m_tList = new wxListBox( this, -1, wxPoint( sx * 65 / 100, 11 ),
                             wxSize( ( sx * 32 / 100 ), ( sy * 20 / 100 ) ), 0, TClist,
                             wxLB_SINGLE | wxLB_NEEDED_SB | wxLB_HSCROLL  );

    //  Measure the size of a generic button, with label
    wxButton *test_button = new wxButton( this, wxID_OK, _( "OK" ), wxPoint( -1, -1), wxDefaultSize );
    test_button->GetSize( &m_tsx, &m_tsy );
    delete test_button;
    
    //  In the interest of readability, if the width of the dialog is too narrow, 
    //  simply skip showing the "Hi/Lo" list control.
    
    if( (m_tsy * 15) > sx )
        m_tList->Hide();
    
    
    OK_button = new wxButton( this, wxID_OK, _( "OK" ), wxPoint( sx - (2 * m_tsy + 10), sy - (m_tsy + 10) ),
                              wxDefaultSize );

    PR_button = new wxButton( this, ID_TCWIN_PR, _( "Prev" ), wxPoint( 10, sy - (m_tsy + 10) ),
                              wxSize( -1, -1 ) );

    wxSize texc_size = wxSize( ( sx * 60 / 100 ), ( sy *29 / 100 ) );
    if( !m_tList->IsShown()){
        texc_size = wxSize( ( sx * 90 / 100 ), ( sy *29 / 100 ) );
    }
        
    m_ptextctrl = new wxTextCtrl( this, -1, _T(""), wxPoint( sx * 3 / 100, 6 ),
                                  texc_size ,
                                  wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP);
    int bsx, bsy, bpx, bpy;
    PR_button->GetSize( &bsx, &bsy );
    PR_button->GetPosition( &bpx, &bpy );

    NX_button = new wxButton( this, ID_TCWIN_NX, _( "Next" ), wxPoint( bpx + bsx + 5, sy - (m_tsy + 10) ),
                              wxSize( -1, -1 ) );

    m_TCWinPopupTimer.SetOwner( this, TCWININF_TIMER );

    wxScreenDC dc;
    int text_height;
    dc.GetTextExtent(_T("W"), NULL, &text_height);
    m_button_height = m_tsy; //text_height + 20;


    // Build graphics tools

    wxFont *dlg_font = FontMgr::Get().GetFont( _("Dialog") );
    int dlg_font_size = dlg_font->GetPointSize();

    pSFont = FontMgr::Get().FindOrCreateFont( dlg_font_size-2, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL,
                                                    wxFONTWEIGHT_NORMAL, FALSE, wxString( _T ( "Arial" ) ) );
    pSMFont = FontMgr::Get().FindOrCreateFont( dlg_font_size-1, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL,
                                                       wxFONTWEIGHT_NORMAL, FALSE, wxString( _T ( "Arial" ) ) );
    pMFont = FontMgr::Get().FindOrCreateFont( dlg_font_size, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD,
                                                      FALSE, wxString( _T ( "Arial" ) ) );
    pLFont = FontMgr::Get().FindOrCreateFont( dlg_font_size+1, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD,
                                                      FALSE, wxString( _T ( "Arial" ) ) );

    pblack_1 = wxThePenList->FindOrCreatePen( GetGlobalColor( _T ( "UINFD" ) ), wxMax(1,(int)(m_tcwin_scaler+0.5)),
					      wxPENSTYLE_SOLID );
    pblack_2 = wxThePenList->FindOrCreatePen( GetGlobalColor( _T ( "UINFD" ) ), wxMax(2,(int)(2*m_tcwin_scaler+0.5)),
					      wxPENSTYLE_SOLID );
    pblack_3 = wxThePenList->FindOrCreatePen( GetGlobalColor( _T ( "UWHIT" ) ), wxMax(1,(int)(m_tcwin_scaler+0.5)),
                                                                          wxPENSTYLE_SOLID );
    pred_2 = wxThePenList->FindOrCreatePen( GetGlobalColor( _T ( "UINFR" ) ), wxMax(4,(int)(4*m_tcwin_scaler+0.5)),
                                                                        wxPENSTYLE_SOLID );
    pltgray = wxTheBrushList->FindOrCreateBrush( GetGlobalColor( _T ( "UIBCK" ) ),
                                                                               wxBRUSHSTYLE_SOLID );
    pltgray2 = wxTheBrushList->FindOrCreateBrush( GetGlobalColor( _T ( "DILG1" ) ),
                                                                                wxBRUSHSTYLE_SOLID );

    DimeControl( this );

    //  Fill in some static text control information

    //  Tidi station information
    m_ptextctrl->Clear();

    wxString locn( pIDX->IDX_station_name, wxConvUTF8 );
    wxString locna, locnb;
    if( locn.Contains( wxString( _T ( "," ) ) ) ) {
        locna = locn.BeforeFirst( ',' );
        locnb = locn.AfterFirst( ',' );
    } else {
        locna = locn;
        locnb.Empty();
    }

    // write the first line
    wxTextAttr style;
    style.SetFont( *pLFont );
    m_ptextctrl->SetDefaultStyle( style );

    m_ptextctrl->AppendText( locna );
    m_ptextctrl->AppendText(_T("\n"));

    style.SetFont( *pSMFont );
    m_ptextctrl->SetDefaultStyle( style );

    if( !locnb.IsEmpty() )
        m_ptextctrl->AppendText( locnb );
    m_ptextctrl->AppendText(_T("\n"));


    //Reference to the master station
    if(( 't' == pIDX->IDX_type ) || ( 'c' == pIDX->IDX_type )) {
        wxString mref( pIDX->IDX_reference_name, wxConvUTF8 );
        mref.Prepend(_T(" "));

        m_ptextctrl->AppendText( _( "Reference Station :" ) );
        m_ptextctrl->AppendText(_T("\n"));

        m_ptextctrl->AppendText( mref );
        m_ptextctrl->AppendText(_T("\n"));

    }
    else {
        m_ptextctrl->AppendText(_T("\n"));
    }

    //      Show the data source
    wxString dsource( pIDX->source_ident, wxConvUTF8 );
    dsource.Prepend(_T(" "));

    m_ptextctrl->AppendText( _( "Data Source :" ) );
    m_ptextctrl->AppendText(_T("\n"));

    m_ptextctrl->AppendText( dsource );

    m_ptextctrl->ShowPosition( 0 );
}
Esempio n. 15
0
void GoToPositionDialog::SetColorScheme( ColorScheme cs )
{
    DimeControl( this );
}
Esempio n. 16
0
void AISTargetQueryDialog::UpdateText()
{
    wxString html;

    if( !m_pQueryTextCtl ) return;

    int scroll_x, scroll_y;
    m_pQueryTextCtl->GetViewStart(&scroll_x, &scroll_y);
    
    DimeControl( this );
    wxColor bg = GetBackgroundColour();
    m_pQueryTextCtl->SetBackgroundColour( bg );
    SetBackgroundColour( bg );

//    if( m_MMSI == 0 ) { //  Faulty MMSI could be reported as 0
        AIS_Target_Data *td = g_pAIS->Get_Target_Data_From_MMSI( m_MMSI );
        if( td )
        {
            if( td->b_PersistTrack )
            {
                m_createTrkBtn->SetLabel(_("Stop Tracking"));
            }
            else
            {
                m_createTrkBtn->SetLabel(_("Record Track"));
            }
            wxFont *dFont = FontMgr::Get().GetFont( _("AISTargetQuery") );
            wxString face = dFont->GetFaceName();
            int sizes[7];
            for( int i=-2; i<5; i++ ) {
                sizes[i+2] = dFont->GetPointSize() + i + (i>0?i:0);
            }

            html.Printf( _T("<html><body bgcolor=#%02x%02x%02x><center>"), bg.Red(), bg.Green(), bg.Blue() );

            html << td->BuildQueryResult();
            
            html << _T("</center></font></body></html>");

            m_pQueryTextCtl->SetFonts( face, face, sizes );

            wxCharBuffer buf = html.ToUTF8();
            if( buf.data() )                            // string OK?
                 m_pQueryTextCtl->SetPage( html );

            if(!m_bsize_set){
                SetBestSize();
                m_bsize_set = true;
            }
                
            m_createWptBtn->Enable( td->b_positionOnceValid );
            m_createTrkBtn->Enable( td->b_show_track );
        }
  //  }
  
#ifdef __WXQT__ 
    SetColorScheme( m_colorscheme );
#endif
    
    m_pQueryTextCtl->Scroll(scroll_x, scroll_y);
}