wxMaxima
Loading...
Searching...
No Matches
Data Structures | Public Member Functions
MatrixScrollbars Class Referencefinal

The native scrollbars of the matrices a worksheet shows in a viewport. More...

#include <MatrixScrollbars.h>

Inheritance diagram for MatrixScrollbars:
[legend]
Collaboration diagram for MatrixScrollbars:
[legend]

Public Member Functions

 MatrixScrollbars (wxScrolled< wxWindow > *worksheet)
 
 MatrixScrollbars (const MatrixScrollbars &)=delete
 
MatrixScrollbars & operator= (const MatrixScrollbars &)=delete
 
wxCoord ScrollbarThickness () const override
 How thick a native scrollbar is, in worksheet pixels.
 
void MatrixDrawn (MatrCell *matrix) override
 A matrix that needs scrollbars has just been drawn.
 
void BeginPaint ()
 To be called before a paint draws any cell.
 
void EndPaint (const wxRegion &updateRegion)
 To be called once a paint has drawn all it is going to.
 
void Sync ()
 Creates, moves, shows and hides scrollbars as the last paint found.
 
size_t VisibleScrollbars () const
 How many scrollbars are visible right now (for tests)
 

Detailed Description

The native scrollbars of the matrices a worksheet shows in a viewport.

A MatrCell in Configuration::OversizedMatrices::scroll mode knows where its scrollbars belong, but owns no window: see MatrixScrollHost for why. This is the worksheet's side of that arrangement. It keeps one real wxScrollBar per scrollbar a matrix needs, as a child window of the worksheet, and keeps them in line with the matrices:

Moving a matrix's scrollbar scrolls the matrix (MatrCell::ScrollTo()) and redraws just it; no relayout is needed. The mouse wheel over the matrix still scrolls the worksheet, so a matrix never traps the wheel, and the scrollbars never keep the keyboard focus: typing always goes to the worksheet.

Member Function Documentation

◆ EndPaint()

void MatrixScrollbars::EndPaint ( const wxRegion &  updateRegion)

To be called once a paint has drawn all it is going to.

Parameters
updateRegionwhat the paint repainted, in window coordinates

◆ MatrixDrawn()

void MatrixScrollbars::MatrixDrawn ( MatrCell *  matrix)
overridevirtual

A matrix that needs scrollbars has just been drawn.

Called from MatrCell::Draw(), i.e. from inside the paint handler, so the host must not create, move or show windows here – only note what is needed, and act once the paint is over.

Implements MatrixScrollHost.

◆ ScrollbarThickness()

wxCoord MatrixScrollbars::ScrollbarThickness ( ) const
overridevirtual

How thick a native scrollbar is, in worksheet pixels.

Implements MatrixScrollHost.


The documentation for this class was generated from the following files: