|
Scroom 0.14-49-gb7ae7a6d
|
#include <view.hh>

Public Types | |
| using | value_type = T |
| using | Me = Freezable< T > |
Public Member Functions | |
| Freezable ()=default | |
| Freezable (value_type v) | |
| const value_type & | get () const |
| bool | set (value_type v) |
| void | lock () |
| void | unlock () |
| bool | is_locked () const |
| operator const value_type & () const | |
| Me & | operator= (value_type v) |
| const value_type * | operator* () const |
| const value_type * | operator-> () const |
| Me & | operator+= (value_type v) |
| Me & | operator-= (value_type v) |
Private Attributes | |
| value_type | value |
| unsigned | locked {0} |
Protect a value from being assigned.
When the presentation position changes, scroll-bars and textboxes need updating, which in turn generate their own value-changed events, sometimes with different values. It is a mess.
By locking the current position, we keep those events from changing (and thereby corrupting) the updated value.
| using Freezable< T >::value_type = T |
|
default |
|
inlineexplicit |
|
inline |
Referenced by View::on_scrollbar_value_changed(), and View::updateXY().

|
inline |
|
inline |
|
inline |
|
inline |

|
inline |
|
inline |
|
inline |
Referenced by Freezable< T >::operator+=(), and Freezable< T >::operator-=().


|
inline |
|
private |
Referenced by Freezable< T >::is_locked(), Freezable< T >::lock(), Freezable< T >::set(), and Freezable< T >::unlock().
|
private |