+
     hb+  c                   sh    R t R.t^ RIt ! R R]P                  4      tR t]R8X  d
   ]! 4        R# R# )a  

enchant.checker.wxSpellCheckerDialog: wxPython spellchecker interface

This module provides the class wxSpellCheckerDialog, which provides
a wxPython dialog that can be used as an interface to a spell checking
session.  Currently it is intended as a proof-of-concept and demonstration
class, but it should be suitable for general-purpose use in a program.

The class must be given an enchant.checker.SpellChecker object with
which to operate.  It can (in theory...) be used in modal and non-modal
modes.  Use Show() when operating on an array of characters as it will
modify the array in place, meaning other work can be done at the same
time.  Use ShowModal() when operating on a static string.

	ShowModalNc                   s   a a ] tR t^5t oRt. ROtRtRV 3R lltR tR t	RR lt
R tR tR tR	 tR
 tR tR tR tR tR tRtVtV ;t# )wxSpellCheckerDialoga~  Simple spellcheck dialog for wxPython

This class implements a simple spellcheck interface for wxPython,
in the form of a dialog.  It's intended mainly of an example of
how to do this, although it should be useful for applications that
just need a simple graphical spellchecker.

To use, a SpellChecker instance must be created and passed to the
dialog before it is shown:

    >>> dlg = wxSpellCheckerDialog(None,-1,"")
    >>> chkr = SpellChecker("en_AU",text)
    >>> dlg.SetSpellChecker(chkr)
    >>> dlg.Show()

This is most useful when the text to be checked is in the form of
a character array, as it will be modified in place as the user
interacts with the dialog.  For checking strings, the final result
will need to be obtained from the SpellChecker object:

    >>> dlg = wxSpellCheckerDialog(None,-1,"")
    >>> chkr = SpellChecker("en_AU",text)
    >>> dlg.SetSpellChecker(chkr)
    >>> dlg.ShowModal()
    >>> text = dlg.GetSpellChecker().get_text()

