• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetGlobalColor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetGlobalColor函数的典型用法代码示例。如果您正苦于以下问题:C++ GetGlobalColor函数的具体用法?C++ GetGlobalColor怎么用?C++ GetGlobalColor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetGlobalColor函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: tbm

void TacticsInstrument_Position::Draw(wxGCDC* dc)
{
      wxColour cl;

#ifdef __WXMSW__
      wxBitmap tbm( dc->GetSize().x, m_DataHeight * 2, -1 );
      wxMemoryDC tdc( tbm );
      wxColour c2;
      GetGlobalColor( _T("DASHB"), &c2 );
      tdc.SetBackground( c2 );
      tdc.Clear();

      tdc.SetFont(*g_pFontData );
      GetGlobalColor( _T("DASHF"), &cl );
      tdc.SetTextForeground( cl );

      tdc.DrawText(m_data1, 10, 0);
      tdc.DrawText(m_data2, 10, m_DataHeight);

      tdc.SelectObject( wxNullBitmap );

      dc->DrawBitmap(tbm, 0, m_TitleHeight, false);
#else
      dc->SetFont(*g_pFontData );
      GetGlobalColor( _T("DASHF"), &cl );
      dc->SetTextForeground( cl );

      dc->DrawText(m_data1, 10, m_TitleHeight);
      dc->DrawText(m_data2, 10, m_TitleHeight + m_DataHeight);
#endif


}
开发者ID:Hakansv,项目名称:tactics_pi,代码行数:33,代码来源:instrument.cpp


示例2: GetGlobalColor

void DashboardInstrument_GPS::DrawForeground(wxBufferedDC* dc)
{
      wxColour cl;
      GetGlobalColor(_T("BLUE1"), &cl);
      wxBrush brush;
      brush.SetStyle(wxSOLID);
      brush.SetColour(cl);
      dc->SetBrush(brush);
      dc->SetPen(*wxTRANSPARENT_PEN);
      dc->SetTextBackground(cl);
      GetGlobalColor(_T("BLUE2"), &cl);
      dc->SetTextForeground(cl);
      dc->SetBackgroundMode(wxSOLID);

      wxString label;
      wxFont font = dc->GetFont();
      for (int idx = 0; idx < 12; idx++)
      {
            if (m_SatInfo[idx].SignalToNoiseRatio)
            {
                  dc->DrawRectangle(idx*16+5, 140, 14, m_SatInfo[idx].SignalToNoiseRatio * -0.4);
                  label.Printf(_T("%02d"), m_SatInfo[idx].SatNumber);
                  int width, height;
                  dc->GetTextExtent(label, &width, &height, 0, 0, &font);
                  int posx = m_cx + m_radius * cos(deg2rad(m_SatInfo[idx].AzimuthDegreesTrue-ANGLE_OFFSET)) * sin(deg2rad(ANGLE_OFFSET-m_SatInfo[idx].ElevationDegrees)) - width/2;
                  int posy = m_cy + m_radius * sin(deg2rad(m_SatInfo[idx].AzimuthDegreesTrue-ANGLE_OFFSET)) * sin(deg2rad(ANGLE_OFFSET-m_SatInfo[idx].ElevationDegrees)) - height/2;
                  dc->DrawText(label, posx, posy);
            }
      }
}
开发者ID:bdbcat,项目名称:OpenCPN,代码行数:30,代码来源:gps.cpp


示例3: GetGlobalColor

