* Added and implemented B_INVALIDATE as available on Dano; to invalidate only a certain

part of the view, you can add a BRect "be:area" to that message - very handy.
* Cleaned up AppDefs.h a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20683 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-04-14 18:11:42 +00:00
parent ea4f253fd6
commit ffcc37a0aa
2 changed files with 21 additions and 21 deletions

View File

@ -1,29 +1,16 @@
/*
* Copyright 2001-2002, Haiku Inc. All Rights Reserved.
* Copyright 2001-2007, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Erik Jaesler (erik@cgsoftware.com)
*/
#ifndef _APP_DEFS_H
#define _APP_DEFS_H
// Standard Includes -----------------------------------------------------------
// System Includes -------------------------------------------------------------
#include <BeBuild.h>
// Project Includes ------------------------------------------------------------
// Local Includes --------------------------------------------------------------
// Local Defines ---------------------------------------------------------------
// Globals ---------------------------------------------------------------------
// Global Cursors --------------------------------------------------------------
// Old-style cursors
extern const unsigned char B_HAND_CURSOR[];
@ -36,8 +23,8 @@ extern const BCursor *B_CURSOR_SYSTEM_DEFAULT;
extern const BCursor *B_CURSOR_I_BEAM;
#endif
// System Message Codes --------------------------------------------------------
// System Message Codes
enum {
B_ABOUT_REQUESTED = '_ABR',
B_WINDOW_ACTIVATED = '_ACT',
@ -46,6 +33,7 @@ enum {
B_QUIT_REQUESTED = '_QRQ',
B_CLOSE_REQUESTED = '_QRQ', // Obsolete; use B_QUIT_REQUESTED
B_CANCEL = '_CNC',
B_INVALIDATE = '_IVL',
B_KEY_DOWN = '_KYD',
B_KEY_UP = '_KYU',
B_UNMAPPED_KEY_DOWN = '_UKD',
@ -76,8 +64,10 @@ enum {
B_WORKSPACES_CHANGED = '_WCG',
B_WORKSPACE_ACTIVATED = '_WAC',
B_ZOOM = '_WZM',
_COLORS_UPDATED = '_CLU', // Currently internal-use only. Later, public as B_COLORS_UPDATED
_FONTS_UPDATED = '_FNU', // Currently internal-use only. Later, public as B_FONTS_UPDATED
_COLORS_UPDATED = '_CLU',
// Currently internal-use only. Later, public as B_COLORS_UPDATED
_FONTS_UPDATED = '_FNU',
// Currently internal-use only. Later, public as B_FONTS_UPDATED
_APP_MENU_ = '_AMN',
_BROWSER_MENUS_ = '_BRM',
_MENU_EVENT_ = '_MEV',
@ -99,8 +89,7 @@ enum {
};
// Other Commands --------------------------------------------------------------
// Other Commands
enum {
B_SET_PROPERTY = 'PSET',
B_GET_PROPERTY = 'PGET',
@ -142,7 +131,5 @@ enum {
// Media Kit reserves all reserved codes starting in 'TRI'
};
//------------------------------------------------------------------------------
#endif // _APP_DEFS_H

View File

@ -962,6 +962,19 @@ FrameMoved(origin);
target->MessageReceived(msg);
break;
case B_INVALIDATE:
{
if (BView* view = dynamic_cast<BView*>(target)) {
BRect rect;
if (msg->FindRect("be:area", &rect) == B_OK)
view->Invalidate(rect);
else
view->Invalidate();
} else
target->MessageReceived(msg);
break;
}
case B_KEY_DOWN:
{
if (!_HandleKeyDown(msg)) {