Skip to content

Commit cb61314

Browse files
author
jwlodek
committed
Update generated docs
1 parent 4d4d073 commit cb61314

5 files changed

Lines changed: 140 additions & 9 deletions

File tree

docs/DocstringGenerated/Colors.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Class representing a text color rendering rule
5050
### __init__
5151

5252
```python
53-
def __init__(self, regex, color, rule_type, match_type, region, include_whitespace, logger)
53+
def __init__(self, regex, color, selected_color, rule_type, match_type, region, include_whitespace, logger)
5454
```
5555

5656
Constructor for ColorRule object
@@ -64,6 +64,7 @@ Constructor for ColorRule object
6464
-----|----------|-----
6565
regex | str | A python 're' module string
6666
color | int | A valid color value. Ex. py_cui.WHITE_ON_BLACK
67+
selected_color | int | Color to use if rule matched but selected modifier is applied
6768
rule_type | str | String representing rule type. ['startswith', 'endswith', 'notstartswith', 'notendswith', 'contains']
6869
match_type | str | String representing the match type. ['line', 'regex', 'region']
6970
region | [int, int] | Start and end positions for the coloring, None if match_type != 'region'
@@ -103,7 +104,7 @@ Checks if the color rule matches a line
103104
### _generate_fragments_regex
104105

105106
```python
106-
def _generate_fragments_regex(self, widget, render_text)
107+
def _generate_fragments_regex(self, widget, render_text, selected)
107108
```
108109

109110
Splits text into fragments based on regular expression
@@ -131,7 +132,7 @@ Splits text into fragments based on regular expression
131132
### _split_text_on_region
132133

133134
```python
134-
def _split_text_on_region(self, widget, render_text)
135+
def _split_text_on_region(self, widget, render_text, selected)
135136
```
136137

137138
Splits text into fragments based on region
@@ -159,7 +160,7 @@ Splits text into fragments based on region
159160
### generate_fragments
160161

161162
```python
162-
def generate_fragments(self, widget, line, render_text)
163+
def generate_fragments(self, widget, line, render_text, selected=False)
163164
```
164165

165166
Splits text into fragments if matched line to regex

docs/DocstringGenerated/Form.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Form widget for py_cui. Allows for giving user several fillable text fields in o
88

99
Class | Doc
1010
-----|-----
11-
DuplicateFormKeyError(Exception) |
11+
DuplicateFormKeyError(Exception) | Error thrown when a duplicate form field key is passed
1212
FormField(py_cui.ui.TextBoxImplementation) | Class containing basic logic of a field in a form
1313
FormFieldElement(py_cui.ui.UIElement, FormField) | Extension of UI element representing an individual field in the form
1414
FormImplementation(py_cui.ui.UIImplementation) | Main implementation class for the form widget/popup
@@ -25,7 +25,7 @@ Form widget for py_cui. Allows for giving user several fillable text fields in o
2525
class DuplicateFormKeyError(Exception)
2626
```
2727

28-
28+
Error thrown when a duplicate form field key is passed
2929

3030

3131

docs/DocstringGenerated/Renderer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ Internal function for drawing a blank row
320320
### _get_render_text
321321

322322
```python
323-
def _get_render_text(self, ui_element, line, centered, bordered, start_pos)
323+
def _get_render_text(self, ui_element, line, centered, bordered, selected, start_pos)
324324
```
325325

326326
Internal function that computes the scope of the text that should be drawn
@@ -351,7 +351,7 @@ Internal function that computes the scope of the text that should be drawn
351351
### _generate_text_color_fragments
352352

353353
```python
354-
def _generate_text_color_fragments(self, ui_element, line, render_text)
354+
def _generate_text_color_fragments(self, ui_element, line, render_text, selected)
355355
```
356356

357357
Function that applies color rules to text, dividing them if match is found

docs/DocstringGenerated/Ui.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,15 @@ class contains all links to the CUI engine.
6868
get_start_position | Gets coords of upper left corner
6969
get_stop_position | Gets coords of lower right corner
7070
get_color | Gets current element color
71+
get_border_color | Gets current element border color
72+
get_selected_color | Gets current selected item color
7173
is_selected | Get selected status
7274
get_renderer | Gets reference to renderer object
7375
get_help_text | Returns current help text
7476
set_title | Function that sets the widget title.
7577
set_color | Sets element default color
78+
set_border_color | Sets element border color
79+
set_selected_color | Sets element sected color
7680
set_selected | Marks the UI element as selected or not selected
7781
set_help_text | Sets status bar help text
7882
set_focus_text | Sets status bar focus text. Legacy function, overridden by set_focus_text
@@ -312,6 +316,48 @@ Gets current element color
312316

313317

314318

319+
### get_border_color
320+
321+
```python
322+
def get_border_color(self)
323+
```
324+
325+
Gets current element border color
326+
327+
328+
329+
330+
#### Returns
331+
332+
Return Variable | Type | Doc
333+
-----|----------|-----
334+
color | int | color code for combination
335+
336+
337+
338+
339+
340+
### get_selected_color
341+
342+
```python
343+
def get_selected_color(self)
344+
```
345+
346+
Gets current selected item color
347+
348+
349+
350+
351+
#### Returns
352+
353+
Return Variable | Type | Doc
354+
-----|----------|-----
355+
color | int | color code for combination
356+
357+
358+
359+
360+
315361
### is_selected
316362

317363
```python
@@ -417,6 +463,48 @@ Sets element default color
417463

