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


C++ SetBackgroundColor函数代码示例

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


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

示例1: SetBackgroundColor

CCreateToySourcePanel::CCreateToySourcePanel()
	: glgui::CMovablePanel("Create Toy Source Tool")
{
	SetBackgroundColor(Color(0, 0, 0, 255));
	SetHeaderColor(Color(100, 100, 100, 255));
	SetBorder(glgui::CPanel::BT_SOME);

	m_pToyFileLabel = new glgui::CLabel("Toy File:", "sans-serif", 10);
	m_pToyFileLabel->SetAlign(glgui::CLabel::TA_TOPLEFT);
	AddControl(m_pToyFileLabel);
	m_pToyFileText = new glgui::CTextField();
	m_pToyFileText->SetContentsChangedListener(this, ToyChanged);
	AddControl(m_pToyFileText);

	m_pSourceFileLabel = new glgui::CLabel("Source File:", "sans-serif", 10);
	m_pSourceFileLabel->SetAlign(glgui::CLabel::TA_TOPLEFT);
	AddControl(m_pSourceFileLabel);
	m_pSourceFileText = new glgui::CTextField();
	m_pSourceFileText->SetContentsChangedListener(this, SourceChanged);
	AddControl(m_pSourceFileText);

	m_pWarnings = new glgui::CLabel("");
	m_pWarnings->SetAlign(glgui::CLabel::TA_TOPLEFT);
	AddControl(m_pWarnings);

	m_pCreate = new glgui::CButton("Create");
	m_pCreate->SetClickedListener(this, Create);
	AddControl(m_pCreate);
}
开发者ID:BSVino,项目名称:CodenameInfinite,代码行数:29,代码来源:toyeditor.cpp

示例2: assert

void
Canvas::StretchMono(PixelScalar dest_x, PixelScalar dest_y,
                    UPixelScalar dest_width, UPixelScalar dest_height,
                    const Bitmap &src,
                    PixelScalar src_x, PixelScalar src_y,
                    UPixelScalar src_width, UPixelScalar src_height,
                    Color fg_color, Color bg_color)
{
  assert(IsDefined());
  assert(src.IsDefined());

#ifndef _WIN32_WCE
  if (bg_color == COLOR_BLACK && (src_width != dest_width ||
                                  src_height != dest_height)) {
    /* workaround for a WINE bug: stretching a mono bitmap ignores the
       text color; this kludge makes the text color white */
    SetTextColor(COLOR_BLACK);
    SetBackgroundColor(COLOR_WHITE);
    Stretch(dest_x, dest_y, dest_width, dest_height,
            src, src_x, src_y, src_width, src_height,
            MERGEPAINT);
    return;
  }
#endif

  /* on GDI, monochrome bitmaps are special: they are painted with the
     destination HDC's current colors */
  SetTextColor(fg_color);
  SetBackgroundTransparent();

  Stretch(dest_x, dest_y, dest_width, dest_height,
          src, src_x, src_y, src_width, src_height);
}
开发者ID:mobotics,项目名称:XCSoar,代码行数:33,代码来源:Canvas.cpp

示例3: SetId

void UITouchButton::Initialize(DWORD dwId, LPCSTR szText, INT32 iFontSize, int iBackgroundColor, int iFocuedBackgroundColor)
{
    SetId(dwId);
    SetText(szText);
    SetFontSize(iFontSize);

    SetBackgroundColor(iBackgroundColor);
    SetFocusedBackgroundColor(iFocuedBackgroundColor);
}
开发者ID:chenhbzl,项目名称:OriginApp,代码行数:9,代码来源:UITouchButton.cpp

示例4: SetBackgroundColor

void UITouchButton::Init()
{
    UIButton::Init();
    SetBackgroundColor(ColorManager::knWhite);
    SetFocusedBackgroundColor(ColorManager::knBlack);
    SetFontColor(ColorManager::knBlack);
    SetFocusedFontColor(ColorManager::knWhite);

}
开发者ID:chenhbzl,项目名称:OriginApp,代码行数:9,代码来源:UITouchButton.cpp

