diff options
Diffstat (limited to 'client/widgets/lineedit.h')
-rw-r--r-- | client/widgets/lineedit.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/client/widgets/lineedit.h b/client/widgets/lineedit.h index 650924c..e76fe74 100644 --- a/client/widgets/lineedit.h +++ b/client/widgets/lineedit.h @@ -37,6 +37,11 @@ * @extends widget * @screenshot * The lineedit is a single line textual input field. + * @example Simple example of usage: + * <lineedit name="myname" value="some text"/> + * @example A more advanced example: + * <lineedit name="myname" value="some text" readonly="true" + * onChange="this:setValue('['..this:value()..']')"/> * @att readonly Make the lineedit readonly (not changeable by the user), but * still able to select and copy text. */ @@ -77,18 +82,31 @@ private: /*** * @method nil clearSuggestions() * This method clears the suggestion list. + * For an example see @see showSuggestions(). */ int lin_clear_suggestions(lua_State *L); /*** * @method nil showSuggestions() * This method forces showing of the suggestion list. + * @example Example of suggestion usage: + * function myOnChange() + * if(isSuggested(this:value()) == false) + * then + * this:clearSuggestions() + * this:addSuggestion(this:value() .. 'abc') + * this:addSuggestion(this:value() .. 'abd') + * this:addSuggestion(this:value() .. 'acd') + * this:showSuggestions() + * end + * end */ int lin_show_suggestions(lua_State *L); /*** - * @method boolean isSuggested(string value, boolean joker) + * @method boolean isSuggested(string value) * This method makes a lookup in the suggestion list, searching for value. + * For an example see @see showSuggestions(). * @param value A string containing the text to look for in the suggestion list. * @return a boolean with the value true if the string was found, false * if not. @@ -99,7 +117,8 @@ int lin_is_suggested(lua_State *L); * @method nil addSuggestion(string suggestion) * Adds a suggestion to the suggestion list. The list is popped up each time * a character is entered into the lineedit by the user, or it is explicitly - * opened by calling @ref showSuggestions(). + * opened by calling @see showSuggestions(). + * For an example see @see showSuggestions(). * @param suggestion A string containing the value to be added to the * suggestion list. */ |