void ODPropertiesDialogImpl::SetTableCellBackgroundColours()
{
    wxColour wxRed;
    GetGlobalColor( wxS( "URED" ), &wxRed );
    wxColour wxGreen;
    GetGlobalColor( wxS( "UGREN" ), &wxGreen );
    wxColour wxGray;
    GetGlobalColor( wxS( "GREY1" ), &wxGray );

    m_gridODWDInteractions->SetCellBackgroundColour(0, 0, wxGray);
    m_gridODWDInteractions->SetCellBackgroundColour(0, 1, wxGray);
    m_gridODWDInteractions->SetCellBackgroundColour(0, 2, wxGray);
    m_gridODWDInteractions->SetCellBackgroundColour(0, 3, wxGray);
    m_gridODWDInteractions->SetCellBackgroundColour(0, 4, wxGray);
    m_gridODWDInteractions->SetCellBackgroundColour(1, 0, wxGray);
    m_gridODWDInteractions->SetCellBackgroundColour(2, 0, wxGray);
    m_gridODWDInteractions->SetCellBackgroundColour(3, 0, wxGray);
    m_gridODWDInteractions->SetCellBackgroundColour(1, 1, wxGreen);
    m_gridODWDInteractions->SetCellBackgroundColour(2, 1, wxGreen);
    m_gridODWDInteractions->SetCellBackgroundColour(3, 1, wxGreen);
    m_gridODWDInteractions->SetCellBackgroundColour(1, 2, wxGreen);
    m_gridODWDInteractions->SetCellBackgroundColour(2, 2, wxRed);
    m_gridODWDInteractions->SetCellBackgroundColour(3, 2, wxRed);
    m_gridODWDInteractions->SetCellBackgroundColour(1, 3, wxRed);
    m_gridODWDInteractions->SetCellBackgroundColour(2, 3, wxGreen);
    m_gridODWDInteractions->SetCellBackgroundColour(3, 3, wxRed);
    m_gridODWDInteractions->SetCellBackgroundColour(1, 4, wxRed);
    m_gridODWDInteractions->SetCellBackgroundColour(2, 4, wxRed);
    m_gridODWDInteractions->SetCellBackgroundColour(3, 4, wxGreen);

    return;
}
开发者ID:CarCode,项目名称:Cocoa-OCPN,代码行数:32,代码来源:ODPropertiesDialogImpl.cpp


示例4: wxColour

void PathMan::SetColorScheme( PI_ColorScheme cs )
{
    // Re-Create the pens and colors

    m_pActiveODPointPen = wxThePenList->FindOrCreatePen( wxColour( 0, 0, 255 ), g_path_line_width, wxPENSTYLE_SOLID );
    m_pODPointPen = wxThePenList->FindOrCreatePen( wxColour( 0, 0, 255 ), g_path_line_width, wxPENSTYLE_SOLID );

//    Or in something like S-52 compliance
    wxColour tColour;
    GetGlobalColor( wxS("UINFB"), &tColour );
    m_pPathPen = wxThePenList->FindOrCreatePen( tColour, g_path_line_width, wxPENSTYLE_SOLID );
    m_pPathBrush = wxTheBrushList->FindOrCreateBrush( tColour, wxPENSTYLE_SOLID );

    GetGlobalColor( wxS("UINFO"), &tColour );
    m_pSelectedPathPen = wxThePenList->FindOrCreatePen( tColour, g_path_line_width, wxPENSTYLE_SOLID );
    m_pSelectedPathBrush = wxTheBrushList->FindOrCreateBrush( tColour, wxPENSTYLE_SOLID );

    GetGlobalColor( wxS("UARTE"), &tColour );
    m_pActivePathPen = wxThePenList->FindOrCreatePen( tColour, g_path_line_width, wxPENSTYLE_SOLID );

    GetGlobalColor( wxS("PLRTE"), &tColour );
    m_pActivePathBrush = wxTheBrushList->FindOrCreateBrush( tColour, wxPENSTYLE_SOLID );
    m_pActiveODPointBrush =  wxTheBrushList->FindOrCreateBrush( tColour, wxPENSTYLE_SOLID);

    m_pActiveODPointPen = wxThePenList->FindOrCreatePen( tColour, g_path_line_width, wxPENSTYLE_SOLID );
    GetGlobalColor( wxS("CHBLK"), &tColour );
    m_pODPointPen = wxThePenList->FindOrCreatePen( tColour, g_path_line_width, wxPENSTYLE_SOLID );
    m_pODPointBrush = wxTheBrushList->FindOrCreateBrush( tColour, wxPENSTYLE_SOLID);

}
开发者ID:cagscat,项目名称:ocpn_draw_pi,代码行数:30,代码来源:PathMan.cpp


