本文整理汇总了C++中BFilePanel::Refresh方法的典型用法代码示例。如果您正苦于以下问题:C++ BFilePanel::Refresh方法的具体用法?C++ BFilePanel::Refresh怎么用?C++ BFilePanel::Refresh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BFilePanel
的用法示例。
在下文中一共展示了BFilePanel::Refresh方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OpenSaveFilePanel
/*
open a file panel and ask for a PDF file
the file panel will tell by itself if openning have been cancelled
or not.
*/
void BepdfApplication::OpenSaveFilePanel(BHandler* handler, bool fileMode, BRefFilter* filter, BMessage* msg, const char* name) {
BFilePanel* panel = NULL;
// lazy construct file panel
if (fileMode) {
// file panel for selection of file
if (mSaveFilePanel == NULL) {
mSaveFilePanel = new BFilePanel (B_SAVE_PANEL,
NULL, NULL, B_FILE_NODE, false, NULL, NULL, true);
}
// hide other file panel
if (mSaveToDirectoryFilePanel != NULL && mSaveToDirectoryFilePanel->IsShowing()) {
mSaveToDirectoryFilePanel->Hide();
}
panel = mSaveFilePanel;
} else {
// file panel for selection of directory
if (mSaveToDirectoryFilePanel == NULL) {
mSaveToDirectoryFilePanel = new BFilePanel (B_OPEN_PANEL,
NULL, NULL, B_DIRECTORY_NODE, false, NULL, NULL, true);
}
// hide other file panel
if (mSaveFilePanel != NULL && mSaveFilePanel->IsShowing()) {
mSaveFilePanel->Hide();
}
panel = mSaveToDirectoryFilePanel;
}
// (re)-set to directory of currently opened PDF file
// TODO decide if directory should be independent from PDF file
panel->SetPanelDirectory(mSettings->GetPanelDirectory());
if (name != NULL) {
panel->SetSaveText(name);
}
else if (fileMode) {
panel->SetSaveText("");
}
// set/reset filter
panel->SetRefFilter(filter);
// add kind to message
BMessage message(B_SAVE_REQUESTED);
if (msg == NULL) {
msg = &message;
}
panel->SetMessage(msg);
// set target
BMessenger msgr(handler);
panel->SetTarget(msgr);
panel->Refresh();
panel->Show();
}