handle actions of the columns popup menu in wxHeaderCtrl itself (but the derived class must implement UpdateColumnVisibility()); also renamed wxHD_DRAGDROP to wxHD_ALLOW_REORDER as it will be possible to reorder columns interactively using a customization dialog and not just by dragging them soon
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -224,7 +224,8 @@ public:
|
||||
wxID_ANY,
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize,
|
||||
owner->CanDragColMove() ? wxHD_DRAGDROP : 0)
|
||||
wxHD_ALLOW_HIDE |
|
||||
(owner->CanDragColMove() ? wxHD_ALLOW_REORDER : 0))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -267,6 +268,16 @@ private:
|
||||
return true;
|
||||
}
|
||||
|
||||
// overridden to react to the actions using the columns popup menu
|
||||
virtual void UpdateColumnVisibility(unsigned int idx, bool show)
|
||||
{
|
||||
GetOwner()->SetColSize(idx, show ? wxGRID_AUTOSIZE : 0);
|
||||
|
||||
// as this is done by the user we should notify the main program about
|
||||
// it
|
||||
GetOwner()->SendEvent(wxEVT_GRID_COL_SIZE, -1, idx);
|
||||
}
|
||||
|
||||
|
||||
// event handlers forwarding wxHeaderCtrl events to wxGrid
|
||||
void OnClick(wxHeaderCtrlEvent& event)
|
||||
|
Reference in New Issue
Block a user