Applied patch by Maurice Kalinowski with additional changes by myself:
* Fixed ResEdit build. * Small cleanups and simplifications. * Removed reference to CapitalB resource in ReadyToRun(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24049 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -17,6 +17,7 @@ main(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
App::App(void)
|
||||
: BApplication("application/x-vnd.Haiku-ResEdit"),
|
||||
fWindowCount(0)
|
||||
@@ -36,19 +37,8 @@ App::~App(void)
|
||||
void
|
||||
App::ReadyToRun(void)
|
||||
{
|
||||
/*
|
||||
if (fWindowCount < 1) {
|
||||
ResWindow *win = new ResWindow(BRect(50,100,600,400));
|
||||
win->Show();
|
||||
}
|
||||
*/
|
||||
if (fWindowCount < 1) {
|
||||
BEntry entry("/boot/develop/projects/ResEdit/CapitalBe.rsrc");
|
||||
entry_ref ref;
|
||||
entry.GetRef(&ref);
|
||||
ResWindow *win = new ResWindow(BRect(50,100,600,400),&ref);
|
||||
win->Show();
|
||||
}
|
||||
if (fWindowCount < 1)
|
||||
new ResWindow(BRect(50, 100, 600, 400));
|
||||
}
|
||||
|
||||
|
||||
@@ -82,27 +72,23 @@ App::MessageReceived(BMessage *msg)
|
||||
void
|
||||
App::ArgvReceived(int32 argc, char** argv)
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int32 i = 1; i < argc; i++) {
|
||||
BEntry entry(argv[i]);
|
||||
entry_ref ref;
|
||||
if (entry.GetRef(&ref) < B_OK)
|
||||
continue;
|
||||
ResWindow *win = new ResWindow(BRect(50,100,600,400),&ref);
|
||||
win->Show();
|
||||
new ResWindow(BRect(50, 100, 600, 400), &ref);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
App::RefsReceived(BMessage *msg)
|
||||
{
|
||||
entry_ref ref;
|
||||
int32 i=0;
|
||||
while (msg->FindRef("refs",i,&ref) == B_OK) {
|
||||
ResWindow *win = new ResWindow(BRect(50,100,600,400),&ref);
|
||||
win->Show();
|
||||
i++;
|
||||
}
|
||||
int32 i = 0;
|
||||
while (msg->FindRef("refs", i++, &ref) == B_OK)
|
||||
new ResWindow(BRect(50, 100, 600, 400), &ref);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,5 +26,5 @@ Application ResEdit :
|
||||
ResourceRoster.cpp
|
||||
ResView.cpp
|
||||
ResWindow.cpp
|
||||
: be tracker translation
|
||||
: be tracker translation libcolumnlistview.a
|
||||
;
|
||||
|
||||
@@ -14,10 +14,13 @@ ResWindow::ResWindow(const BRect &rect, const entry_ref *ref)
|
||||
{
|
||||
be_app->PostMessage(M_REGISTER_WINDOW);
|
||||
|
||||
ResView *child = new ResView(Bounds(), "resview", B_FOLLOW_ALL, B_WILL_DRAW, ref);
|
||||
ResView *child = new ResView(Bounds(), "resview", B_FOLLOW_ALL,
|
||||
B_WILL_DRAW, ref);
|
||||
AddChild(child);
|
||||
|
||||
SetTitle(child->Filename());
|
||||
|
||||
Show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005-2006, Haiku, Inc.
|
||||
* Copyright (c) 2005-2008, Haiku, Inc.
|
||||
* Distributed under the terms of the MIT license.
|
||||
*
|
||||
* Author:
|
||||
@@ -10,13 +10,16 @@
|
||||
|
||||
#include <Window.h>
|
||||
|
||||
class ResWindow : public BWindow
|
||||
{
|
||||
|
||||
struct entry_ref;
|
||||
|
||||
class ResWindow : public BWindow {
|
||||
public:
|
||||
ResWindow(const BRect &rect,
|
||||
const entry_ref *ref=NULL);
|
||||
~ResWindow(void);
|
||||
bool QuitRequested(void);
|
||||
ResWindow(const BRect& rect,
|
||||
const entry_ref* ref = NULL);
|
||||
virtual ~ResWindow();
|
||||
|
||||
virtual bool QuitRequested();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // RESWIN_H
|
||||
|
||||
Reference in New Issue
Block a user