Changes between Version 3 and Version 4 of code/doc/ArgumentCompletionFunctions
- Timestamp:
- Apr 12, 2017, 10:32:47 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/doc/ArgumentCompletionFunctions
v3 v4 1 1 = !ArgumentCompletionFunctions = 2 [[TracNav(TracNav/TOC_Development)]]3 2 4 3 == Description == 5 An ArgumentCompletionFunction returns an [wiki:ArgumentCompletionList] used by the [wiki:CommandExecutor] to complete arguments of a [wiki:ConsoleCommand]. To bind anArgumentCompletionFunction to an argument, an [wiki:ArgumentCompleter] is use.4 An !ArgumentCompletionFunction returns an [wiki:ArgumentCompletionList] used by the [wiki:CommandExecutor] to complete arguments of a [wiki:ConsoleCommand]. To bind an !ArgumentCompletionFunction to an argument, an [wiki:ArgumentCompleter] is use. 6 5 7 6 == Arguments == 8 An ArgumentCompletionFunction may take several parameters. The first parameter is the currently given argument fragment, the second parameter is the last finished argument, the third parameter is the second last finished argument etc.7 An !ArgumentCompletionFunction may take several parameters. The first parameter is the currently given argument fragment, the second parameter is the last finished argument, the third parameter is the second last finished argument etc. 9 8 10 9 Example: … … 15 14 }}} 16 15 17 Then the ArgumentCompletionFunction of the fourth argument gets called the following way:16 Then the !ArgumentCompletionFunction of the fourth argument gets called the following way: 18 17 {{{ 19 18 ac_function(fragment, argument3, argument2, argument1); … … 23 22 24 23 == Usage == 25 === Defining a new ArgumentCompletionFunction ===24 === Defining a new !ArgumentCompletionFunction === 26 25 In {{{core/ArgumentCompletionFunctions.h}}} write: 27 26 {{{ … … 33 32 }}} 34 33 35 === Implementing a new ArgumentCompletionFunction ===34 === Implementing a new !ArgumentCompletionFunction === 36 35 In {{{core/ArgumentCompletionFunctions.cc}}} write: 37 36 {{{ … … 59 58 } 60 59 }}} 61 Note: ''lowercase'' and ''display'' in the constructor of ArgumentCompletionListElement are optional. If not specified, the first string (''argument'') is used.60 Note: ''lowercase'' and ''display'' in the constructor of !ArgumentCompletionListElement are optional. If not specified, the first string (''argument'') is used. 62 61 63 62 == Example ==