本文整理汇总了C++中BButton::Invoke方法的典型用法代码示例。如果您正苦于以下问题:C++ BButton::Invoke方法的具体用法?C++ BButton::Invoke怎么用?C++ BButton::Invoke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BButton
的用法示例。
在下文中一共展示了BButton::Invoke方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: msg
void
ServerAgent::DCCGetDialog (
BString nick,
BString file,
BString size,
BString ip,
BString port)
{
BMessage msg (M_DCC_ACCEPT), reply;
msg.AddString ("vision:nick", nick.String());
msg.AddString ("vision:file", file.String());
msg.AddString ("vision:size", size.String());
msg.AddString ("vision:ip", ip.String());
msg.AddString ("vision:port", port.String());
BFilePanel *panel;
BString text;
text << nick
<< ": "
<< file
<< " ("
<< size
<< " bytes)";
panel = new BFilePanel (
B_SAVE_PANEL,
&fSMsgr,
0,
0,
false,
&msg);
panel->SetButtonLabel (B_DEFAULT_BUTTON, "Accept");
panel->SetButtonLabel (B_CANCEL_BUTTON, "Refuse");
panel->SetSaveText (file.String());
BWindow *panelWindow (panel->Window());
if (panelWindow->Lock())
{
panelWindow->SetTitle (text.String());
panelWindow->SetFlags (panelWindow->Flags() | B_AVOID_FOCUS);
panelWindow->AddFilter (new DCCFileFilter (panel, msg));
if (vision_app->GetBool ("dccAutoAccept"))
{
BDirectory path (vision_app->GetString ("dccDefPath"));
if (path.InitCheck() == B_OK)
panel->SetPanelDirectory(&path);
}
if (vision_app->GetBool ("dccAutoAccept"))
{
panelWindow->Hide();
BButton *button (dynamic_cast<BButton *>(panel->Window()->FindView ("default button")));
if (button)
button->Invoke();
}
panelWindow->Unlock();
panel->Show();
// hack trick to ensure that the file panel doesn't take over the keyboard focus
// when it pops up
panelWindow->Lock();
panelWindow->SetFlags (panelWindow->Flags() & ~B_AVOID_FOCUS);
panelWindow->Unlock();
}
}