void Button::NotifyMouseEnter()
{
    Control::NotifyMouseEnter();
    bool changed = SetStyle(styleMouseOver);
    if (changed)
        RecalculateSize(true);
}
Beispiel #2
0
// Set maximum and warning state values.
void gui_ProgressBar::SetValues(float maxValue, float warnValue)
{
    mMaxValue  = maxValue;
    mWarnValue = warnValue;

    RecalculateSize();  // We need to recalculate size, because max. value is changed.
}
void Button::NotifyMouseLeave()
{
    Control::NotifyMouseLeave();
    bool changed = SetStyle(styleDefault);
    if (changed)
        RecalculateSize(true);
}
Beispiel #4
0
void AISTargetAlertDialog::UpdateText()
{
    if( GetAlertText() ) {
        
        wxFont *dFont = FontMgr::Get().GetFont( _("AISTargetAlert"), 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;
        wxColor bg = GetBackgroundColour();
        
        html.Printf( _T("<html><body bgcolor=#%02x%02x%02x><center>"), bg.Red(), bg.Green(), bg.Blue() );
        
        html << m_alert_text;
        html << _T("</center></font></body></html>");

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

        RecalculateSize();
    }
    
    SetColorScheme();
    if( !g_bopengl && CanSetTransparent() )
        SetTransparent( 192 );
}
Beispiel #5
0
void Bitmap::Layout()
{
  if (m_tree->GetType() != MC_TYPE_GROUP)
  {
    RecalculateWidths();
    BreakUpCells();
    BreakLines();
    RecalculateSize();
  }
  else {
    int fontsize = 12;
    wxConfig::Get()->Read(wxT("fontSize"), &fontsize);
    int mfontsize = fontsize;
    wxConfig::Get()->Read(wxT("mathfontsize"), &mfontsize);
    GroupCell* tmp = (GroupCell *)m_tree;

    wxMemoryDC dc;
    dc.SelectObject(m_bmp);
    CellParser parser(dc);
    parser.SetClientWidth(BM_FULL_WIDTH);

    while (tmp != NULL)
    {
      tmp->Recalculate(parser, fontsize, mfontsize);
      tmp = (GroupCell *)tmp->m_next;
    }
  }

  int width, height;
  GetMaxPoint(&width, &height);
  m_bmp.Create(width, height);

  Draw();
}
Beispiel #6
0
void GroupCell::Recalculate(CellParser& parser, int d_fontsize, int m_fontsize)
{
  m_fontSize = d_fontsize;
  m_mathFontSize = m_fontsize;

  RecalculateWidths(parser, d_fontsize);
  RecalculateSize(parser, d_fontsize);
}
Beispiel #7
0
// Set bar size
void gui_ProgressBar::SetSize(float width, float height, float borderSize)
{
    // Absolute values are needed to recalculate actual bar size according to resolution.
    mAbsWidth  = width;
    mAbsHeight = height;
    mAbsBorderSize = borderSize;

    RecalculateSize();
}
Beispiel #8
0
void ButtonVector::SetStyles(Style *def, Style *mouseOver)
{
    styleDefault = def;
    styleMouseOver = mouseOver;

    if (IsMouseOver())
        SetStyle(styleMouseOver);
    else
        SetStyle(styleDefault);

    RecalculateSize(true);
}
void AISTargetAlertDialog::CreateControls()
{
    wxBoxSizer* topSizer = new wxBoxSizer( wxVERTICAL );
    SetSizer( topSizer );

    m_pAlertTextCtl = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
                                       wxHW_SCROLLBAR_AUTO | wxHW_NO_SELECTION);
#ifdef __OCPN__ANDROID__
    m_pAlertTextCtl->GetHandle()->setStyleSheet( getQtStyleSheet());
#endif

    m_pAlertTextCtl->SetBorders( 5 );
#ifdef __WXOSX__
    topSizer->Add( m_pAlertTextCtl, 1, wxALL | wxEXPAND, 5 );
#else
    topSizer->Add( m_pAlertTextCtl, 1, wxALIGN_CENTER_HORIZONTAL | wxALL | wxEXPAND, 5 );
#endif
    // A horizontal box sizer to contain Ack
    wxBoxSizer* AckBox = new wxBoxSizer( wxHORIZONTAL );
    topSizer->Add( AckBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );

    // The Silence button
    if( g_bAIS_CPA_Alert_Audio ){
        wxButton* silence = new wxButton( this, ID_SILENCE, _( "&Silence Alert" ), wxDefaultPosition,
            wxDefaultSize, 0 );
        AckBox->Add( silence, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
    }

    // The Ack button
    if( m_back ) {
        wxButton* ack = new wxButton( this, ID_ACKNOWLEDGE, _( "&Acknowledge" ), wxDefaultPosition,
            wxDefaultSize, 0 );
        AckBox->Add( ack, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
    }

    if( m_bjumpto ) {
        wxButton* jumpto = new wxButton( this, ID_JUMPTO, _( "&Jump To" ), wxDefaultPosition,
                wxDefaultSize, 0 );
        AckBox->Add( jumpto, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
    }
    
    if( m_bcreateWP ) {
        wxButton *createWptBtn = new wxButton( this, ID_WPT_CREATE, _("Create Waypoint"), wxDefaultPosition, wxDefaultSize, 0 );
        AckBox->Add( createWptBtn, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
    }
    

    UpdateText();

    RecalculateSize();

}
Beispiel #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;

}
Beispiel #11
0
bool about::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos,
        const wxSize& size, long style )
{
    m_parent = parent;
#ifdef __WXOSX__
    style |= wxSTAY_ON_TOP;
#endif

    SetExtraStyle( GetExtraStyle() | wxWS_EX_BLOCK_EVENTS );
    wxDialog::Create( parent, id, caption, pos, size, style );
    wxFont *qFont = GetOCPNScaledFont(_("Dialog"));
    SetFont( *qFont );

    m_displaySize = g_Platform->getDisplaySize();
    CreateControls();
    Populate();

    RecalculateSize();

    return TRUE;
}
Beispiel #12
0
void Button::NotifyMouseEnter()
{
    SetStyle(styleMouseOver);
    RecalculateSize(true);
}
Beispiel #13
0
void Button::NotifyMouseLeave()
{
    SetStyle(styleDefault);
    RecalculateSize(true);
}
Beispiel #14
0
void GroupCell::Draw(CellParser& parser, wxPoint point, int fontsize)
{
  double scale = parser.GetScale();
  wxDC& dc = parser.GetDC();
  if (m_width == -1 || m_height == -1) {
    RecalculateWidths(parser, fontsize);
    RecalculateSize(parser, fontsize);
  }
  if (DrawThisCell(parser, point))
  {
    // draw a thick line for 'page break'
    // and return
    if (m_groupType == GC_TYPE_PAGEBREAK) {
      wxRect rect = GetRect(false);
      int y = rect.GetY();
      wxPen pen(parser.GetColor(TS_CURSOR), 1, wxPENSTYLE_DOT);
      dc.SetPen(pen);
      dc.DrawLine(0, y , 10000, y);
      MathCell::Draw(parser, point, fontsize);
      return;
    }

    //
    // Paint background if we have a text cell
    //
    if (m_groupType == GC_TYPE_TEXT) {
      wxRect rect = GetRect(false);
      int y = rect.GetY();

      if (m_height > 0 && m_width > 0 && y>=0) {
        wxBrush br(parser.GetColor(TS_TEXT_BACKGROUND));
        dc.SetBrush(br);
        wxPen pen(parser.GetColor(TS_TEXT_BACKGROUND));
        dc.SetPen(pen);
        dc.DrawRectangle(0, y , 10000, rect.GetHeight());
      }
    }
    //
    // Draw input and output
    //
    SetPen(parser);
    wxPoint in(point);
    parser.Outdated(false);
    m_input->DrawList(parser, in, fontsize);
    if (m_groupType == GC_TYPE_CODE && m_input->m_next)
      parser.Outdated(((EditorCell *)(m_input->m_next))->ContainsChanges());

    if (m_output != NULL && !m_hide) {
      MathCell *tmp = m_output;
      int drop = tmp->GetMaxDrop();
      in.y += m_input->GetMaxDrop() + m_output->GetMaxCenter();
      m_outputRect.y = in.y - m_output->GetMaxCenter();
      m_outputRect.x = in.x;

      while (tmp != NULL) {

        if (!tmp->m_isBroken) {
          tmp->m_currentPoint.x = in.x;
          tmp->m_currentPoint.y = in.y;
          if (tmp->DrawThisCell(parser, in))
            tmp->Draw(parser, in, MAX(tmp->IsMath() ? m_mathFontSize : m_fontSize, MC_MIN_SIZE));
          if (tmp->m_nextToDraw != NULL) {
            if (tmp->m_nextToDraw->BreakLineHere()) {
              in.x = m_indent;
              in.y += drop + tmp->m_nextToDraw->GetMaxCenter();
              if (tmp->m_bigSkip)
                in.y += MC_LINE_SKIP;
              drop = tmp->m_nextToDraw->GetMaxDrop();
            } else
              in.x += (tmp->GetWidth() + MC_CELL_SKIP);
          }

        } else {
          if (tmp->m_nextToDraw != NULL && tmp->m_nextToDraw->BreakLineHere()) {
            in.x = m_indent;
            in.y += drop + tmp->m_nextToDraw->GetMaxCenter();
            if (tmp->m_bigSkip)
              in.y += MC_LINE_SKIP;
            drop = tmp->m_nextToDraw->GetMaxDrop();
          }
        }

        tmp = tmp->m_nextToDraw;
      }
    }

    parser.Outdated(false);
    MathCell *editable = GetEditable();
    if (editable != NULL && editable->IsActive()) {
      dc.SetPen( *(wxThePenList->FindOrCreatePen(parser.GetColor(TS_ACTIVE_CELL_BRACKET), 2, wxPENSTYLE_SOLID))); // window linux, set a pen
      dc.SetBrush( *(wxTheBrushList->FindOrCreateBrush(parser.GetColor(TS_ACTIVE_CELL_BRACKET)))); //highlight c.
    }
    else {
      dc.SetPen( *(wxThePenList->FindOrCreatePen(parser.GetColor(TS_CELL_BRACKET), 1, wxPENSTYLE_SOLID))); // window linux, set a pen
      dc.SetBrush( *(wxTheBrushList->FindOrCreateBrush(parser.GetColor(TS_CELL_BRACKET)))); //highlight c.
    }

    if ((!m_hide) && (!m_hiddenTree)) {
      dc.SetBrush(*wxTRANSPARENT_BRUSH);
    }

    if (IsFoldable()) { // draw a square
      wxPoint *points = new wxPoint[4];
      points[0].x = point.x - SCALE_PX(10, scale);
      points[0].y = point.y - m_center;
      points[1].x = point.x - SCALE_PX(10, scale);
      points[1].y = point.y - m_center + SCALE_PX(10, scale);
      points[2].x = point.x;
      points[2].y = point.y - m_center + SCALE_PX(10, scale);
      points[3].x = point.x;
      points[3].y = point.y - m_center;
      dc.DrawPolygon(4, points);
      delete [] points;
    }
    else { // draw a triangle and line
      wxPoint *points = new wxPoint[3];
      points[0].x = point.x - SCALE_PX(10, scale);
      points[0].y = point.y - m_center;
      points[1].x = point.x - SCALE_PX(10, scale);
      points[1].y = point.y - m_center + SCALE_PX(10, scale);
      points[2].x = point.x;
      points[2].y = point.y - m_center;
      dc.DrawPolygon(3, points);
      delete [] points;

      // vertical
      dc.DrawLine(point.x - SCALE_PX(10, scale), point.y - m_center,
          point.x - SCALE_PX(10, scale), point.y - m_center + m_height);
      // bottom horizontal
      dc.DrawLine(point.x - SCALE_PX(10, scale), point.y - m_center + m_height,
          point.x - SCALE_PX(2, scale) , point.y - m_center + m_height);
      // middle horizontal
      if (m_groupType == GC_TYPE_CODE && m_output != NULL && !m_hide) {
        dc.DrawLine(point.x - SCALE_PX(6, scale),
            point.y - m_center + m_input->GetMaxHeight(),
            point.x - SCALE_PX(10, scale),
            point.y - m_center + m_input->GetMaxHeight());
      }
    }

    UnsetPen(parser);
  }
  MathCell::Draw(parser, point, fontsize);
}
Beispiel #15
0
void ButtonVector::SetGraphicsPath(GraphicsPath *gp)
{
    ::delete graphicsPath;
    graphicsPath = gp;
    RecalculateSize(true);
}
Beispiel #16
0
AISTargetListDialog::AISTargetListDialog( wxWindow *parent, wxAuiManager *auimgr,
        AIS_Decoder *pdecoder ) :
        wxPanel( parent, wxID_ANY, wxDefaultPosition, wxSize( -1, -1/*780, 250*/ ), wxBORDER_NONE )
{
    m_pparent = parent;
    m_pAuiManager = auimgr;
    m_pdecoder = pdecoder;
    g_bsort_once = false;
    m_bautosort_force = false;
    
    wxFont *qFont = GetOCPNScaledFont(_("Dialog"));
    SetFont( *qFont );

    s_p_sort_decoder = pdecoder;
    m_pMMSI_array = new ArrayOfMMSI( ArrayItemCompareMMSI );

    CreateControls();

    SetColorScheme();
    UpdateButtons();

    if( m_pAuiManager ) {
        wxAuiPaneInfo pane =
                wxAuiPaneInfo().Name( _T("AISTargetList") ).CaptionVisible( true ).Float().FloatingPosition( 50, 50 )
                .FloatingSize(400, 200).BestSize(700, GetCharHeight() * 10);
        m_pAuiManager->LoadPaneInfo( g_AisTargetList_perspective, pane );

        //      Force and/or override any perspective information that is not applicable
        pane.Name( _T("AISTargetList") );
        pane.DestroyOnClose( true );
        pane.TopDockable( false ).BottomDockable( true ).LeftDockable( false ).RightDockable( false );
        pane.Show( true );
        
        bool b_reset_pos = false;
        if( (pane.floating_size.x != -1) && (pane.floating_size.y != -1)){
#ifdef __WXMSW__
            //  Support MultiMonitor setups which an allow negative window positions.
            //  If the requested window title bar does not intersect any installed monitor,
            //  then default to simple primary monitor positioning.
            RECT frame_title_rect;
            frame_title_rect.left = pane.floating_pos.x;
            frame_title_rect.top = pane.floating_pos.y;
            frame_title_rect.right = pane.floating_pos.x + pane.floating_size.x;
            frame_title_rect.bottom = pane.floating_pos.y + 30;

            if( NULL == MonitorFromRect( &frame_title_rect, MONITOR_DEFAULTTONULL ) )
                b_reset_pos = true;
#else

            //    Make sure drag bar (title bar) of window intersects wxClient Area of screen, with a little slop...
            wxRect window_title_rect;// conservative estimate
            window_title_rect.x = pane.floating_pos.x;
            window_title_rect.y = pane.floating_pos.y;
            window_title_rect.width = pane.floating_size.x;
            window_title_rect.height = 30;

            wxRect ClientRect = wxGetClientDisplayRect();
            ClientRect.Deflate(60, 60);// Prevent the new window from being too close to the edge
            if(!ClientRect.Intersects(window_title_rect))
                b_reset_pos = true;

#endif

            if( b_reset_pos )
                pane.FloatingPosition( 50, 50 );
        }

        //    If the list got accidentally dropped on top of the chart bar, move it away....
        if( pane.IsDocked() && ( pane.dock_row == 0 ) ) {
            pane.Float();
            pane.Row( 1 );
            pane.Position( 0 );

        }
        pane.Caption( wxGetTranslation( _("AIS target list") ) );
        pane.Show();
        
        //  Some special setup for touch screens
        if(g_btouch){
            pane.Float();
            pane.Dockable( false );
            
            wxSize screen_size = ::wxGetDisplaySize();
            pane.FloatingSize(screen_size.x * 6/10, screen_size.y * 8/10);
            pane.FloatingPosition(screen_size.x * 2/10, screen_size.y * 1/10);
        }
        
        
        m_pAuiManager->AddPane( this, pane );
        m_pAuiManager->Update();

        g_AisTargetList_perspective = m_pAuiManager->SavePaneInfo( pane );
        pConfig->UpdateSettings();
        
        m_pAuiManager->Connect( wxEVT_AUI_PANE_CLOSE,
                wxAuiManagerEventHandler( AISTargetListDialog::OnPaneClose ), NULL, this );
    }
    else {
        //  Make an estimate of the default dialog size
        //  for the case when the AUI Perspective for this dialog is undefined
        wxSize esize;
        esize.x = 700;
        esize.y = GetCharHeight() * 10; //18;
        SetSize( esize );    
    }
    
    RecalculateSize();
}
Beispiel #17
0
void gui_ProgressBar::Resize()
{
    RecalculateSize();
    RecalculatePosition();
}
Beispiel #18
0
void Button::SetText(const WCHAR *s)
{
    str::ReplacePtr(&text, s);
    RecalculateSize(true);
}
Beispiel #19
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 );
}
void CParentNode::RecalculateSizeFull()
{
	for( long no = 0; no < GetChildCount(); no++ )
		GetChild( no )->RecalculateSizeFull();
	RecalculateSize( 0 );
}