示例5: _T

StatWin::StatWin( wxWindow *win )
{

    long wstyle = wxSIMPLE_BORDER | wxFRAME_NO_TASKBAR;
#ifndef __WXMAC__
    wstyle |= wxFRAME_SHAPED;
#endif
#ifdef __WXMAC__
    wstyle |= wxSTAY_ON_TOP;
#endif

    wxDialog::Create( win, wxID_ANY, _T(""), wxPoint( 20, 20 ), wxSize( 5, 5 ), wstyle );

    int x, y;
    GetClientSize( &x, &y );

    m_backBrush = wxBrush( GetGlobalColor( _T("UIBDR") ), wxSOLID );

    SetBackgroundColour( GetGlobalColor( _T("UIBDR") ) );

    SetBackgroundStyle( wxBG_STYLE_CUSTOM ); // on WXMSW, this prevents flashing on color scheme change

    m_rows = 1;

    //   Create the Children

    pPiano = new PianoWin( (wxFrame *) this );

}
开发者ID:Choony,项目名称:OpenCPN,代码行数:29,代码来源:statwin.cpp


示例6: wxWindow

// ctor
StatWin::StatWin(wxFrame *frame):
 wxWindow(frame, wxID_ANY, wxPoint(20,20), wxSize(5,5), wxSIMPLE_BORDER)

{
      int x,y;
      GetClientSize(&x, &y);

      m_backBrush = wxBrush(GetGlobalColor(_T("UIBDR")), wxSOLID);

      SetBackgroundColour(GetGlobalColor(_T("UIBDR")));

      SetBackgroundStyle(wxBG_STYLE_CUSTOM);  // on WXMSW, this prevents flashing on color scheme change

      m_rows = 1;

 //   Create the Children

      pPiano = new PianoWin((wxFrame *)this);
      pPiano->SetSize(0, 0, x *6/10, y*1/m_rows);

#ifdef USE_WIFI_CLIENT
      pWiFi = new WiFiStatWin((wxFrame *)this);
      pWiFi->SetSize(x * 6/10, 0, x *4/10, y * 1/m_rows);
#endif

 }
开发者ID:tai-fun,项目名称:OpenCPN,代码行数:27,代码来源:statwin.cpp


示例7: wxGrid

