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"); 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->AddItem(new BMenuItem("Remove from File", new BMessage(kMsgRemoveAttribute)));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
// the ProbeView file menu items will be inserted here // the ProbeView print menu items will be inserted here
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(new BMenuItem("Close", new BMessage(B_CLOSE_REQUESTED), 'W', B_COMMAND_KEY)); 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 = tabView->ContainerView()->Bounds();
rect.top += 3; rect.top += 3;
fProbeView = new ProbeView(rect, ref, attribute, settings); 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); tabView->AddRawEditorTab(fProbeView);
view->AddChild(tabView); 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)); new BMessage(kMsgOpenFilePanel), 'O', B_COMMAND_KEY));
menu->AddSeparatorItem(); 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->AddSeparatorItem();
menu->AddItem(new BMenuItem("About DiskProbe" B_UTF8_ELLIPSIS, new BMessage(B_ABOUT_REQUESTED))); 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->AddItem(new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED), 'Q', B_COMMAND_KEY));
menu->SetTargetForItems(be_app); menu->SetTargetForItems(be_app);
item->SetTarget(this);
menuBar->AddItem(menu); menuBar->AddItem(menu);
// add our interface widgets // add our interface widgets
@@ -60,7 +66,8 @@ FileWindow::FileWindow(BRect rect, entry_ref *ref, const BMessage *settings)
BRect rect = Bounds(); BRect rect = Bounds();
rect.top = menuBar->Bounds().Height() + 1; rect.top = menuBar->Bounds().Height() + 1;
ProbeView *probeView = new ProbeView(rect, ref, NULL, settings); 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); AddChild(probeView);
probeView->UpdateSizeLimits(); probeView->UpdateSizeLimits();
+17 -5
View File
@@ -969,12 +969,25 @@ ProbeView::UpdateAttributesMenu(BMenu *menu)
void 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; BMenuItem *item;
menu->AddItem(item = new BMenuItem("Page Setup" B_UTF8_ELLIPSIS, NULL), index++); menu->AddItem(item = new BMenuItem("Page Setup" B_UTF8_ELLIPSIS, NULL), index++);
item->SetTarget(this);
item->SetEnabled(false); item->SetEnabled(false);
menu->AddItem(item = new BMenuItem("Print" B_UTF8_ELLIPSIS, NULL, 'P', B_COMMAND_KEY), index++); menu->AddItem(item = new BMenuItem("Print" B_UTF8_ELLIPSIS, NULL, 'P', B_COMMAND_KEY), index++);
item->SetTarget(this);
item->SetEnabled(false); item->SetEnabled(false);
} }
@@ -1002,7 +1015,9 @@ ProbeView::AttachedToWindow()
ResizeBy(0, -bar->Bounds().Height()); ResizeBy(0, -bar->Bounds().Height());
BMenu *menu = new BMenu(fEditor.IsAttribute() ? "Attribute" : fEditor.IsDevice() ? "Device" : "File"); 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->AddSeparatorItem();
menu->AddItem(new BMenuItem("Close", new BMessage(B_CLOSE_REQUESTED), 'W', B_COMMAND_KEY)); menu->AddItem(new BMenuItem("Close", new BMessage(B_CLOSE_REQUESTED), 'W', B_COMMAND_KEY));
@@ -1058,9 +1073,6 @@ ProbeView::AttachedToWindow()
UpdateSelectionMenuItems(0, 0); UpdateSelectionMenuItems(0, 0);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(new BMenuItem("Write", NULL, 'S', B_COMMAND_KEY));
menu->AddSeparatorItem();
subMenu = new BMenu("Bookmarks"); subMenu = new BMenu("Bookmarks");
subMenu->AddItem(new BMenuItem("Add", NULL, 'B', B_COMMAND_KEY)); subMenu->AddItem(new BMenuItem("Add", NULL, 'B', B_COMMAND_KEY));
menu->AddItem(new BMenuItem(subMenu)); menu->AddItem(new BMenuItem(subMenu));
+2 -1
View File
@@ -33,7 +33,8 @@ class ProbeView : public BView {
virtual void WindowActivated(bool active); virtual void WindowActivated(bool active);
virtual void MessageReceived(BMessage *message); 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(); void UpdateSizeLimits();