本文整理汇总了C++中BFilePanel::IsShowing方法的典型用法代码示例。如果您正苦于以下问题:C++ BFilePanel::IsShowing方法的具体用法?C++ BFilePanel::IsShowing怎么用?C++ BFilePanel::IsShowing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BFilePanel
的用法示例。
在下文中一共展示了BFilePanel::IsShowing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FileTypesWindow
void
FileTypes::MessageReceived(BMessage *message)
{
switch (message->what) {
case kMsgSettingsChanged:
fSettings.UpdateFrom(message);
break;
case kMsgOpenTypesWindow:
if (fTypesWindow == NULL) {
fTypesWindow = new FileTypesWindow(fSettings.Message());
fTypesWindow->Show();
fWindowCount++;
} else
fTypesWindow->Activate(true);
break;
case kMsgTypesWindowClosed:
fTypesWindow = NULL;
_WindowClosed();
break;
case kMsgOpenApplicationTypesWindow:
if (fApplicationTypesWindow == NULL) {
fApplicationTypesWindow = new ApplicationTypesWindow(
fSettings.Message());
fApplicationTypesWindow->Show();
fWindowCount++;
} else
fApplicationTypesWindow->Activate(true);
break;
case kMsgApplicationTypesWindowClosed:
fApplicationTypesWindow = NULL;
_WindowClosed();
break;
case kMsgTypeWindowClosed:
fTypeWindowCount--;
// supposed to fall through
case kMsgWindowClosed:
_WindowClosed();
break;
case kMsgOpenFilePanel:
{
// the open file panel sends us a message when it's done
const char* subTitle;
if (message->FindString("title", &subTitle) != B_OK)
subTitle = B_TRANSLATE("Open file");
int32 what;
if (message->FindInt32("message", &what) != B_OK)
what = B_REFS_RECEIVED;
BMessenger target;
if (message->FindMessenger("target", &target) != B_OK)
target = be_app_messenger;
BString title = B_TRANSLATE("FileTypes");
if (subTitle != NULL && subTitle[0]) {
title.Append(": ");
title.Append(subTitle);
}
fFilePanel->SetMessage(new BMessage(what));
fFilePanel->Window()->SetTitle(title.String());
fFilePanel->SetTarget(target);
if (!fFilePanel->IsShowing())
fFilePanel->Show();
break;
}
case B_SILENT_RELAUNCH:
// In case we were launched via the add-on, there is no types
// window yet.
if (fTypesWindow == NULL)
PostMessage(kMsgOpenTypesWindow);
break;
case B_CANCEL:
if (fWindowCount == 0)
PostMessage(B_QUIT_REQUESTED);
break;
case B_SIMPLE_DATA:
RefsReceived(message);
break;
default:
BApplication::MessageReceived(message);
break;
}
}
示例2: OpenWindow
void
DiskProbe::MessageReceived(BMessage* message)
{
switch (message->what) {
case kMsgOpenOpenWindow:
if (fOpenWindow == NULL) {
fOpenWindow = new OpenWindow();
fOpenWindow->Show();
fWindowCount++;
} else
fOpenWindow->Activate(true);
break;
case kMsgOpenWindowClosed:
fOpenWindow = NULL;
// supposed to fall through
case kMsgWindowClosed:
if (--fWindowCount == 0 && !fFilePanel->IsShowing())
PostMessage(B_QUIT_REQUESTED);
break;
case kMsgSettingsChanged:
fSettings.UpdateFrom(message);
break;
case kMsgFindWindowClosed:
fFindWindow = NULL;
break;
case kMsgFindTarget:
{
BMessenger target;
if (message->FindMessenger("target", &target) != B_OK)
break;
if (fFindWindow != NULL && fFindWindow->Lock()) {
fFindWindow->SetTarget(target);
fFindWindow->Unlock();
}
break;
}
case kMsgOpenFindWindow:
{
BMessenger target;
if (message->FindMessenger("target", &target) != B_OK)
break;
if (fFindWindow == NULL) {
// open it!
fFindWindow = new FindWindow(fWindowFrame.OffsetByCopy(80, 80),
*message, target, &fSettings.Message());
fFindWindow->Show();
} else
fFindWindow->Activate();
break;
}
case kMsgOpenFilePanel:
fFilePanel->Show();
break;
case B_CANCEL:
if (fWindowCount == 0)
PostMessage(B_QUIT_REQUESTED);
break;
default:
BApplication::MessageReceived(message);
break;
}
}
示例3:
void
FileTypes::_WindowClosed()
{
if (--fWindowCount == 0 && !fFilePanel->IsShowing())
PostMessage(B_QUIT_REQUESTED);
}
示例4: FileTypesWindow
void
FileTypes::MessageReceived(BMessage* message)
{
switch (message->what) {
case kMsgSettingsChanged:
fSettings.UpdateFrom(message);
break;
case kMsgOpenTypesWindow:
if (fTypesWindow == NULL) {
fTypesWindow = new FileTypesWindow(fSettings.Message());
if (fArgvType.Length() > 0) {
// Set the window to the type that was requested on the
// command line (-type), we do this only once, if we
// ever opened more than one FileTypesWindow.
fTypesWindow->SelectType(fArgvType.String());
fArgvType = "";
}
fTypesWindow->Show();
fWindowCount++;
} else
fTypesWindow->Activate(true);
break;
case kMsgTypesWindowClosed:
fTypesWindow = NULL;
_WindowClosed();
break;
case kMsgOpenApplicationTypesWindow:
if (fApplicationTypesWindow == NULL) {
fApplicationTypesWindow = new ApplicationTypesWindow(
fSettings.Message());
fApplicationTypesWindow->Show();
fWindowCount++;
} else
fApplicationTypesWindow->Activate(true);
break;
case kMsgApplicationTypesWindowClosed:
fApplicationTypesWindow = NULL;
_WindowClosed();
break;
case kMsgTypeWindowClosed:
fTypeWindowCount--;
// supposed to fall through
case kMsgWindowClosed:
_WindowClosed();
break;
case kMsgOpenFilePanel:
{
// the open file panel sends us a message when it's done
const char* subTitle;
if (message->FindString("title", &subTitle) != B_OK)
subTitle = B_TRANSLATE("Open file");
int32 what;
if (message->FindInt32("message", &what) != B_OK)
what = B_REFS_RECEIVED;
BMessenger target;
if (message->FindMessenger("target", &target) != B_OK)
target = be_app_messenger;
BString title = B_TRANSLATE("FileTypes");
if (subTitle != NULL && subTitle[0]) {
title.Append(": ");
title.Append(subTitle);
}
uint32 flavors = B_FILE_NODE;
if (message->FindBool("allowDirs"))
flavors |= B_DIRECTORY_NODE;
fFilePanel->SetNodeFlavors(flavors);
fFilePanel->SetMessage(new BMessage(what));
fFilePanel->Window()->SetTitle(title.String());
fFilePanel->SetTarget(target);
if (!fFilePanel->IsShowing())
fFilePanel->Show();
break;
}
case B_SILENT_RELAUNCH:
// In case we were launched via the add-on, there is no types
// window yet.
if (fTypesWindow == NULL)
PostMessage(kMsgOpenTypesWindow);
break;
case B_CANCEL:
if (fWindowCount == 0)
PostMessage(B_QUIT_REQUESTED);
break;
case B_SIMPLE_DATA:
//.........这里部分代码省略.........