示例5: OnWindowEvent

 void OnWindowEvent(const SDL_Event &event) override
 {
     if (event.type == SDL_KEYDOWN)
     {
         switch (event.key.keysym.sym)
         {
         case SDLK_r:
             SetBackgroundColor({1, 0, 0, 1});
             break;
         case SDLK_g:
             SetBackgroundColor({0, 1, 0, 1});
             break;
         case SDLK_b:
             SetBackgroundColor({0, 0, 1, 1});
             break;
         }
     }
 }
开发者ID:ps-group,项目名称:cg_course_examples,代码行数:18,代码来源:main.cpp

示例6: SetBackgroundColor

BOOL CDlgZhiFu::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// TODO:  在此添加额外的初始化
	SetBackgroundColor(RGB(255,255,255),TRUE);
	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
开发者ID:boboding,项目名称:Boboding,代码行数:9,代码来源:DlgZhiFu.cpp

示例7: IsDithered

void
DialogLook::Initialise(const Font &caption_font,
                       const Font &_text_font,
                       const Font &_small_font,
                       const Font &button_font,
                       const Font &list_font,
                       const Font &list_font_bold)
{
  caption.text_color = COLOR_BLACK;
  caption.font = &caption_font;

#ifdef EYE_CANDY
  caption.background_bitmap.Load(IDB_DIALOGTITLE);
#endif

  caption.background_color = IsDithered() ? COLOR_BLACK : COLOR_XCSOAR_DARK;
  caption.inactive_background_color = COLOR_GRAY;

  if (IsDithered())
    SetBackgroundColor(COLOR_WHITE);
  else
    SetBackgroundColor(Color(0xe2, 0xdc, 0xbe));
  text_color = COLOR_BLACK;

  text_font = &_text_font;
  small_font = &_small_font;
  button.Initialise(button_font);

  focused.background_color = COLOR_XCSOAR_DARK;
  focused.text_color = COLOR_WHITE;
  focused.border_pen.Set(Layout::FastScale(1) + 2, COLOR_BLACK);

  list.background_color = COLOR_WHITE;
  list.text_color = COLOR_BLACK;
  list.selected.background_color = IsDithered()
    ? COLOR_VERY_LIGHT_GRAY : COLOR_XCSOAR_LIGHT;
  list.selected.text_color = COLOR_BLACK;
  list.focused.background_color = IsDithered() ? COLOR_BLACK : COLOR_XCSOAR;
  list.focused.text_color = COLOR_WHITE;
  list.pressed.background_color = COLOR_YELLOW;
  list.pressed.text_color = COLOR_BLACK;
  list.font = &list_font;
  list.font_bold = &list_font_bold;
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:44,代码来源:DialogLook.cpp

示例8: SetBackgroundColor

BOOL CDlgMemoAdd::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// TODO:  在此添加额外的初始化
	//SetBackgroundColor(DialogSubBackgroundColor,TRUE);
	m_DateTime_ctlTime.SetFormat(_T("yyyy-MM-dd HH:mm"));

	SetBackgroundColor(DialogSubBackgroundColor,TRUE);
	m_Button_ctlSave.LoadStdImage(IDB_PNG_SAVE, _T("PNG"));
	m_Button_ctlCancel.LoadStdImage(IDB_PNG_CANCEL, _T("PNG"));

	m_Static_ctl1.SetBackgroundColor(DialogSubBackgroundColor,TRUE);
	//m_Static_ctl1.SetTextColor(StaticCaptionColor,TRUE);

	m_Static_ctl2.SetBackgroundColor(DialogSubBackgroundColor,TRUE);
	//m_Static_ctl2.SetTextColor(StaticCaptionColor,TRUE);

	m_Static_ctl3.SetBackgroundColor(DialogSubBackgroundColor,TRUE);
	//m_Static_ctl3.SetTextColor(StaticCaptionColor,TRUE);

	m_Static_ctl4.SetBackgroundColor(DialogSubBackgroundColor,TRUE);
	//m_Static_ctl4.SetTextColor(StaticCaptionColor,TRUE);*/

	/*m_Static_ctl5.SetBackgroundColor(DialogSubBackgroundColor,TRUE);
	m_Static_ctl5.SetTextColor(StaticCaptionColor,TRUE);*/


	try{
		CppSQLite3DB db;
		db.open(CBoBoDingApp::g_strDatabasePath);
		CString strSQL=_T("select distinct * from CategoryMemo order by ID asc;");
		CppSQLite3Query q = db.execQuery(strSQL);
		CString strCategoryName;
		while(!q.eof())
		{
			strCategoryName=(q.fieldValue(_T("CategoryName")));
			if (strCategoryName.Compare(_T("+"))!=0)
			{
				m_Combo_ctlCategory.AddString(strCategoryName);
			}
			
			q.nextRow();

		}
	}

	catch (CppSQLite3Exception& e)
	{

		//AfxMessageBox(e.errorMessage());
	}
	m_Combo_ctlCategory.SetCurSel(0);
	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
开发者ID:boboding,项目名称:Boboding,代码行数:56,代码来源:DlgMemoAdd.cpp

示例9: LineIndex

void CRichEditExtn::OnKillFocus(CWnd* pNewWnd)
{
  m_bIsFocused = FALSE;
  m_lastposition = LineIndex();
  GetSel(m_nStartChar, m_nEndChar);
  CRichEditCtrl::OnKillFocus(pNewWnd);

  SetBackgroundColor(FALSE, crefNoFocus);
  Invalidate(TRUE);
}
开发者ID:macduff,项目名称:passwordsafe,代码行数:10,代码来源:ControlExtns.cpp

示例10: ModifyStyleEx

BOOL BiliLogin::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// TODO:  在此添加额外的初始化
	ModifyStyleEx(0, WS_EX_LAYERED /*| WS_EX_TRANSPARENT*/);
	SetLayeredWindowAttributes(0, 190, LWA_ALPHA);
	SetBackgroundColor(RGB(230, 250, 250));
	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常:  OCX 属性页应返回 FALSE
}
开发者ID:ahelloworld,项目名称:bilibili_flash_client,代码行数:11,代码来源:BiliLogin.cpp