//------------------------------------------------------------------------------
//          custom grid implementation
//------------------------------------------------------------------------------
CustomGrid::CustomGrid( wxWindow *parent, wxWindowID id, const wxPoint &pos,
					   const wxSize &size, long style,
					   const wxString &name )
  : wxGrid( parent, id, pos, size, style, name )
{
    //create grid
    SetTable( new wxGridStringTable(0, 0), true, wxGridSelectRows );
    //some general settings
    EnableEditing( false );
    EnableGridLines( true );
    EnableDragGridSize( false );
    SetMargins( 0, 0 );
    EnableDragColMove( false );
    EnableDragColSize( false );
    EnableDragRowSize( false );
    //init rows pref
    wxFileConfig *pConf = GetOCPNConfigObject();
    if (pConf) {
        pConf->SetPath(_T("/Settings/GRIB"));
        m_IsDigit = pConf->Read(_T("GribDataTableRowPref"), _T("XXX"));
    }
    if( m_IsDigit.Len() != wxString(_T("XXX")).Len() ) m_IsDigit = _T("XXX");
    //create structure for all numerical rows
    for( unsigned int i = 0; i < m_IsDigit.Len(); i++ ){
        m_NumRow.push_back(wxNOT_FOUND);
        m_NumRowVal.push_back(std::vector <double>());
    }
    //init labels attr
    wxFont labelfont = GetOCPNGUIScaledFont_PlugIn( _T("Dialog") ).MakeBold();
    SetLabelFont(labelfont);
    wxColour colour;
    GetGlobalColor(_T("DILG0"), &colour);
    SetLabelBackgroundColour(colour);
    //set row label size
    int w;
    GetTextExtent( _T("Ab"), &w, NULL, 0, 0, &labelfont);
    double x = (double)w * 6.5;
    SetRowLabelSize((int)x);
    //colour settings
    GetGlobalColor(_T("GREEN1"), &m_greenColour);
    GetGlobalColor(_T("DILG1"), &m_greyColour);

#ifdef __WXOSX__
    m_bLeftDown = false;
#endif

    //connect events at dialog level
    Connect(wxEVT_SCROLLWIN_THUMBTRACK, wxScrollEventHandler( CustomGrid::OnScroll ), NULL, this );
    Connect(wxEVT_SIZE, wxSizeEventHandler( CustomGrid::OnResize ), NULL, this );
    Connect(wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( CustomGrid::OnLabeClick ), NULL, this );
    //connect events at grid level
    GetGridWindow()->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler( CustomGrid::OnMouseEvent ), NULL, this );
    GetGridWindow()->Connect(wxEVT_LEFT_UP, wxMouseEventHandler( CustomGrid::OnMouseEvent ), NULL, this );
    GetGridWindow()->Connect(wxEVT_MOTION, wxMouseEventHandler( CustomGrid::OnMouseEvent ), NULL, this );
    //timer event
    m_tRefreshTimer.Connect(wxEVT_TIMER, wxTimerEventHandler( CustomGrid::OnRefreshTimer ), NULL, this);
}
开发者ID:OpenCPN,项目名称:OpenCPN,代码行数:60,代码来源:CustomGrid.cpp


示例8: GetClientSize

void WiFiStatWin::OnPaint(wxPaintEvent& event)
{
    int width, height;
    GetClientSize(&width, &height );
    wxPaintDC dc(this);

    dc.SetBackground(backBrush);
    dc.Clear();

    int bar_total = width / NSIGBARS;

//    Create the Signal Strength Indicators
    dc.SetBrush(backBrush);
    wxPen ppPen(GetGlobalColor(_T("UBLCK")), 1, wxSOLID);
    dc.SetPen(ppPen);

    if(m_bserverstat)
    {
        for(int ista = 0 ; ista < NSIGBARS ; ista++)
        {
            if(0 != m_quality[ista])
            {
                int x = width - bar_total * (ista + 1);

                dc.SetBrush(backBrush);
                dc.DrawRectangle(x+2, 2, bar_total-4 , height-4);

                // Old stations get soft color bars
                if(m_age[ista])
                {
                    dc.SetBrush(qual_hiBrush);
                    if(m_secure[ista])
                        dc.SetBrush(secureBrush);
                }
                else
                {
                    dc.SetBrush(qual_hiNewBrush);
                    if(m_secure[ista])
                        dc.SetBrush(secureNewBrush);
                }

                DrawBars(dc, x+2, 2, bar_total-4 , height-4, m_quality[ista], 100);
            }
        }
    }
    else
    {
        wxPen yellowPen(GetGlobalColor(_T("CHYLW")), 1, wxSOLID);
        dc.SetPen(yellowPen);

        dc.DrawLine(1, 1, width-1, 1);
        dc.DrawLine(width-1, 1, width-1, height-1);
        dc.DrawLine(width-1, height-1, 1, height-1);
        dc.DrawLine(1, height-1, 1, 1);
    }
}
开发者ID:tai-fun,项目名称:OpenCPN,代码行数:56,代码来源:statwin.cpp


示例9: GetClientSize

