scrollbar in text editor

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@154 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-23 12:47:08 +00:00
parent 153dab9a4f
commit 2233295cfd
13 changed files with 179 additions and 74 deletions
+25
View File
@@ -90,6 +90,31 @@ class TextViewer {
/// Return the height of the last line
double heightOfLastLine() const;
// --------------------------------------------------- : Lines/scrolling
/// The total number of lines
size_t lineCount() const;
/// number of fully visible lines, height gives the height of the box
size_t visibleLineCount(double height) const;
/// the index of the first visible line
size_t firstVisibleLine() const;
// scroll so line_id becomes the first visible line
void scrollTo(size_t line_id);
/// Ensure the specified character is fully visible
/* Always scrolls by a whole line.
* Returns true if the editor has scrolled.
*/
bool ensureVisible(double height, size_t char_id);
/// Get exact scroll position
double getExactScrollPosition() const;
/// Set exact scroll position
void setExactScrollPosition(double pos);
private:
/// Scroll all lines a given amount
void scrollBy(double delta);
private:
// --------------------------------------------------- : More drawing
double scale; /// < Scale when drawing