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


C++ BDeskbar::RemoveItem方法代码示例

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


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

示例1:

void
MailDaemonApp::RemoveDeskbarIcon()
{
    BDeskbar deskbar;
    if (deskbar.HasItem("mail_daemon"))
        deskbar.RemoveItem("mail_daemon");
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例2:

/***********************************************************
 * RemoveDeskbarIcon
 ***********************************************************/
void
HDaemonApp::RemoveDeskbarIcon()
{
    BDeskbar deskbar;
    if( deskbar.HasItem( "scooby_daemon" ))
        deskbar.RemoveItem( "scooby_daemon" );
}
开发者ID:HaikuArchives,项目名称:Scooby,代码行数:10,代码来源:HDaemonApp.cpp

示例3:

void
NetworkStatusView::_Quit()
{
    if (fInDeskbar) {
        BDeskbar deskbar;
        deskbar.RemoveItem(kDeskbarItemName);
    } else
        be_app->PostMessage(B_QUIT_REQUESTED);
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:9,代码来源:NetworkStatusView.cpp

示例4: OnQuitRequested

void WatchView::OnQuitRequested()
{
    // According to the Be Book, we are not allowed to do this
    // since we're a view that's sitting on the Deskbar's shelf.
    // But it works just fine for me, and I see no other way to
    // make a Deskbar replicant quit itself.

    BDeskbar deskbar;
    deskbar.RemoveItem(DESKBAR_ITEM_NAME);
}
开发者ID:DonCN,项目名称:haiku,代码行数:10,代码来源:WatchView.cpp

示例5:

void
AudioSettingsView::_HideDeskbarVolumeControl()
{
    BDeskbar deskbar;
    status_t status = deskbar.RemoveItem("MediaReplicant");
    if (status != B_OK) {
        fprintf(stderr, B_TRANSLATE(
            "Couldn't remove volume control in Deskbar: %s\n"),
            strerror(status));
    }
}
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:11,代码来源:MediaViews.cpp

示例6: Remove

void DeskbarPulseView::Remove() {
    // Remove ourselves from the deskbar by name
    BDeskbar *deskbar = new BDeskbar();
    status_t err = deskbar->RemoveItem("DeskbarPulseView");
    if (err != B_OK) {
        BString str;
        snprintf(str.LockBuffer(512), 512,
            B_TRANSLATE("Removing from Deskbar failed.\n%s"), strerror(err));
        str.UnlockBuffer();
        BAlert *alert = new BAlert(B_TRANSLATE("Info"), str.String(),
            B_TRANSLATE("OK"));
        alert->SetShortcut(0, B_ESCAPE);
        alert->Go(NULL);
    }
    delete deskbar;
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:16,代码来源:DeskbarPulseView.cpp

示例7: AttachedToWindow

void DeskbarView::AttachedToWindow()
{
    BView::AttachedToWindow();
    if (Parent())
        SetViewColor(Parent()->ViewColor());
    else
        SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));

    SetLowColor(ViewColor());

    if (be_roster->IsRunning("application/x-vnd.Be-POST")) {
        _RefreshMailQuery();
    } else {
        BDeskbar deskbar;
        deskbar.RemoveItem("mail_daemon");
    }
}
开发者ID:,项目名称:,代码行数:17,代码来源:

示例8: AttachedToWindow

void DeskbarView::AttachedToWindow()
{
    BView::AttachedToWindow();
    if (Parent())
        SetViewColor(Parent()->ViewColor());
    else
        SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));

    SetLowColor(ViewColor());

    if (be_roster->IsRunning(B_MAIL_DAEMON_SIGNATURE)) {
        _RefreshMailQuery();
    } else {
        BDeskbar deskbar;
        deskbar.RemoveItem("mail_daemon");
    }
}
开发者ID:kodybrown,项目名称:haiku,代码行数:17,代码来源:DeskbarView.cpp

示例9: if

void
WorkspacesView::MessageReceived(BMessage* message)
{
    switch (message->what) {
        case B_ABOUT_REQUESTED:
            _AboutRequested();
            break;

        case B_MOUSE_WHEEL_CHANGED:
        {
            WorkspacesWindow* window
                = dynamic_cast<WorkspacesWindow*>(Window());
            if (window == NULL || !window->SwitchOnWheel())
                break;

            float deltaY = message->FindFloat("be:wheel_delta_y");
            if (deltaY > 0.1)
                activate_workspace(current_workspace() + 1);
            else if (deltaY < -0.1)
                activate_workspace(current_workspace() - 1);
            break;
        }

        case kMsgChangeCount:
            be_roster->Launch(kScreenPrefletSignature);
            break;

        case kMsgToggleLiveInDeskbar:
        {
            // only actually used from the replicant itself
            // since HasItem() locks up we just remove directly.
            BDeskbar deskbar;
            // we shouldn't do this here actually, but it works for now...
            deskbar.RemoveItem (kDeskbarItemName);
            break;
        }

        default:
            BView::MessageReceived(message);
            break;
    }
}
开发者ID:,项目名称:,代码行数:42,代码来源:

