当前位置: 首页>>代码示例>>C++>>正文


C++ GetColour函数代码示例

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


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

示例1: QRegion

// If this is opaque it obscures the underlying area.
QRegion MHRectangle::GetOpaqueArea()
{
    if (! m_fRunning)
    {
        return QRegion();
    }

    MHRgba lineColour = GetColour(m_LineColour);
    MHRgba fillColour = GetColour(m_FillColour);

    // If the fill is transparent or semi-transparent we return an empty region and
    // ignore the special case where the surrounding box is opaque.
    if (fillColour.alpha() != 255)
    {
        return QRegion();
    }

    if (lineColour.alpha() == 255 || m_nLineWidth == 0)
    {
        return QRegion(QRect(m_nPosX, m_nPosY, m_nBoxWidth, m_nBoxHeight));
    }

    if (m_nBoxWidth <= 2 * m_nLineWidth || m_nBoxHeight <= 2 * m_nLineWidth)
    {
        return QRegion();
    }
    else return QRegion(QRect(m_nPosX + m_nLineWidth, m_nPosY + m_nLineWidth,
                                  m_nBoxWidth - m_nLineWidth * 2, m_nBoxHeight - m_nLineWidth * 2));
}
开发者ID:StefanRoss,项目名称:mythtv,代码行数:30,代码来源:Visible.cpp

示例2: GUIXGetWindowColours

