* cleanup, no functional change
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27201 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -155,9 +155,8 @@ ShowImageWindow::ShowImageWindow(const entry_ref *ref,
|
||||
if (InitCheck() != B_OK) {
|
||||
BAlert* alert;
|
||||
alert = new BAlert("ShowImage",
|
||||
"Could not load image! Either the file or an image translator for it does not exist.",
|
||||
"OK", NULL, NULL,
|
||||
B_WIDTH_AS_USUAL, B_INFO_ALERT);
|
||||
"Could not load image! Either the file or an image translator for "
|
||||
"it does not exist.", "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_INFO_ALERT);
|
||||
alert->Go();
|
||||
|
||||
// quit if file could not be opened
|
||||
@@ -208,12 +207,14 @@ ShowImageWindow::UpdateTitle()
|
||||
SetTitle(path.String());
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ShowImageWindow::BuildContextMenu(BMenu *menu)
|
||||
{
|
||||
BuildViewMenu(menu, true);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ShowImageWindow::BuildViewMenu(BMenu *menu, bool popupMenu)
|
||||
{
|
||||
@@ -224,9 +225,10 @@ ShowImageWindow::BuildViewMenu(BMenu *menu, bool popupMenu)
|
||||
fSlideShowDelay = delayMenu;
|
||||
|
||||
delayMenu->SetRadioMode(true);
|
||||
// Note: ShowImage loads images in window thread so it becomes unresponsive if
|
||||
// slide show delay is too short! (Especially if loading the image takes as long as
|
||||
// or longer than the slide show delay). Should load in background thread!
|
||||
// Note: ShowImage loads images in window thread so it becomes unresponsive
|
||||
// if slide show delay is too short! (Especially if loading the image
|
||||
// takes as long as or longer than the slide show delay). Should load
|
||||
// in background thread!
|
||||
AddDelayItem(delayMenu, "Three Seconds", 3);
|
||||
AddDelayItem(delayMenu, "Four Second", 4);
|
||||
AddDelayItem(delayMenu, "Five Seconds", 5);
|
||||
@@ -260,7 +262,8 @@ ShowImageWindow::BuildViewMenu(BMenu *menu, bool popupMenu)
|
||||
|
||||
AddShortcut(B_ENTER, 0, new BMessage(MSG_FULL_SCREEN));
|
||||
|
||||
AddItemMenu(menu, "Show Caption in Full Screen Mode", MSG_SHOW_CAPTION, 0, 0, 'W', true);
|
||||
AddItemMenu(menu, "Show Caption in Full Screen Mode", MSG_SHOW_CAPTION, 0,
|
||||
0, 'W', true);
|
||||
MarkMenuItem(menu, MSG_SHOW_CAPTION, fShowCaption);
|
||||
|
||||
MarkMenuItem(menu, MSG_SCALE_BILINEAR, fImageView->GetScaleBilinear());
|
||||
@@ -272,15 +275,15 @@ ShowImageWindow::BuildViewMenu(BMenu *menu, bool popupMenu)
|
||||
MarkMenuItem(menu, MSG_SHRINK_TO_WINDOW, shrink);
|
||||
MarkMenuItem(menu, MSG_ZOOM_TO_WINDOW, zoom);
|
||||
|
||||
enabled = !(shrink || zoom);
|
||||
enabled = !(shrink || zoom);
|
||||
EnableMenuItem(menu, MSG_ORIGINAL_SIZE, enabled);
|
||||
EnableMenuItem(menu, MSG_ZOOM_IN, enabled);
|
||||
EnableMenuItem(menu, MSG_ZOOM_OUT, enabled);
|
||||
|
||||
if (popupMenu) {
|
||||
menu->AddSeparatorItem();
|
||||
|
||||
AddItemMenu(menu, "As Desktop Background", MSG_DESKTOP_BACKGROUND, 0, 0, 'W', true);
|
||||
AddItemMenu(menu, "As Desktop Background", MSG_DESKTOP_BACKGROUND, 0, 0,
|
||||
'W', true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +309,8 @@ ShowImageWindow::AddMenus(BMenuBar *bar)
|
||||
AddItemMenu(menu, "Page Setup" B_UTF8_ELLIPSIS, MSG_PAGE_SETUP, 0, 0, 'W', true);
|
||||
AddItemMenu(menu, "Print" B_UTF8_ELLIPSIS, MSG_PREPARE_PRINT, 0, 0, 'W', true);
|
||||
menu->AddSeparatorItem();
|
||||
AddItemMenu(menu, "About ShowImage" B_UTF8_ELLIPSIS, B_ABOUT_REQUESTED, 0, 0, 'A', true);
|
||||
AddItemMenu(menu, "About ShowImage" B_UTF8_ELLIPSIS, B_ABOUT_REQUESTED, 0, 0,
|
||||
'A', true);
|
||||
menu->AddSeparatorItem();
|
||||
AddItemMenu(menu, "Quit", B_QUIT_REQUESTED, 'Q', 0, 'A', true);
|
||||
bar->AddItem(menu);
|
||||
@@ -344,10 +348,12 @@ ShowImageWindow::AddMenus(BMenuBar *bar)
|
||||
menu->AddSeparatorItem();
|
||||
AddItemMenu(menu, "Invert Colors", MSG_INVERT, 0, 0, 'W', true);
|
||||
menu->AddSeparatorItem();
|
||||
fResizeItem = AddItemMenu(menu, "Resize" B_UTF8_ELLIPSIS, MSG_OPEN_RESIZER_WINDOW, 0, 0, 'W', true);
|
||||
fResizeItem = AddItemMenu(menu, "Resize" B_UTF8_ELLIPSIS,
|
||||
MSG_OPEN_RESIZER_WINDOW, 0, 0, 'W', true);
|
||||
bar->AddItem(menu);
|
||||
menu->AddSeparatorItem();
|
||||
AddItemMenu(menu, "Use as Desktop Background", MSG_DESKTOP_BACKGROUND, 0, 0, 'W', true);
|
||||
AddItemMenu(menu, "Use as Desktop Background", MSG_DESKTOP_BACKGROUND, 0, 0,
|
||||
'W', true);
|
||||
}
|
||||
|
||||
|
||||
@@ -355,7 +361,8 @@ BMenuItem *
|
||||
ShowImageWindow::AddItemMenu(BMenu *menu, char *caption, uint32 command,
|
||||
char shortcut, uint32 modifier, char target, bool enabled)
|
||||
{
|
||||
BMenuItem* item = new BMenuItem(caption, new BMessage(command), shortcut, modifier);
|
||||
BMenuItem* item =
|
||||
new BMenuItem(caption, new BMessage(command), shortcut, modifier);
|
||||
|
||||
if (target == 'A')
|
||||
item->SetTarget(be_app);
|
||||
@@ -399,7 +406,8 @@ ShowImageWindow::WindowRedimension(BBitmap *pbitmap)
|
||||
const float windowBorderHeight = 5;
|
||||
|
||||
float width = r.Width() + 2 * PEN_SIZE + B_V_SCROLL_BAR_WIDTH;
|
||||
float height = r.Height() + 2 * PEN_SIZE + 1 + fBar->Frame().Height() + B_H_SCROLL_BAR_HEIGHT;
|
||||
float height = r.Height() + 2 * PEN_SIZE + 1 + fBar->Frame().Height() +
|
||||
B_H_SCROLL_BAR_HEIGHT;
|
||||
|
||||
// dimensions so that window does not reach outside of screen
|
||||
float maxWidth = screen.Frame().Width() + 1 - windowBorderWidth - Frame().left;
|
||||
@@ -958,7 +966,7 @@ ShowImageWindow::ClosePrompt()
|
||||
prompt << " (page " << page << ")";
|
||||
|
||||
prompt << " has been changed. "
|
||||
<< "Do you want to close the document?";
|
||||
<< "Do you want to close the document?";
|
||||
BAlert *pAlert = new BAlert("Close document", prompt.String(),
|
||||
"Cancel", "Close");
|
||||
if (pAlert->Go() == 0) {
|
||||
@@ -1149,6 +1157,7 @@ ShowImageWindow::Print(BMessage *msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ShowImageWindow::OpenResizerWindow(int32 width, int32 height)
|
||||
{
|
||||
@@ -1161,6 +1170,7 @@ ShowImageWindow::OpenResizerWindow(int32 width, int32 height)
|
||||
fResizerWindowMessenger->SendMessage(ResizerWindow::kActivateMsg);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ShowImageWindow::UpdateResizerWindow(int32 width, int32 height)
|
||||
{
|
||||
@@ -1175,6 +1185,7 @@ ShowImageWindow::UpdateResizerWindow(int32 width, int32 height)
|
||||
fResizerWindowMessenger->SendMessage(&updateMsg);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ShowImageWindow::CloseResizerWindow()
|
||||
{
|
||||
@@ -1186,6 +1197,7 @@ ShowImageWindow::CloseResizerWindow()
|
||||
fResizerWindowMessenger = NULL;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
ShowImageWindow::QuitRequested()
|
||||
{
|
||||
@@ -1212,4 +1224,3 @@ ShowImageWindow::ScreenChanged(BRect frame, color_space mode)
|
||||
{
|
||||
fImageView->SetDither(mode == B_CMAP8);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user