config.sub
wx-config.in
mkinstalldirs
+wxGTK.spec
docs/gtk/*.html
docs/gtk/*.txt
Returns TRUE on success. This should be tested (as in the sample shown above).
-\membersection{wxClipboard::SetData}\label{wxclipboardadddata}
+\membersection{wxClipboard::SetData}\label{wxclipboardsetdata}
\func{bool}{SetData}{\param{wxDataObject*}{ data}}
Destructor.
+\membersection{wxLayoutAlgorithm::LayoutFrame}\label{wxlayoutalgorithmlayoutframe}
+
+\constfunc{bool}{LayoutFrame}{\param{wxFrame* }{frame}, \param{wxWindow*}{ mainWindow = NULL}}
+
+Lays out the children of a normal frame. {\it mainWindow} is set to occupy the remaining space.
+
+This function simply calls \helpref{wxLayoutAlgorithm::LayoutWindow}{wxlayoutalgorithmlayoutwindow}.
+
\membersection{wxLayoutAlgorithm::LayoutMDIFrame}\label{wxlayoutalgorithmlayoutmdiframe}
\constfunc{bool}{LayoutMDIFrame}{\param{wxMDIParentFrame* }{frame}, \param{wxRect*}{ rect = NULL}}
The MDI client window is set to occupy the remaining space.
-\membersection{wxLayoutAlgorithm::LayoutFrame}\label{wxlayoutalgorithmlayoutframe}
+\membersection{wxLayoutAlgorithm::LayoutWindow}\label{wxlayoutalgorithmlayoutwindow}
-\constfunc{bool}{LayoutFrame}{\param{wxFrame* }{frame}, \param{wxWindow*}{ mainWindow = NULL}}
+\constfunc{bool}{LayoutWindow}{\param{wxWindow* }{parent}, \param{wxWindow*}{ mainWindow = NULL}}
-Lays out the children of a normal frame.
+Lays out the children of a normal frame or other window.
{\it mainWindow} is set to occupy the remaining space.
\helpref{wxFileDropTarget}{wxfiledroptarget}
It has to be noted that the API for drag and drop in wxWindows is not
-yet finnished which is mostly due to the fact that DnD support under
+yet finished which is mostly due to the fact that DnD support under
GTK 1.0 is very rudimentary and entirely different from the XDnD
protocoll used by GTK 1.2. This also entails that not all of the documentation
concerning DnD might be correct and some of the code might get broken
// The MDI client window is sized to whatever's left over.
bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = (wxRect*) NULL);
- // mainWindow is sized to whatever's left over.
- bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = (wxWindow*) NULL);
+ // mainWindow is sized to whatever's left over. This function for backward
+ // compatibility; use LayoutWindow.
+ bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = (wxWindow*) NULL)
+ {
+ return LayoutWindow(frame, mainWindow);
+ }
+
+ // mainWindow is sized to whatever's left over. This function for backward
+ bool LayoutWindow(wxWindow* frame, wxWindow* mainWindow = (wxWindow*) NULL);
};
#endif
return TRUE;
}
-// Layout algorithm for normal frame. mainWindow gets what's left over.
-bool wxLayoutAlgorithm::LayoutFrame(wxFrame* frame, wxWindow* mainWindow)
+// Layout algorithm for any window. mainWindow gets what's left over.
+bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
{
+ // Test if the parent is a sash window, and if so,
+ // reduce the available space to allow space for any active edges.
+
+ int leftMargin = 0, rightMargin = 0, topMargin = 0, bottomMargin = 0;
+ if (parent->IsKindOf(CLASSINFO(wxSashWindow)))
+ {
+ wxSashWindow* sashWindow = (wxSashWindow*) parent;
+
+ leftMargin = sashWindow->GetExtraBorderSize();
+ rightMargin = sashWindow->GetExtraBorderSize();
+ topMargin = sashWindow->GetExtraBorderSize();
+ bottomMargin = sashWindow->GetExtraBorderSize();
+
+ if (sashWindow->GetSashVisible(wxSASH_LEFT))
+ leftMargin += sashWindow->GetDefaultBorderSize();
+ if (sashWindow->GetSashVisible(wxSASH_RIGHT))
+ rightMargin += sashWindow->GetDefaultBorderSize();
+ if (sashWindow->GetSashVisible(wxSASH_TOP))
+ topMargin += sashWindow->GetDefaultBorderSize();
+ if (sashWindow->GetSashVisible(wxSASH_BOTTOM))
+ bottomMargin += sashWindow->GetDefaultBorderSize();
+ }
+
int cw, ch;
- frame->GetClientSize(& cw, & ch);
+ parent->GetClientSize(& cw, & ch);
- wxRect rect(0, 0, cw, ch);
+ wxRect rect(leftMargin, topMargin, cw - leftMargin - rightMargin, ch - topMargin - bottomMargin);
wxCalculateLayoutEvent event;
event.SetRect(rect);
- wxNode* node = frame->GetChildren().First();
+ wxNode* node = parent->GetChildren().First();
while (node)
{
wxWindow* win = (wxWindow*) node->Data();
#include "wx/string.h"
#include "wx/dcscreen.h"
#include "wx/sashwin.h"
+#include "wx/laywin.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxSashWindow, wxWindow)
int cw, ch;
GetClientSize(&cw, &ch);
- if (GetChildren().Number() > 0)
+ if (GetChildren().Number() == 1)
{
wxWindow* child = (wxWindow*) (GetChildren().First()->Data());
child->SetSize(x, y, width, height);
}
+ else if (GetChildren().Number() > 1)
+ {
+ // Perhaps multiple children are themselves sash windows.
+ // TODO: this doesn't really work because the subwindows sizes/positions
+ // must be set to leave a gap for the parent's sash (hit-test and decorations).
+ // Perhaps we can allow for this within LayoutWindow, testing whether the parent
+ // is a sash window, and if so, allowing some space for the edges.
+ wxLayoutAlgorithm layout;
+ layout.LayoutWindow(this);
+ }
wxClientDC dc(this);
DrawBorders(dc);