void ChInfoWin::OnPaint( wxPaintEvent& event )
{
    int width, height;
    GetClientSize( &width, &height );
    wxPaintDC dc( this );

    dc.SetBrush( wxBrush( GetGlobalColor( _T ( "UIBCK" ) ) ) );
    dc.SetPen( wxPen( GetGlobalColor( _T ( "UITX1" ) ) ) );
    dc.DrawRectangle( 0, 0, width, height );
}
开发者ID:registry,项目名称:OpenCPN,代码行数:10,代码来源:ChInfoWin.cpp


示例10: rand

bool IACIsobarSystem::Draw(wxDC *dc, PlugIn_ViewPort *vp, TexFont &numfont, TexFont &sysfont) {
    bool hasDrawn = false;
    // draw isobar text at a random position of the isoline to prevent
    // text clutter. Getting the random positiuon must be before
    // "if" because otherwise the positions depend on the viewport
    int randomPositionIndex = rand() % m_positions.Count();

    if (dc) {
        wxColour colour;
        GetGlobalColor(_T ( "CHBLK" ), &colour);
        wxPen pen(colour, ISOBAR_WIDTH);
        dc->SetPen(pen);
        dc->SetBrush(*wxTRANSPARENT_BRUSH);

        hasDrawn = DrawPositions(dc, vp);
        if (hasDrawn) {
            GeoPoint &Pos = m_positions[randomPositionIndex];
            if (PointInLLBox(vp, Pos.x, Pos.y)) {
                wxPoint p;
                GetCanvasPixLL(vp, &p, Pos.y, Pos.x);
                dc->SetTextForeground(colour);
                wxFont *font = wxTheFontList->FindOrCreateFont(NUMBERS_FONT_SIZE, wxFONTFAMILY_SWISS, wxNORMAL, wxFONTWEIGHT_NORMAL,
                                                               FALSE, wxString(_T ( "Arial" )));
                dc->SetFont(*font);
                wxString msg;
                msg.Printf(wxT("%u"), m_val);
                wxSize s1 = dc->GetTextExtent(msg);
                dc->DrawText(msg, p.x - (s1.GetWidth() / 2), p.y - (s1.GetHeight()));
            }
        }
    } else {
        GetGlobalColor(_T ( "CHBLK" ), &m_isoLineColor);
        m_isoLineWidth = wxMax(ISOBAR_WIDTH, GL_MIN_LINE_WIDTH);
        hasDrawn = DrawPositions(dc, vp);
        if (hasDrawn) {
            wxColour colour;
            GetGlobalColor(_T ( "CHBLK" ), &colour);
            GeoPoint &Pos = m_positions[randomPositionIndex];
            wxPoint p;
            GetCanvasPixLL(vp, &p, Pos.y, Pos.x);
            wxString msg;
            msg.Printf(wxT("%u"), m_val);
            int w, h;
            glEnable(GL_BLEND);
            glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
            glEnable(GL_TEXTURE_2D);
            glColor3ub(colour.Red(), colour.Green(), colour.Blue());
            numfont.GetTextExtent(msg, &w, &h);
            numfont.RenderString(msg, p.x - (w / 2), p.y - (h / 2));
            glDisable(GL_TEXTURE_2D);
            glDisable(GL_BLEND);
        }
    }
    return hasDrawn;
}
开发者ID:rgleason,项目名称:iacfleet_pi,代码行数:55,代码来源:iacfile.cpp


示例11: wxBrush

void WiFiStatWin::SetColorScheme(ColorScheme cs)
{
    backBrush = wxBrush(GetGlobalColor(_T("UIBDR")), wxSOLID);

    qual_hiBrush =   wxBrush(GetGlobalColor(_T("CHYLW")), wxSOLID);    //Yellow
    secureBrush =    wxBrush(GetGlobalColor(_T("UINFO")), wxSOLID);    //Orange

    qual_hiNewBrush =   wxBrush(GetGlobalColor(_T("UGREN")), wxSOLID); //Bright Green
    secureNewBrush =    wxBrush(GetGlobalColor(_T("URED")), wxSOLID);  //Bright Red

}
开发者ID:tai-fun,项目名称:OpenCPN,代码行数:11,代码来源:statwin.cpp


