관리-도구
편집 파일: textpad.cpython-34.pyo
� i f� � @ s~ d Z d d l Z d d l Z d d � Z Gd d � d � Z e d k rz d d � Z e j e � Z e d e e � � n d S)z:Simple textbox editing widget with Emacs-like keybindings.� Nc C s� | j | d | t j | | d � | j | | d t j | | d � | j | | d t j | | d � | j | d | t j | | d � | j | | t j � | j | | t j � | j | | t j � | j | | t j � d S)z^Draw a rectangle with corners at the provided upper-left and lower-right coordinates. � N) Zvline�cursesZ ACS_VLINEZhlineZ ACS_HLINE�addchZACS_ULCORNERZACS_URCORNERZACS_LRCORNERZACS_LLCORNER)�win�uly�ulxZlryZlrx� r �3/opt/alt/python34/lib64/python3.4/curses/textpad.py� rectangle s %%%%r c @ sd e Z d Z d Z d d d � Z d d � Z d d � Z d d � Z d d � Z d d d � Z d S)�Textboxad Editing 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 Fc C sm | | _ | | _ | j � \ | _ | _ | j d | _ | j d | _ d | _ d | _ | j d � d S)Nr )r �insert_modeZgetmaxyx�maxy�maxx�stripspaces�lastcmdZkeypad)�selfr r r r r �__init__+ s zTextbox.__init__c C su | j } xe t j j | j j | | � � t j j k rS t | j | d � } Pn | d k rc Pn | d } q W| S)zuGo to the location of the first blank on the given line, returning the index of the last non-blank character.r r )r r �asciir �inchZSP�min)r �y�lastr r r �_end_of_line5 s -zTextbox._end_of_linec C s� | j j � \ } } | | j k s3 | | j k r� | j rN | j j � } n y | j j | � Wn t j k ry Yn X| j r� | j j � \ } } t j j | � r� | j | � | j j | | � q� q� n d S)N) r �getyxr r r r r r �errorr �isprint�_insert_printable_char�move)r �chr �xZoldchZbackyZbackxr r r r B s zTextbox._insert_printable_charc C se | j j � \ } } | | _ t j j | � ra | | j k sN | | j k ra| j | � qan | t j j k r� | j j | d � n�| t j j t j t j j t j f k r`| d k r� | j j | | d � nY | d k r� nJ | j r| j j | d | j | d � � n | j j | d | j � | t j j t j f k ra| j j � qan| t j j k r�| j j � n�| t j j k r�| j r�| j j | | j | � � qa| j j | | j � n�| t j j t j f k rE| | j k r| j j | | d � qa| | j k r+qa| j j | d d � n| t j j k r[d S| t j j k r�| j d k r�d S| | j k ra| j j | d d � qan�| t j j k r| d k r�| j | � d k r�| j j � qa| j j | | � | j j � nO| t j j k r4| j j � n-| t j j t j f k r�| | j k ra| j j | d | � | | j | d � k r�| j j | d | j | d � � q�qan� | t j j k r�| j j � n� | t j j! t j"