示例10: main

int main(int argc, char *argv[]) {
    BDeskbar deskbar;
    app_info info;
    
    new BApplication(APP_SIG);

    // Remove the old instance
    if (deskbar.HasItem(VIEW_NAME) == true) deskbar.RemoveItem(VIEW_NAME);

    if (argc == 1) {
        if (be_app->GetAppInfo(&info) == B_OK) {
            status_t result = deskbar.AddItem(&info.ref, NULL);
            printf("Adding deskbar icon (%s): %s\n", info.ref.name, strerror(result));
        } else {
            printf("Unable to obtain app info\n");
        };
    };
    
    return B_OK;
};
开发者ID:HaikuArchives,项目名称:FeedKit,代码行数:20,代码来源:Main.cpp

示例11: BAlert

void
NetworkWindow::_ShowReplicant(bool show)
{
    if (show) {
        const char* argv[] = {"--deskbar", NULL};

        status_t status = be_roster->Launch(kNetworkStatusSignature, 1, argv);
        if (status != B_OK) {
            BString errorMessage;
            errorMessage.SetToFormat(
                B_TRANSLATE("Installing NetworkStatus in Deskbar failed: %s"),
                strerror(status));
            BAlert* alert = new BAlert(B_TRANSLATE("launch error"),
                errorMessage, B_TRANSLATE("Ok"));
            alert->Go(NULL);
        }
    } else {
        BDeskbar deskbar;
        deskbar.RemoveItem("NetworkStatus");
    }
}
开发者ID:kodybrown,项目名称:haiku,代码行数:21,代码来源:NetworkWindow.cpp

示例12: if

void
AdvancedOptionsView::MessageReceived(BMessage *message)
{
    switch (message->what) {
        case kLocalUseDirectWindow:
            fController->SetUseDirectWindow(fUseDirectWindow->Value() == B_CONTROL_ON);
            break;
        
        case kLocalHideDeskbar:
        {
            bool hide = fHideDeskbarIcon->Value() == B_CONTROL_ON;
            BDeskbar deskbar;
            if (deskbar.IsRunning()) {
                if (hide) {
                    // Save the current minimize setting, since we are going to override
                    // it when "hide deskbar" is set
                    fCurrentMinimizeValue = Settings::Current().MinimizeOnRecording();
                    fMinimizeOnStart->SetValue(B_CONTROL_ON);
                    fMinimizeOnStart->SetEnabled(false);
                    while (deskbar.HasItem(BSC_DESKBAR_VIEW))
                        deskbar.RemoveItem(BSC_DESKBAR_VIEW);
                } else if (!deskbar.HasItem(BSC_DESKBAR_VIEW)) {
                    fMinimizeOnStart->SetValue(fCurrentMinimizeValue ? B_CONTROL_ON : B_CONTROL_OFF);
                    fMinimizeOnStart->SetEnabled(true);
                    deskbar.AddItem(new DeskbarControlView(BRect(0, 0, 15, 15),
                        BSC_DESKBAR_VIEW));
                }
            }
        }
        // Fall through
        case kLocalMinimizeOnRecording:
            Settings::Current().SetMinimizeOnRecording(fMinimizeOnStart->Value() == B_CONTROL_ON);
            break;
        
        
        default:
            BView::MessageReceived(message);
            break;
    }
}
开发者ID:jackburton79,项目名称:bescreencapture,代码行数:40,代码来源:AdvancedOptionsView.cpp

示例13: MessageReceived