示例11: EWindow

TWindow::TWindow(ERect frame, const char *title, e_window_type type, euint32 flags, euint32 workspace)
	: EWindow(frame, title, type, flags, workspace)
{
	EView *view = new TView(frame.OffsetToCopy(E_ORIGIN), NULL, E_FOLLOW_ALL, E_WILL_DRAW | E_FRAME_EVENTS);
	AddChild(view);

	SetBackgroundColor(view->ViewColor());

#if TEST_STATUSBAR
	SetPulseRate(100000);
#endif
}
开发者ID:D-os,项目名称:EasyToolkitAndExtension,代码行数:12,代码来源:scroll-test.cpp

示例12: SetBackgroundColor

void CRichInfo::PreSubclassWindow()
{
  SetBackgroundColor(FALSE,GetSysColor(COLOR_3DFACE));

  // Set the control to word wrap the text
  SetTargetDevice(NULL,0);

  // Notify the parent window of the control's required size
  SetEventMask(ENM_REQUESTRESIZE);

  CRichEditCtrl::PreSubclassWindow();
}
开发者ID:DavidKinder,项目名称:Windows-Frotz,代码行数:12,代码来源:FrotzDialogs.cpp

示例13: InsertItem

void CGameListCtrl::InsertItemInReportView(long _Index)
{
	// When using wxListCtrl, there is no hope of per-column text colors.
	// But for reference, here are the old colors that were used: (BGR)
	// title: 0xFF0000
	// company: 0x007030
	int ImageIndex = -1;

	GameListItem& rISOFile = *m_ISOFiles[_Index];

	// Insert a first row with nothing in it, that will be used as the Index
	long ItemIndex = InsertItem(_Index, wxEmptyString);

	// Insert the platform's image in the first (visible) column
	SetItemColumnImage(_Index, COLUMN_PLATFORM, m_PlatformImageIndex[rISOFile.GetPlatform()]);

	if (rISOFile.GetBitmap().IsOk())
		ImageIndex = m_imageListSmall->Add(rISOFile.GetBitmap());

	// Set the game's banner in the second column
	SetItemColumnImage(_Index, COLUMN_BANNER, ImageIndex);

	wxString name = StrToWxStr(rISOFile.GetName());

	int disc_number = rISOFile.GetDiscNumber() + 1;
	if (disc_number > 1 && name.Lower().find(wxString::Format("disc %i", disc_number)) == std::string::npos
	                    && name.Lower().find(wxString::Format("disc%i", disc_number)) == std::string::npos)
	{
		name = wxString::Format(_("%s (Disc %i)"), name.c_str(), disc_number);
	}

	SetItem(_Index, COLUMN_TITLE, name, -1);
	SetItem(_Index, COLUMN_MAKER, StrToWxStr(rISOFile.GetCompany()), -1);

	// Emulation state
	SetItemColumnImage(_Index, COLUMN_EMULATION_STATE, m_EmuStateImageIndex[rISOFile.GetEmuState()]);

	// Country
	SetItemColumnImage(_Index, COLUMN_COUNTRY, m_FlagImageIndex[rISOFile.GetCountry()]);

	// File size
	SetItem(_Index, COLUMN_SIZE, NiceSizeFormat(rISOFile.GetFileSize()), -1);

	// Game ID
	SetItem(_Index, COLUMN_ID, rISOFile.GetUniqueID(), -1);

	// Background color
	SetBackgroundColor();

	// Item data
	SetItemData(_Index, ItemIndex);
}
开发者ID:Chemlo,项目名称:dolphin,代码行数:52,代码来源:GameListCtrl.cpp

