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


C++ CFrame::setBackgroundColor方法代码示例

本文整理汇总了C++中CFrame::setBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:C++ CFrame::setBackgroundColor方法的具体用法?C++ CFrame::setBackgroundColor怎么用?C++ CFrame::setBackgroundColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFrame的用法示例。


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

示例1: open

//-----------------------------------------------------------------------------------
bool TutorialEditor::open (void* ptr)
{
	//-- first we create the frame with a size of 300, 300 and set the background to white
	CRect frameSize (0, 0, 300, 300);
	CFrame* newFrame = new CFrame (frameSize, ptr, this);
	newFrame->setBackgroundColor (kWhiteCColor);

	//-- load some bitmaps we need
	CBitmap* background = new CBitmap ("KnobBackground.png");
	CBitmap* handle = new CBitmap ("KnobHandle.png");
	CBitmap* handleHighlight = new CBitmap ("KnobHandleHighlight.png");

	//-- creating a knob and adding it to the frame
	CRect r (0, 0, background->getWidth (), background->getHeight ());
	CKnob* knob1 = new MyKnob (r, this, kLeftVolumeParameter, background, handle, handleHighlight);
	newFrame->addView (knob1);

	//-- creating another knob, we are offsetting the rect, so that the knob is next to the previous knob
	r.offset (background->getWidth () + 5, 0);
	CKnob* knob2 = new MyKnob (r, this, kRightVolumeParameter, background, handle, handleHighlight);
	newFrame->addView (knob2);

	//-- forget the bitmaps
	background->forget ();
	handle->forget ();

	//-- remember our controls so that we can sync them with the state of the effect
	controls[kLeftVolumeParameter] = knob1;
	controls[kRightVolumeParameter] = knob2;

	//-- set the member frame to our frame
	frame = newFrame;

	//-- sync parameters
	for (int i = 0; i < kNumParameters; i++)
		setParameter (i, effect->getParameter (i));
	return true;
}
开发者ID:DaniM,项目名称:lyngo,代码行数:39,代码来源:Tutorial2Editor.cpp

示例2: open

