JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbro h@sZdZddlZddlZddZGdddZedkr+dd ZeeZe d e edSdS) z:Simple textbox editing widget with Emacs-like keybindings.NcCs||d|tj||d|||dtj||d|||dtj||d||d|tj||d|||tj|||tj|||tj|||tj dS)z^Draw a rectangle with corners at the provided upper-left and lower-right coordinates. N) ZvlinecursesZ ACS_VLINEZhlineZ ACS_HLINEaddchZ ACS_ULCORNERZ ACS_URCORNERZ ACS_LRCORNERZ ACS_LLCORNER)winulyulxZlryZlrxr5/opt/alt/python310/lib64/python3.10/curses/textpad.py rectanglesr c@sLeZdZdZdddZddZddZd d Zd d Zd dZ dddZ dS)TextboxadEditing widget using the interior of a window object. Supports the following Emacs-like key bindings: Ctrl-A Go to left edge of window. Ctrl-B Cursor left, wrapping to previous line if appropriate. Ctrl-D Delete character under cursor. Ctrl-E Go to right edge (stripspaces off) or end of line (stripspaces on). Ctrl-F Cursor right, wrapping to next line when appropriate. Ctrl-G Terminate, returning the window contents. Ctrl-H Delete character backward. Ctrl-J Terminate if the window is 1 line, otherwise insert newline. Ctrl-K If line is blank, delete it, otherwise clear to end of line. Ctrl-L Refresh screen. Ctrl-N Cursor down; move down one line. Ctrl-O Insert a blank line at cursor location. Ctrl-P Cursor up; move up one line. Move operations do nothing if the cursor is at an edge where the movement is not possible. The following synonyms are supported where possible: KEY_LEFT = Ctrl-B, KEY_RIGHT = Ctrl-F, KEY_UP = Ctrl-P, KEY_DOWN = Ctrl-N KEY_BACKSPACE = Ctrl-h FcCs.||_||_|d|_d|_|ddSNr)r insert_mode_update_max_yx stripspaceslastcmdZkeypad)selfrr rrr __init__+s zTextbox.__init__cCs&|j\}}|d|_|d|_dSr )rZgetmaxyxmaxymaxx)rrrrrr r3s zTextbox._update_max_yxcCs\||j} tj|j||tjjkr"t|j|d} |S|dkr) |S|d}q)zuGo to the location of the first blank on the given line, returning the index of the last non-blank character.Trr)rrrasciirinchZSPmin)ryZlastrrr _end_of_line8szTextbox._end_of_linecCs||j\}}d}||jks||jkrW|jr|j}z|j|Wn tj y1Ynw|jr;tj |s |j}|r ||}|sq||s |S|jq)z2Edit in the widget window and collect the results.)rZgetchr$r#r+)rZvalidaterrrr edits   z Textbox.edit)Fr) __name__ __module__ __qualname____doc__rrrr!r$r+r,rrrr r s Ar __main__cCsfd\}}d\}}||d|dt||||}t||d|d|||||t|S)N) )zUse Ctrl-G to end editing.r)ZaddstrrZnewwinr r#r r,)ZstdscrZncolsZnlinesrrrrrr test_editboxs  r7zContents of text box:) r0rZ curses.asciir r r-r7wrapperstrprintreprrrrr s ,