示例12: SetBackgroundColour

void ChInfoWin::SetBitmap()
{
    SetBackgroundColour( GetGlobalColor( _T ( "UIBCK" ) ) );

    m_pInfoTextCtl->SetBackgroundColour( GetGlobalColor( _T ( "UIBCK" ) ) );
    m_pInfoTextCtl->SetForegroundColour( GetGlobalColor( _T ( "UITX1" ) ) );

    m_pInfoTextCtl->SetSize( 1, 1, m_size.x - 2, m_size.y - 2 );
    m_pInfoTextCtl->SetLabel( m_string );

    SetSize( m_position.x, m_position.y, m_size.x, m_size.y );
}
开发者ID:buya07,项目名称:KomodoExercise,代码行数:12,代码来源:ChInfoWin.cpp


示例13: GetGlobalColor

void DashboardInstrument_Dial::DrawForeground(wxGCDC* dc)
{
      // The default foreground is the arrow used in most dials
      wxColour cl;
      GetGlobalColor(_T("DASH2"), &cl);
      wxPen pen1;
      pen1.SetStyle(wxSOLID);
      pen1.SetColour(cl);
      pen1.SetWidth(2);
      dc->SetPen(pen1);
      GetGlobalColor(_T("DASH1"), &cl);
      wxBrush brush1;
      brush1.SetStyle(wxSOLID);
      brush1.SetColour(cl);
      dc->SetBrush(brush1);
      dc->DrawCircle(m_cx, m_cy, m_radius / 8);

      dc->SetPen(*wxTRANSPARENT_PEN);

      GetGlobalColor(_T("DASHN"), &cl);
      wxBrush brush;
      brush.SetStyle(wxSOLID);
      brush.SetColour(cl);
      dc->SetBrush(brush);

      /* this is fix for a +/-180° round instrument, when m_MainValue is supplied as <0..180><L | R>
       * for example TWA & AWA */
      double data;
      if(m_MainValueUnit == _T("DegL"))
          data=360-m_MainValue;
      else
          data=m_MainValue;

      // The arrow should stay inside fixed limits
      double val;
      if (data < m_MainValueMin) val = m_MainValueMin;
      else if (data > m_MainValueMax) val = m_MainValueMax;
      else val = data;

      double value = deg2rad((val - m_MainValueMin) * m_AngleRange / (m_MainValueMax - m_MainValueMin)) + deg2rad(m_AngleStart - ANGLE_OFFSET);

      wxPoint points[4];
      points[0].x = m_cx + (m_radius * 0.95 * cos(value - .010));
      points[0].y = m_cy + (m_radius * 0.95 * sin(value - .010));
      points[1].x = m_cx + (m_radius * 0.95 * cos(value + .015));
      points[1].y = m_cy + (m_radius * 0.95 * sin(value + .015));
      points[2].x = m_cx + (m_radius * 0.22 * cos(value + 2.8));
      points[2].y = m_cy + (m_radius * 0.22 * sin(value + 2.8));
      points[3].x = m_cx + (m_radius * 0.22 * cos(value - 2.8));
      points[3].y = m_cy + (m_radius * 0.22 * sin(value - 2.8));
      dc->DrawPolygon(4, points, 0, 0);
}
开发者ID:doublespy,项目名称:OpenCPN,代码行数:52,代码来源:dial.cpp


示例14: GetClientSize

