-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb738e7
commit c9495e8
Showing
2 changed files
with
87 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,71 @@ | ||
# input | ||
|
||
The `input` class is intended to handle input widget. | ||
The `inputDelegate` class is intended to handle input widget. | ||
|
||
> #### 📌 This class inherit from the [`widget`](widget.md) class | ||
📌 This class inherit from the [`widgetDelegate`](widgetDelegate.md) class | ||
|
||
## Properties | ||
|
||
|Properties|Description| | ||
|----------|-----------| | ||
|**.name** | [*inherited*](formObject.md) | | ||
|**.type** | [*inherited*](formObject.md) | | ||
|**.coordinates** | [*inherited*](formObject.md) | | ||
|**.dimensions** | [*inherited*](formObject.md) | | ||
|**.windowCoordinates** | [*inherited*](formObject.md) | | ||
|**.action** | [*inherited*](widget.md) | | ||
|**.assignable** | [*inherited*](widget.md) | | ||
|**.pointer** | [*inherited*](widget.md) | | ||
|**.value** | [*inherited*](widget.md) | | ||
#### This class is available via the [`formDelegate`](formDelegate.md#objects) class as `input` interface. | ||
|
||
## 🔸 cs.input.new() | ||
```4D | ||
This.form.input.new("formObjectName") | ||
``` | ||
|
||
The class constructor `cs.input.new({formObjectName})` creates a new class instance. | ||
#### This class can also be instantiated on its own. | ||
|
||
```4D | ||
cs. inputDelegate.new({"formObjectName"}) | ||
``` | ||
If the `formObjectName` parameter is ommited, the constructor use the result of **[OBJECT Get name](https://doc.4d.com/4Dv18R6/4D/18-R6/OBJECT-Get-name.301-5198296.en.html)** ( _Object current_ ) | ||
|
||
> 📌 Omitting the object name can only be used if the constructor is called from the object method. | ||
## Summary | ||
## Properties | ||
|
||
All the properties of the extended class, plus: | ||
|
||
> 📌 All functions that return `cs.input` may include one call after another. | ||
|Properties|Description|Type|default|Writable| | ||
|:----------|:-----------|:-----------|:-----------|:-----------:| | ||
|**.asPassword** | Input field as password entry | `Boolean` | **False** | <font color="green">X</font> | ||
|**.filter** | The entry filter | `Integer`\* \| `Text`\* | - | <font color="green">X</font> | ||
|**.placeholder** | The placeholder text | `Text`\*\* | - | <font color="green">X</font> | ||
|**.modified** | Modified state of the field after calling the `backup()` function| `Boolean` | **False** | ||
|
||
## Functions | ||
|
||
All the functions of the extended class, plus: | ||
|
||
| Function | Action | | ||
| -------- | ------ | | ||
|.**highlight** ({start`:Integer`{; end`:Integer`}}) →`:cs.input` | Highlights:<br/>- All text if no parameters are passed<br/>- From `start` to the end of the text if the `end` parameter is omitted<br/>- From `start` to `end` if `start` & `end` are passed | | ||
|.**highlightLastToEnd** () →`:cs.input` | Highlights the text from the last character entered to the end | | ||
|.**highlighted** () →`:Object` | Returns the start & end positions of currently selected text as object: `{ start, end }` | | ||
|.**highlightingStart** () →`:Integer` | Returns the start position of currently selected text | | ||
|.**highlightingEnd** () →`:Integer` | Returns the end position of currently selected text | | ||
|.**highlightingEnd** () →`:Integer` | Returns the end position of currently selected text | | ||
|.**setFilter** ( filter`:Integer`) →`:cs.input`<br/>.**setFilter** ( filter`:Text`) →`:cs.input` | Sets the entry filter for the widget. Use [4D constants](https://doc.4d.com/4Dv19/4D/19/Field-and-Variable-Types.302-5393351.en.html) (ie. _Is date_ or _Is integer_) for default predefined formats or pass the filter definition as text. | | ||
|.**getFilter** () →`:Text` | Returns the current filter associated with the widget if any. | | ||
| -------- | ------ | | ||
|.**getFilter** () → `Text` | Returns the current filter associated with the widget if any. | ||
|.**setFilter** ( filter: `Integer`\*) → `inputDelegate`<br/>.**setFilter** ( filter: `Text`\*) → `inputDelegate` | Sets the entry filter for the widget. | ||
|.**setPlaceholder** ( `Text`\*\*) → `cs.inputDelegate` | Sets the placeholder text | ||
|.**highlight** ({start: `Integer` {; end: `Integer`}}) → `cs.inputDelegate` | Highlights:<br/>* All text if no parameters are passed<br/>* From `start` to the end of the text if the `end` parameter is omitted<br/>* From `start` to `end` if `start` & `end` are passed | ||
|.**highlightLastToEnd** () → `cs.inputDelegate` | Highlights the text from the last character entered to the end | ||
|.**highlighted** () → `Object` | Returns the selection status of the field as a [selection object](#selectionObject). | ||
|.**highlightingStart** () → `Integer` | Returns the start position of currently selected text | ||
|.**highlightingEnd** () → `Integer` | Returns the end position of currently selected text | ||
|**.backup ()** | Stores the current input value. | ||
|
||
|
||
#### <a name="selectionObject">Selection object</a> | ||
|
||
```json | ||
{ | ||
start: (Integer), | ||
end: (Integer), | ||
length: (Integer), | ||
withSeletion: (Boolean), | ||
noSelection: (Boolean), | ||
selection: (Text) | ||
} | ||
``` | ||
|
||
> 📌 All functions that return `cs.inputDelegate` may include one call after another. | ||
---- | ||
|
||
\* Use [4D constants](https://doc.4d.com/4Dv19/4D/19/Field-and-Variable-Types.302-5393351.en.html) (ie. _Is date_ or _Is integer_) for default predefined formats or pass the filter definition as text. Some predefined filters are available: `"url"`, `"email"`, `"noCr"`, `"noSpaceNorCr"` | ||
|
||
\** Accepts an xliff resname, if so, uses the localized string | ||
|
||
\*** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters