* Set the _RESIZE_MASK_ macro to 0xffff. It was the bitwise inverse of the
disjunction of all view flags before, and the new layout related flags were missing. I suppose there was not striking reason for previous method. * Made InvalidateLayout() virtual. When implementing layout management directly in a derived class instead of a separate BLayout, one needs to override it to know when to discard cashed layout infos. * Added a ResizeTo(BSize) method. * Avoided ugly multi-line strings in PrintToStream(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21355 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -80,9 +80,7 @@ const uint32 _B_RESERVED7_ = 0x00200000UL; /* 22 */
|
|||||||
const uint32 B_SUPPORTS_LAYOUT = 0x00100000UL; /* 21 */
|
const uint32 B_SUPPORTS_LAYOUT = 0x00100000UL; /* 21 */
|
||||||
const uint32 B_INVALIDATE_AFTER_LAYOUT = 0x00080000UL; /* 20 */
|
const uint32 B_INVALIDATE_AFTER_LAYOUT = 0x00080000UL; /* 20 */
|
||||||
|
|
||||||
#define _RESIZE_MASK_ ~(B_FULL_UPDATE_ON_RESIZE | _B_RESERVED1_ | B_WILL_DRAW \
|
#define _RESIZE_MASK_ (0xffff)
|
||||||
| B_PULSE_NEEDED | B_NAVIGABLE_JUMP | B_FRAME_EVENTS | B_NAVIGABLE \
|
|
||||||
| B_SUBPIXEL_PRECISE | B_DRAW_ON_CHILDREN | B_INPUT_METHOD_AWARE | _B_RESERVED7_)
|
|
||||||
|
|
||||||
const uint32 _VIEW_TOP_ = 1UL;
|
const uint32 _VIEW_TOP_ = 1UL;
|
||||||
const uint32 _VIEW_LEFT_ = 2UL;
|
const uint32 _VIEW_LEFT_ = 2UL;
|
||||||
@@ -473,6 +471,7 @@ public:
|
|||||||
void MoveTo(float x, float y);
|
void MoveTo(float x, float y);
|
||||||
void ResizeBy(float dh, float dv);
|
void ResizeBy(float dh, float dv);
|
||||||
void ResizeTo(float width, float height);
|
void ResizeTo(float width, float height);
|
||||||
|
void ResizeTo(BSize size);
|
||||||
void ScrollBy(float dh, float dv);
|
void ScrollBy(float dh, float dv);
|
||||||
void ScrollTo(float x, float y);
|
void ScrollTo(float x, float y);
|
||||||
virtual void ScrollTo(BPoint where);
|
virtual void ScrollTo(BPoint where);
|
||||||
@@ -533,7 +532,7 @@ public:
|
|||||||
virtual void SetLayout(BLayout* layout);
|
virtual void SetLayout(BLayout* layout);
|
||||||
BLayout* GetLayout() const;
|
BLayout* GetLayout() const;
|
||||||
|
|
||||||
void InvalidateLayout(bool descendants = false);
|
virtual void InvalidateLayout(bool descendants = false);
|
||||||
void EnableLayoutInvalidation();
|
void EnableLayoutInvalidation();
|
||||||
void DisableLayoutInvalidation();
|
void DisableLayoutInvalidation();
|
||||||
bool IsLayoutValid() const;
|
bool IsLayoutValid() const;
|
||||||
@@ -560,7 +559,6 @@ private:
|
|||||||
friend class BTabView;
|
friend class BTabView;
|
||||||
friend class BWindow;
|
friend class BWindow;
|
||||||
|
|
||||||
virtual void _ReservedView10();
|
|
||||||
virtual void _ReservedView11();
|
virtual void _ReservedView11();
|
||||||
virtual void _ReservedView12();
|
virtual void _ReservedView12();
|
||||||
virtual void _ReservedView13();
|
virtual void _ReservedView13();
|
||||||
|
|||||||
+44
-37
@@ -3642,6 +3642,13 @@ BView::ResizeTo(float width, float height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BView::ResizeTo(BSize size)
|
||||||
|
{
|
||||||
|
ResizeBy(size.width - fBounds.Width(), size.height - fBounds.Height());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
// Inherited Methods (from BHandler)
|
// Inherited Methods (from BHandler)
|
||||||
|
|
||||||
@@ -4843,7 +4850,7 @@ extern "C" void _ReservedView6__5BView() {}
|
|||||||
extern "C" void _ReservedView7__5BView() {}
|
extern "C" void _ReservedView7__5BView() {}
|
||||||
extern "C" void _ReservedView8__5BView() {}
|
extern "C" void _ReservedView8__5BView() {}
|
||||||
extern "C" void _ReservedView9__5BView() {}
|
extern "C" void _ReservedView9__5BView() {}
|
||||||
void BView::_ReservedView10(){}
|
extern "C" void _ReservedView10__5BView() {}
|
||||||
void BView::_ReservedView11(){}
|
void BView::_ReservedView11(){}
|
||||||
void BView::_ReservedView12(){}
|
void BView::_ReservedView12(){}
|
||||||
void BView::_ReservedView13(){}
|
void BView::_ReservedView13(){}
|
||||||
@@ -4871,25 +4878,25 @@ void
|
|||||||
BView::PrintToStream()
|
BView::PrintToStream()
|
||||||
{
|
{
|
||||||
printf("BView::PrintToStream()\n");
|
printf("BView::PrintToStream()\n");
|
||||||
printf("\tName: %s\
|
printf("\tName: %s\n"
|
||||||
\tParent: %s\
|
"\tParent: %s\n"
|
||||||
\tFirstChild: %s\
|
"\tFirstChild: %s\n"
|
||||||
\tNextSibling: %s\
|
"\tNextSibling: %s\n"
|
||||||
\tPrevSibling: %s\
|
"\tPrevSibling: %s\n"
|
||||||
\tOwner(Window): %s\
|
"\tOwner(Window): %s\n"
|
||||||
\tToken: %ld\
|
"\tToken: %ld\n"
|
||||||
\tFlags: %ld\
|
"\tFlags: %ld\n"
|
||||||
\tView origin: (%f,%f)\
|
"\tView origin: (%f,%f)\n"
|
||||||
\tView Bounds rectangle: (%f,%f,%f,%f)\
|
"\tView Bounds rectangle: (%f,%f,%f,%f)\n"
|
||||||
\tShow level: %d\
|
"\tShow level: %d\n"
|
||||||
\tTopView?: %s\
|
"\tTopView?: %s\n"
|
||||||
\tBPicture: %s\
|
"\tBPicture: %s\n"
|
||||||
\tVertical Scrollbar %s\
|
"\tVertical Scrollbar %s\n"
|
||||||
\tHorizontal Scrollbar %s\
|
"\tHorizontal Scrollbar %s\n"
|
||||||
\tIs Printing?: %s\
|
"\tIs Printing?: %s\n"
|
||||||
\tShelf?: %s\
|
"\tShelf?: %s\n"
|
||||||
\tEventMask: %ld\
|
"\tEventMask: %ld\n"
|
||||||
\tEventOptions: %ld\n",
|
"\tEventOptions: %ld\n",
|
||||||
Name(),
|
Name(),
|
||||||
fParent ? fParent->Name() : "NULL",
|
fParent ? fParent->Name() : "NULL",
|
||||||
fFirstChild ? fFirstChild->Name() : "NULL",
|
fFirstChild ? fFirstChild->Name() : "NULL",
|
||||||
@@ -4910,23 +4917,23 @@ BView::PrintToStream()
|
|||||||
fEventMask,
|
fEventMask,
|
||||||
fEventOptions);
|
fEventOptions);
|
||||||
|
|
||||||
printf("\tState status:\
|
printf("\tState status:\n"
|
||||||
\t\tLocalCoordianteSystem: (%f,%f)\
|
"\t\tLocalCoordianteSystem: (%f,%f)\n"
|
||||||
\t\tPenLocation: (%f,%f)\
|
"\t\tPenLocation: (%f,%f)\n"
|
||||||
\t\tPenSize: %f\
|
"\t\tPenSize: %f\n"
|
||||||
\t\tHighColor: [%d,%d,%d,%d]\
|
"\t\tHighColor: [%d,%d,%d,%d]\n"
|
||||||
\t\tLowColor: [%d,%d,%d,%d]\
|
"\t\tLowColor: [%d,%d,%d,%d]\n"
|
||||||
\t\tViewColor: [%d,%d,%d,%d]\
|
"\t\tViewColor: [%d,%d,%d,%d]\n"
|
||||||
\t\tPattern: %llx\
|
"\t\tPattern: %llx\n"
|
||||||
\t\tDrawingMode: %d\
|
"\t\tDrawingMode: %d\n"
|
||||||
\t\tLineJoinMode: %d\
|
"\t\tLineJoinMode: %d\n"
|
||||||
\t\tLineCapMode: %d\
|
"\t\tLineCapMode: %d\n"
|
||||||
\t\tMiterLimit: %f\
|
"\t\tMiterLimit: %f\n"
|
||||||
\t\tAlphaSource: %d\
|
"\t\tAlphaSource: %d\n"
|
||||||
\t\tAlphaFuntion: %d\
|
"\t\tAlphaFuntion: %d\n"
|
||||||
\t\tScale: %f\
|
"\t\tScale: %f\n"
|
||||||
\t\t(Print)FontAliasing: %s\
|
"\t\t(Print)FontAliasing: %s\n"
|
||||||
\t\tFont Info:\n",
|
"\t\tFont Info:\n",
|
||||||
fState->origin.x, fState->origin.y,
|
fState->origin.x, fState->origin.y,
|
||||||
fState->pen_location.x, fState->pen_location.y,
|
fState->pen_location.x, fState->pen_location.y,
|
||||||
fState->pen_size,
|
fState->pen_size,
|
||||||
|
|||||||
Reference in New Issue
Block a user