void DeskbarView::MessageReceived(BMessage *message) {
//	message->PrintToStream();
    switch (message->what)
    {
        case 'LIVE':
            {
                ticks++;				
                Invalidate();
                team_info teamInfo;
                status_t error = get_team_info(team, &teamInfo);
                if (error != B_OK && id>0) {
                    BDeskbar deskbar;
                    deskbar.RemoveItem(id);
                } else {
                    BMessage *mes=new BMessage(*message);
                    mes->AddRect("rect",ConvertToScreen(Bounds()));
                    ReplyMessenger.SendMessage(mes);
                }
                break;
            }
        case B_SET_PROPERTY:
            {
                switch( message->FindInt32("what2") ) {
                    case 'TTIP':
                        {							
                            const char *tip=NULL;
                            status_t res = message->FindString("tooltip",&tip);
                            
                            if(!tip || res!=B_OK)
                                tip = applicationName.String();
                            if(strlen(tip)==0)
                                tip = applicationName.String();													
                            if(strlen(tip)!=0)		
                                SetToolTip(tip);
                                
                            break;
                        }					
                    case 'BITS':
                        {
                            BBitmap *oldicon=icon;
                            icon=NULL;
                            delete oldicon;
                            BMessage bits;
                            message->FindMessage("icon", &bits);
                            icon = new BBitmap(&bits);
                            bits.MakeEmpty();
                            Invalidate();
                            break;
                        }
                    case '_ID_':
                        {
                            message->FindInt32("ReplicantID",&id);
                            break;
                        }
                    case 'MSGR':
                        {
                            ssize_t numBytes;
                            const char *name=NULL;
                            message->FindMessenger("messenger", &ReplyMessenger);
                            message->FindData("qtrayobject",B_ANY_TYPE,&traysysobject,&numBytes);
                            if(message->FindString("application_name",&name)==B_OK)
                                applicationName.SetTo(name);
                            break;
                        }
                }
            }
            break;		
        default:
            BView::MessageReceived(message);
            break;
    }
}
开发者ID:bogdan-voevoda,项目名称:qt4,代码行数:72,代码来源:qsystray.cpp

示例14: ChildAt

void
WorkspacesWindow::MessageReceived(BMessage *message)
{
    switch (message->what) {
        case B_SIMPLE_DATA:
        {
            // Drop from Tracker
            entry_ref ref;
            for (int i = 0; (message->FindRef("refs", i, &ref) == B_OK); i++)
                be_roster->Launch(&ref);
            break;
        }

        case B_ABOUT_REQUESTED:
            PostMessage(message, ChildAt(0));
            break;

        case kMsgToggleBorder:
        {
            bool enable = false;
            if (Look() == B_NO_BORDER_WINDOW_LOOK)
                enable = true;

            if (enable)
                if (fSettings->HasTitle())
                    SetLook(B_TITLED_WINDOW_LOOK);
                else
                    SetLook(B_MODAL_WINDOW_LOOK);
            else
                SetLook(B_NO_BORDER_WINDOW_LOOK);

            fSettings->SetHasBorder(enable);
            break;
        }

        case kMsgToggleTitle:
        {
            bool enable = false;
            if (Look() == B_MODAL_WINDOW_LOOK
                || Look() == B_NO_BORDER_WINDOW_LOOK)
                enable = true;

            if (enable)
                SetLook(B_TITLED_WINDOW_LOOK);
            else
                SetLook(B_MODAL_WINDOW_LOOK);

            // No matter what the setting for title, 
            // we must force the border on
            fSettings->SetHasBorder(true);
            fSettings->SetHasTitle(enable);
            break;
        }

        case kMsgToggleAutoRaise:
            SetAutoRaise(!IsAutoRaising());
            SetFeel(B_NORMAL_WINDOW_FEEL);
            break;

        case kMsgToggleAlwaysOnTop:
        {
            bool enable = false;
            if (Feel() != B_FLOATING_ALL_WINDOW_FEEL)
                enable = true;

            if (enable)
                SetFeel(B_FLOATING_ALL_WINDOW_FEEL);
            else
                SetFeel(B_NORMAL_WINDOW_FEEL);

            fSettings->SetAlwaysOnTop(enable);
            break;
        }

        case kMsgToggleLiveInDeskbar:
        {
            BDeskbar deskbar;
            if (deskbar.HasItem (kDeskbarItemName))
                deskbar.RemoveItem (kDeskbarItemName);
            else {
                entry_ref ref;
                be_roster->FindApp(kSignature, &ref);
                deskbar.AddItem(&ref);
            }
            break;
        }

        default:
            BWindow::MessageReceived(message);
            break;
    }
}
开发者ID:MaddTheSane,项目名称:haiku,代码行数:92,代码来源:Workspaces.cpp

示例15: RemoveFromDeskbar

status_t VBoxGuestDeskbarView::RemoveFromDeskbar()
{
    BDeskbar deskbar;
    return deskbar.RemoveItem(VIEWNAME);
}
开发者ID:jbremer,项目名称:virtualbox,代码行数:5,代码来源:VBoxGuestDeskbarView.cpp


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