本文整理汇总了C++中SetViewColor函数的典型用法代码示例。如果您正苦于以下问题:C++ SetViewColor函数的具体用法?C++ SetViewColor怎么用?C++ SetViewColor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetViewColor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BView
PatchView::PatchView(BRect rect)
:
BView(rect, "PatchView", B_FOLLOW_ALL, B_WILL_DRAW),
fUnknownDeviceIcon(NULL)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
BRect iconRect(0, 0, LARGE_ICON_SIZE - 1, LARGE_ICON_SIZE - 1);
fUnknownDeviceIcon = new BBitmap(iconRect, B_RGBA32);
if (BIconUtils::GetVectorIcon(
UnknownDevice::kVectorIcon,
sizeof(UnknownDevice::kVectorIcon),
fUnknownDeviceIcon) == B_OK)
return;
delete fUnknownDeviceIcon;
}
示例2: BView
BrowseView::BrowseView(BRect r,Tasks *t)
: BView(r,NULL,B_FOLLOW_ALL,B_WILL_DRAW)
{
tasks = t;
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
mainList = NULL;
linksList = NULL;
horizontalMover = NULL;
nextButton = NULL;
searchTextView = NULL;
containsView = NULL;
infoText = NULL;
m_DontUpdateURL = false;
}
示例3: inherited
/*------------------------------------------------------------------------------*\
()
-
\*------------------------------------------------------------------------------*/
BmFilterView::BmFilterView( int32 width, int32 height)
: inherited( BRect(0,0,float(width-1),float(height-1)), "Beam_FilterView",
B_SINGLE_SELECTION_LIST,
false, true)
{
int32 flags = 0;
SetViewColor( B_TRANSPARENT_COLOR);
if (ThePrefs->GetBool("StripedListView"))
SetStripedBackground( true);
AddColumn( new CLVColumn( "Name", 200.0, flags|CLV_SORT_KEYABLE, 50.0));
AddColumn( new CLVColumn( "State", 80.0, flags, 50.0));
SetSortFunction( CLVEasyItem::CompareItems);
SetSortKey( COL_KEY);
}
示例4: BListView
NamesView::NamesView(BRect frame)
: BListView(
frame,
"namesList",
B_MULTIPLE_SELECTION_LIST,
B_FOLLOW_ALL),
fActiveTheme (vision_app->ActiveTheme())
{
fActiveTheme->ReadLock();
SetFont (&fActiveTheme->FontAt (F_NAMES));
SetViewColor (fActiveTheme->ForegroundAt (C_NAMES_BACKGROUND));
fActiveTheme->ReadUnlock();
fTracking = false;
}
示例5: BView
KlondikeView::KlondikeView()
:
BView(BRect(0, 0, STARTING_WINDOW_WIDTH + 10, STARTING_WINDOW_HEIGHT + 10),
"KlondikeView", B_FOLLOW_LEFT | B_FOLLOW_TOP,
B_WILL_DRAW | B_PULSE_NEEDED | B_FULL_UPDATE_ON_RESIZE)
{
SetViewColor(0, 85, 0);
windowWidth = STARTING_WINDOW_WIDTH;
windowHeight = STARTING_WINDOW_HEIGHT;
_LoadBitmaps();
for (short i = 0; i < CARDS_IN_PLAY; i++)
fAllCards[i] = NULL;
}
示例6: SetViewColor
/*=============================================================================================*\
| ShrinkView |
+-----------------------------------------------------------------------------------------------+
| Effet: Appelle le constructeur de BView et initialise les valeurs de bases. |
| Entre: |
| BRect frame: Rectagle de la View lorsqu'elle est agrandit. |
| char * pzLabel: Etiquette de la view. |
| bool bShrink: True si la view doit etre initialiment reduite, false sinon. |
\*=============================================================================================*/
ShrinkView::ShrinkView(BRect frame, const char * pzLabel, bool bShrink, BBitmap * pBmp)
: BView::BView(frame, "ShrinkView", B_FOLLOW_NONE, B_WILL_DRAW)
{
rgb_color color = {192, 192, 192, 0};
SetViewColor(color);
m_fFullHeight = frame.Height();
m_bShrink = bShrink;
m_bMouseOver = false;
strcpy(m_pzLabel, pzLabel);
if(m_bShrink)
{
ResizeTo(Bounds().Width(), 16);
}
m_pBmp = pBmp;
}//End of ShrinkView.
示例7: SetViewColor
void
BListView::_InitObject(list_view_type type)
{
fListType = type;
fFirstSelected = -1;
fLastSelected = -1;
fAnchorIndex = -1;
fSelectMessage = NULL;
fScrollView = NULL;
fTrack = new track_data;
fTrack->try_drag = false;
fTrack->item_index = -1;
SetViewColor(ui_color(B_LIST_BACKGROUND_COLOR));
SetLowColor(ui_color(B_LIST_BACKGROUND_COLOR));
}
示例8: BControl
BIconButton::BIconButton(const char* name, const char* label,
BMessage* message, BHandler* target, bool customBackground)
:
BControl(name, label, message, B_WILL_DRAW),
fButtonState(0),
fNormalBitmap(NULL),
fDisabledBitmap(NULL),
fClickedBitmap(NULL),
fDisabledClickedBitmap(NULL),
fTargetCache(target),
fCustomBackground(customBackground)
{
SetTarget(target);
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
SetViewColor(B_TRANSPARENT_32_BIT);
}
示例9: CALLED
void
BMenuField::AttachedToWindow()
{
CALLED();
BView* parent = Parent();
if (parent != NULL) {
// inherit the color from parent
rgb_color color = parent->ViewColor();
if (color == B_TRANSPARENT_COLOR)
color = ui_color(B_PANEL_BACKGROUND_COLOR);
SetViewColor(color);
SetLowColor(color);
}
}
示例10: BView
AgentDockHeader::AgentDockHeader (BRect frame, const char *name, uint32 resize)
: BView (
frame,
"AgentDockHeader",
resize,
B_WILL_DRAW)
{
SetViewColor (ui_color (B_MENU_BACKGROUND_COLOR));
BRect stringRect (frame);
stringRect.left = stringRect.left + 3;
stringRect.right = stringRect.right - 24;
fHeaderView = new AgentDockHeaderString (stringRect, name);
AddChild (fHeaderView);
}
示例11: CounterView
CounterView (BRect FrameSize) : BView (FrameSize, "CounterView", B_FOLLOW_ALL_SIDES,
B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE | B_PULSE_NEEDED),
m_MovingDotPoint (10, 20),
m_BackingView (FrameSize, "BackingView", B_FOLLOW_ALL_SIDES, B_FULL_UPDATE_ON_RESIZE)
{
m_CurrentCount = 0;
m_StringResizeNeededCount = 10;
m_BackingBitmap = NULL;
SetViewColor (B_TRANSPARENT_COLOR);
FrameResized (FrameSize.right, FrameSize.bottom); // Set m_TextStartPoint.
ViewPulseThreadID = spawn_thread (ViewPulserCode,
"CounterViewPulser", 80 /* Priority */, this); // Creates but doesn't start.
m_InputDeviceMousePntr = find_input_device ("VNC Fake Mouse");
m_InputDeviceKeyboardPntr = find_input_device ("VNC Fake Keyboard");
m_EventTriggerCounter = 0;
};
示例12: BView
ConfigView::ConfigView(uint32 flags)
: BView("EXRTranslator Settings", flags)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
BStringView *fTitle = new BStringView("title",
B_TRANSLATE("EXR image translator"));
fTitle->SetFont(be_bold_font);
char version[256];
sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"),
int(B_TRANSLATION_MAJOR_VERSION(EXR_TRANSLATOR_VERSION)),
int(B_TRANSLATION_MINOR_VERSION(EXR_TRANSLATOR_VERSION)),
int(B_TRANSLATION_REVISION_VERSION(EXR_TRANSLATOR_VERSION)),
__DATE__);
BStringView *fVersion = new BStringView("version", version);
BStringView *fCopyright = new BStringView("copyright",
B_UTF8_COPYRIGHT "2008 Haiku Inc.");
BStringView *fCopyright2 = new BStringView("copyright2",
B_TRANSLATE("Based on OpenEXR (http://www.openexr.com)"));
BStringView *fCopyright3 = new BStringView("copyright3",
B_UTF8_COPYRIGHT "2006, Industrial Light & Magic,");
BStringView *fCopyright4 = new BStringView("copyright4",
B_TRANSLATE("a division of Lucasfilm Entertainment Company Ltd"));
// Build the layout
BLayoutBuilder::Group<>(this, B_VERTICAL, 7)
.SetInsets(5)
.Add(fTitle)
.Add(fVersion)
.AddGlue()
.Add(fCopyright)
.Add(fCopyright2)
.AddGlue()
.Add(fCopyright3)
.Add(fCopyright4)
.AddGlue();
BFont font;
GetFont(&font);
SetExplicitPreferredSize(BSize(font.Size() * 400 / 12,
font.Size() * 200 / 12));
}
示例13: BView
ConfigView::ConfigView(BRect frame, Gravity* parent)
:
BView(frame, B_EMPTY_STRING, B_FOLLOW_ALL_SIDES, B_WILL_DRAW),
fParent(parent),
fTitleString(new BStringView(B_EMPTY_STRING, "OpenGL Gravity Effect")),
fAuthorString(new BStringView(B_EMPTY_STRING, "by Tri-Edge AI")),
fCountSlider(new BSlider(B_EMPTY_STRING, "Particle Count: ",
new BMessage(kMsgSize), 0, 4, B_HORIZONTAL, B_BLOCK_THUMB,
B_NAVIGABLE | B_WILL_DRAW)),
fShadeString(new BStringView(B_EMPTY_STRING, "Shade: ")),
fShadeList(new BListView(B_EMPTY_STRING, B_SINGLE_SELECTION_LIST,
B_WILL_DRAW | B_NAVIGABLE))
{
SetLayout(new BGroupLayout(B_HORIZONTAL));
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
fShadeList->SetSelectionMessage(new BMessage(kMsgShade));
fShadeList->AddItem(new BStringItem("Red"));
fShadeList->AddItem(new BStringItem("Green"));
fShadeList->AddItem(new BStringItem("Blue"));
fShadeList->AddItem(new BStringItem("Orange"));
fShadeList->AddItem(new BStringItem("Purple"));
fShadeList->AddItem(new BStringItem("White"));
fShadeList->AddItem(new BStringItem("Rainbow"));
fShadeList->Select(parent->Config.ShadeID);
fShadeScroll = new BScrollView(B_EMPTY_STRING, fShadeList,
B_WILL_DRAW | B_FRAME_EVENTS, false, true);
fCountSlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
fCountSlider->SetHashMarkCount(5);
fCountSlider->SetLimitLabels("128", "2048");
fCountSlider->SetModificationMessage(new BMessage(kMsgSize));
fCountSlider->SetValue(parent->Config.ParticleCount);
AddChild(BLayoutBuilder::Group<>(B_VERTICAL, B_USE_DEFAULT_SPACING)
.AddGroup(B_VERTICAL, 0)
.Add(fTitleString)
.Add(fAuthorString)
.End()
.Add(fShadeString)
.Add(fShadeScroll)
.Add(fCountSlider)
.SetInsets(B_USE_DEFAULT_SPACING));
}
示例14: BControl
KnobSwitch::KnobSwitch(BRect frame, const char *name, uint32 resizeMask, uint32 flags) :
BControl(frame, name, "", 0, resizeMask, flags),
fPressing(false),
fCurrState(kUp)
{
fUpBmap = new BBitmap(BRect(0, 0, kUpBitmapWidth - 1, kUpBitmapHeight - 1),
kUpBitmapColorSpace);
fMiddleBmap = new BBitmap(BRect(0, 0, kMiddleBitmapWidth - 1, kMiddleBitmapHeight - 1),
kMiddleBitmapColorSpace);
fDownBmap = new BBitmap(BRect(0, 0, kDownBitmapWidth - 1, kDownBitmapHeight - 1),
kDownBitmapColorSpace);
fUpBmap->SetBits(kUpBitmapBits, sizeof(kUpBitmapBits), 0, kUpBitmapColorSpace);
fMiddleBmap->SetBits(kMiddleBitmapBits, sizeof(kMiddleBitmapBits), 0, kMiddleBitmapColorSpace);
fDownBmap->SetBits(kDownBitmapBits, sizeof(kDownBitmapBits), 0, kDownBitmapColorSpace);
SetViewColor(B_TRANSPARENT_COLOR);
}
示例15: Parent
void
BBox::AttachedToWindow()
{
BView* parent = Parent();
if (parent != NULL) {
// inherit the color from parent
rgb_color color = parent->ViewColor();
if (color == B_TRANSPARENT_COLOR)
color = ui_color(B_PANEL_BACKGROUND_COLOR);
SetViewColor(color);
SetLowColor(color);
}
// The box could have been resized in the mean time
fBounds = Bounds();
}