void DashboardInstrument_Depth::DrawBackground(wxGCDC* dc)
{
      wxSize size = GetClientSize();
      wxColour cl;

      GetGlobalColor(_T("DASHL"), &cl);
      dc->SetTextForeground(cl);

      wxPen pen;
      pen.SetStyle(wxPENSTYLE_SOLID);
      GetGlobalColor(_T("DASHF"), &cl);
      pen.SetColour(cl);
      pen.SetWidth(1);
      dc->SetPen(pen);

      dc->DrawLine(3, 50, size.x-3, 50);
      dc->DrawLine(3, 140, size.x-3, 140);

#ifdef __WXMSW__
      pen.SetStyle(wxPENSTYLE_SHORT_DASH);
#else
      pen.SetStyle(wxPENSTYLE_DOT);
      pen.SetWidth(1);
#endif

      dc->SetPen(pen);
      dc->DrawLine(3, 65, size.x-3, 65);
      dc->DrawLine(3, 90, size.x-3, 90);
      dc->DrawLine(3, 115, size.x-3, 115);

      dc->SetFont(*g_pFontSmall);

      m_MaxDepth = 0;
      for (int idx = 0; idx < DEPTH_RECORD_COUNT; idx++)
      {
            if (m_ArrayDepth[idx] > m_MaxDepth)
                  m_MaxDepth = m_ArrayDepth[idx];
      }
      // Increase MaxDepth slightly for nicer display
      m_MaxDepth *= 1.2;

      wxString label;
      label.Printf(_T("%.0f ")+m_DepthUnit, 0.0);
      int width, height;
      dc->GetTextExtent(label, &width, &height, 0, 0, g_pFontSmall);
      dc->DrawText(label, size.x-width-1, 40-height);

      label.Printf(_T("%.0f ")+m_DepthUnit, m_MaxDepth);
      dc->GetTextExtent(label, &width, &height, 0, 0, g_pFontSmall);
      dc->DrawText(label, size.x-width-1, size.y-height);
}
开发者ID:CarCode,项目名称:Cocoa-OCPN,代码行数:51,代码来源:depth.cpp


示例15: SetBackgroundColour

void ChInfoWin::SetBitmap()
{
    SetBackgroundColour( GetGlobalColor( _T ( "UIBCK" ) ) );

    m_pInfoTextCtl->SetBackgroundColour( GetGlobalColor( _T ( "UIBCK" ) ) );
    m_pInfoTextCtl->SetForegroundColour( GetGlobalColor( _T ( "UITX1" ) ) );

    m_pInfoTextCtl->SetSize( 1, 1, m_size.x - 2, m_size.y - 2 );
    m_pInfoTextCtl->SetLabel( m_string );

    wxPoint top_position = m_position; //GetParent()->ClientToScreen( m_position);
    SetSize( top_position.x, top_position.y, m_size.x, m_size.y );
    SetClientSize( m_size.x, m_size.y );
}
开发者ID:registry,项目名称:OpenCPN,代码行数:14,代码来源:ChInfoWin.cpp


示例16: GetGlobalColor

void DashboardInstrument_Compass::DrawBackground(wxBufferedDC* dc)
{
      wxPen pen;

//      wxBrush brushHatch(*wxLIGHT_GREY, wxTRANSPARENT);

      // Now draw the boat
      wxColour cl;
      GetGlobalColor(_T("GREY1"), &cl);
      pen.SetStyle(wxSOLID);
      pen.SetColour(cl);
      dc->SetPen(pen);
      GetGlobalColor(_T("GREY2"), &cl);
      dc->SetBrush(cl);

      wxPoint points[7];

/*
 *           0
 *          /\
 *         /  \
 *        /    \
 *     6 /      \ 1
 *      |   X    |
 *      |        |
 *    5 |        | 2
 *       \      /
 *        \__ _/
 *        4    3
 */
      points[0].x = m_cx;
      points[0].y = m_cy - m_radius * .50; // a little bit longer than compass rose
      points[1].x = m_cx + m_radius * .15;
      points[1].y = m_cy;
      points[2].x = m_cx + m_radius * .15;
      points[2].y = m_cy + m_radius * .20;
      points[3].x = m_cx + m_radius * .10;
      points[3].y = m_cy + m_radius * .40;
      points[4].x = m_cx - m_radius * .10;
      points[4].y = m_cy + m_radius * .40;
      points[5].x = m_cx - m_radius * .15;
      points[5].y = m_cy + m_radius * .20;
      points[6].x = m_cx - m_radius * .15;
      points[6].y = m_cy;

      dc->DrawPolygon(7, points, 0, 0);

      DrawCompassRose(dc);
}
开发者ID:epolyan,项目名称:OpenCPN,代码行数:49,代码来源:compass.cpp


