Disable CLIP_SIBLINGS style.
Fixes for getting best size. Fixed some error in flag processing. All according to patch #1523304. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -70,8 +70,9 @@ bool wxChoice::Create(
|
|||||||
WS_TABSTOP |
|
WS_TABSTOP |
|
||||||
WS_VISIBLE;
|
WS_VISIBLE;
|
||||||
|
|
||||||
if (lStyle & wxCLIP_SIBLINGS )
|
// clipping siblings does not yet work
|
||||||
lSstyle |= WS_CLIPSIBLINGS;
|
// if (lStyle & wxCLIP_SIBLINGS )
|
||||||
|
// lSstyle |= WS_CLIPSIBLINGS;
|
||||||
|
|
||||||
wxASSERT_MSG( !(lStyle & wxCB_DROPDOWN) &&
|
wxASSERT_MSG( !(lStyle & wxCB_DROPDOWN) &&
|
||||||
!(lStyle & wxCB_READONLY) &&
|
!(lStyle & wxCB_READONLY) &&
|
||||||
@@ -103,10 +104,10 @@ bool wxChoice::Create(
|
|||||||
|
|
||||||
// Set height to use with sizers i.e. without the dropdown listbox
|
// Set height to use with sizers i.e. without the dropdown listbox
|
||||||
wxFont vFont = GetFont();
|
wxFont vFont = GetFont();
|
||||||
int nCx,nCy;
|
int nEditHeight;
|
||||||
wxGetCharSize( GetHWND(), &nCx, &nCy, &vFont );
|
wxGetCharSize( GetHWND(), NULL, &nEditHeight, &vFont );
|
||||||
int nEditHeight = EDIT_HEIGHT_FROM_CHAR_HEIGHT(nCy);
|
nEditHeight = EDIT_HEIGHT_FROM_CHAR_HEIGHT(nEditHeight);
|
||||||
SetBestFittingSize(wxSize(-1,nEditHeight));
|
SetBestFittingSize(wxSize(-1,nEditHeight+4)); // +2x2 for the border
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // end of wxChoice::Create
|
} // end of wxChoice::Create
|
||||||
@@ -126,8 +127,7 @@ int wxChoice::DoAppend(
|
|||||||
{
|
{
|
||||||
int nIndex;
|
int nIndex;
|
||||||
LONG nIndexType = 0;
|
LONG nIndexType = 0;
|
||||||
|
if (m_windowStyle & wxCB_SORT)
|
||||||
if (m_windowStyle & wxLB_SORT)
|
|
||||||
nIndexType = LIT_SORTASCENDING;
|
nIndexType = LIT_SORTASCENDING;
|
||||||
else
|
else
|
||||||
nIndexType = LIT_END;
|
nIndexType = LIT_END;
|
||||||
@@ -150,7 +150,7 @@ int wxChoice::DoInsert( const wxString& rsItem, unsigned int pos )
|
|||||||
int nIndex;
|
int nIndex;
|
||||||
LONG nIndexType = 0;
|
LONG nIndexType = 0;
|
||||||
|
|
||||||
if (m_windowStyle & wxLB_SORT)
|
if (m_windowStyle & wxCB_SORT)
|
||||||
nIndexType = LIT_SORTASCENDING;
|
nIndexType = LIT_SORTASCENDING;
|
||||||
else
|
else
|
||||||
nIndexType = pos;
|
nIndexType = pos;
|
||||||
@@ -225,7 +225,7 @@ void wxChoice::SetString(unsigned int n, const wxString& rsStr)
|
|||||||
|
|
||||||
::WinSendMsg(GetHwnd(), LM_DELETEITEM, (MPARAM)n, 0);
|
::WinSendMsg(GetHwnd(), LM_DELETEITEM, (MPARAM)n, 0);
|
||||||
|
|
||||||
if (m_windowStyle & wxLB_SORT)
|
if (m_windowStyle & wxCB_SORT)
|
||||||
nIndexType = LIT_SORTASCENDING;
|
nIndexType = LIT_SORTASCENDING;
|
||||||
else
|
else
|
||||||
nIndexType = LIT_END;
|
nIndexType = LIT_END;
|
||||||
|
@@ -129,8 +129,9 @@ bool wxComboBox::Create(
|
|||||||
lSstyle = WS_TABSTOP |
|
lSstyle = WS_TABSTOP |
|
||||||
WS_VISIBLE;
|
WS_VISIBLE;
|
||||||
|
|
||||||
if (lStyle & wxCLIP_SIBLINGS )
|
// clipping siblings does not yet work
|
||||||
lSstyle |= WS_CLIPSIBLINGS;
|
// if (lStyle & wxCLIP_SIBLINGS )
|
||||||
|
// lSstyle |= WS_CLIPSIBLINGS;
|
||||||
if (lStyle & wxCB_READONLY)
|
if (lStyle & wxCB_READONLY)
|
||||||
lSstyle |= CBS_DROPDOWNLIST;
|
lSstyle |= CBS_DROPDOWNLIST;
|
||||||
else if (lStyle & wxCB_SIMPLE)
|
else if (lStyle & wxCB_SIMPLE)
|
||||||
@@ -163,10 +164,10 @@ bool wxComboBox::Create(
|
|||||||
|
|
||||||
// Set height to use with sizers i.e. without the dropdown listbox
|
// Set height to use with sizers i.e. without the dropdown listbox
|
||||||
wxFont vFont = GetFont();
|
wxFont vFont = GetFont();
|
||||||
int nCx,nCy;
|
int nEditHeight;
|
||||||
wxGetCharSize( GetHWND(), &nCx, &nCy, &vFont );
|
wxGetCharSize( GetHWND(), NULL, &nEditHeight, &vFont );
|
||||||
int nEditHeight = EDIT_HEIGHT_FROM_CHAR_HEIGHT(nCy);
|
nEditHeight = EDIT_HEIGHT_FROM_CHAR_HEIGHT(nEditHeight);
|
||||||
SetBestFittingSize(wxSize(-1,nEditHeight));
|
SetBestFittingSize(wxSize(-1,nEditHeight+4)); // +2x2 for the border
|
||||||
|
|
||||||
if (!rsValue.empty())
|
if (!rsValue.empty())
|
||||||
{
|
{
|
||||||
@@ -388,7 +389,7 @@ bool wxComboBox::ProcessEditMsg(
|
|||||||
return(HandleKillFocus((WXHWND)(HWND)wParam));
|
return(HandleKillFocus((WXHWND)(HWND)wParam));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} // end of WinGuiBase_CComboBox::ProcessEditMsg
|
} // end of wxComboBox::ProcessEditMsg
|
||||||
|
|
||||||
MRESULT EXPENTRY wxComboEditWndProc(
|
MRESULT EXPENTRY wxComboEditWndProc(
|
||||||
HWND hWnd
|
HWND hWnd
|
||||||
|
@@ -131,6 +131,9 @@ bool wxControl::OS2CreateControl( const wxChar* zClassname,
|
|||||||
else
|
else
|
||||||
label = m_label;
|
label = m_label;
|
||||||
|
|
||||||
|
// clipping siblings does not yet work
|
||||||
|
dwStyle &= ~WS_CLIPSIBLINGS;
|
||||||
|
|
||||||
m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
|
m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
|
||||||
,(PSZ)zClass // Window class
|
,(PSZ)zClass // Window class
|
||||||
,(PSZ)label.c_str() // Initial Text
|
,(PSZ)label.c_str() // Initial Text
|
||||||
|
Reference in New Issue
Block a user