Removed the "Block/Write" menu item, and introduced new "Save" menu items;

they are not yet working, though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6756 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-02-26 12:54:51 +00:00
parent c7a76e9f26
commit 6781cbdc9b
4 changed files with 32 additions and 11 deletions
+4 -3
View File
@@ -173,11 +173,11 @@ AttributeWindow::AttributeWindow(BRect rect, entry_ref *ref, const char *attribu
BMenu *menu = new BMenu("Attribute");
menu->AddItem(new BMenuItem("Save", NULL, 'S', B_COMMAND_KEY));
// the ProbeView save menu items will be inserted here
menu->AddItem(new BMenuItem("Remove from File", new BMessage(kMsgRemoveAttribute)));
menu->AddSeparatorItem();
// the ProbeView file menu items will be inserted here
// the ProbeView print menu items will be inserted here
menu->AddSeparatorItem();
menu->AddItem(new BMenuItem("Close", new BMessage(B_CLOSE_REQUESTED), 'W', B_COMMAND_KEY));
@@ -201,7 +201,8 @@ AttributeWindow::AttributeWindow(BRect rect, entry_ref *ref, const char *attribu
rect = tabView->ContainerView()->Bounds();
rect.top += 3;
fProbeView = new ProbeView(rect, ref, attribute, settings);
fProbeView->AddFileMenuItems(menu, menu->CountItems() - 2);
fProbeView->AddSaveMenuItems(menu, 0);
fProbeView->AddPrintMenuItems(menu, menu->CountItems() - 2);
tabView->AddRawEditorTab(fProbeView);
view->AddChild(tabView);
+9 -2
View File
@@ -45,7 +45,12 @@ FileWindow::FileWindow(BRect rect, entry_ref *ref, const BMessage *settings)
new BMessage(kMsgOpenFilePanel), 'O', B_COMMAND_KEY));
menu->AddSeparatorItem();
// the ProbeView file menu items will be inserted here
// the ProbeView save menu items will be inserted here
BMenuItem *item = new BMenuItem("Close", new BMessage(B_CLOSE_REQUESTED), 'W', B_COMMAND_KEY);
menu->AddItem(item);
menu->AddSeparatorItem();
// the ProbeView print menu items will be inserted here
menu->AddSeparatorItem();
menu->AddItem(new BMenuItem("About DiskProbe" B_UTF8_ELLIPSIS, new BMessage(B_ABOUT_REQUESTED)));
@@ -53,6 +58,7 @@ FileWindow::FileWindow(BRect rect, entry_ref *ref, const BMessage *settings)
menu->AddItem(new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED), 'Q', B_COMMAND_KEY));
menu->SetTargetForItems(be_app);
item->SetTarget(this);
menuBar->AddItem(menu);
// add our interface widgets
@@ -60,7 +66,8 @@ FileWindow::FileWindow(BRect rect, entry_ref *ref, const BMessage *settings)
BRect rect = Bounds();
rect.top = menuBar->Bounds().Height() + 1;
ProbeView *probeView = new ProbeView(rect, ref, NULL, settings);
probeView->AddFileMenuItems(menu, menu->CountItems() - 4);
probeView->AddSaveMenuItems(menu, 4);
probeView->AddPrintMenuItems(menu, menu->CountItems() - 4);
AddChild(probeView);
probeView->UpdateSizeLimits();
+17 -5
View File
@@ -969,12 +969,25 @@ ProbeView::UpdateAttributesMenu(BMenu *menu)
void
ProbeView::AddFileMenuItems(BMenu *menu, int32 index)
ProbeView::AddSaveMenuItems(BMenu *menu, int32 index)
{
BMenuItem *item;
menu->AddItem(item = new BMenuItem("Save", new BMessage(B_SAVE_REQUESTED)), index++);
item->SetTarget(this);
item->SetEnabled(false);
//menu->AddItem(new BMenuItem("Save As" B_UTF8_ELLIPSIS, NULL));
}
void
ProbeView::AddPrintMenuItems(BMenu *menu, int32 index)
{
BMenuItem *item;
menu->AddItem(item = new BMenuItem("Page Setup" B_UTF8_ELLIPSIS, NULL), index++);
item->SetTarget(this);
item->SetEnabled(false);
menu->AddItem(item = new BMenuItem("Print" B_UTF8_ELLIPSIS, NULL, 'P', B_COMMAND_KEY), index++);
item->SetTarget(this);
item->SetEnabled(false);
}
@@ -1002,7 +1015,9 @@ ProbeView::AttachedToWindow()
ResizeBy(0, -bar->Bounds().Height());
BMenu *menu = new BMenu(fEditor.IsAttribute() ? "Attribute" : fEditor.IsDevice() ? "Device" : "File");
AddFileMenuItems(menu, 0);
AddSaveMenuItems(menu, 0);
menu->AddSeparatorItem();
AddPrintMenuItems(menu, menu->CountItems());
menu->AddSeparatorItem();
menu->AddItem(new BMenuItem("Close", new BMessage(B_CLOSE_REQUESTED), 'W', B_COMMAND_KEY));
@@ -1058,9 +1073,6 @@ ProbeView::AttachedToWindow()
UpdateSelectionMenuItems(0, 0);
menu->AddSeparatorItem();
menu->AddItem(new BMenuItem("Write", NULL, 'S', B_COMMAND_KEY));
menu->AddSeparatorItem();
subMenu = new BMenu("Bookmarks");
subMenu->AddItem(new BMenuItem("Add", NULL, 'B', B_COMMAND_KEY));
menu->AddItem(new BMenuItem(subMenu));
+2 -1
View File
@@ -33,7 +33,8 @@ class ProbeView : public BView {
virtual void WindowActivated(bool active);
virtual void MessageReceived(BMessage *message);
void AddFileMenuItems(BMenu *menu, int32 index);
void AddSaveMenuItems(BMenu *menu, int32 index);
void AddPrintMenuItems(BMenu *menu, int32 index);
void UpdateSizeLimits();