本文整理汇总了C++中LKSurface::SetBkColor方法的典型用法代码示例。如果您正苦于以下问题:C++ LKSurface::SetBkColor方法的具体用法?C++ LKSurface::SetBkColor怎么用?C++ LKSurface::SetBkColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LKSurface
的用法示例。
在下文中一共展示了LKSurface::SetBkColor方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPaintAirspacePicto
static void OnPaintAirspacePicto(WindowControl * Sender, LKSurface& Surface){
(void)Sender;
WndFrame *wPicto = ((WndFrame *)wf->FindByName(TEXT("frmAirspacePicto")));
LKASSERT(wPicto!=NULL);
const RECT rc = wPicto->GetClientRect();
Surface.SelectObject(LKPen_Petrol_C2);
Surface.SelectObject(LKBrush_Petrol);
Surface.Rectangle(rc.left,rc.top,rc.right,rc.bottom);
Surface.SetBkColor(RGB_LIGHTGREY);
/****************************************************************
* for drawing the airspace pictorial, we need the original data.
* copy contain only base class property, not geo data,
* original data are shared ressources !
* for that we need to grant all called methods are thread safe
****************************************************************/
{
CCriticalSection::CGuard guard(CAirspaceManager::Instance().MutexRef());
CAirspace* airspace = CAirspaceManager::Instance().GetAirspacesForDetails();
if(airspace) {
airspace->DrawPicto(Surface, rc);
}
}
}
示例2: OnAirspacePaintListItem
static void OnAirspacePaintListItem(WindowControl * Sender, LKSurface& Surface){
TCHAR label[40];
(void)Sender;
if (DrawListIndex < AIRSPACECLASSCOUNT){
int i = DrawListIndex;
LK_tcsncpy(label, CAirspaceManager::Instance().GetAirspaceTypeText(i), 39);
int w0, w1, w2, x0;
if (ScreenLandscape) {
w0 = 202*ScreenScale;
} else {
w0 = 225*ScreenScale;
}
// LKTOKEN [email protected]_ = "Warn"
w1 = Surface.GetTextWidth(MsgToken(789))+ScreenScale*10;
// LKTOKEN [email protected]_ = "Display"
w2 = Surface.GetTextWidth(MsgToken(241))+ScreenScale*10;
x0 = w0-w1-w2;
Surface.SetTextColor(RGB_BLACK);
Surface.DrawTextClip(2*ScreenScale, 2*ScreenScale,
label, x0-ScreenScale*10);
if (colormode) {
Surface.SelectObject(LK_WHITE_PEN);
Surface.SelectObject(LKBrush_White);
Surface.Rectangle(x0, 2*ScreenScale,w0, 22*ScreenScale);
Surface.SetTextColor(MapWindow::GetAirspaceColourByClass(i));
Surface.SetBkColor(LKColor(0xFF, 0xFF, 0xFF));
Surface.SelectObject(MapWindow::GetAirspaceBrushByClass(i));
Surface.Rectangle(x0, 2*ScreenScale,w0, 22*ScreenScale);
} else {
bool iswarn;
bool isdisplay;
iswarn = (MapWindow::iAirspaceMode[i]>=2);
isdisplay = ((MapWindow::iAirspaceMode[i]%2)>0);
if (iswarn) {
// LKTOKEN [email protected]_ = "Warn"
_tcscpy(label, MsgToken(789));
Surface.DrawText(w0-w1-w2, 2*ScreenScale, label);
}
if (isdisplay) {
// LKTOKEN [email protected]_ = "Display"
_tcscpy(label, MsgToken(241));
Surface.DrawText(w0-w2, 2*ScreenScale, label);
}
}
}
}
示例3: OnAirspacePatternsPaintListItem
static void OnAirspacePatternsPaintListItem(WindowControl * Sender, LKSurface& Surface) {
(void) Sender;
if ((DrawListIndex < NUMAIRSPACEBRUSHES) &&(DrawListIndex >= 0)) {
int i = DrawListIndex;
Surface.SelectObject(LKBrush_White);
Surface.SelectObject(LK_BLACK_PEN);
Surface.SetBkColor(LKColor(0xFF, 0xFF, 0xFF));
Surface.SelectObject(MapWindow::GetAirspaceBrush(i));
Surface.SetTextColor(LKColor(0x00, 0x00, 0x00));
Surface.Rectangle(100 * ScreenScale, 2 * ScreenScale, 180 * ScreenScale, 22 * ScreenScale);
}
}
示例4: OnMultiSelectListPaintListItem
static void OnMultiSelectListPaintListItem(WindowControl * Sender, LKSurface& Surface) {
#define PICTO_WIDTH 50
Surface.SetTextColor(RGB_BLACK);
if (TaskDrawListIndex < iNO_Tasks) {
TCHAR *pToken = NULL;
TCHAR *pWClast = NULL;
TCHAR *pWClast2 = NULL;
TCHAR text[180] = {TEXT("empty")};
TCHAR text1[180] = {TEXT("empty")};
TCHAR text2[180] = {TEXT("empty")};
_tcscpy(text, szTaskStrings [TaskDrawListIndex] );
unsigned int i=0;
while (i < _tcslen(text) ) // remove all quotations "
{
if(text[i]== '"') // quotations found ?
{
for (unsigned int j= i ; j < _tcslen(text); j++)
text[j] = text[j+1];
}
i++;
}
pToken = strsep_r(text, TEXT(","), &pWClast) ;
_tcscpy(text1, pToken );
if(*text1 == '\0') _tcscpy(text1, _T("???") );
pToken = strsep_r(pWClast, TEXT(","), &pWClast2) ; // remove takeof point
_tcscpy(text2, pWClast2);
Surface.SetBkColor(LKColor(0xFF, 0xFF, 0xFF));
PixelRect rc = {
0,
0,
0, // DLGSCALE(PICTO_WIDTH),
static_cast<PixelScalar>(Sender->GetHeight())
};
/********************
* show text
********************/
Surface.SetBackgroundTransparent();
Surface.SetTextColor(RGB_BLACK);
Surface.DrawText(rc.right + DLGSCALE(2), DLGSCALE(2), text1);
int ytext2 = Surface.GetTextHeight(text1);
Surface.SetTextColor(RGB_DARKBLUE);
Surface.DrawText(rc.right + DLGSCALE(2), ytext2, text2);
}
}
示例5: OnAirspaceColoursPaintListItem
static void OnAirspaceColoursPaintListItem(WindowControl * Sender, LKSurface& Surface){
(void)Sender;
if ((DrawListIndex < NUMAIRSPACECOLORS) &&(DrawListIndex>=0)) {
int i = DrawListIndex;
Surface.SelectObject(LKBrush_White);
Surface.SelectObject(LK_BLACK_PEN);
Surface.SetBkColor(LKColor(0xFF, 0xFF, 0xFF));
Surface.SelectObject(MapWindow::GetAirspaceSldBrush(i)); // this is the solid brush
Surface.SetTextColor(MapWindow::GetAirspaceColour(i));
Surface.Rectangle(
100*ScreenScale,
2*ScreenScale,
180*ScreenScale,
22*ScreenScale);
}
}
示例6: OnPaintAirspacePicto
static void OnPaintAirspacePicto(WindowControl * Sender, LKSurface& Surface){
const RECT rc = Sender->GetClientRect();
Surface.SetBkColor(RGB_LIGHTGREY);
/****************************************************************
* for drawing the airspace pictorial, we need the original data.
* copy contain only base class property, not geo data,
* original data are shared ressources !
* for that we need to grant all called methods are thread safe
****************************************************************/
{
ScopeLock guard(CAirspaceManager::Instance().MutexRef());
CAirspace* airspace = CAirspaceManager::Instance().GetAirspacesForDetails();
if(airspace) {
airspace->DrawPicto(Surface, rc);
}
}
}
示例7: OnMultiSelectListPaintListItem
static void OnMultiSelectListPaintListItem(WindowControl * Sender, LKSurface& Surface) {
#define PICTO_WIDTH 50
Surface.SetTextColor(RGB_BLACK);
if ((DrawListIndex < iNO_ELEMENTS) &&(DrawListIndex >= 0)) {
int j;
static CAirspaceBase airspace_copy;
int i = DrawListIndex;
LKASSERT(i < MAX_LIST_ITEMS);
PixelRect rc = {
0,
0,
DLGSCALE(PICTO_WIDTH),
static_cast<PixelScalar>(Sender->GetHeight())
};
const CAirspace* pAS = NULL;
int HorDist, Bearing, VertDist;
double Distance;
unsigned int idx = 0;
TCHAR text1[180] = {TEXT("empty")};
TCHAR text2[180] = {TEXT("empty")};
TCHAR Comment[80] = {TEXT("")};
TCHAR Comment1[80] = {TEXT("")};
Surface.SetBkColor(LKColor(0xFF, 0xFF, 0xFF));
LKASSERT(i < MAX_LIST_ITEMS);
switch (Elements[i].type) {
case IM_AIRSPACE:
pAS = (CAirspace*) Elements[i].ptr;
if (pAS) {
/***********************************************************************
* here we use a local copy of the airspace, only common property exists
***********************************************************************/
airspace_copy = CAirspaceManager::Instance().GetAirspaceCopy(pAS);
// airspace type already in name?
if (_tcsnicmp(airspace_copy.Name(), airspace_copy.TypeName(), _tcslen(airspace_copy.TypeName())) == 0) {
_stprintf(text1, TEXT("%s"), airspace_copy.Name()); // yes, take name only
} else {
// fixed strings max. 20 NAME_SIZE 30 => max. 30 char
_stprintf(text1, TEXT("%s %s"), airspace_copy.TypeName(), airspace_copy.Name());
}
CAirspaceManager::Instance().GetSimpleAirspaceAltText(Comment, sizeof (Comment) / sizeof (Comment[0]), airspace_copy.Top());
CAirspaceManager::Instance().GetSimpleAirspaceAltText(Comment1, sizeof (Comment1) / sizeof (Comment1[0]), airspace_copy.Base());
CAirspaceManager::Instance().AirspaceCalculateDistance((CAirspace*) pAS, &HorDist, &Bearing, &VertDist);
_stprintf(text2, TEXT("%3.1f%s (%s - %s)"), (double) HorDist*DISTANCEMODIFY, Units::GetDistanceName(), Comment1, Comment); //8 + 8+3 21
/****************************************************************
* for drawing the airspace pictorial, we need the original data.
* copy contain only base class property, not geo data,
* original data are shared ressources !
* for that we need to grant all called methods are thread safe
****************************************************************/
pAS->DrawPicto(Surface, rc);
}
break;
case IM_TASK_PT:
case IM_WAYPOINT:
idx = -1;
LockTaskData(); // protect from external task changes
if (Elements[i].type == IM_TASK_PT) {
if(ValidTaskPointFast(Elements[i].iIdx)) {
idx = Task[Elements[i].iIdx].Index;
}
} else {
if(ValidWayPointFast(Elements[i].iIdx)) {
idx = Elements[i].iIdx;
}
}
// This is not a solution. It will avoid a crash but the solution is to understand
// why we are getting a wrong idx, eventually. If ever we got a wrong idx!
// And then this "fix" should be changed to something more useful, instead of
// adopting a totally wrong waypoint for task.
assert(idx < WayPointList.size());
if(idx < WayPointList.size()) {
if (WayPointList[idx].Comment != NULL) {
LK_tcsncpy(Comment, WayPointList[idx].Comment, 30);
} else {
_tcscpy(Comment, TEXT(""));
}
DistanceBearing(GPS_INFO.Latitude, GPS_INFO.Longitude, WayPointList[idx].Latitude,
WayPointList[idx].Longitude, &Distance, NULL);
if (Elements[i].type != IM_TASK_PT) {
if (WayPointCalc[idx].IsLandable) {
MapWindow::DrawRunway(Surface, &WayPointList[idx], rc, nullptr, 1.5, true);
if (WayPointCalc[idx].IsAirport) {
// remove spaces from frequency
for (j = 1; j < (CUPSIZE_FREQ); j++)
//.........这里部分代码省略.........
示例8: RenderNearAirspace
//.........这里部分代码省略.........
Surface.SelectObject(LK8PanelUnitFont);
_stprintf(text, TEXT("%s"), Units::GetUnitName(Units::GetUserDistanceUnit()));
switch (GetMMNorthUp(getsideviewpage)) {
case NORTHUP:
default:
DrawXGrid(Surface, rc, xtick / DISTANCEMODIFY, xtick, 0, TEXT_ABOVE_LEFT, RGB_BLACK, &sDia, text);
break;
case TRACKUP:
DrawXGrid(Surface, rci, xtick / DISTANCEMODIFY, xtick, 0, TEXT_ABOVE_LEFT, RGB_BLACK, &sDia, text);
break;
}
Surface.SetTextColor(Sideview_TextColor);
double fHeight = (sDia.fYMax - sDia.fYMin);
double ytick = 100.0;
if (fHeight > 500.0) ytick = 200.0;
if (fHeight > 1000.0) ytick = 500.0;
if (fHeight > 2000.0) ytick = 1000.0;
if (fHeight > 4000.0) ytick = 2000.0;
if (fHeight > 8000.0) ytick = 4000.0;
if (Units::GetUserAltitudeUnit() == unFeet)
ytick = ytick * FEET_FACTOR;
_stprintf(text, TEXT("%s"), Units::GetUnitName(Units::GetUserAltitudeUnit()));
if (sDia.fYMin < GC_SEA_LEVEL_TOLERANCE)
rc.bottom -= SV_BORDER_Y; /* scale witout sea */
DrawYGrid(Surface, rc, ytick / ALTITUDEMODIFY, ytick, 0, TEXT_UNDER_RIGHT, Sideview_TextColor, &sDia, text);
Surface.SetBkColor(RGB_WHITE);
if (!bInvCol)
Surface.SetBackgroundOpaque();
/****************************************************************************************************
* draw AGL
****************************************************************************************************/
if (calc_altitudeagl - sDia.fYMin > 500) {
Surface.SetTextColor(LIGHTBLUE_COL);
Units::FormatUserAltitude(calc_altitudeagl, buffer, 7);
LK_tcsncpy(text, MsgToken(1742), TBSIZE - _tcslen(buffer)); // AGL:
_tcscat(text, buffer);
Surface.GetTextSize(text, &tsize);
TxYPt.x = CalcDistanceCoordinat(0, &sDia) - tsize.cx / 2;
TxYPt.y = CalcHeightCoordinat((calc_terrainalt + calc_altitudeagl)*0.8, &sDia);
if ((tsize.cy) < (CalcHeightCoordinat(calc_terrainalt, &sDia) - TxYPt.y)) {
Surface.DrawText(TxYPt.x + IBLSCALE(1), TxYPt.y, text);
}
}
Surface.SetBackgroundTransparent();
/****************************************************************************************************
* Print current Elevation
****************************************************************************************************/
Surface.SetTextColor(RGB_BLACK);
int x, y;
if ((calc_terrainalt - sDia.fYMin) > 0) {
Units::FormatUserAltitude(calc_terrainalt, buffer, 7);
LK_tcsncpy(text, MsgToken(1743), TBSIZE - _tcslen(buffer)); // ELV:
_tcscat(text, buffer);
Surface.GetTextSize(text, &tsize);
x = CalcDistanceCoordinat(0, &sDia) - tsize.cx / 2;