1. fixed apparent bug in wxGrid code
2. fixed WM_CHAR handling in combobox 3. fixed controls positioning in the toolbar with older comctl32.dll/mingw32 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7005 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: combobox.h
|
// Name: wx/msw/combobox.h
|
||||||
// Purpose: wxComboBox class
|
// Purpose: wxComboBox class
|
||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -46,14 +46,16 @@ public:
|
|||||||
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Create(wxWindow *parent, wxWindowID id,
|
bool Create(wxWindow *parent,
|
||||||
const wxString& value = wxEmptyString,
|
wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxString& value = wxEmptyString,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
int n = 0, const wxString choices[] = NULL,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = 0,
|
int n = 0,
|
||||||
const wxValidator& validator = wxDefaultValidator,
|
const wxString choices[] = NULL,
|
||||||
const wxString& name = wxComboBoxNameStr);
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxComboBoxNameStr);
|
||||||
|
|
||||||
// List functions: see wxChoice
|
// List functions: see wxChoice
|
||||||
|
|
||||||
@@ -75,7 +77,9 @@ public:
|
|||||||
virtual void SetSelection(long from, long to);
|
virtual void SetSelection(long from, long to);
|
||||||
virtual void SetEditable(bool editable);
|
virtual void SetEditable(bool editable);
|
||||||
|
|
||||||
|
// implementation only from now on
|
||||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||||
|
bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||||
|
@@ -5427,8 +5427,10 @@ void wxGrid::DrawGridSpace( wxDC& dc )
|
|||||||
int right, bottom;
|
int right, bottom;
|
||||||
CalcUnscrolledPosition( cw, ch, &right, &bottom );
|
CalcUnscrolledPosition( cw, ch, &right, &bottom );
|
||||||
|
|
||||||
if ( right > (m_numCols>0) ? GetColRight(m_numCols-1) : 0 ||
|
int rightCol = m_numCols > 0 ? GetColRight(m_numCols - 1) : 0;
|
||||||
bottom > (m_numRows>0) ? GetRowBottom(m_numRows-1) : 0 )
|
int bottomRow = m_numRows > 0 ? GetRowBottom(m_numRows - 1) : 0 ;
|
||||||
|
|
||||||
|
if ( right > rightCol || bottom > bottomRow )
|
||||||
{
|
{
|
||||||
int left, top;
|
int left, top;
|
||||||
CalcUnscrolledPosition( 0, 0, &left, &top );
|
CalcUnscrolledPosition( 0, 0, &left, &top );
|
||||||
@@ -5436,17 +5438,16 @@ void wxGrid::DrawGridSpace( wxDC& dc )
|
|||||||
dc.SetBrush( wxBrush(GetDefaultCellBackgroundColour(), wxSOLID) );
|
dc.SetBrush( wxBrush(GetDefaultCellBackgroundColour(), wxSOLID) );
|
||||||
dc.SetPen( *wxTRANSPARENT_PEN );
|
dc.SetPen( *wxTRANSPARENT_PEN );
|
||||||
|
|
||||||
if ( right > (m_numCols>0) ? GetColRight(m_numCols-1) : 0 )
|
if ( right > rightCol )
|
||||||
dc.DrawRectangle( (m_numCols>0) ? GetColRight(m_numCols-1) : 0,
|
{
|
||||||
top, right - (m_numCols>0) ?
|
dc.DrawRectangle( rightCol, top, right - rightCol, ch);
|
||||||
GetColRight(m_numCols-1) : 0, ch );
|
}
|
||||||
|
|
||||||
if ( bottom > (m_numRows>0) ? GetRowBottom(m_numRows-1) : 0 )
|
if ( bottom > bottomRow )
|
||||||
dc.DrawRectangle( left,
|
{
|
||||||
(m_numRows>0) ? GetRowBottom(m_numRows-1) : 0,
|
dc.DrawRectangle( left, bottomRow, cw, bottom - bottomRow);
|
||||||
cw,
|
}
|
||||||
bottom - ((m_numRows>0) ? GetRowBottom(m_numRows-1) : 0 ));
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -6300,13 +6301,13 @@ bool wxGrid::MoveCursorUp( bool expandSelection )
|
|||||||
{
|
{
|
||||||
if ( m_selectingKeyboard == wxGridNoCellCoords )
|
if ( m_selectingKeyboard == wxGridNoCellCoords )
|
||||||
m_selectingKeyboard = m_currentCellCoords;
|
m_selectingKeyboard = m_currentCellCoords;
|
||||||
if ( m_selectingKeyboard.GetRow() > 0 )
|
if ( m_selectingKeyboard.GetRow() > 0 )
|
||||||
{
|
{
|
||||||
m_selectingKeyboard.SetRow( m_selectingKeyboard.GetRow() - 1 );
|
m_selectingKeyboard.SetRow( m_selectingKeyboard.GetRow() - 1 );
|
||||||
MakeCellVisible( m_selectingKeyboard.GetRow(),
|
MakeCellVisible( m_selectingKeyboard.GetRow(),
|
||||||
m_selectingKeyboard.GetCol() );
|
m_selectingKeyboard.GetCol() );
|
||||||
SelectBlock( m_currentCellCoords, m_selectingKeyboard );
|
SelectBlock( m_currentCellCoords, m_selectingKeyboard );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -6332,13 +6333,13 @@ bool wxGrid::MoveCursorDown( bool expandSelection )
|
|||||||
{
|
{
|
||||||
if ( m_selectingKeyboard == wxGridNoCellCoords )
|
if ( m_selectingKeyboard == wxGridNoCellCoords )
|
||||||
m_selectingKeyboard = m_currentCellCoords;
|
m_selectingKeyboard = m_currentCellCoords;
|
||||||
if ( m_selectingKeyboard.GetRow() < m_numRows-1 )
|
if ( m_selectingKeyboard.GetRow() < m_numRows-1 )
|
||||||
{
|
{
|
||||||
m_selectingKeyboard.SetRow( m_selectingKeyboard.GetRow() + 1 );
|
m_selectingKeyboard.SetRow( m_selectingKeyboard.GetRow() + 1 );
|
||||||
MakeCellVisible( m_selectingKeyboard.GetRow(),
|
MakeCellVisible( m_selectingKeyboard.GetRow(),
|
||||||
m_selectingKeyboard.GetCol() );
|
m_selectingKeyboard.GetCol() );
|
||||||
SelectBlock( m_currentCellCoords, m_selectingKeyboard );
|
SelectBlock( m_currentCellCoords, m_selectingKeyboard );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -6364,13 +6365,13 @@ bool wxGrid::MoveCursorLeft( bool expandSelection )
|
|||||||
{
|
{
|
||||||
if ( m_selectingKeyboard == wxGridNoCellCoords )
|
if ( m_selectingKeyboard == wxGridNoCellCoords )
|
||||||
m_selectingKeyboard = m_currentCellCoords;
|
m_selectingKeyboard = m_currentCellCoords;
|
||||||
if ( m_selectingKeyboard.GetCol() > 0 )
|
if ( m_selectingKeyboard.GetCol() > 0 )
|
||||||
{
|
{
|
||||||
m_selectingKeyboard.SetCol( m_selectingKeyboard.GetCol() - 1 );
|
m_selectingKeyboard.SetCol( m_selectingKeyboard.GetCol() - 1 );
|
||||||
MakeCellVisible( m_selectingKeyboard.GetRow(),
|
MakeCellVisible( m_selectingKeyboard.GetRow(),
|
||||||
m_selectingKeyboard.GetCol() );
|
m_selectingKeyboard.GetCol() );
|
||||||
SelectBlock( m_currentCellCoords, m_selectingKeyboard );
|
SelectBlock( m_currentCellCoords, m_selectingKeyboard );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -6397,12 +6398,12 @@ bool wxGrid::MoveCursorRight( bool expandSelection )
|
|||||||
if ( m_selectingKeyboard == wxGridNoCellCoords )
|
if ( m_selectingKeyboard == wxGridNoCellCoords )
|
||||||
m_selectingKeyboard = m_currentCellCoords;
|
m_selectingKeyboard = m_currentCellCoords;
|
||||||
if ( m_selectingKeyboard.GetCol() < m_numCols - 1 )
|
if ( m_selectingKeyboard.GetCol() < m_numCols - 1 )
|
||||||
{
|
{
|
||||||
m_selectingKeyboard.SetCol( m_selectingKeyboard.GetCol() + 1 );
|
m_selectingKeyboard.SetCol( m_selectingKeyboard.GetCol() + 1 );
|
||||||
MakeCellVisible( m_selectingKeyboard.GetRow(),
|
MakeCellVisible( m_selectingKeyboard.GetRow(),
|
||||||
m_selectingKeyboard.GetCol() );
|
m_selectingKeyboard.GetCol() );
|
||||||
SelectBlock( m_currentCellCoords, m_selectingKeyboard );
|
SelectBlock( m_currentCellCoords, m_selectingKeyboard );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -76,9 +76,12 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd,
|
|||||||
if ( message == WM_CHAR )
|
if ( message == WM_CHAR )
|
||||||
{
|
{
|
||||||
HWND hwndCombo = ::GetParent(hWnd);
|
HWND hwndCombo = ::GetParent(hWnd);
|
||||||
wxCHECK_MSG( hwndCombo, 0, _T("should have combo as parent") );
|
wxWindow *win = wxFindWinFromHandle((WXHWND)hwndCombo);
|
||||||
|
wxComboBox *combo = wxDynamicCast(win, wxComboBox);
|
||||||
|
wxCHECK_MSG( combo, 0, _T("should have combo as parent") );
|
||||||
|
|
||||||
::SendMessage(hwndCombo, message, wParam, lParam);
|
if ( combo->MSWProcessEditMsg(message, wParam, lParam) )
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam);
|
return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam);
|
||||||
@@ -88,6 +91,16 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd,
|
|||||||
// wxComboBox
|
// wxComboBox
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
|
{
|
||||||
|
if ( msg == WM_CHAR )
|
||||||
|
{
|
||||||
|
return HandleChar(wParam, lParam, TRUE /* isASCII */);
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
|
bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
|
||||||
{
|
{
|
||||||
switch ( param )
|
switch ( param )
|
||||||
|
@@ -580,7 +580,7 @@ bool wxToolBar::Realize()
|
|||||||
TBBUTTON tbb;
|
TBBUTTON tbb;
|
||||||
wxZeroMemory(tbb);
|
wxZeroMemory(tbb);
|
||||||
tbb.idCommand = 0;
|
tbb.idCommand = 0;
|
||||||
tbb.fsState = TBSTATE_ENABLED | TBSTATE_HIDDEN;
|
tbb.fsState = TBSTATE_ENABLED;
|
||||||
tbb.fsStyle = TBSTYLE_SEP;
|
tbb.fsStyle = TBSTYLE_SEP;
|
||||||
|
|
||||||
size_t nSeparators = size.x / widthSep;
|
size_t nSeparators = size.x / widthSep;
|
||||||
|
Reference in New Issue
Block a user