Added line height to wxRTC to allow faster scrolling if needed
This commit is contained in:
@@ -2218,6 +2218,10 @@ public:
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/// Set the line increment height in pixels
|
||||||
|
void SetLineHeight(int height) { m_lineHeight = height; }
|
||||||
|
int GetLineHeight() const { return m_lineHeight; }
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2408,6 +2412,9 @@ protected:
|
|||||||
/// Whether images are enabled for this control
|
/// Whether images are enabled for this control
|
||||||
bool m_enableImages;
|
bool m_enableImages;
|
||||||
|
|
||||||
|
/// Line height in pixels
|
||||||
|
int m_lineHeight;
|
||||||
|
|
||||||
/// Whether delayed image loading is enabled for this control
|
/// Whether delayed image loading is enabled for this control
|
||||||
bool m_enableDelayedImageLoading;
|
bool m_enableDelayedImageLoading;
|
||||||
bool m_delayedImageProcessingRequired;
|
bool m_delayedImageProcessingRequired;
|
||||||
|
@@ -389,6 +389,9 @@ void wxRichTextCtrl::Init()
|
|||||||
m_enableDelayedImageLoading = false;
|
m_enableDelayedImageLoading = false;
|
||||||
m_delayedImageProcessingRequired = false;
|
m_delayedImageProcessingRequired = false;
|
||||||
m_delayedImageProcessingTime = 0;
|
m_delayedImageProcessingTime = 0;
|
||||||
|
|
||||||
|
// Line height in pixels
|
||||||
|
m_lineHeight = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRichTextCtrl::DoThaw()
|
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
|
// TODO: reimplement scrolling so we scroll by line, not by fixed number
|
||||||
// of pixels. See e.g. wxVScrolledWindow for ideas.
|
// of pixels. See e.g. wxVScrolledWindow for ideas.
|
||||||
int pixelsPerUnit = 5;
|
int pixelsPerUnit = GetLineHeight();
|
||||||
wxSize clientSize = GetClientSize();
|
wxSize clientSize = GetClientSize();
|
||||||
|
|
||||||
int maxHeight = (int) (0.5 + GetScale() * (GetBuffer().GetCachedSize().y + GetBuffer().GetTopMargin()));
|
int maxHeight = (int) (0.5 + GetScale() * (GetBuffer().GetCachedSize().y + GetBuffer().GetTopMargin()));
|
||||||
|
Reference in New Issue
Block a user