Currently the checker must deal with strings of the same type as
returned by wxPython - unicode or normal string depending on the
underlying system.  This needs to be fixed, somehow...
c                s   < \         SV `  VVV\        P                  \        P
                  \        P                  ,          R 7       ^(V n        RV n        RV n	        \        P                  ! V RR\        P                  \        P                  ,          \        P                  ,          R7      V n        \        P                  ! V RR\        P                  R7      V n        \        P"                  ! V R\        P$                  R7      V n        V P)                  4        \        P*                  ! W P&                  P-                  4       V P.                  4       \        P0                  ! W P&                  P-                  4       V P2                  4       R# ))ZsizestyleNT )r   )super__init__r   szwxZDEFAULT_DIALOG_STYLEZRESIZE_BORDER_numContext_checker_buttonsEnabledZTextCtrlZTE_MULTILINEZTE_READONLYZTE_RICH
error_textZTE_PROCESS_ENTERreplace_textZListBoxZ	LB_SINGLEreplace_list
InitLayoutZEVT_LISTBOXZGetIdOnReplSelectZEVT_LISTBOX_DCLICK	OnReplace)selfZparentZidZtitle	__class__s   &&&&I/usr/lib/python3.14/site-packages/enchant/checker/wxSpellCheckerDialog.pyr   ZwxSpellCheckerDialog.__init__j   s   %(())B,<,<< 	 	
 #++"b".. @2:: M
 KKb"B<O<OPJJtRr||D
t..4468I8IJ
d$5$5$;$;$=t~~N    c                sh   \         P                  ! \         P                  4      p\         P                  ! \         P                  4      p\         P                  ! \         P                  4      p\         P                  ! \         P                  4      pVP	                  \         P
                  ! V RR4      ^ \         P                  \         P                  ,          ^4       VP	                  V P                  ^\         P                  \         P                  ,          ^4       VP	                  \         P
                  ! V RR4      ^ \         P                  \         P                  ,          ^4       VP	                  V P                  ^\         P                  \         P                  ,          ^4       VP	                  V^ \         P                  ^ 4       VP	                  V P                  ^\         P                  \         P                  ,          ^4       VP	                  V^\         P                  ^ 4       . V n        RV P                  R3RV P                   R3RV P"                  R3R	V P$                  R
3RV P&                  R3RV P(                  R33 F  w  rVp\         P*                  ! V RV4      pVP-                  \         P.                  ! V4      4       VP	                  V^ \         P0                  \         P                  ,          ^4       VP3                  \         P4                  V4       V P                  P7                  V4       K  	  VP	                  V^ \         P                  \         P                  ,          ^4       V P9                  R4       V P;                  V4       VP=                  V 4       R# )z!Lay out controls and add buttons.zUnrecognised Word:zReplace with:ZIgnorezIgnore this word and continuez
Ignore Allz.Ignore all instances of this word and continueZReplacezReplace this wordzReplace Allz"Replace all instances of this wordAddzAdd this word to the dictionaryZDonez(Finish spell-checking and accept changesTNr   )r   ZBoxSizerZ
HORIZONTALZVERTICALr   Z
StaticTextZLEFTZTOPr   ZALLZEXPANDZALIGN_CENTER_VERTICALr   r   buttonsOnIgnoreOnIgnoreAllr   OnReplaceAllOnAddOnDoneZButtonZ
SetToolTipZToolTipZALIGN_RIGHTZBindZ
EVT_BUTTONZappendZSetAutoLayoutZSetSizerZFit)	r   ZsizerZtxtSizerZbtnSizerZreplaceSizerZlabelZactionZtipbtns	   &        r   r   ZwxSpellCheckerDialog.InitLayout~   s   BMM*;;r{{+;;r{{+{{2==1MM$$891bgg>NPQ	
 	T__a")));Q?MM$O4FFR---		
 	**Arvv8P8P/PRST\1bii3T&&266BII+=qA		(Aryy!,t}}&EF  @
 (;<D--/STDJJ ABT[["LM#
E3 ))D"e,CNN2::c?+LLa"&&!8!<HHR]]F+LL$!#
" 			(Arvv		1154 e		$r   c                s   V P                   f   V P                  R4       R#  V P                   P                  4        T P                  4        T P                  P                  R4       T P                  P                  \        P                  ! \        P                  4      4       T P                   P!                  T P"                  4      pT P                  P%                  T4       T P                  P                  \        P                  ! \        P&                  4      4       T P                  P%                  T P                   P(                  4       T P                  P                  \        P                  ! \        P                  4      4       T P                   P+                  T P"                  4      pT P                  P%                  T4       T P                   P-                  4       pT P                  P/                  T4       T P                  P                  T;'       d    T^ ,          ;'       g    R4       R#   \         d    T P                  R4       T P                  P                  R4       T P                  P                  4        T P                  P                  R4       T P                  4       '       d    T P                  \        P                  4        R# i ; i)zAdvance to the next error.

This method advances the SpellChecker to the next error, if
any.  It then displays the error and some surrounding context,
and well as listing the suggested replacements.
Fr   T)r
   EnableButtonsZnextZStopIterationr   SetValuer   ZClearr   IsModalEndModalr   ID_OKZSetDefaultStyleZTextAttrZBLACKZleading_contextr	   Z
AppendTextZREDZwordZtrailing_contextZsuggestZSet)r   ZlContextZtContextZsuggss   &   r   AdvanceZwxSpellCheckerDialog.Advance   s    == u%
	MM  	 	  $''BHH(=>==001A1AB""8,''BFF(;<""4==#5#56''BHH(=>==11$2B2BC""8,%%'e$""5#5#5U1X#;#;<5  	u%OO$$R(##%&&r*||~~bhh'	s   H; ;BK =K K c                s    WP                   8w  d0   V P                  RR  F  pVP                  V4       K  	  Wn         R# R# )z#Enable the checking-related buttonsNr   )r   r   ZEnable)r   Zstater      && r   r   Z"wxSpellCheckerDialog.EnableButtons   s:    (((||CR(

5! )#(  )r   c                s:    V P                   P                  4       pV# )z"Get the chosen replacement string.)r   ZGetValue)r   repls   & r   GetReplZwxSpellCheckerDialog.GetRepl   s      ))+r   c                Z    V P                   P                  4        V P                  4        R# )zCallback for the "add" button.N)r
   Zaddr#   r   evt   &&r   r   ZwxSpellCheckerDialog.OnAdd   s    r   c                s    V P                   P                  4       \        n        V P	                  4       '       d"   V P                  \        P                  4       R# V P                  4        R# )z Callback for the "close" button.N)	r   ZGetSizeTupler   r   r    r!   r   r"   ZCloser(   r*   r   r   ZwxSpellCheckerDialog.OnDone   s<    "&//">">"@<<>>MM"((#JJLr   c                s&    V P                  4        R# )zJCallback for the "ignore" button.
This simply advances to the next error.
N)r#   r(   r*   r   r   ZwxSpellCheckerDialog.OnIgnore   s     	r   c                r'   )z%Callback for the "ignore all" button.N)r
   Zignore_alwaysr#   r(   r*   r   r   Z wxSpellCheckerDialog.OnIgnoreAll   s    ##%r   c                s    V P                  4       pV'       d   V P                  P                  V4       V P                  4        R# )z"Callback for the "replace" button.N)r&   r
   Zreplacer#   r   r)   r%   r$   r   r   ZwxSpellCheckerDialog.OnReplace   s+    ||~MM!!$'r   c                s|    V P                  4       pV P                  P                  V4       V P                  4        R# )z&Callback for the "replace all" button.N)r&   r
   Zreplace_alwaysr#   r+   r$   r   r   Z!wxSpellCheckerDialog.OnReplaceAll   s(    ||~$$T*r   c                s    V P                   P                  4       pVR8X  d   R# V P                   P                  V4      pV P                  P	                  V4       R# )z3Callback when a new replacement option is selected.Nr   )r   ZGetSelectionZ	GetStringr   r   )r   r)   ZselZopts   &&  r   r   Z!wxSpellCheckerDialog.OnReplSelect  sJ    ,,."9))#.""3'r   c                s    V P                   # )zGet the spell checker object.)r
   )r   s   &r   GetSpellCheckerZ$wxSpellCheckerDialog.GetSpellChecker  s    }}r   c                s.    Wn         V P                  4       # )zdSet the spell checker, advancing to the first error.
Return True if error(s) to correct, else False.)r
   r#   )r   chkrr*   r   SetSpellCheckerZ$wxSpellCheckerDialog.SetSpellChecker  s     ||~r   )r   r
   r	   r   r   r   r   )dlgr-   r/   r.   r-   r/   r/   r-   r/   r.   r-   r/   r    r/   r,   )i,  iF   )Nr   zChecking Spelling...)T)__name__
__module____qualname____firstlineno____doc___DOC_ERRORSr   r   r   r#   r   r&   r   r   r   r   r   r   r   r,   r.   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r   r   5   sf     >K& 
BO()V(T)


( r   r   c                  s  a  ! V3R  lR\         4      p ^ RIHp Rp\        RV.4       \        P
                  ! R4      pV ! 4       oV! RV4      pSP                  V4       SP                  4        VP                  4        R# )c                   s@   <a a ] tR tRt oV 3R ltV3R ltRtVtV ;t# )_test.<locals>.TestDialogi  c                sd   < \         SV `  ! V!   \        P                  ! W P                  4       R # )N)r   r   r   Z	EVT_CLOSEOnClose)r   Zargsr   s   &*r   r   Z"_test.<locals>.TestDialog.__init__  s     Gd#LL||,r   c                s   < SP                  4       pVe   \        RVP                  4       .4       V P                  4        R # )NzAFTER:)r,   printZget_textZDestroy)r   Zevntr-   r/   s   && r   r;   Z!_test.<locals>.TestDialog.OnClose  s3    &&(Dx12LLNr    )	r0   r1   r2   r3   r   r;   r6   r7   r8   )r   r9   r/   s   @@r   
TestDialogr:     s     	-	 	r   r>   )SpellCheckerzQThis is sme text with a fw speling errors in it. Here are a fw more to tst it ut.zBEFORE:FZen_USN)	r   Zenchant.checkerr?   r<   r   ZAppr.   ZShowZMainLoop)r>   r?   ZtextZappr-   r/   s        @r   _testr@     sg    	) 	 -^D	9d

&&-C
,C&DHHJLLNr   Z__main__)r4   r5   r   ZDialogr   r@   r0   r=   r   r   <module>rA      sC   @  m 	_299 _D0 z	G r   