app_server, sometimes needs to hide some windows without affecting a window's original hidden state. For that I introduced 2 new methods in WinBorder and made Layer::IsHidden() virtual.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8375 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca 2004-07-11 11:08:36 +00:00
parent 038d30aae7
commit b0a5df7a0f
4 changed files with 25 additions and 4 deletions

View File

@ -1174,7 +1174,7 @@ void Layer::PrintToStream(void)
printf("Frame: (%f, %f, %f, %f)", fFrame.left, fFrame.top, fFrame.right, fFrame.bottom);
printf("Token: %ld\n",fViewToken);
printf("Hidden - direct: %s\n", fHidden?"true":"false");
printf("Hidden - direct: %s\n", IsHidden()?"true":"false");
printf("Hidden - indirect: %s\n", IsHidden()?"true":"false");
printf("ResizingMode: %lx\n", fResizeMode);
printf("Flags: %lx\n", fFlags);

View File

@ -80,7 +80,7 @@ public:
virtual void Show(bool invalidate=true);
virtual void Hide(bool invalidate=true);
bool IsHidden(void) const;
virtual bool IsHidden(void) const;
BRect Bounds(void) const;
BRect Frame(void) const;

View File

@ -90,6 +90,7 @@ WinBorder::WinBorder(const BRect &r, const char *name, const int32 look, const i
fMouseButtons = 0;
fKeyModifiers = 0;
fServerHidden = false;
fMainWinBorder = NULL;
fDecorator = NULL;
fTopLayer = NULL;
@ -410,6 +411,21 @@ void WinBorder::ResizeBy(float x, float y)
Layer::ResizeBy(x,y);
}
bool WinBorder::IsHidden() const{
if (fServerHidden)
return true;
return Layer::IsHidden();
}
void WinBorder::ServerHide(){
fServerHidden = true;
}
void WinBorder::ServerUnhide(){
fServerHidden = false;
}
bool WinBorder::HasPoint(const BPoint& pt) const
{
return fFullVisible.Contains(pt);
@ -479,7 +495,7 @@ void WinBorder::AddToSubsetOf(WinBorder* main)
{
// if the main window is hidden also hide this one.
if(main->IsHidden())
fHidden = true;
Hide();//fHidden = true;
// add to main window's subset
main->Window()->fWinFMWList.AddItem(this);
@ -587,7 +603,7 @@ void WinBorder::PrintToStream()
if (fLevel == B_NORMAL_FEEL)
printf("\t%s", "B_NORMAL_WINDOW_FEEL");
printf("\t%s\n", fHidden?"hidden" : "not hidden");
printf("\t%s\n", IsHidden()"hidden" : "not hidden");
}
void WinBorder::UpdateColors(void)

View File

@ -52,6 +52,10 @@ public:
virtual void RebuildFullRegion(void);
virtual bool IsHidden() const;
void ServerHide();
void ServerUnhide();
void MouseDown(PortMessage *msg, bool sendMessage);
void MouseMoved(PortMessage *msg);
void MouseUp(PortMessage *msg);
@ -89,6 +93,7 @@ protected:
int32 fKeyModifiers;
BPoint fLastMousePosition;
bool fServerHidden;
WinBorder *fMainWinBorder;
bool fIsMoving;
bool fIsResizing;