bool CSmartelectronixDisplayEditor::open(void* ptr)
{
		CBitmap* hBackground = new CBitmap("body.bmp");

		CRect frameSize (rect.left, rect.top, rect.right, rect.bottom);
		CFrame* newFrame = new CFrame (frameSize, this);
		newFrame->open (ptr);
		newFrame->setBackground(hBackground);
		newFrame->setBackgroundColor (kWhiteCColor);

		/*
		setKnobMode(kLinearMode);

		CBitmap* heads = new CBitmap(IDB_BITMAPHEADS);
    CBitmap* readout = new CBitmap(IDB_BITMAPREADOUT);

    //display = new CWaveDisplay(CRect(38,16,663,285),(CSmartelectronixDisplay*)effect,hBackground,heads,readout);
    display = new CWaveDisplay(CRect(38, 16, 665, 285), (CSmartelectronixDisplay*)effect, hBackground, heads, readout);
    frame->addView(display);
    heads->forget();
    readout->forget();

    // top row
    CBitmap* knob = new CBitmap(IDB_BITMAPKNOB);

    // time windows
    timeWindow = new CAnimKnob(CRect(697, 31, 697 + knob->getWidth(), 31 + knob->getHeight() / 75), this, CSmartelectronixDisplay::kTimeWindow, 75, 33, knob, CPoint(0, 0));
    timeWindow->setDefaultValue(0.5f);
    timeWindow->setValue(effect->getParameter(CSmartelectronixDisplay::kTimeWindow));
    frame->addView(timeWindow);

    ((CSmartelectronixDisplay*)effect)->getDisplay(CSmartelectronixDisplay::kTimeWindow, temp);
    timeLabel = new CLabel(CRect(696, 72, 730, 83), temp);
    frame->addView(timeLabel);

    // amp window
    ampWindow = new CAnimKnob(CRect(762, 31, 762 + knob->getWidth(), 31 + knob->getHeight() / 75), this, CSmartelectronixDisplay::kAmpWindow, 75, 33, knob, CPoint(0, 0));
    ampWindow->setDefaultValue(0.5f);
    ampWindow->setValue(effect->getParameter(CSmartelectronixDisplay::kAmpWindow));
    frame->addView(ampWindow);

    ((CSmartelectronixDisplay*)effect)->getDisplay(CSmartelectronixDisplay::kAmpWindow, temp);
    ampLabel = new CLabel(CRect(760, 72, 794, 83), temp);
    frame->addView(ampLabel);

    // trigger speed
    triggerSpeed = new CAnimKnob(CRect(700, 134, 700 + knob->getWidth(), 134 + knob->getHeight() / 75), this, CSmartelectronixDisplay::kTriggerSpeed, 75, 33, knob, CPoint(0, 0));
    triggerSpeed->setDefaultValue(0.5f);
    triggerSpeed->setValue(effect->getParameter(CSmartelectronixDisplay::kTriggerSpeed));
    frame->addView(triggerSpeed);

    ((CSmartelectronixDisplay*)effect)->getDisplay(CSmartelectronixDisplay::kTriggerSpeed, temp);
    trigLabel = new CLabel(CRect(698, 175, 732, 186), temp);
    frame->addView(trigLabel);

    // trigger limit
    triggerLimit = new CAnimKnob(CRect(765, 134, 765 + knob->getWidth(), 134 + knob->getHeight() / 75), this, CSmartelectronixDisplay::kTriggerLimit, 75, 33, knob, CPoint(0, 0));
    triggerLimit->setDefaultValue(0.5f);
    triggerLimit->setValue(effect->getParameter(CSmartelectronixDisplay::kTriggerLimit));
    frame->addView(triggerLimit);

    ((CSmartelectronixDisplay*)effect)->getDisplay(CSmartelectronixDisplay::kTriggerLimit, temp);
    threshLabel = new CLabel(CRect(765, 175, 799, 186), temp);
    frame->addView(threshLabel);

    knob->forget();

    // trigger type
    CBitmap* triggerBitmap = new CBitmap(IDB_BITMAPTRIGGER);
#if SIMPLE_VERSION
    trigger = new CMultiStateButton(CRect(718, 94, 718 + triggerBitmap->getWidth(), 94 + triggerBitmap->getHeight() / 5), this, CSmartelectronixDisplay::kTriggerType, triggerBitmap, 4, triggerBitmap->getHeight() / 5);
#else
    trigger = new CMultiStateButton(CRect(718, 94, 718 + triggerBitmap->getWidth(), 94 + triggerBitmap->getHeight() / 5), this, CSmartelectronixDisplay::kTriggerType, triggerBitmap, 5, triggerBitmap->getHeight() / 5);
#endif
    trigger->setValue(effect->getParameter(CSmartelectronixDisplay::kTriggerType));
    frame->addView(trigger);
    triggerBitmap->forget();

    CBitmap* onOff = new CBitmap(IDB_BITMAPONOFF);
    CBitmap* channel = new CBitmap(IDB_BITMAPCHANNEL);

    // sync redraw
    syncDraw = new COnOffButton(CRect(696, 221, 696 + onOff->getWidth(), 221 + onOff->getHeight() / 2), this, CSmartelectronixDisplay::kSyncDraw, onOff);
    syncDraw->setValue(effect->getParameter(CSmartelectronixDisplay::kSyncDraw));
    frame->addView(syncDraw);

    // dc
    dc = new COnOffButton(CRect(690, 259, 690 + onOff->getWidth(), 259 + onOff->getHeight() / 2), this, CSmartelectronixDisplay::kDCKill, onOff);
    dc->setValue(effect->getParameter(CSmartelectronixDisplay::kDCKill));
    frame->addView(dc);

    // freeze
    freeze = new COnOffButton(CRect(754, 221, 754 + onOff->getWidth(), 221 + onOff->getHeight() / 2), this, CSmartelectronixDisplay::kFreeze, onOff);
    freeze->setValue(effect->getParameter(CSmartelectronixDisplay::kFreeze));
    frame->addView(freeze);

    // channel
    channelSelector = new COnOffButton(CRect(748, 259, 748 + onOff->getWidth(), 259 + onOff->getHeight() / 2), this, CSmartelectronixDisplay::kChannel, channel);
    channelSelector->setValue(effect->getParameter(CSmartelectronixDisplay::kChannel));
    frame->addView(channelSelector);
//.........这里部分代码省略.........
开发者ID:eriser,项目名称:smartelectronix,代码行数:101,代码来源:SmartelectronixDisplayEditor.cpp


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