Added line height to wxRTC to allow faster scrolling if needed

This commit is contained in:
JulianSmart
2015-11-14 18:31:39 +00:00
parent 308727daed
commit f48374a949
2 changed files with 11 additions and 1 deletions

View File

@@ -2218,6 +2218,10 @@ public:
#endif
/// Set the line increment height in pixels
void SetLineHeight(int height) { m_lineHeight = height; }
int GetLineHeight() const { return m_lineHeight; }
// Implementation
/**
@@ -2408,6 +2412,9 @@ protected:
/// Whether images are enabled for this control
bool m_enableImages;
/// Line height in pixels
int m_lineHeight;
/// Whether delayed image loading is enabled for this control
bool m_enableDelayedImageLoading;
bool m_delayedImageProcessingRequired;

View File

@@ -389,6 +389,9 @@ void wxRichTextCtrl::Init()
m_enableDelayedImageLoading = false;
m_delayedImageProcessingRequired = false;
m_delayedImageProcessingTime = 0;
// Line height in pixels
m_lineHeight = 5;
}
void wxRichTextCtrl::DoThaw()
@@ -2923,7 +2926,7 @@ void wxRichTextCtrl::SetupScrollbars(bool atTop, bool fromOnPaint)
// TODO: reimplement scrolling so we scroll by line, not by fixed number
// of pixels. See e.g. wxVScrolledWindow for ideas.
int pixelsPerUnit = 5;
int pixelsPerUnit = GetLineHeight();
wxSize clientSize = GetClientSize();
int maxHeight = (int) (0.5 + GetScale() * (GetBuffer().GetCachedSize().y + GetBuffer().GetTopMargin()));