mirror of https://github.com/odrling/Aegisub
Add mouse wheel forwarding to ScintillaTextCtrl as wxSTC uses the scroll wheel
Originally committed to SVN as r5783.
This commit is contained in:
parent
9ed1653aae
commit
17b9347562
|
@ -42,6 +42,7 @@
|
|||
ScintillaTextCtrl::ScintillaTextCtrl(wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style)
|
||||
: wxStyledTextCtrl(parent, id, pos, size, style, value)
|
||||
{
|
||||
Bind(wxEVT_MOUSEWHEEL, &ScintillaTextCtrl::OnMouseWheel, this);
|
||||
}
|
||||
|
||||
/// @brief Get unicode-compatible position
|
||||
|
@ -111,3 +112,10 @@ wxString ScintillaTextCtrl::GetWordAtPosition(int pos) {
|
|||
void ScintillaTextCtrl::SetSelectionU(int start, int end) {
|
||||
SetSelection(GetUnicodePosition(start),GetUnicodePosition(end));
|
||||
}
|
||||
|
||||
void ScintillaTextCtrl::OnMouseWheel(wxMouseEvent& evt) {
|
||||
if (ForwardMouseWheelEvent(this, evt)) {
|
||||
// Skip the event so that wxSTC's default mouse wheel handler is hit
|
||||
evt.Skip();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,8 @@
|
|||
/// DOCME
|
||||
class ScintillaTextCtrl : public wxStyledTextCtrl {
|
||||
wxString text;
|
||||
|
||||
void OnMouseWheel(wxMouseEvent& evt);
|
||||
public:
|
||||
wxString GetWordAtPosition(int pos);
|
||||
void GetBoundsOfWordAtPosition(int pos,int &start,int &end);
|
||||
|
|
Loading…
Reference in New Issue