本文整理汇总了C++中BView::RemoveSelf方法的典型用法代码示例。如果您正苦于以下问题:C++ BView::RemoveSelf方法的具体用法?C++ BView::RemoveSelf怎么用?C++ BView::RemoveSelf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BView
的用法示例。
在下文中一共展示了BView::RemoveSelf方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChildAt
status_t
BBox::SetLabel(BView *viewLabel)
{
if (viewLabel != NULL) {
if (viewLabel == this || viewLabel->Window() != NULL || viewLabel->Parent() != NULL) return B_ERROR;
AddChild(viewLabel, ChildAt(0));
if (viewLabel->Parent() != this) return B_ERROR;
viewLabel->SetResizingMode(B_FOLLOW_NONE);
} else if (fLabelView == NULL) {
return B_OK;
}
if (fLabelView != NULL) {
BView *view = fLabelView;
fLabelView = NULL;
view->RemoveSelf();
delete view;
}
fLabelView = viewLabel;
ReAdjustLabel();
return B_OK;
}
示例2: RemoveChildren
void RemoveChildren(BView* view)
{
if (view != NULL) {
BView* child;
while ((child = view->ChildAt(0)) != NULL) {
child->RemoveSelf();
delete child;
}
}
}
示例3: MessageReceived
void PrefWindow::MessageReceived(BMessage *message){
BView *tmpV;
int32 k;
switch (message->what){
case QUIT:
Hide();
break;
case CHANGE_LANGUAGE:
tmpV = ChildAt(0);
if (tmpV != NULL){
tmpV->RemoveSelf();
delete tmpV;
}
BLayoutBuilder::Group<>(this)
.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
.Add(new PrefView());
break;
case SET_FACTORY:
k = (new BAlert(NULL,Language.get("FACTORY_SURE"),Language.get("APPLY"),Language.get("CANCEL")))->Go();
if (k==0){
Prefs.FactorySettings();
KeyBind.InstallDefaults();
tmpV = FindView("Prefs color");
if (tmpV != NULL){
PostMessage(COLOR_SELECT, tmpV);
}
tmpV = FindView("Prefs keys");
if (tmpV != NULL){
tmpV->LockLooper();
tmpV->Pulse();
tmpV->UnlockLooper();
}else{
be_app->PostMessage(CHANGE_LANGUAGE);
}
Pool.sample_view_dirty = true; // update the sample-view
Pool.update_draw_cache = true; // update the draw cache
Pool.update_index = true; // update the index cache
Pool.RedrawWindow();
}
break;
default:
BWindow::MessageReceived(message);
}
}
示例4:
void
BTextWidget::StopEdit(bool saveChanges, BPoint poseLoc, BPoseView* view,
BPose* pose, int32 poseIndex)
{
// find the text editing view
BView* scrollView = view->FindView("BorderView");
ASSERT(scrollView != NULL);
if (scrollView == NULL)
return;
BTextView* textView = dynamic_cast<BTextView*>(
scrollView->FindView("WidgetTextView"));
ASSERT(textView != NULL);
if (textView == NULL)
return;
BColumn* column = view->ColumnFor(fAttrHash);
ASSERT(column != NULL);
if (column == NULL)
return;
if (saveChanges && fText->CommitEditedText(textView)) {
// we have an actual change, re-sort
view->CheckPoseSortOrder(pose, poseIndex);
}
// make text widget visible again
SetVisible(true);
view->Invalidate(ColumnRect(poseLoc, column, view));
// force immediate redraw so TEView disappears
scrollView->RemoveSelf();
delete scrollView;
ASSERT(view->Window() != NULL);
view->Window()->UpdateIfNeeded();
view->MakeFocus();
SetActive(false);
}
示例5: if
void
BBox::SetLabel(const char *label)
{
if (!(label == NULL || *label == 0)) {
BStringView *strView = cast_as(fLabelView, BStringView);
if (strView != NULL) {
strView->SetText(label);
strView->ResizeToPreferred();
ReAdjustLabel();
return;
}
if ((strView = new BStringView(BRect(0, 0, 1, 1), NULL, label, B_FOLLOW_NONE)) == NULL) return;
strView->SetFont(be_bold_font);
strView->ResizeToPreferred();
if (SetLabel(strView) != B_OK) delete strView;
} else if (fLabelView != NULL) {
BView *view = fLabelView;
fLabelView = NULL;
view->RemoveSelf();
delete view;
}
}
示例6: InitWindow
// ToolboxWindow::InitWindow -- Initialization Commands here
void ToolboxWindow::InitWindow(void)
{
BRect r;
r = Bounds();
// Add Controls
// Toolbar
//int ToolbarButtonMargin = 2;
//int ToolbarButtonWidth = 22;
//int ButtonGap = 1;
// StringView Button
BRect BitmapFrame (BRect(0,0,23,23));
BPicture *tmpBPicture;
BPicture *tmpBPicture2;
BView *tmpBPictureView = new BView(BitmapFrame, "tmpBPictureView",B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
rgb_color toolbar_button_background = { 255, 255, 255, 0 };
AddChild(tmpBPictureView);
BBitmap *stringviewpicture = new BBitmap(BitmapFrame,B_RGB32);
stringviewpicture->SetBits(stringviewicon,1728,0,B_RGB32);
tmpBPictureView->SetLowColor(toolbar_button_background);
tmpBPictureView->BeginPicture(new BPicture);
tmpBPictureView->DrawBitmap(stringviewpicture,BPoint(0,0));
tmpBPicture = tmpBPictureView->EndPicture();
tmpBPictureView->RemoveSelf();
AddChild(tmpBPictureView);
BBitmap *stringviewpicture_state2 = new BBitmap(BitmapFrame,B_RGB32);
stringviewpicture_state2->SetBits(stringviewiconinverse,1728,0,B_RGB32);
tmpBPictureView->SetLowColor(toolbar_button_background);
tmpBPictureView->BeginPicture(new BPicture);
tmpBPictureView->DrawBitmap(stringviewpicture_state2,BPoint(0,0));
tmpBPicture2 = tmpBPictureView->EndPicture();
btnBrieStringViewControl = new BPictureButton(BRect (1,0,24,23),"StringView",tmpBPicture,tmpBPicture2, new BMessage(TOOLBOX_BTN_STRINGVIEWCONTROL),B_ONE_STATE_BUTTON, B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
tmpBPictureView->RemoveSelf();
AddChild(tmpBPictureView);
//--------------------------------------------------------------------//
// TextView Button
BBitmap *textviewpicture = new BBitmap(BitmapFrame,B_RGB32);
textviewpicture->SetBits(brietextcontrol,1728,0,B_RGB32);
tmpBPictureView->SetLowColor(toolbar_button_background);
tmpBPictureView->BeginPicture(new BPicture);
tmpBPictureView->DrawBitmap(textviewpicture,BPoint(0,0));
tmpBPicture = tmpBPictureView->EndPicture();
tmpBPictureView->RemoveSelf();
AddChild(tmpBPictureView);
BBitmap *textviewpicture_state2 = new BBitmap(BitmapFrame,B_RGB32);
textviewpicture_state2->SetBits(brietextcontrolinverse,1728,0,B_RGB32);
tmpBPictureView->SetLowColor(toolbar_button_background);
tmpBPictureView->BeginPicture(new BPicture);
tmpBPictureView->DrawBitmap(textviewpicture_state2,BPoint(0,0));
tmpBPicture2 = tmpBPictureView->EndPicture();
btnBrieTextControl = new BPictureButton(BRect (26,0,50,23),"TextControl",tmpBPicture,tmpBPicture2, new BMessage(TOOLBOX_BTN_TEXTCONTROL),B_ONE_STATE_BUTTON, B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
tmpBPictureView->RemoveSelf();
AddChild(tmpBPictureView);
//--------------------------------------------------------------------//
// Button Button
BBitmap *buttonpicture = new BBitmap(BitmapFrame,B_RGB32);
buttonpicture->SetBits(stringviewicon,1728,0,B_RGB32);
tmpBPictureView->SetLowColor(toolbar_button_background);
tmpBPictureView->BeginPicture(new BPicture);
tmpBPictureView->DrawBitmap(buttonpicture,BPoint(0,0));
tmpBPicture = tmpBPictureView->EndPicture();
tmpBPictureView->RemoveSelf();
AddChild(tmpBPictureView);
BBitmap *buttonpicture_state2 = new BBitmap(BitmapFrame,B_RGB32);
buttonpicture_state2->SetBits(stringviewiconinverse,1728,0,B_RGB32);
tmpBPictureView->SetLowColor(toolbar_button_background);
tmpBPictureView->BeginPicture(new BPicture);
tmpBPictureView->DrawBitmap(buttonpicture_state2,BPoint(0,0));
tmpBPicture2 = tmpBPictureView->EndPicture();
btnBrieButtonControl = new BPictureButton(BRect (1,25,24,48),
"Button",tmpBPicture,tmpBPicture2, new BMessage(TOOLBOX_BTN_BUTTONCONTROL),B_ONE_STATE_BUTTON, B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
tmpBPictureView->RemoveSelf();
AddChild(tmpBPictureView);
//--------------------------------------------------------------------//
// Picture Button
BBitmap *picturepicture = new BBitmap(BitmapFrame,B_RGB32);
picturepicture->SetBits(stringviewicon,1728,0,B_RGB32);
tmpBPictureView->SetLowColor(toolbar_button_background);
tmpBPictureView->BeginPicture(new BPicture);
tmpBPictureView->DrawBitmap(picturepicture,BPoint(0,0));
tmpBPicture = tmpBPictureView->EndPicture();
//.........这里部分代码省略.........
示例7: rect
PrinterItem::PrinterItem(PrintersWindow* window, const BDirectory& node,
PrinterListLayoutData& layoutData)
: BListItem(0, false),
fFolder(NULL),
fNode(node),
fLayoutData(layoutData)
{
BRect rect(0, 0, B_LARGE_ICON - 1, B_LARGE_ICON - 1);
if (sIcon == NULL) {
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
sIcon = new BBitmap(rect, B_RGBA32);
#else
sIcon = new BBitmap(rect, B_CMAP8);
#endif
BMimeType type(PSRV_PRINTER_FILETYPE);
type.GetIcon(sIcon, B_LARGE_ICON);
}
if (sIcon && sIcon->IsValid() && sSelectedIcon == NULL) {
const float checkMarkIconSize = 20.0;
BBitmap *checkMark = _LoadVectorIcon("check_mark_icon",
checkMarkIconSize);
if (checkMark && checkMark->IsValid()) {
sSelectedIcon = new BBitmap(rect, B_RGBA32, true);
if (sSelectedIcon && sSelectedIcon->IsValid()) {
// draw check mark at bottom left over printer icon
BView *view = new BView(rect, "offscreen", B_FOLLOW_ALL,
B_WILL_DRAW);
float y = rect.Height() - checkMark->Bounds().Height();
sSelectedIcon->Lock();
sSelectedIcon->AddChild(view);
view->DrawBitmap(sIcon);
view->SetDrawingMode(B_OP_ALPHA);
view->DrawBitmap(checkMark, BPoint(0, y));
view->Sync();
view->RemoveSelf();
sSelectedIcon->Unlock();
delete view;
}
}
delete checkMark;
}
// Get Name of printer
_GetStringProperty(PSRV_PRINTER_ATTR_PRT_NAME, fName);
_GetStringProperty(PSRV_PRINTER_ATTR_COMMENTS, fComments);
_GetStringProperty(PSRV_PRINTER_ATTR_TRANSPORT, fTransport);
_GetStringProperty(PSRV_PRINTER_ATTR_TRANSPORT_ADDR, fTransportAddress);
_GetStringProperty(PSRV_PRINTER_ATTR_DRV_NAME, fDriverName);
BPath path;
if (find_directory(B_USER_PRINTERS_DIRECTORY, &path) != B_OK)
return;
// Setup spool folder
path.Append(fName.String());
BDirectory dir(path.Path());
if (dir.InitCheck() == B_OK) {
fFolder = new SpoolFolder(window, this, dir);
UpdatePendingJobs();
}
}
示例8: toFront
void
ActivityWindow::MessageReceived(BMessage* message)
{
if (message->WasDropped()) {
_MessageDropped(message);
return;
}
switch (message->what) {
case B_REFS_RECEIVED:
case B_SIMPLE_DATA:
_MessageDropped(message);
break;
case kMsgAddView:
{
#ifdef __HAIKU__
BView* firstView = fLayout->View()->ChildAt(0);
_AddDefaultView();
if (firstView != NULL)
ResizeBy(0, firstView->Bounds().Height() + fLayout->Spacing());
#endif
break;
}
case kMsgRemoveView:
{
#ifdef __HAIKU__
BView* view;
if (message->FindPointer("view", (void**)&view) != B_OK)
break;
view->RemoveSelf();
ResizeBy(0, -view->Bounds().Height() - fLayout->Spacing());
delete view;
#endif
break;
}
case kMsgShowSettings:
{
if (fSettingsWindow.IsValid()) {
// Just bring the window to front (via scripting)
BMessage toFront(B_SET_PROPERTY);
toFront.AddSpecifier("Active");
toFront.AddSpecifier("Window", B_TRANSLATE("Settings"));
toFront.AddBool("data", true);
fSettingsWindow.SendMessage(&toFront);
} else {
// Open new settings window
BWindow* window = new SettingsWindow(this);
window->Show();
fSettingsWindow = window;
}
break;
}
case kMsgTimeIntervalUpdated:
BroadcastToActivityViews(message);
break;
default:
BWindow::MessageReceived(message);
break;
}
}
示例9:
/*! \brief Destructor for the class ActivityWindow
*/
ActivityWindow::~ActivityWindow()
{
BView* toRemove;
if ( NULL != ( toRemove = FindView( "Explanation 1" ) ) ) {
toRemove->RemoveSelf();
delete toRemove;
}
if ( NULL != ( toRemove = FindView( "Background" ) ) ) {
toRemove->RemoveSelf();
delete toRemove;
}
if ( NULL != ( toRemove = FindView( "Text view explanation" ) ) ) {
toRemove->RemoveSelf();
delete toRemove;
}
if ( NULL != fTextScroller ) {
fTextScroller->RemoveSelf();
delete fTextScroller;
}
if ( NULL != fNoteText ) {
fNoteText->RemoveSelf();
delete fNoteText;
}
if ( NULL != ( toRemove = FindView( "Sound file explanation" ) ) ) {
toRemove->RemoveSelf();
delete toRemove;
}
if ( NULL != ( toRemove = FindView( "Sound file name" ) ) ) {
toRemove->RemoveSelf();
delete toRemove;
}
if ( NULL != ( toRemove = FindView( "Program explanation" ) ) ) {
toRemove->RemoveSelf();
delete toRemove;
}
if ( NULL != ( toRemove = FindView( "Program file name" ) ) ) {
toRemove->RemoveSelf();
delete toRemove;
}
if ( NULL != ( toRemove = FindView( "Program file options explanation" ) ) ) {
toRemove->RemoveSelf();
delete toRemove;
}
if ( NULL != ( toRemove = FindView( "Program file options" ) ) ) {
toRemove->RemoveSelf();
delete toRemove;
}
if ( NULL != ( toRemove = FindView( "Snooze time selector" ) ) ) {
toRemove->RemoveSelf();
delete toRemove;
}
if ( NULL != ( toRemove = FindView( "Snooze button" ) ) ) {
toRemove->RemoveSelf();
delete toRemove;
}
if ( NULL != ( toRemove = FindView( "Dismiss button" ) ) ) {
toRemove->RemoveSelf();
delete toRemove;
}
} // <-- end of destructor for ActivityWindow