Cleaned up remains of outdated 3D effect handling.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
a04be86ee4
commit
0093fe11c5
@ -210,10 +210,6 @@ public:
|
|||||||
static WXDWORD MakeExtendedStyle( long lStyle
|
static WXDWORD MakeExtendedStyle( long lStyle
|
||||||
,bool bEliminateBorders = TRUE
|
,bool bEliminateBorders = TRUE
|
||||||
);
|
);
|
||||||
// Determine whether 3D effects are wanted
|
|
||||||
WXDWORD Determine3DEffects( WXDWORD dwDefaultBorderStyle
|
|
||||||
,bool* pbWant3D
|
|
||||||
) const;
|
|
||||||
|
|
||||||
// PM only: TRUE if this control is part of the main control
|
// PM only: TRUE if this control is part of the main control
|
||||||
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
||||||
|
@ -99,14 +99,13 @@ bool wxControl::OS2CreateControl(
|
|||||||
, WXDWORD dwExstyle
|
, WXDWORD dwExstyle
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
bool bWant3D = FALSE;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Doesn't do anything at all under OS/2
|
// Doesn't do anything at all under OS/2
|
||||||
//
|
//
|
||||||
if (dwExstyle == (WXDWORD)-1)
|
if (dwExstyle == (WXDWORD)-1)
|
||||||
{
|
{
|
||||||
dwExstyle = Determine3DEffects(WS_EX_CLIENTEDGE, &bWant3D);
|
dwExstyle = 0;
|
||||||
|
(void) OS2GetStyle(GetWindowStyle(), &dwExstyle);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// All controls should have these styles (wxWindows creates all controls
|
// All controls should have these styles (wxWindows creates all controls
|
||||||
|
@ -1132,81 +1132,6 @@ WXDWORD wxWindowOS2::MakeExtendedStyle(
|
|||||||
return dwStyle;
|
return dwStyle;
|
||||||
} // end of wxWindowOS2::MakeExtendedStyle
|
} // end of wxWindowOS2::MakeExtendedStyle
|
||||||
|
|
||||||
//
|
|
||||||
// Determines whether simulated 3D effects or CTL3D should be used,
|
|
||||||
// applying a default border style if required, and returning an extended
|
|
||||||
// style to pass to OS2Create.
|
|
||||||
//
|
|
||||||
WXDWORD wxWindowOS2::Determine3DEffects(
|
|
||||||
WXDWORD dwDefaultBorderStyle
|
|
||||||
, bool* pbWant3D
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
WXDWORD dwStyle = 0L;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Native PM does not have any specialize 3D effects like WIN32 does,
|
|
||||||
// so we have to try and invent them.
|
|
||||||
//
|
|
||||||
|
|
||||||
//
|
|
||||||
// If matches certain criteria, then assume no 3D effects
|
|
||||||
// unless specifically requested (dealt with in MakeExtendedStyle)
|
|
||||||
//
|
|
||||||
if (!GetParent() ||
|
|
||||||
!IsKindOf(CLASSINFO(wxControl)) ||
|
|
||||||
(m_windowStyle & wxNO_BORDER)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
*pbWant3D = FALSE;
|
|
||||||
return MakeExtendedStyle(m_windowStyle, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// 1) App can specify global 3D effects
|
|
||||||
//
|
|
||||||
*pbWant3D = wxTheApp->GetAuto3D();
|
|
||||||
|
|
||||||
//
|
|
||||||
// 2) If the parent is being drawn with user colours, or simple border
|
|
||||||
// specified, switch effects off.
|
|
||||||
//
|
|
||||||
if (GetParent() &&
|
|
||||||
(GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS) ||
|
|
||||||
(m_windowStyle & wxSIMPLE_BORDER)
|
|
||||||
)
|
|
||||||
*pbWant3D = FALSE;
|
|
||||||
|
|
||||||
//
|
|
||||||
// 3) Control can override this global setting by defining
|
|
||||||
// a border style, e.g. wxSUNKEN_BORDER
|
|
||||||
//
|
|
||||||
if ((m_windowStyle & wxDOUBLE_BORDER) ||
|
|
||||||
(m_windowStyle & wxRAISED_BORDER) ||
|
|
||||||
(m_windowStyle & wxSTATIC_BORDER) ||
|
|
||||||
(m_windowStyle & wxSUNKEN_BORDER)
|
|
||||||
)
|
|
||||||
*pbWant3D = TRUE;
|
|
||||||
|
|
||||||
dwStyle = MakeExtendedStyle( m_windowStyle
|
|
||||||
,FALSE
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
// If we want 3D, but haven't specified a border here,
|
|
||||||
// apply the default border style specified.
|
|
||||||
//
|
|
||||||
if (dwDefaultBorderStyle && (*pbWant3D) &&
|
|
||||||
!((m_windowStyle & wxDOUBLE_BORDER) ||
|
|
||||||
(m_windowStyle & wxRAISED_BORDER) ||
|
|
||||||
(m_windowStyle & wxSTATIC_BORDER) ||
|
|
||||||
(m_windowStyle & wxSIMPLE_BORDER)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
dwStyle |= dwDefaultBorderStyle;
|
|
||||||
return dwStyle;
|
|
||||||
} // end of wxWindowOS2::Determine3DEffects
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Setup background and foreground colours correctly
|
// Setup background and foreground colours correctly
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user