示例17: GetGlobalColor

bool GetGlobalColor(wxString colorName, wxColour *pcolour)
{
      wxColour c = GetGlobalColor(colorName);
      *pcolour = c;

      return true;
}
开发者ID:biiont,项目名称:OpenCPN,代码行数:7,代码来源:pluginmanager.cpp


示例18: wxWindow

TStatWin::TStatWin( wxFrame *frame ) :
        wxWindow( frame, wxID_ANY, wxPoint( 20, 20 ), wxSize( 5, 5 ), wxSIMPLE_BORDER )
{
    SetBackgroundColour( GetGlobalColor( _T("UIBDR") ) );
    pText = new wxString();
    bTextSet = false;
}
开发者ID:Choony,项目名称:OpenCPN,代码行数:7,代码来源:statwin.cpp


示例19: GetGlobalColor

void TacticsInstrument_AppTrueWindAngle::Draw(wxGCDC* bdc)
{
	wxColour c1;
	GetGlobalColor(_T("DASHB"), &c1);
	wxBrush b1(c1);
	bdc->SetBackground(b1);
	bdc->Clear();

	wxSize size = GetClientSize();
	m_cx = size.x / 2;
	int availableHeight = size.y - m_TitleHeight - 6;
	int width, height;
	bdc->GetTextExtent(_T("000"), &width, &height, 0, 0, g_pFontLabel);
	m_cy = m_TitleHeight + 2;
	m_cy += availableHeight / 2;
	m_radius = availableHeight / 2.0 * 0.95;


	DrawLabels(bdc);
	DrawFrame(bdc);
	DrawMarkers(bdc);
	DrawBackground(bdc);
	DrawData(bdc, m_MainValueApp, m_MainValueAppUnit, m_MainValueFormat, m_MainValueOption1);
	DrawData(bdc, m_MainValueTrue, m_MainValueTrueUnit, m_MainValueFormat, m_MainValueOption2);
	DrawData(bdc, m_ExtraValueApp, m_ExtraValueAppUnit, m_ExtraValueFormat, m_ExtraValueOption1);
	DrawData(bdc, m_ExtraValueTrue, m_ExtraValueTrueUnit, m_ExtraValueFormat, m_ExtraValueOption2);
    DrawData(bdc, m_TWD, m_MainValueTrueUnit, _T("TWD:%.0f"), DIAL_POSITION_INSIDE);

	DrawForeground(bdc);
}
开发者ID:CarCode,项目名称:Cocoa-OCPN,代码行数:30,代码来源:wind.cpp


示例20: GetGlobalColor

void AnnunText::SetColorScheme( ColorScheme cs )
{
    ocpnStyle::Style* style = g_StyleManager->GetCurrentStyle();
    m_pbackBrush = wxTheBrushList->FindOrCreateBrush( GetGlobalColor( _T("UBLCK") ), wxSOLID );

    m_text_color = style->consoleFontColor;
}
开发者ID:IgorMikhal,项目名称:OpenCPN,代码行数:7,代码来源:concanv.cpp



注:本文中的GetGlobalColor函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetGlobalTeam函数代码示例发布时间:2022-05-30
下一篇:
C++ GetGeometry函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap