Added the nice "Open File" recent documents menu.

Moved the DiskProbe application signature constant into the DiskProbe.h header file.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6769 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-02-26 19:38:14 +00:00
parent 5d9e40fe92
commit aa60f34665
3 changed files with 10 additions and 6 deletions

View File

@ -26,11 +26,9 @@
#include <string.h>
static const char *kSignature = "application/x-vnd.OpenBeOS-DiskProbe";
static const uint32 kMsgDiskProbeSettings = 'DPst';
static const uint32 kCascadeOffset = 20;
static const uint32 kMsgDiskProbeSettings = 'DPst';
struct disk_probe_settings {
BRect window_frame;

View File

@ -9,6 +9,8 @@
#include <SupportDefs.h>
static const char *kSignature = "application/x-vnd.OpenBeOS-DiskProbe";
static const uint32 kMsgOpenFilePanel = 'opFp';
static const uint32 kMsgOpenOpenWindow = 'opOw';
static const uint32 kMsgOpenWindowClosed = 'clOw';

View File

@ -13,6 +13,7 @@
#include <MenuBar.h>
#include <MenuItem.h>
#include <Path.h>
#include <be_apps/Tracker/RecentItems.h>
FileWindow::FileWindow(BRect rect, entry_ref *ref, const BMessage *settings)
@ -41,12 +42,15 @@ FileWindow::FileWindow(BRect rect, entry_ref *ref, const BMessage *settings)
devicesMenu->SetTargetForItems(be_app);
menu->AddItem(new BMenuItem(devicesMenu));
menu->AddItem(new BMenuItem("Open File" B_UTF8_ELLIPSIS,
new BMessage(kMsgOpenFilePanel), 'O', B_COMMAND_KEY));
BMenu *recentsMenu = BRecentFilesList::NewFileListMenu("Open File" B_UTF8_ELLIPSIS,
NULL, NULL, be_app, 10, false, NULL, kSignature);
BMenuItem *item;
menu->AddItem(item = new BMenuItem(recentsMenu, new BMessage(kMsgOpenFilePanel)));
item->SetShortcut('O', B_COMMAND_KEY);
menu->AddSeparatorItem();
// the ProbeView save menu items will be inserted here
BMenuItem *item = new BMenuItem("Close", new BMessage(B_CLOSE_REQUESTED), 'W', B_COMMAND_KEY);
item = new BMenuItem("Close", new BMessage(B_CLOSE_REQUESTED), 'W', B_COMMAND_KEY);
menu->AddItem(item);
menu->AddSeparatorItem();