diff --git a/src/apps/resedit/App.cpp b/src/apps/resedit/App.cpp index 3a9173cbe5..a4f2f0401f 100644 --- a/src/apps/resedit/App.cpp +++ b/src/apps/resedit/App.cpp @@ -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); } diff --git a/src/apps/resedit/Jamfile b/src/apps/resedit/Jamfile index c7cd9c26fd..3c1df5db68 100644 --- a/src/apps/resedit/Jamfile +++ b/src/apps/resedit/Jamfile @@ -26,5 +26,5 @@ Application ResEdit : ResourceRoster.cpp ResView.cpp ResWindow.cpp - : be tracker translation + : be tracker translation libcolumnlistview.a ; diff --git a/src/apps/resedit/ResWindow.cpp b/src/apps/resedit/ResWindow.cpp index 791e577f8a..ddd44ca6fa 100644 --- a/src/apps/resedit/ResWindow.cpp +++ b/src/apps/resedit/ResWindow.cpp @@ -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(); } diff --git a/src/apps/resedit/ResWindow.h b/src/apps/resedit/ResWindow.h index 5a7fea12d4..d6e01ab9c4 100644 --- a/src/apps/resedit/ResWindow.h +++ b/src/apps/resedit/ResWindow.h @@ -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 -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