add wxEVT_COMMAND_HEADER_SEPARATOR_DCLICK and semi-automatic header resizing support
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -68,9 +68,12 @@ private:
|
||||
// return the horizontal start position of the given column
|
||||
int GetColStart(unsigned int idx) const;
|
||||
|
||||
// refresh the given column [only]
|
||||
// refresh the given column [only]; idx must be valid
|
||||
void RefreshCol(unsigned int idx);
|
||||
|
||||
// refresh the given column if idx is valid
|
||||
void RefreshColIfNotNone(unsigned int idx);
|
||||
|
||||
// refresh all the controls starting from (and including) the given one
|
||||
void RefreshColsAfter(unsigned int idx);
|
||||
|
||||
|
@@ -20,6 +20,7 @@
|
||||
// notice that the classes in this header are defined in the core library even
|
||||
// although currently they're only used by wxGrid which is in wxAdv because we
|
||||
// plan to use it in wxListCtrl which is in core too in the future
|
||||
class WXDLLIMPEXP_FWD_CORE wxHeaderCtrlEvent;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
@@ -101,6 +102,15 @@ protected:
|
||||
// information for the given column
|
||||
virtual wxHeaderColumnBase& GetColumn(unsigned int idx) = 0;
|
||||
|
||||
// this method is called from the default EVT_HEADER_SEPARATOR_DCLICK
|
||||
// handler to update the fitting column width of the given column, it
|
||||
// should return true if the width was really updated
|
||||
virtual bool UpdateColumnWidthToFit(unsigned int WXUNUSED(idx),
|
||||
int WXUNUSED(widthTitle))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
// methods implementing our public API and defined in platform-specific
|
||||
// implementations
|
||||
@@ -112,6 +122,11 @@ private:
|
||||
|
||||
// this window doesn't look nice with the border so don't use it by default
|
||||
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
|
||||
|
||||
// event handlers
|
||||
void OnSeparatorDClick(wxHeaderCtrlEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -276,6 +291,8 @@ extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_DCLICK;
|
||||
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_RIGHT_DCLICK;
|
||||
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_MIDDLE_DCLICK;
|
||||
|
||||
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_SEPARATOR_DCLICK;
|
||||
|
||||
typedef void (wxEvtHandler::*wxHeaderCtrlEventFunction)(wxHeaderCtrlEvent&);
|
||||
|
||||
#define wxHeaderCtrlEventHandler(func) \
|
||||
@@ -293,4 +310,6 @@ typedef void (wxEvtHandler::*wxHeaderCtrlEventFunction)(wxHeaderCtrlEvent&);
|
||||
#define EVT_HEADER_RIGHT_DCLICK(id, fn) wx__DECLARE_HEADER_EVT(RIGHT_DCLICK, id, fn)
|
||||
#define EVT_HEADER_MIDDLE_DCLICK(id, fn) wx__DECLARE_HEADER_EVT(MIDDLE_DCLICK, id, fn)
|
||||
|
||||
#define EVT_HEADER_SEPARATOR_DCLICK(id, fn) wx__DECLARE_HEADER_EVT(SEPARATOR_DCLICK, id, fn)
|
||||
|
||||
#endif // _WX_HEADERCTRL_H_
|
||||
|
@@ -71,9 +71,13 @@ private:
|
||||
enum Operation { Set, Insert };
|
||||
void DoSetOrInsertItem(Operation oper, unsigned int idx);
|
||||
|
||||
// send an event of the given type for the given column, return true if it
|
||||
// was processed
|
||||
bool SendEvent(wxEventType evtType, unsigned int idx);
|
||||
|
||||
// send a click or double click event (depending on dblclk value) for the
|
||||
// click with the given button on the given item
|
||||
bool SendClickEvent(bool dblclk, unsigned int idx, int button);
|
||||
bool SendClickEvent(bool dblclk, int button, unsigned int idx);
|
||||
|
||||
|
||||
// the image list: initially NULL, created on demand
|
||||
|
Reference in New Issue
Block a user