Attempts to get client origin working. Work in progress.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14153 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-02-12 12:59:14 +00:00
parent 43d611cbcc
commit e5053ade6b
6 changed files with 71 additions and 3 deletions

View File

@@ -35,11 +35,12 @@
#include "wx/log.h"
#include "wx/intl.h"
#include "wx/frame.h"
#include "wx/menu.h"
#include "wx/statusbr.h"
#endif //WX_PRECOMP
#include "wx/x11/private.h"
bool wxMWMIsRunning(Window w);
// ----------------------------------------------------------------------------
@@ -396,3 +397,54 @@ bool wxMWMIsRunning(Window w)
return (ret == Success);
}
// For implementation purposes - sometimes decorations make the client area
// smaller
wxPoint wxTopLevelWindowX11::GetClientAreaOrigin() const
{
if (this->IsKindOf(CLASSINFO(wxFrame)))
{
wxFrame* frame = (wxFrame*) this;
if (frame->GetMenuBar())
return wxPoint(0, frame->GetMenuBar()->GetSize().y);
}
return wxPoint(0, 0);
}
void wxTopLevelWindowX11::DoGetClientSize( int *width, int *height ) const
{
wxWindowX11::DoGetClientSize(width, height);
if (this->IsKindOf(CLASSINFO(wxFrame)))
{
wxFrame* frame = (wxFrame*) this;
if (frame->GetMenuBar())
(*height) -= frame->GetMenuBar()->GetSize().y;
if (frame->GetStatusBar())
(*height) -= frame->GetStatusBar()->GetSize().y;
}
}
void wxTopLevelWindowX11::DoSetClientSize(int width, int height)
{
// TODO - take menubar and status line into account
wxWindowX11::DoSetClientSize(width, height);
#if 0
if (!GetMainWindow())
return;
XWindowChanges windowChanges;
int valueMask = 0;
if (width != -1)
{
windowChanges.width = width ;
valueMask |= CWWidth;
}
if (height != -1)
{
windowChanges.height = height ;
valueMask |= CWHeight;
}
XConfigureWindow(wxGlobalDisplay(), (Window) GetMainWindow(),
valueMask, & windowChanges);
#endif
}