void GUIXGetWindowColours( gui_window * wnd, gui_colour_set * colours )
{
    int i;

    for( i = 0; i < wnd->num_attrs; i++ ) {
        colours[i].fore = GetColour( GETFG( wnd->colours[i] ) );
        colours[i].back = GetColour( GETBG( wnd->colours[i] ) );
    }
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:9,代码来源:guicolor.c

示例3: GetColour

bool Tapplication::LoadSkin( const char* filename )
{
	IniFile file;
	if ( !file.Load( filename ) )
		return false;

	GetColour( file, "Frame", m_colors[normalColors].frameColor );
	GetColour( file, "Background", m_colors[normalColors].bgColor );
	GetColour( file, "TextForeground", m_colors[normalColors].textColor );

	m_colors[highlightColors].frameColor = m_colors[normalColors].frameColor;
	GetColour( file, "Highlight", m_colors[highlightColors].bgColor );
	GetColour( file, "TextHighlightedForeground", m_colors[highlightColors].textColor );

	m_colors[headerColors].frameColor = m_colors[normalColors].frameColor;
	GetColour( file, "TitleBackground", m_colors[headerColors].bgColor );
	GetColour( file, "TitleForeground", m_colors[headerColors].textColor);

	// default footer colours to the normal colours in case the ini file doesn't contain them
	m_colors[footerColors].frameColor = m_colors[normalColors].frameColor;
	m_colors[footerColors].bgColor = m_colors[normalColors].bgColor;
	m_colors[footerColors].textColor = m_colors[normalColors].textColor;
	GetColour( file, "FooterBackground", m_colors[headerColors].bgColor );
	GetColour( file, "FooterForeground", m_colors[headerColors].textColor);

	m_colors[scrollBarColors].frameColor = m_colors[headerColors].frameColor;
	m_colors[scrollBarColors].bgColor = m_colors[headerColors].bgColor;
	m_colors[scrollBarColors].textColor = m_colors[headerColors].textColor;

	return true;
}
开发者ID:BackupTheBerlios,项目名称:tap-svn,代码行数:31,代码来源:Tapplication.cpp

示例4: GetStyle

bool CWinGlkWndTextGrid::MeasureStyle(int iStyle, int iHint, glui32* pResult)
{
  bool bMeasured = true;

  CWinGlkStyle* pStyle = GetStyle(iStyle);
  if (pStyle)
  {
    switch (iHint)
    {
    case stylehint_Indentation:
    case stylehint_ParaIndentation:
    case stylehint_Weight:
    case stylehint_Oblique:
    case stylehint_Proportional:
      if (pResult)
        *pResult = 0;
      break;
    case stylehint_Size:
      if (pResult)
        *pResult = pStyle->m_Size;
      break;
    case stylehint_Justification:
      if (pResult)
        *pResult = stylehint_just_LeftFlush;
      break;
    case stylehint_TextColor:
      if (pResult)
      {
        int iColour = GetColour(pStyle->m_TextColour);
        BYTE r = (BYTE)((iColour & 0x00FF0000) >> 16);
        BYTE g = (BYTE)((iColour & 0x0000FF00) >> 8);
        BYTE b = (BYTE)((iColour & 0x000000FF));
        (*pResult) = RGB(r,g,b);
      }
      break;
    case stylehint_BackColor:
      if (pResult)
      {
        int iColour = GetColour(pStyle->m_BackColour);
        BYTE r = (BYTE)((iColour & 0x00FF0000) >> 16);
        BYTE g = (BYTE)((iColour & 0x0000FF00) >> 8);
        BYTE b = (BYTE)((iColour & 0x000000FF));
        (*pResult) = RGB(r,g,b);
      }
      break;
    case stylehint_ReverseColor:
      if (pResult)
        *pResult = pStyle->m_ReverseColour;
      break;
    default:
      bMeasured = false;
      break;
    }
  }
  else
开发者ID:EmacsUser,项目名称:Windows-Glk,代码行数:55,代码来源:GlkWindowTextGrid.cpp

示例5: XRC_MAKE_INSTANCE

wxObject * MaxBannerWindowXmlHandler::DoCreateResource()
{
    XRC_MAKE_INSTANCE(banner, MaxBannerWindow)

    banner->Create(m_parentAsWindow,
                   GetID(),
                   GetDirection(wxS("direction")),
                   GetPosition(),
                   GetSize(),
                   GetStyle(wxS("style")),
                   GetName());

	banner->MaxBind(CB_PREF(wx_wxbannerwindow_wxBannerWindow__xrcNew)(banner));

    SetupWindow(banner);

    const wxColour colStart = GetColour(wxS("gradient-start"));
    const wxColour colEnd = GetColour(wxS("gradient-end"));
    if ( colStart.IsOk() || colEnd.IsOk() )
    {
        if ( !colStart.IsOk() || !colEnd.IsOk() )
        {
            ReportError
            (
                "Both start and end gradient colours must be "
                "specified if either one is."
            );
        }
        else
        {
            banner->SetGradient(colStart, colEnd);
        }
    }

    wxBitmap bitmap = GetBitmap();
    if ( bitmap.IsOk() )
    {
        if ( colStart.IsOk() || colEnd.IsOk() )
        {
            ReportError
            (
                "Gradient colours are ignored by wxBannerWindow "
                "if the background bitmap is specified."
            );
        }

        banner->SetBitmap(bitmap);
    }

    banner->SetText(GetText(wxS("title")), GetText(wxS("message")));

    return banner;
}
开发者ID:maxmods,项目名称:wx.mod,代码行数:53,代码来源:glue.cpp

示例6: DrawBrick

void byoSnake::DrawBorder(wxDC* DC)
{
    for ( int i=0; i<m_FieldHoriz+2; i++ )
    {
        DrawBrick(DC,i,2,GetColour(m_BorderColour));
        DrawBrick(DC,i,3+m_FieldVert,GetColour(m_BorderColour));
    }
    for ( int i=0; i<m_FieldVert; i++ )
    {
        DrawBrick(DC,0,i+3,GetColour(m_BorderColour));
        DrawBrick(DC,m_FieldHoriz+1,i+3,GetColour(m_BorderColour));
    }
}
开发者ID:stahta01,项目名称:codeAdapt_IDE,代码行数:13,代码来源:byosnake.cpp

示例7: switch

const wxPen* wxStockGDI::GetPen(Item item)
{
    wxPen* pen = static_cast<wxPen*>(ms_stockObject[item]);
    if (pen == NULL)
    {
        switch (item)
        {
        case PEN_BLACK:
            pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxPENSTYLE_SOLID);
            break;
        case PEN_BLACKDASHED:
            pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxPENSTYLE_SHORT_DASH);
            break;
        case PEN_BLUE:
            pen = new wxPen(*GetColour(COLOUR_BLUE), 1, wxPENSTYLE_SOLID);
            break;
        case PEN_CYAN:
            pen = new wxPen(*GetColour(COLOUR_CYAN), 1, wxPENSTYLE_SOLID);
            break;
        case PEN_GREEN:
            pen = new wxPen(*GetColour(COLOUR_GREEN), 1, wxPENSTYLE_SOLID);
            break;
        case PEN_YELLOW:
            pen = new wxPen(*GetColour(COLOUR_YELLOW), 1, wxPENSTYLE_SOLID);
            break;
        case PEN_GREY:
            pen = new wxPen(wxColour(wxT("GREY")), 1, wxPENSTYLE_SOLID);
            break;
        case PEN_LIGHTGREY:
            pen = new wxPen(*GetColour(COLOUR_LIGHTGREY), 1, wxPENSTYLE_SOLID);
            break;
        case PEN_MEDIUMGREY:
            pen = new wxPen(wxColour(wxT("MEDIUM GREY")), 1, wxPENSTYLE_SOLID);
            break;
        case PEN_RED:
            pen = new wxPen(*GetColour(COLOUR_RED), 1, wxPENSTYLE_SOLID);
            break;
        case PEN_TRANSPARENT:
            pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxPENSTYLE_TRANSPARENT);
            break;
        case PEN_WHITE:
            pen = new wxPen(*GetColour(COLOUR_WHITE), 1, wxPENSTYLE_SOLID);
            break;
        default:
            wxFAIL;
        }
        ms_stockObject[item] = pen;
    }
    return pen;
}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:50,代码来源:gdicmn.cpp

