C# Class Kimono.KReplace

Inheritance: KFind, IDisposable
Afficher le fichier Open project: 0xd34df00d/Qross

Méthodes publiques

Méthode Description
CloseReplaceNextDialog ( ) : void Close the "replace next?" dialog. The application should do this when the last match was hit. If the application deletes the KReplace, then "find previous" won't be possible anymore.
Dispose ( ) : void
KReplace ( string pattern, string replacement, long options ) : System
KReplace ( string pattern, string replacement, long options, QWidget parent ) : System Only use this constructor if you don't use KFindDialog, or if you use it as a modal dialog.
KReplace ( string pattern, string replacement, long options, QWidget parent, QWidget replaceDialog ) : System This is the recommended constructor if you also use KReplaceDialog (non-modal). You should pass the pointer to it here, so that when a message box appears it has the right parent. Don't worry about deletion, KReplace will notice if the find dialog is closed.
NumReplacements ( ) : int Return the number of replacements made (i.e. the number of times the replace signal was emitted). Can be used in a dialog box to tell the user how many replacements were made. The final dialog does so already, unless you used setDisplayFinalDialog(false).
Replace ( ) : KFind.Result Walk the text fragment (e.g. kwrite line, kspread cell) looking for matches. For each match, if prompt-on-replace is specified, emits the highlight() signal and displays the prompt-for-replace dialog before doing the replace.
Replace ( StringBuilder text, Qyoto.QRegExp pattern, string replacement, int index, long options, int &replacedLength ) : int
Replace ( StringBuilder text, string pattern, string replacement, int index, long options, int &replacedLength ) : int Search the given string, replaces with the given replacement string, and returns whether a match was found. If one is, the replacement string length is also returned. A performance optimised version of the function is provided for use with regular expressions. name="text" The string to search. name="pattern" The pattern to look for. name="replacement" The replacement string to insert into the text. name="index" The starting index into the string. name="options" The options to use. name="replacedLength" Output parameter, contains the length of the replaced string. Not always the same as replacement.length(), when backreferences are used.
ReplaceNextDialog ( ) : Kimono.KDialog
ReplaceNextDialog ( bool create ) : Kimono.KDialog Return (or create) the dialog that shows the "find next?" prompt. Usually you don't need to call this. One case where it can be useful, is when the user selects the "Find" menu item while a find operation is under way. In that case, the program may want to call setActiveWindow() on that dialog.

Méthodes protégées

Méthode Description
CreateProxy ( ) : void
KReplace ( Type dummy ) : System

Private Methods

Méthode Description
DisplayFinalDialog ( ) : void
KReplace ( ) : System
ResetCounts ( ) : void
ShouldRestart ( ) : bool
ShouldRestart ( bool forceAsking ) : bool
ShouldRestart ( bool forceAsking, bool showNumMatches ) : bool

Method Details

CloseReplaceNextDialog() public méthode

Close the "replace next?" dialog. The application should do this when the last match was hit. If the application deletes the KReplace, then "find previous" won't be possible anymore.
public CloseReplaceNextDialog ( ) : void
Résultat void

CreateProxy() protected méthode

protected CreateProxy ( ) : void
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

KReplace() protected méthode

protected KReplace ( Type dummy ) : System
dummy System.Type
Résultat System

KReplace() public méthode

public KReplace ( string pattern, string replacement, long options ) : System
pattern string
replacement string
options long
Résultat System

KReplace() public méthode

Only use this constructor if you don't use KFindDialog, or if you use it as a modal dialog.
public KReplace ( string pattern, string replacement, long options, QWidget parent ) : System
pattern string
replacement string
options long
parent Qyoto.QWidget
Résultat System

KReplace() public méthode

This is the recommended constructor if you also use KReplaceDialog (non-modal). You should pass the pointer to it here, so that when a message box appears it has the right parent. Don't worry about deletion, KReplace will notice if the find dialog is closed.
public KReplace ( string pattern, string replacement, long options, QWidget parent, QWidget replaceDialog ) : System
pattern string
replacement string
options long
parent Qyoto.QWidget
replaceDialog Qyoto.QWidget
Résultat System

NumReplacements() public méthode

Return the number of replacements made (i.e. the number of times the replace signal was emitted). Can be used in a dialog box to tell the user how many replacements were made. The final dialog does so already, unless you used setDisplayFinalDialog(false).
public NumReplacements ( ) : int
Résultat int

Replace() public méthode

Walk the text fragment (e.g. kwrite line, kspread cell) looking for matches. For each match, if prompt-on-replace is specified, emits the highlight() signal and displays the prompt-for-replace dialog before doing the replace.
public Replace ( ) : KFind.Result
Résultat KFind.Result

Replace() public static méthode

public static Replace ( StringBuilder text, Qyoto.QRegExp pattern, string replacement, int index, long options, int &replacedLength ) : int
text StringBuilder
pattern Qyoto.QRegExp
replacement string
index int
options long
replacedLength int
Résultat int

Replace() public static méthode

Search the given string, replaces with the given replacement string, and returns whether a match was found. If one is, the replacement string length is also returned. A performance optimised version of the function is provided for use with regular expressions. name="text" The string to search. name="pattern" The pattern to look for. name="replacement" The replacement string to insert into the text. name="index" The starting index into the string. name="options" The options to use. name="replacedLength" Output parameter, contains the length of the replaced string. Not always the same as replacement.length(), when backreferences are used.
public static Replace ( StringBuilder text, string pattern, string replacement, int index, long options, int &replacedLength ) : int
text StringBuilder
pattern string
replacement string
index int
options long
replacedLength int
Résultat int

ReplaceNextDialog() public méthode

public ReplaceNextDialog ( ) : Kimono.KDialog
Résultat Kimono.KDialog

ReplaceNextDialog() public méthode

Return (or create) the dialog that shows the "find next?" prompt. Usually you don't need to call this. One case where it can be useful, is when the user selects the "Find" menu item while a find operation is under way. In that case, the program may want to call setActiveWindow() on that dialog.
public ReplaceNextDialog ( bool create ) : Kimono.KDialog
create bool
Résultat Kimono.KDialog