diff --git a/headers/build/HaikuBuildCompatibility.h b/headers/build/HaikuBuildCompatibility.h index 0e35c43a8a..91d30a8aa6 100644 --- a/headers/build/HaikuBuildCompatibility.h +++ b/headers/build/HaikuBuildCompatibility.h @@ -54,7 +54,6 @@ extern float roundf(float value); #endif // HAIKU_TARGET_PLATFORM_HAIKU #ifdef HAIKU_TARGET_PLATFORM_BEOS -# define B_BAD_DATA (B_NOT_ALLOWED+1) # define B_REDO 'REDO' #endif diff --git a/src/apps/stylededit/FindWindow.cpp b/src/apps/stylededit/FindWindow.cpp index 56b7c21c8f..a9db7b8667 100644 --- a/src/apps/stylededit/FindWindow.cpp +++ b/src/apps/stylededit/FindWindow.cpp @@ -23,6 +23,8 @@ FindWindow::FindWindow(BRect frame, BHandler *_handler, BString *searchString, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS, B_CURRENT_WORKSPACE) { + AddShortcut('W',B_COMMAND_KEY,new BMessage(B_QUIT_REQUESTED)); + fFindView = new BView(Bounds(), "FindView", B_FOLLOW_ALL, B_WILL_DRAW); fFindView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); AddChild(fFindView); diff --git a/src/apps/stylededit/ReplaceWindow.cpp b/src/apps/stylededit/ReplaceWindow.cpp index e65dea8937..14a1d764a1 100644 --- a/src/apps/stylededit/ReplaceWindow.cpp +++ b/src/apps/stylededit/ReplaceWindow.cpp @@ -11,6 +11,7 @@ #include "Constants.h" #include "ReplaceWindow.h" +#include #include #include #include @@ -24,6 +25,8 @@ ReplaceWindow::ReplaceWindow(BRect frame, BHandler *_handler, BString *searchStr B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS, B_CURRENT_WORKSPACE) { + AddShortcut('W',B_COMMAND_KEY,new BMessage(B_QUIT_REQUESTED)); + fReplaceView = new BView(Bounds(), "ReplaceView", B_FOLLOW_ALL, B_WILL_DRAW); fReplaceView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); AddChild(fReplaceView); @@ -133,6 +136,11 @@ ReplaceWindow::DispatchMessage(BMessage *message, BHandler *handler) if (key == B_ESCAPE) { message->MakeEmpty(); message->what = B_QUIT_REQUESTED; + + // This is a hack, but it actually does what is expected, + // unlike the hack above. This kind of key filtering probably + // ought to be handled by a BMessageFilter, though. + BMessenger (this).SendMessage(B_QUIT_REQUESTED); } } }