* Rewrote shortkey handling - it now actually works as expected.

* Some work on _DetermineTarget(), more to come.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14869 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-11-12 16:13:06 +00:00
parent e4a5c29b25
commit 292d5ced0e
3 changed files with 270 additions and 291 deletions
+11 -10
View File
@@ -259,6 +259,7 @@ public:
// Private or reserved ---------------------------------------------------------
private:
typedef BLooper inherited;
class Shortcut;
friend class BApplication;
friend class BBitmap;
@@ -287,7 +288,7 @@ private:
BWindow &operator=(BWindow&);
BWindow(BRect frame, int32 bitmapToken);
void InitData(BRect frame, const char* title,
void _InitData(BRect frame, const char* title,
window_look look, window_feel feel,
uint32 flags, uint32 workspace,
int32 bitmapToken = -1);
@@ -307,9 +308,9 @@ private:
drawing_mode dragMode,
BHandler* reply_to);
*/
void prepareView(BView* aView); // changed from view_builder(BView* a_view);
void attachView(BView* aView); // changed from attach_builder(BView* a_view);
void detachView(BView* aView); // changed from detach_builder(BView* a_view);
void prepareView(BView* aView);
void attachView(BView* aView);
void detachView(BView* aView);
//int32 get_server_token() const;
BMessage *extract_drop(BMessage* an_event, BHandler* *target);
//void movesize(uint32 opcode, float h, float v);
@@ -334,16 +335,16 @@ private:
//void post_message(BMessage* message);
//void SetLocalTitle(const char* new_title);
//void enable_pulsing(bool enable);
BHandler *determine_target(BMessage* msg, BHandler* target, bool pref);
BHandler *_DetermineTarget(BMessage* message, BHandler* target);
//void kb_navigate();
//void navigate_to_next(int32 direction, bool group = false);
//void set_focus(BView* focus, bool notify_input_server); // what does notify_input_server mean??? why???
bool InUpdate();
void DequeueAll();
//bool find_token_and_handler(BMessage* msg, int32* token, BHandler* *handler);
window_type composeType(window_look look, // changed from: compose_type(...)
window_type _ComposeType(window_look look,
window_feel feel) const;
void decomposeType(window_type type, // changed from: decompose_type(...)
void _DecomposeType(window_type type,
window_look* look,
window_feel* feel) const;
@@ -353,7 +354,7 @@ private:
void BuildTopView();
void setFocus(BView *focusView, bool notifyIputServer = false);
int32 findShortcut(uint32 key, uint32 modifiers);
Shortcut* _FindShortcut(uint32 key, uint32 modifiers);
bool findHandler(BView* start, BHandler* handler);
BView* findView(BView* aView, const char* viewName) const;
BView* findView(BView* aView, BPoint point) const;
@@ -386,13 +387,13 @@ private:
uint32 fFlags;
uint32 _unused0[2];
BView *top_view;
BView *fTopView;
BView *fFocus;
BView *fLastMouseMovedView;
uint32 _unused1;
BMenuBar *fKeyMenuBar;
BButton *fDefaultButton;
BList accelList;
BList fShortcuts;
int32 fTopViewToken;
bool fPulseEnabled;
bool fViewsNeedPulse; // not yet used
-69
View File
@@ -1,69 +0,0 @@
//------------------------------------------------------------------------------
// Copyright (c) 2001-2002, OpenBeOS
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: WindowAux.h
// Author: Adrian Oanca ([email protected])
// Description: BWindowAux.h contains helper definitions for BWindow class
//
//------------------------------------------------------------------------------
#ifndef _WINDOWAUX_H
#define _WINDOWAUX_H
// Standard Includes -----------------------------------------------------------
// System Includes -------------------------------------------------------------
#include <BeBuild.h>
#include <Message.h>
#include <Handler.h>
// Project Includes ------------------------------------------------------------
// Local Includes --------------------------------------------------------------
// Local Defines ---------------------------------------------------------------
// Globals ---------------------------------------------------------------------
struct _BCmdKey{
uint32 key;
uint32 modifiers;
BMessage* message;
BHandler* target;
int32 targetToken;
_BCmdKey(uint32 k, uint32 mod, BMessage* m = NULL)
: key(k),
modifiers(mod),
message(m),
target(NULL),
targetToken(B_ANY_TOKEN)
{
}
~_BCmdKey()
{
delete message;
}
};
#endif // _WINDOWAUX_H