Update column width in wxHeaderCtrlSimple while resizing the column
In EVT_HEADER_RESIZING event handler there is necessary to update actual column width and redraw the control to show the column with new width. Closes #18331.
This commit is contained in:
@@ -345,6 +345,8 @@ protected:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnHeaderResizing(wxHeaderCtrlEvent& evt);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// functions implementing our public API
|
// functions implementing our public API
|
||||||
void DoInsert(const wxHeaderColumnSimple& col, unsigned int idx);
|
void DoInsert(const wxHeaderColumnSimple& col, unsigned int idx);
|
||||||
@@ -371,6 +373,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
wxDECLARE_NO_COPY_CLASS(wxHeaderCtrlSimple);
|
wxDECLARE_NO_COPY_CLASS(wxHeaderCtrlSimple);
|
||||||
|
wxDECLARE_EVENT_TABLE();
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -386,6 +386,10 @@ bool wxHeaderCtrlBase::ShowCustomizeDialog()
|
|||||||
// wxHeaderCtrlSimple implementation
|
// wxHeaderCtrlSimple implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
|
wxBEGIN_EVENT_TABLE(wxHeaderCtrlSimple, wxHeaderCtrl)
|
||||||
|
EVT_HEADER_RESIZING(wxID_ANY, wxHeaderCtrlSimple::OnHeaderResizing)
|
||||||
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
void wxHeaderCtrlSimple::Init()
|
void wxHeaderCtrlSimple::Init()
|
||||||
{
|
{
|
||||||
m_sortKey = wxNO_COLUMN;
|
m_sortKey = wxNO_COLUMN;
|
||||||
@@ -466,6 +470,12 @@ wxHeaderCtrlSimple::UpdateColumnWidthToFit(unsigned int idx, int widthTitle)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxHeaderCtrlSimple::OnHeaderResizing(wxHeaderCtrlEvent& evt)
|
||||||
|
{
|
||||||
|
m_cols[evt.GetColumn()].SetWidth(evt.GetWidth());
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// wxHeaderCtrlEvent implementation
|
// wxHeaderCtrlEvent implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
Reference in New Issue
Block a user