From d7044d310387d3752774831c1a8a768c0ca1ed67 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 29 Mar 2011 10:04:47 +0000 Subject: Examples in docs. --- client/widgets/lineedit.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'client/widgets/lineedit.h') 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: + * + * @example A more advanced example: + * * @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. */ -- cgit v1.2.3