Changeset 24049

Show
Ignore:
Timestamp:
02/21/08 15:10:41 (9 months ago)
Author:
stippi
Message:

Applied patch by Maurice Kalinowski with additional changes by myself:
* Fixed ResEdit build.
* Small cleanups and simplifications.
* Removed reference to CapitalB resource in ReadyToRun().

Location:
haiku/trunk/src/apps/resedit
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • haiku/trunk/src/apps/resedit/App.cpp

    r23943 r24049  
    1717        return 0; 
    1818} 
     19 
    1920 
    2021App::App(void) 
     
    3738App::ReadyToRun(void) 
    3839{ 
    39 /* 
    40         if (fWindowCount < 1) { 
    41                 ResWindow *win = new ResWindow(BRect(50,100,600,400)); 
    42                 win->Show(); 
    43         } 
    44 */ 
    45         if (fWindowCount < 1) { 
    46                 BEntry entry("/boot/develop/projects/ResEdit/CapitalBe.rsrc"); 
    47                 entry_ref ref; 
    48                 entry.GetRef(&ref); 
    49                 ResWindow *win = new ResWindow(BRect(50,100,600,400),&ref); 
    50                 win->Show(); 
    51         } 
     40        if (fWindowCount < 1) 
     41                new ResWindow(BRect(50, 100, 600, 400)); 
    5242} 
    5343 
     
    8373App::ArgvReceived(int32 argc, char** argv) 
    8474{ 
    85         int i; 
    86         for (i = 1; i < argc; i++) { 
     75        for (int32 i = 1; i < argc; i++) { 
    8776                BEntry entry(argv[i]); 
    8877                entry_ref ref; 
    8978                if (entry.GetRef(&ref) < B_OK) 
    9079                        continue; 
    91                 ResWindow *win = new ResWindow(BRect(50,100,600,400),&ref); 
    92                 win->Show(); 
     80                new ResWindow(BRect(50, 100, 600, 400), &ref); 
    9381        } 
    9482} 
     83 
    9584 
    9685void 
     
    9887{ 
    9988        entry_ref ref; 
    100         int32 i=0; 
    101         while (msg->FindRef("refs",i,&ref) == B_OK) { 
    102                 ResWindow *win = new ResWindow(BRect(50,100,600,400),&ref); 
    103                 win->Show(); 
    104                 i++; 
    105         } 
     89        int32 i = 0; 
     90        while (msg->FindRef("refs", i++, &ref) == B_OK) 
     91                new ResWindow(BRect(50, 100, 600, 400), &ref); 
    10692} 
    10793 
  • haiku/trunk/src/apps/resedit/Jamfile

    r21802 r24049  
    2727        ResView.cpp 
    2828        ResWindow.cpp 
    29         : be tracker translation 
     29        : be tracker translation libcolumnlistview.a 
    3030; 
  • haiku/trunk/src/apps/resedit/ResWindow.cpp

    r19734 r24049  
    1515        be_app->PostMessage(M_REGISTER_WINDOW); 
    1616         
    17         ResView *child = new ResView(Bounds(), "resview", B_FOLLOW_ALL, B_WILL_DRAW, ref); 
     17        ResView *child = new ResView(Bounds(), "resview", B_FOLLOW_ALL, 
     18                B_WILL_DRAW, ref); 
    1819        AddChild(child); 
    1920         
    2021        SetTitle(child->Filename()); 
     22 
     23        Show(); 
    2124} 
    2225 
  • haiku/trunk/src/apps/resedit/ResWindow.h

    r19734 r24049  
    11/* 
    2  * Copyright (c) 2005-2006, Haiku, Inc. 
     2 * Copyright (c) 2005-2008, Haiku, Inc. 
    33 * Distributed under the terms of the MIT license. 
    44 * 
     
    1111#include <Window.h> 
    1212 
    13 class ResWindow : public BWindow 
    14 { 
     13 
     14struct entry_ref; 
     15 
     16class ResWindow : public BWindow { 
    1517public: 
    16                                 ResWindow(const BRect &rect, 
    17                                                                 const entry_ref *ref=NULL); 
    18                                 ~ResWindow(void); 
    19         bool            QuitRequested(void); 
     18                                                                ResWindow(const BRect& rect, 
     19                                                                        const entry_ref* ref = NULL); 
     20        virtual                                         ~ResWindow(); 
     21 
     22        virtual bool                            QuitRequested(); 
    2023}; 
    2124 
    22 #endif 
     25#endif // RESWIN_H