本文整理匯總了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));
}
示例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] ) );
}
}
示例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;
}
示例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
示例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;
}
示例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));
}
}
示例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;
}
示例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());
}
示例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);
}
}
示例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 );
}
示例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;
}
}
}
示例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();
}
示例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();
}
示例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;
}
}
示例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;
}