示例8: wxT

void ColorPicker::Save(wxString const &group)
{
	wxString rkey = group + wxT("red");
	wxString gkey = group + wxT("green");
	wxString bkey = group + wxT("blue");
	wxString akey = group + wxT("alpha");

	wxConfigBase *config = wxConfig::Get();

	config->Write(rkey, GetColour().Red());
	config->Write(gkey, GetColour().Green());
	config->Write(bkey, GetColour().Blue());
	config->Write(akey, GetColour().Alpha());

}
开发者ID:FlavioFalcao,项目名称:osmbrowser,代码行数:15,代码来源:rulecontrol.cpp

示例9: dc

void CColourPopup::ChangeSelection(int nIndex)
{
    CClientDC dc(this);        // device context for drawing

    if (nIndex > m_nNumColours)
        nIndex = CUSTOM_BOX_VALUE; 

    if ((m_nCurrentSel >= 0 && m_nCurrentSel < m_nNumColours) ||
        m_nCurrentSel == CUSTOM_BOX_VALUE || m_nCurrentSel == DEFAULT_BOX_VALUE)
    {
        // Set Current selection as invalid and redraw old selection (this way
        // the old selection will be drawn unselected)
        int OldSel = m_nCurrentSel;
        m_nCurrentSel = INVALID_COLOUR;
        DrawCell(&dc, OldSel);
    }

    // Set the current selection as row/col and draw (it will be drawn selected)
    m_nCurrentSel = nIndex;
    DrawCell(&dc, m_nCurrentSel);

    // Store the current colour
    if (m_nCurrentSel == CUSTOM_BOX_VALUE)
        m_pParent->SendMessage(CPN_SELCHANGE, (WPARAM) m_crInitialColour, 0);
    else if (m_nCurrentSel == DEFAULT_BOX_VALUE)
    {
        m_crColour = CLR_DEFAULT;
        m_pParent->SendMessage(CPN_SELCHANGE, (WPARAM) CLR_DEFAULT, 0);
    }
    else
    {
        m_crColour = GetColour(m_nCurrentSel);
        m_pParent->SendMessage(CPN_SELCHANGE, (WPARAM) m_crColour, 0);
    }
}
开发者ID:BackupTheBerlios,项目名称:iris-svn,代码行数:35,代码来源:ColourPopup.cpp

示例10: GetColour

void MusWxDC::SetPen( int colour, int width, int style )
{
    m_pen.SetColour( GetColour( colour ) );
    m_pen.SetWidth( width );
    m_pen.SetStyle( style );
    m_dc->SetPen( m_pen );
}
开发者ID:DDMAL,项目名称:aruspix,代码行数:7,代码来源:muswxdc.cpp

示例11: IlluminateButton

void IlluminateButton( uint8_t theId )
{
    volatile t_ATime* KeyTimer = GetKeyTimer( theId );
    volatile uint8_t* SequenceState = GetSequenceState( theId );
    
    if ( ( MaturedTimer( KeyTimer ) ) || ( SequenceState == 0 ) )
    {
        volatile t_Sequences Sequence = GetSequence( theId );
        
        switch ( GetColour( Sequence, SequenceState, KeyTimer ) )
        {
            case e_Off:
                ColourNone( theId );
                break;

            case e_ColourA:
                ColourA( theId );
                break;

            case e_ColourB:
                ColourB( theId );
                break;
        }
    }
}
开发者ID:Grahamsoft,项目名称:FPQ,代码行数:25,代码来源:OutputTask.c