418464

419465

466+
### set_border_color
467+
468+
```python
469+
def set_border_color(self, color)
470+
```
471+
472+
Sets element border color
473+
474+
475+
476+
477+
#### Parameters
478+
479+
Parameter | Type | Doc
480+
-----|----------|-----
481+
color | int | New color pair key code
482+
483+
484+
485+
486+
487+
### set_selected_color
488+
489+
```python
490+
def set_selected_color(self, color)
491+
```
492+
493+
Sets element sected color
494+
495+
496+
497+
498+
#### Parameters
499+
500+
Parameter | Type | Doc
501+
-----|----------|-----
502+
color | int | New color pair key code
503+
504+
505+
506+
507+
420508
### set_selected
421509

422510
```python

docs/DocstringGenerated/Widgets.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ and setting status bar text.
7272
get_absolute_stop_pos | Gets the absolute dimensions of the widget in characters. Override of base class function
7373
get_grid_cell | Gets widget row, column in grid
7474
get_grid_cell_spans | Gets widget row span, column span in grid
75+
set_selectable | Setter for widget selectablility
7576
is_selectable | Checks if the widget is selectable
7677
_is_row_col_inside | Checks if a particular row + column is inside the widget area
7778
_handle_key_press | Base class function that handles all assigned key presses.
@@ -144,7 +145,7 @@ Maps a keycode to a function that will be executed when in focus mode, if key is
144145
### add_text_color_rule
145146

146147
```python
147-
def add_text_color_rule(self, regex, color, rule_type, match_type='line', region=[0,1], include_whitespace=False)
148+
def add_text_color_rule(self, regex, color, rule_type, match_type='line', region=[0,1], include_whitespace=False, selected_color=None)
148149
```
149150

150151
Forces renderer to draw text using given color if text_condition_function returns True
@@ -251,6 +252,25 @@ Gets widget row span, column span in grid
251252

252253

253254

255+
### set_selectable
256+
257+
```python
258+
def set_selectable(self, selectable)
259+
```
260+
261+
Setter for widget selectablility
262+
263+
264+
265+
Paramters
266+
---------
267+
selectable : bool
268+
Widget selectable if true, otherwise not
269+
270+
271+
272+
273+
254274
### is_selectable
255275

256276
```python
@@ -441,6 +461,7 @@ A Variation of the label widget that renders a block of text.
441461

442462
Method | Doc
443463
-----|-----
464+
set_title | Override of base class, splits title into lines for rendering line by line.
444465
toggle_border | Function that gives option to draw border around label
445466
_draw | Override base draw class.
446467

@@ -461,6 +482,27 @@ Initializer for blocklabel widget
461482

462483

463484

485+
### set_title
486+
487+
```python
488+
def set_title(self, title)
489+
```
490+
491+
Override of base class, splits title into lines for rendering line by line.
492+
493+
494+
495+
496+
#### Parameters
497+
498+
Parameter | Type | Doc
499+
-----|----------|-----
500+
title | str | The new title for the block label object.
501+
502+
503+
504+
505+
464506
### toggle_border
465507

466508
```python

0 commit comments

Comments
 (0)