little fixes/updates for the coordinate conversion system
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7143 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
91d2dcb1cb
commit
2d4c02036e
@ -407,7 +407,7 @@ BRect BView::Bounds() const{
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void BView::ConvertToParent(BPoint* pt) const{
|
void BView::ConvertToParent(BPoint* pt) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
check_lock_no_pick();
|
check_lock_no_pick();
|
||||||
@ -419,7 +419,7 @@ void BView::ConvertToParent(BPoint* pt) const{
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
BPoint BView::ConvertToParent(BPoint pt) const{
|
BPoint BView::ConvertToParent(BPoint pt) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return pt;
|
return pt;
|
||||||
|
|
||||||
check_lock_no_pick();
|
check_lock_no_pick();
|
||||||
@ -434,7 +434,7 @@ BPoint BView::ConvertToParent(BPoint pt) const{
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void BView::ConvertFromParent(BPoint* pt) const{
|
void BView::ConvertFromParent(BPoint* pt) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
check_lock_no_pick();
|
check_lock_no_pick();
|
||||||
@ -446,7 +446,7 @@ void BView::ConvertFromParent(BPoint* pt) const{
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
BPoint BView::ConvertFromParent(BPoint pt) const{
|
BPoint BView::ConvertFromParent(BPoint pt) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return pt;
|
return pt;
|
||||||
|
|
||||||
check_lock_no_pick();
|
check_lock_no_pick();
|
||||||
@ -461,7 +461,7 @@ BPoint BView::ConvertFromParent(BPoint pt) const{
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void BView::ConvertToParent(BRect* r) const{
|
void BView::ConvertToParent(BRect* r) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
check_lock_no_pick();
|
check_lock_no_pick();
|
||||||
@ -472,7 +472,7 @@ void BView::ConvertToParent(BRect* r) const{
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
BRect BView::ConvertToParent(BRect r) const{
|
BRect BView::ConvertToParent(BRect r) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
check_lock_no_pick();
|
check_lock_no_pick();
|
||||||
@ -483,7 +483,7 @@ BRect BView::ConvertToParent(BRect r) const{
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void BView::ConvertFromParent(BRect* r) const{
|
void BView::ConvertFromParent(BRect* r) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
check_lock_no_pick();
|
check_lock_no_pick();
|
||||||
@ -494,7 +494,7 @@ void BView::ConvertFromParent(BRect* r) const{
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
BRect BView::ConvertFromParent(BRect r) const{
|
BRect BView::ConvertFromParent(BRect r) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
check_lock_no_pick();
|
check_lock_no_pick();
|
||||||
@ -507,35 +507,27 @@ BRect BView::ConvertFromParent(BRect r) const{
|
|||||||
|
|
||||||
|
|
||||||
void BView::ConvertToScreen(BPoint* pt) const{
|
void BView::ConvertToScreen(BPoint* pt) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
do_owner_check_no_pick();
|
do_owner_check_no_pick();
|
||||||
|
|
||||||
if (top_level_view)
|
ConvertToParent( pt );
|
||||||
Window()->ConvertToScreen( pt );
|
parent->ConvertToScreen( pt );
|
||||||
else {
|
|
||||||
ConvertToParent( pt );
|
|
||||||
parent->ConvertToScreen( pt );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
BPoint BView::ConvertToScreen(BPoint pt) const{
|
BPoint BView::ConvertToScreen(BPoint pt) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return pt;
|
return pt;
|
||||||
|
|
||||||
do_owner_check_no_pick();
|
do_owner_check_no_pick();
|
||||||
|
|
||||||
BPoint p;
|
BPoint p;
|
||||||
|
|
||||||
if (top_level_view)
|
p = ConvertToParent( pt );
|
||||||
p = Window()->ConvertToScreen( pt );
|
p = parent->ConvertToScreen( p );
|
||||||
else {
|
|
||||||
p = ConvertToParent( pt );
|
|
||||||
p = parent->ConvertToScreen( p );
|
|
||||||
}
|
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@ -543,35 +535,27 @@ BPoint BView::ConvertToScreen(BPoint pt) const{
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void BView::ConvertFromScreen(BPoint* pt) const{
|
void BView::ConvertFromScreen(BPoint* pt) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
do_owner_check_no_pick();
|
do_owner_check_no_pick();
|
||||||
|
|
||||||
if (top_level_view)
|
ConvertFromParent( pt );
|
||||||
Window()->ConvertFromScreen( pt );
|
parent->ConvertFromScreen( pt );
|
||||||
else {
|
|
||||||
ConvertFromParent( pt );
|
|
||||||
parent->ConvertFromScreen( pt );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
BPoint BView::ConvertFromScreen(BPoint pt) const{
|
BPoint BView::ConvertFromScreen(BPoint pt) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return pt;
|
return pt;
|
||||||
|
|
||||||
do_owner_check_no_pick();
|
do_owner_check_no_pick();
|
||||||
|
|
||||||
BPoint p;
|
BPoint p;
|
||||||
|
|
||||||
if (top_level_view)
|
p = ConvertFromParent( pt );
|
||||||
p = Window()->ConvertFromScreen( pt );
|
p = parent->ConvertFromScreen( p );
|
||||||
else {
|
|
||||||
p = ConvertFromParent( pt );
|
|
||||||
p = parent->ConvertFromScreen( p );
|
|
||||||
}
|
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@ -580,35 +564,27 @@ BPoint BView::ConvertFromScreen(BPoint pt) const{
|
|||||||
|
|
||||||
|
|
||||||
void BView::ConvertToScreen(BRect* r) const{
|
void BView::ConvertToScreen(BRect* r) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
do_owner_check_no_pick();
|
do_owner_check_no_pick();
|
||||||
|
|
||||||
if (top_level_view)
|
ConvertToParent( r );
|
||||||
Window()->ConvertToScreen( r );
|
parent->ConvertToScreen( r );
|
||||||
else {
|
|
||||||
ConvertToParent( r );
|
|
||||||
parent->ConvertToScreen( r );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
BRect BView::ConvertToScreen(BRect r) const{
|
BRect BView::ConvertToScreen(BRect r) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
do_owner_check_no_pick();
|
do_owner_check_no_pick();
|
||||||
|
|
||||||
BRect rect;
|
BRect rect;
|
||||||
|
|
||||||
if (top_level_view)
|
rect = ConvertToParent( r );
|
||||||
rect = Window()->ConvertToScreen( r );
|
rect = parent->ConvertToScreen( rect );
|
||||||
else {
|
|
||||||
rect = ConvertToParent( r );
|
|
||||||
rect = parent->ConvertToScreen( rect );
|
|
||||||
}
|
|
||||||
|
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
@ -616,35 +592,27 @@ BRect BView::ConvertToScreen(BRect r) const{
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void BView::ConvertFromScreen(BRect* r) const{
|
void BView::ConvertFromScreen(BRect* r) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
do_owner_check_no_pick();
|
do_owner_check_no_pick();
|
||||||
|
|
||||||
if (top_level_view)
|
ConvertFromParent( r );
|
||||||
Window()->ConvertFromScreen( r );
|
parent->ConvertFromScreen( r );
|
||||||
else {
|
|
||||||
ConvertFromParent( r );
|
|
||||||
parent->ConvertFromScreen( r );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
BRect BView::ConvertFromScreen(BRect r) const{
|
BRect BView::ConvertFromScreen(BRect r) const{
|
||||||
if (!parent && !top_level_view)
|
if (!parent)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
do_owner_check_no_pick();
|
do_owner_check_no_pick();
|
||||||
|
|
||||||
BRect rect;
|
BRect rect;
|
||||||
|
|
||||||
if (top_level_view)
|
rect = ConvertFromParent( r );
|
||||||
rect = Window()->ConvertFromScreen( r );
|
rect = parent->ConvertFromScreen( rect );
|
||||||
else {
|
|
||||||
rect = ConvertFromParent( r );
|
|
||||||
rect = parent->ConvertFromScreen( rect );
|
|
||||||
}
|
|
||||||
|
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
@ -706,25 +674,19 @@ BRect BView::Frame() const {
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void BView::Hide(){
|
void BView::Hide(){
|
||||||
// TODO: You may hide it by relocating with -17000 coord units to the left???
|
|
||||||
if ( owner && fShowLevel == 0){
|
if ( owner && fShowLevel == 0){
|
||||||
check_lock();
|
check_lock();
|
||||||
|
|
||||||
owner->session->WriteInt32( AS_LAYER_HIDE );
|
owner->session->WriteInt32( AS_LAYER_HIDE );
|
||||||
}
|
}
|
||||||
|
|
||||||
fShowLevel++;
|
fShowLevel++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void BView::Show(){
|
void BView::Show(){
|
||||||
|
|
||||||
fShowLevel--;
|
fShowLevel--;
|
||||||
|
|
||||||
if (owner && fShowLevel == 0){
|
if (owner && fShowLevel == 0){
|
||||||
check_lock();
|
check_lock();
|
||||||
|
|
||||||
owner->session->WriteInt32( AS_LAYER_SHOW );
|
owner->session->WriteInt32( AS_LAYER_SHOW );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3662,6 +3624,7 @@ bool BView::addToList(BView *aView, BView *before){
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
bool BView::attachView(BView *aView){
|
bool BView::attachView(BView *aView){
|
||||||
|
// LEAVE the following line commented!!!
|
||||||
// check_lock();
|
// check_lock();
|
||||||
|
|
||||||
/* INFO:
|
/* INFO:
|
||||||
@ -3688,7 +3651,7 @@ bool BView::attachView(BView *aView){
|
|||||||
owner->session->WriteBool( aView->IsHidden() );
|
owner->session->WriteBool( aView->IsHidden() );
|
||||||
owner->session->WriteInt32( aView->CountChildren() );
|
owner->session->WriteInt32( aView->CountChildren() );
|
||||||
|
|
||||||
setCachedState();
|
aView->setCachedState();
|
||||||
|
|
||||||
// call the hook function:
|
// call the hook function:
|
||||||
aView->AttachedToWindow();
|
aView->AttachedToWindow();
|
||||||
|
Loading…
Reference in New Issue
Block a user