示例12: ToRenderUnits

	void OverlayTask::Update()
	{
		for (auto it = m_Selected.begin(), end = m_Selected.end(); it != end; ++it)
		{
			const auto& entity = *it;

			auto pos = entity->GetPosition();
			pos.x = ToRenderUnits(pos.x), pos.y = ToRenderUnits(pos.y);
			pos += m_Offset;

			clan::Rectf box(clan::Sizef(50, 50));
			box.translate(pos.x - box.get_width() * 0.5f, pos.y - box.get_height() * 0.5f);

			m_DebugDraw.DrawRectangle(box, GetColour(it));
		}

		if (m_EditCam)
		{
			clan::Colorf rangeColour(1.0f, 0.6f, 0.6f, 0.95f);
			auto center = m_EditCam->GetPosition();
			auto radius = ToRenderUnits(m_CamRange);
			clan::Rectf camRect(center.x - radius, center.y - radius, center.x + radius, center.y + radius);
			m_DebugDraw.DrawRectangle(camRect, rangeColour);
		}

		if (m_PolygonTool && m_PolygonTool->IsActive())
			m_PolygonTool->Draw();
		if (m_RectangleTool && m_RectangleTool->IsActive())
			m_RectangleTool->Draw();
		if (m_CircleTool && m_CircleTool->IsActive())
			m_CircleTool->Draw();
	}
开发者ID:Kezeali,项目名称:Fusion,代码行数:32,代码来源:FusionEditorWorld.cpp

示例13: GetColour

void GPX::UpdateWPRender(void)
{
	/* iterate through all waypoints and caculate which color to render them in */
	unsigned int e;
	GPXWPRenderRow *frow;

	for(e=0;e<m_labelcolourtable.GetNumChildren();++e)
	{
		frow=static_cast<GPXWPRenderRow *>(m_labelcolourtable.GetChild(e));	/* reset match counters */
		frow->ClearCount();
	}

	for(e=0;e<m_numwpts;++e)
		GetColour(m_wptlist.GetEntry(e));

	/* copy colors to the route table */
	m_routes.CopyColors();

	for(e=0;e<m_labelcolourtable.GetNumChildren();++e)
	{
		frow=static_cast<GPXWPRenderRow *>(m_labelcolourtable.GetChild(e));	/* reset match counters */
		frow->UpdateCount();
	}

	/* since the colours mave have changed, the map needs to be updated */
	MapDirty();
}
开发者ID:neolu,项目名称:gpsturbo,代码行数:27,代码来源:drawsettings.cpp

示例14: Input

/*******************************************************************************
  Function Name  : FindCellFromColour
  Input(s)       : crColour - Color for which cell to be identified
  Output         : -
  Functionality  : Updates the selection row and col from the color
  Member of      : CColourPopup
  Author(s)      : Raja N
  Date Created   : 09/12/2004
  Modifications  : 
*******************************************************************************/
void CColourPopup::FindCellFromColour(COLORREF crColour)
{
    if (crColour == CLR_DEFAULT && m_strDefaultText.GetLength() > 0)
    {
        m_nChosenColourSel = DEFAULT_BOX_VALUE;
        return;
    }
    // Iterate through list of entries in the color table
    for (int i = 0; i < m_nNumColours; i++)
    {
        if (GetColour(i) == crColour)
        {
            m_nChosenColourSel = i;
            return;
        }
    }
    if( m_strCustomText.GetLength() > 0 )
    {
        m_nChosenColourSel = CUSTOM_BOX_VALUE;
    }
    else
    {
        m_nChosenColourSel = INVALID_COLOUR;
    }
}
开发者ID:Fetze,项目名称:busmaster,代码行数:35,代码来源:ColourPopup.cpp

示例15: Validate

bool RTFcolourtbl::Validate(MAP_INT_INT* FixupMap)
{	
	bool bRes = false;
	
	// If the first colour is not auto make sure it is and fix up the document
	int iThisSize = (x64_int_cast)the_RTFcolourdef.size();
	if(iThisSize)
	{
		if(!GetColour(0)->IsAuto())
		{
			RTFcolourdef cd;
			cd.MakeAuto();
			
			// Add the auto colour
			the_RTFcolourdef.push_back(cd);
			
			// Now make it first it the vector
			RTFcolourdef cdOrig = the_RTFcolourdef[0];
			the_RTFcolourdef[0] = cd;
			the_RTFcolourdef[iThisSize] = cdOrig;
			
			// Update the fixup map
			MAP_INT_INT& rFixupMap = *FixupMap;
			rFixupMap[0] = iThisSize;
			
			bRes = true;
		}
	}  
	return bRes;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:30,代码来源:RTFcolourtbl.cpp


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