Class ViewState
- class ooodev.utils.view_state.ViewState(state)[source]
For moving the pane focus
- Parameters:
state (str) –
- class PaneEnum(value)[source]
An enumeration.
- MOVE_DOWN = 1
- MOVE_LEFT = 2
- MOVE_RIGHT = 3
- MOVE_UP = 0
- __init__(state)[source]
Constructor
- Parameters:
state (str) – State in format of ‘0/4998/0/1/0/218/2/0/0/4988/4998’
- Raises:
ValueError – if state does not contains 10 ‘/’ (11 parts)
- Return type:
None
- move_pane_focus(dir)[source]
Moves pane focus
- Parameters:
dir (int | PaneEnum) – Direction to move
- Raises:
ValueError – If dir is unknown
- Returns:
True if move is successful; Otherwise False
- Return type:
bool
Note
The 4 possible view panes are numbered like so
0 | 1 ------- 2 | 3
If there’s no horizontal split then the panes are numbered 0 and 2. If there’s no vertical split then the panes are numbered 0 and 1.
- static parse_int(s)[source]
Parses int
- Parameters:
s (str) – string value that contains int
- Returns:
string value converted to int on success; Otherwise, 0
- Return type:
int
- to_string()[source]
Gets string Representation of object.
String representation can also be used to create a new instance of this class.
same as
str(instance)
- Return type:
str
- property column_left_pane: int
Gets/Sets left column index of left pane
- Return type:
int
- property column_right_pane: int
Gets/Sets left column index of right pane
- Return type:
int
- property column_split_mode: int
Gets/Sets column split mode
- Return type:
int
- property cursor_column: int
Gets/Sets cursor position column
- Return type:
int
- property cursor_row: int
Gets/Sets cursor position row
- Return type:
int
- property horizontal_split: int
Gets/Sets horizontal split position
- Return type:
int
- property pane_focus_num: int
Gets/Sets focused pane number
- Return type:
int
- property row_lower_pane: int
Gets/Sets top row index of lower pane
- Return type:
int
- property row_split_mode: int
Gets/Sets row split mode
- Return type:
int
- property row_upper_pane: int
Gets/Sets top row index of upper pane
- Return type:
int
- property vertical_split: int
Gets/Sets vertical split position
- Return type:
int