Applied patch #420395 (adding wxCLIP_SIBBLINGS capability -- but not by default)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2001-05-16 11:14:37 +00:00
parent 833615dd4d
commit b07664068b
27 changed files with 130 additions and 29 deletions

View File

@@ -106,46 +106,46 @@ wxSizer *wxDialogBase::CreateButtonSizer( long flags )
if (flags & wxYES_NO)
{
yes = new wxButton( this, wxID_YES, _("Yes") );
yes = new wxButton( this, wxID_YES, _("Yes"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS );
box->Add( yes, 0, wxLEFT|wxRIGHT, margin );
no = new wxButton( this, wxID_NO, _("No") );
no = new wxButton( this, wxID_NO, _("No") ,wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS);
box->Add( no, 0, wxLEFT|wxRIGHT, margin );
} else
if (flags & wxYES)
{
yes = new wxButton( this, wxID_YES, _("Yes") );
yes = new wxButton( this, wxID_YES, _("Yes"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS );
box->Add( yes, 0, wxLEFT|wxRIGHT, margin );
} else
if (flags & wxNO)
{
no = new wxButton( this, wxID_NO, _("No") );
no = new wxButton( this, wxID_NO, _("No"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS );
box->Add( no, 0, wxLEFT|wxRIGHT, margin );
}
if (flags & wxOK)
{
ok = new wxButton( this, wxID_OK, _("OK") );
ok = new wxButton( this, wxID_OK, _("OK"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS );
box->Add( ok, 0, wxLEFT|wxRIGHT, margin );
}
if (flags & wxFORWARD)
box->Add( new wxButton( this, wxID_FORWARD, _("Forward") ), 0, wxLEFT|wxRIGHT, margin );
box->Add( new wxButton( this, wxID_FORWARD, _("Forward"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS ), 0, wxLEFT|wxRIGHT, margin );
if (flags & wxBACKWARD)
box->Add( new wxButton( this, wxID_BACKWARD, _("Backward") ), 0, wxLEFT|wxRIGHT, margin );
box->Add( new wxButton( this, wxID_BACKWARD, _("Backward"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS ), 0, wxLEFT|wxRIGHT, margin );
if (flags & wxSETUP)
box->Add( new wxButton( this, wxID_SETUP, _("Setup") ), 0, wxLEFT|wxRIGHT, margin );
box->Add( new wxButton( this, wxID_SETUP, _("Setup"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS ), 0, wxLEFT|wxRIGHT, margin );
if (flags & wxMORE)
box->Add( new wxButton( this, wxID_MORE, _("More...") ), 0, wxLEFT|wxRIGHT, margin );
box->Add( new wxButton( this, wxID_MORE, _("More..."),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS ), 0, wxLEFT|wxRIGHT, margin );
if (flags & wxHELP)
box->Add( new wxButton( this, wxID_HELP, _("Help") ), 0, wxLEFT|wxRIGHT, margin );
box->Add( new wxButton( this, wxID_HELP, _("Help"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS ), 0, wxLEFT|wxRIGHT, margin );
if (flags & wxCANCEL)
{
cancel = new wxButton( this, wxID_CANCEL, _("Cancel") );
cancel = new wxButton( this, wxID_CANCEL, _("Cancel"),wxDefaultPosition,wxDefaultSize,wxCLIP_SIBLINGS );
box->Add( cancel, 0, wxLEFT|wxRIGHT, margin );
}

View File

@@ -77,6 +77,9 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
long msStyle = WS_VISIBLE | WS_TABSTOP | WS_CHILD | BS_OWNERDRAW ;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
#ifdef __WIN32__
if(m_windowStyle & wxBU_LEFT)
msStyle |= BS_LEFT;

View File

@@ -76,6 +76,9 @@ bool wxButton::Create(wxWindow *parent,
long msStyle = WS_VISIBLE | WS_TABSTOP | WS_CHILD /* | WS_CLIPSIBLINGS */ ;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
#ifdef __WIN32__
if(m_windowStyle & wxBU_LEFT)
msStyle |= BS_LEFT;

View File

@@ -104,6 +104,9 @@ bool wxCheckBox::Create(wxWindow *parent,
if ( style & wxALIGN_RIGHT )
msStyle |= BS_LEFTTEXT;
if ( style & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
// We perhaps have different concepts of 3D here - a 3D border,
// versus a 3D button.
// So we only wish to give a border if this is specified

View File

@@ -64,6 +64,10 @@ bool wxChoice::Create(wxWindow *parent,
if ( style & wxCB_SORT )
msStyle |= CBS_SORT;
if ( style & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
// Experience shows that wxChoice vs. wxComboBox distinction confuses
// quite a few people - try to help them
wxASSERT_MSG( !(style & wxCB_DROPDOWN) &&

View File

@@ -290,6 +290,10 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
if ( style & wxCB_SORT )
msStyle |= CBS_SORT;
if ( style & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
// and now create the MSW control
if ( !MSWCreateControl(_T("COMBOBOX"), msStyle) )
return FALSE;

View File

@@ -103,6 +103,10 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id,
long msFlags = WS_CHILD | WS_VISIBLE /* | WS_CLIPSIBLINGS */;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msFlags |= WS_CLIPSIBLINGS;
if (m_windowStyle & wxGA_VERTICAL)
msFlags |= PBS_VERTICAL;

View File

@@ -109,6 +109,9 @@ bool wxGaugeMSW::Create(wxWindow *parent, wxWindowID id,
if (want3D)
msFlags |= ZYZGS_3D;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msFlags |= WS_CLIPSIBLINGS;
HWND wx_button =
CreateWindowEx(MakeExtendedStyle(m_windowStyle), wxT("zYzGauge"), NULL, msFlags,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,

View File

@@ -160,6 +160,8 @@ bool wxListBox::Create(wxWindow *parent,
wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED),
_T("only one of listbox selection modes can be specified") );
if ( m_windowStyle & wxCLIP_SIBLINGS )
wstyle |= WS_CLIPSIBLINGS;
if (m_windowStyle & wxLB_MULTIPLE)
wstyle |= LBS_MULTIPLESEL;

View File

@@ -190,6 +190,10 @@ bool wxListCtrl::Create(wxWindow *parent,
DWORD wstyle = WS_VISIBLE | WS_CHILD | WS_TABSTOP |
LVS_SHAREIMAGELISTS | LVS_SHOWSELALWAYS;
if ( m_windowStyle & wxCLIP_SIBLINGS )
wstyle |= WS_CLIPSIBLINGS;
if ( wxStyleHasBorder(m_windowStyle) )
wstyle |= WS_BORDER;
m_baseStyle = wstyle;

View File

@@ -1146,7 +1146,9 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
ccs.hWindowMenu = (HMENU) parent->GetWindowMenu()->GetHMenu();
ccs.idFirstChild = wxFIRST_MDI_CHILD;
DWORD msStyle = /* MDIS_ALLCHILDSTYLES | */ WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN;
DWORD msStyle = MDIS_ALLCHILDSTYLES | WS_VISIBLE | WS_CHILD |
WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
if ( style & wxHSCROLL )
msStyle |= WS_HSCROLL;
if ( style & wxVSCROLL )

View File

@@ -153,6 +153,8 @@ bool wxNotebook::Create(wxWindow *parent,
long tabStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | TCS_TABS;
if ( m_windowStyle & wxCLIP_SIBLINGS )
tabStyle |= WS_CLIPSIBLINGS;
if (m_windowStyle & wxCLIP_CHILDREN)
tabStyle |= WS_CLIPCHILDREN;
if ( m_windowStyle & wxTC_MULTILINE )

View File

@@ -82,6 +82,10 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
// long msStyle = groupStyle | RADIO_FLAGS;
long msStyle = groupStyle | BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE /* | WS_CLIPSIBLINGS */;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
bool want3D;
WXDWORD exStyle = Determine3DEffects(0, &want3D) ;

View File

@@ -81,11 +81,16 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
height = 14;
}
DWORD wstyle = WS_VISIBLE | WS_CHILD;
if ( m_windowStyle & wxCLIP_SIBLINGS )
wstyle |= WS_CLIPSIBLINGS;
// Now create scrollbar
DWORD _direction = (style & wxHORIZONTAL) ?
SBS_HORZ: SBS_VERT;
HWND scroll_bar = CreateWindowEx(MakeExtendedStyle(style), wxT("SCROLLBAR"), wxT("scrollbar"),
_direction | WS_CHILD | WS_VISIBLE,
_direction | wstyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
wxGetInstance(), NULL);

View File

@@ -84,11 +84,15 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
int width = size.x;
int height = size.y;
long msStyle ;
long msStyle=0 ;
long wstyle=0 ;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
if ( m_windowStyle & wxSL_LABELS )
{
msStyle = WS_CHILD | WS_VISIBLE | WS_BORDER | SS_CENTER;
msStyle |= WS_CHILD | WS_VISIBLE | WS_BORDER | SS_CENTER;
bool want3D;
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
@@ -100,13 +104,20 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
// Now create min static control
wxSprintf(wxBuffer, wxT("%d"), minValue);
wstyle = STATIC_FLAGS;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
m_staticMin = (WXHWND) CreateWindowEx(0, wxT("STATIC"), wxBuffer,
STATIC_FLAGS,
wstyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
wxGetInstance(), NULL);
}
msStyle = 0;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
if (m_windowStyle & wxSL_VERTICAL)
msStyle = TBS_VERT | WS_CHILD | WS_VISIBLE | WS_TABSTOP ;
else
@@ -157,8 +168,11 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
{
// Finally, create max value static item
wxSprintf(wxBuffer, wxT("%d"), maxValue);
wstyle = STATIC_FLAGS;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
m_staticMax = (WXHWND) CreateWindowEx(0, wxT("STATIC"), wxBuffer,
STATIC_FLAGS,
wstyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
wxGetInstance(), NULL);

View File

@@ -82,6 +82,9 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id,
long msStyle = WS_CHILD | WS_VISIBLE | WS_BORDER | SS_CENTER;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
bool want3D;
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
@@ -92,8 +95,11 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id,
// Now create min static control
wxSprintf(wxBuffer, wxT("%d"), minValue);
DWORD wstyle = STATIC_FLAGS;
if ( m_windowStyle & wxCLIP_SIBLINGS )
wstyle |= WS_CLIPSIBLINGS;
m_staticMin = (WXHWND) CreateWindowEx(0, wxT("STATIC"), wxBuffer,
STATIC_FLAGS,
wstyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
wxGetInstance(), NULL);
@@ -123,8 +129,11 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id,
// Finally, create max value static item
wxSprintf(wxBuffer, wxT("%d"), maxValue);
wstyle = STATIC_FLAGS;
if ( m_windowStyle & wxCLIP_SIBLINGS )
wstyle |= WS_CLIPSIBLINGS;
m_staticMax = (WXHWND) CreateWindowEx(0, wxT("STATIC"), wxBuffer,
STATIC_FLAGS,
wstyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
wxGetInstance(), NULL);

View File

@@ -110,6 +110,8 @@ bool wxSpinButton::Create(wxWindow *parent,
UDS_NOTHOUSANDS | // never useful, sometimes harmful
UDS_SETBUDDYINT; // it doesn't harm if we don't have buddy
if ( m_windowStyle & wxCLIP_SIBLINGS )
wstyle |= WS_CLIPSIBLINGS;
if ( m_windowStyle & wxSP_HORIZONTAL )
wstyle |= UDS_HORZ;
if ( m_windowStyle & wxSP_ARROW_KEYS )

View File

@@ -245,6 +245,10 @@ bool wxSpinCtrl::Create(wxWindow *parent,
if ( want3D || wxStyleHasBorder(style) )
msStyle |= WS_BORDER;
if ( style & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
// create the text window
m_hwndBuddy = (WXHWND)::CreateWindowEx
(

View File

@@ -115,6 +115,10 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
int winstyle = BS_OWNERDRAW;
#endif // Win32
if ( m_windowStyle & wxCLIP_SIBLINGS )
winstyle |= WS_CLIPSIBLINGS;
m_hWnd = (WXHWND)::CreateWindow
(
classname,

View File

@@ -122,7 +122,11 @@ bool wxStatusBar95::Create(wxWindow *parent,
m_windowId = id == -1 ? NewControlId() : id;
DWORD wstyle = WS_CHILD | WS_VISIBLE /* | WS_CLIPSIBLINGS */ ;
DWORD wstyle = WS_CHILD | WS_VISIBLE;
if ( style & wxCLIP_SIBLINGS )
wstyle |= WS_CLIPSIBLINGS;
// setting SBARS_SIZEGRIP is perfectly useless: it's always on by default
// (at least in the version of comctl32.dll I'm using), and the only way to

View File

@@ -66,12 +66,17 @@ bool wxStaticLine::Create( wxWindow *parent,
wxSize sizeReal = AdjustSize(size);
DWORD wstyle = WS_CHILD | WS_VISIBLE | SS_GRAYRECT | SS_SUNKEN | SS_NOTIFY;
if ( style & wxCLIP_SIBLINGS )
wstyle |= WS_CLIPSIBLINGS;
m_hWnd = (WXHWND)::CreateWindow
(
wxT("STATIC"),
wxT(""),
WS_VISIBLE | WS_CHILD /* | WS_CLIPSIBLINGS */ |
SS_GRAYRECT | SS_SUNKEN | SS_NOTIFY,
wstyle,
pos.x, pos.y, sizeReal.x, sizeReal.y,
GetWinHwnd(parent),
(HMENU)m_windowId,

View File

@@ -57,7 +57,10 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
m_windowStyle = style;
long msStyle = WS_CHILD | WS_VISIBLE /* | WS_CLIPSIBLINGS */ ;
long msStyle = WS_CHILD | WS_VISIBLE;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
if (m_windowStyle & wxALIGN_CENTRE)
msStyle |= SS_CENTER;
else if (m_windowStyle & wxALIGN_RIGHT)

View File

@@ -214,6 +214,9 @@ bool wxToolBar::Create(wxWindow *parent,
if (style & wxBORDER)
msflags |= WS_BORDER;
if ( style & wxCLIP_SIBLINGS )
msflags |= WS_CLIPSIBLINGS;
#ifdef TBSTYLE_TOOLTIPS
msflags |= TBSTYLE_TOOLTIPS;
#endif

View File

@@ -159,7 +159,11 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
// translate wxWin style flags to MSW ones, checking for consistency while
// doing it
long msStyle = ES_LEFT | WS_VISIBLE | WS_CHILD | WS_TABSTOP /* | WS_CLIPSIBLINGS */ ;
long msStyle = ES_LEFT | WS_VISIBLE | WS_CHILD | WS_TABSTOP;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
if ( m_windowStyle & wxTE_MULTILINE )
{
wxASSERT_MSG( !(m_windowStyle & wxTE_PROCESS_ENTER),

View File

@@ -86,6 +86,10 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
#endif
long msStyle = BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP | WS_CHILD | WS_VISIBLE;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
#ifdef __WIN32__
if(m_windowStyle & wxBU_LEFT)
msStyle |= BS_LEFT;

View File

@@ -527,7 +527,10 @@ bool wxTreeCtrl::Create(wxWindow *parent,
return FALSE;
DWORD wstyle = WS_VISIBLE | WS_CHILD | WS_TABSTOP |
TVS_SHOWSELALWAYS /* | WS_CLIPSIBLINGS */;
TVS_SHOWSELALWAYS;
if ( m_windowStyle & wxCLIP_SIBLINGS )
wstyle |= WS_CLIPSIBLINGS;
if ((m_windowStyle & wxTR_NO_LINES) == 0)
wstyle |= TVS_HASLINES;

View File

@@ -2483,11 +2483,10 @@ bool wxWindow::MSWCreate(int id,
{
int controlId = 0;
if ( style & WS_CHILD )
{
controlId = id;
// all child windows should clip their siblings
// style |= /* WS_CLIPSIBLINGS */ ;
}
if ( GetWindowStyleFlag() & wxCLIP_SIBLINGS )
style |= WS_CLIPSIBLINGS;
wxString className(wclass);
if ( GetWindowStyleFlag() & wxNO_FULL_REPAINT_ON_RESIZE )