本文整理汇总了C++中GetGlobalColor函数的典型用法代码示例。如果您正苦于以下问题:C++ GetGlobalColor函数的具体用法?C++ GetGlobalColor怎么用?C++ GetGlobalColor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetGlobalColor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
}
示例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);
}
}
}
示例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;
}
示例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);
}
示例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 );
}
示例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
}
示例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);
}
示例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);
}
}
示例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 );
}
示例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;
}
示例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
}
示例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 );
}
示例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);
}
示例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);
}
示例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 );
}