示例14: switch

void Display::SetMode(Display::Mode NewMode) {
    // (re-)set display mode.
    
    if (display!=NULL && NewMode==mode) return;
    // No change, nothing to do

    // OSD origin, centered on VDR OSD
    int x0=Setup.OSDLeft+(Setup.OSDWidth-ttSetup.OSDwidth)/2;
    int y0=Setup.OSDTop +(Setup.OSDHeight-ttSetup.OSDheight)/2;
    
    switch (NewMode) {
    case Display::Full:
        // Need to re-initialize *display:
        Delete();
        // Try 3BPP display first:
        display=new cDisplay3BPP(x0,y0,ttSetup.OSDwidth,ttSetup.OSDheight);
        if (!display->Valid()) {
            // Failed, possibly out of memory 
            delete display;
            // Try 2BPP display
            display=new cDisplay2BPP(x0,y0,ttSetup.OSDwidth,ttSetup.OSDheight);
        }
        break;
    case Display::HalfUpper:
        // Shortcut to switch from HalfUpper to HalfLower:
        if (mode==Display::HalfLower) {
            // keep instance.
            ((cDisplay3BPPHalf*)display)->SetUpper(true);
            break;
        }
        // Need to re-initialize *display:
        Delete();
        display=new cDisplay3BPPHalf(x0,y0,ttSetup.OSDwidth,ttSetup.OSDheight,true);
        break;
    case Display::HalfLower:
        // Shortcut to switch from HalfUpper to HalfLower:
        if (mode==Display::HalfUpper) {
            // keep instance.
            ((cDisplay3BPPHalf*)display)->SetUpper(false);
            break;
        }
        // Need to re-initialize *display:
        Delete();
        display=new cDisplay3BPPHalf(x0,y0,ttSetup.OSDwidth,ttSetup.OSDheight,false);
        break;
    }           
    mode=NewMode;
    // If display is invalid, clean up immediately:
    if (!display->Valid()) Delete();
    // Pass through OSD black transparency
    SetBackgroundColor((tColor)ttSetup.configuredClrBackground);    
}
开发者ID:suborb,项目名称:reelvdr,代码行数:52,代码来源:display.c

示例15: LineFromChar

void CRichEditExtn::OnSetFocus(CWnd* pOldWnd)
{
  m_bIsFocused = TRUE;
  CRichEditCtrl::OnSetFocus(pOldWnd);
  if (m_lastposition >= 0) {
    int iLine = LineFromChar(m_lastposition);
    LineScroll(iLine);
    SetSel(m_nStartChar, m_nEndChar); 
  }

  SetBackgroundColor(FALSE, m_crefInFocus);
  Invalidate(TRUE);
}
开发者ID:macduff,项目名称:passwordsafe,代码行数:13,代码来源:ControlExtns.cpp


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