Factored out some common code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20616 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-05-12 20:04:08 +00:00
parent 11eadd92f3
commit 6769d0cbf3
3 changed files with 52 additions and 43 deletions

View File

@@ -40,6 +40,8 @@
#include "wx/unix/execute.h"
#include <Xm/Xm.h>
#include <Xm/Frame.h>
#include "wx/motif/private.h"
#if wxUSE_RESOURCES
@@ -1211,3 +1213,46 @@ wxBitmap wxCreateMaskedBitmap(const wxBitmap& bitmap, wxColour& colour)
return newBitmap;
}
// ----------------------------------------------------------------------------
// Miscellaneous functions
// ----------------------------------------------------------------------------
WXWidget wxCreateBorderWidget( WXWidget parent, long style )
{
Widget borderWidget = (Widget)NULL, parentWidget = (Widget)parent;
if (style & wxSIMPLE_BORDER)
{
borderWidget = XtVaCreateManagedWidget
(
"simpleBorder",
xmFrameWidgetClass, parentWidget,
XmNshadowType, XmSHADOW_ETCHED_IN,
XmNshadowThickness, 1,
NULL
);
}
else if (style & wxSUNKEN_BORDER)
{
borderWidget = XtVaCreateManagedWidget
(
"sunkenBorder",
xmFrameWidgetClass, parentWidget,
XmNshadowType, XmSHADOW_IN,
NULL
);
}
else if (style & wxRAISED_BORDER)
{
borderWidget = XtVaCreateManagedWidget
(
"raisedBorder",
xmFrameWidgetClass, parentWidget,
XmNshadowType, XmSHADOW_OUT,
NULL
);
}
return borderWidget;
}