iOS Switch v2.0.0
1 - Presentation & features
This add-on based on the famous iOS switch allows you to add style and fluid animation to the ergonomics of the radio buttons in your FileMaker solutions!
Simply made with a web viewer, it is possible to configure the web viewer completely independently with a simple copy and paste. Responsive, the size is determined by the size of the web viewer.
Features :
- Modification of the value of an item according to 2 configurable values
- Horizontal or vertical orientation
- Value recovery
- Display of values in the switch
- Customization of the background color of the 2 switch positions
- Customization of the background color of the web viewer
- Responsive size
- No context needed
2 - Configuration / Parameters
2.1 Configuration
The add-on can work without any context thanks by using the global field IUD_iOSSwitch::gct_WV_FinalCode
.
- Copy and paste the web viewer containing the add-on calculation formula on the desired model.
- Modify the _fieldName parameter in the web viewer calculation, to specify the field that will receive the color code.
- Modify the other parameters.
Example of code associated with the web viewer :
Let (
[
_fieldName = GetFieldName ( "**Copiez votre rubrique cible ici**" ) ;
_valueList = "0¶1" ;
_1stValue_Color = "#F1F1F1";
_2ndValue_Color = "#8ce196" ;
_showLabel = 0 ;
_background_Color = "#FFFFFF" ;
_orientation = "horizontal";
_verticalTextOrientation = "";
_fieldValue = GetField ( _fieldName ) ;
_1stValue_FontColor = IUDATA_DarkenColorHEX ( _1stValue_Color ; 100 );
_2ndValue_FontColor = IUDATA_DarkenColorHEX ( _2ndValue_Color ; 100 );
_1stValue = GetValue ( _valueList ; 1 ) ;
_2ndValue = GetValue ( _valueList ; 2 ) ;
_1stValue_Label = Case ( _showLabel ; _1stValue ; "" ) ;
_2ndValue_Label = Case ( _showLabel ; _2ndValue ; "" ) ;
_isChecked = Case (
_fieldValue = _1stValue ; "0" ;
_fieldValue = _2ndValue ; "1" ;
"0"
);
_jsTab = "['" & _1stValue & "','" & _2ndValue & "']";
_Code = z_IUD_IOSSWITCH::gct_WV_FinalCode ;
_FinalCode = Substitute ( _Code ;
[ "{{fieldName}}" ; _fieldName ];
[ "{{isChecked}}" ; _isChecked ];
[ "{{listValue}}" ; _jsTab ] ;
[ "{{leftValue}}" ; _1stValue_Label ] ;
[ "{{rightValue}}" ; _2ndValue_Label ];
[ "{{color1}}" ; _1stValue_Color ] ;
[ "{{color2}}" ; _2ndValue_Color ];
[ "{{fontColor1}}" ; _1stValue_FontColor ];
[ "{{fontColor2}}" ; _2ndValue_FontColor ];
[ "{{orientation}}" ; _orientation ];
[ "{{vertical-text-orientation}}" ; _verticalTextOrientation ];
[ "{{background_Color}}" ; _background_Color ]
)
]
;
Case (
Get ( SystemPlatform ) = 4 ;
"data:text/html;base64," & Base64EncodeRFC ( 4648 ; _FinalCode ) ;
"data:text/html;charset=utf-8,¶" & _FinalCode
)
)
Please note : If your database on which you want to install the add-on is hosted with FileMaker Server. You might need to refresh the globale calculation field IUD_iOSSwitch::gct_WV_FinalCode
. Otherwise the webviewer that contains the add-on will remain empty. To refresh this field, you can set the field IUD_iOSSwitch::WV_HTML
by it's own value inside a script that is launch at the start of your application.
2.2 Parameters
Editable parameter values :
⚠️ if you modify the names of the parameters, you will have to report your modifications to _finalCode
if necessary
_fieldName
: Field linked to the switch. Define the switch's default value, and the value modified by the switch. Text value._valueList
: Use to define the 2 values of the switch. 2 values seperate by a carriage returns._1stValue_Color
: Switch 1st value's background color. Hexadecimal value like "#FFFFFF" or with an existing css color name like "white"._2ndValue_Color
: Switch 2nd value's background color. Hexadecimal value like "#FFFFFF" or with an existing css color name like "white"._showLabel
: Allows to show or not the value's label. 1 / 0 or empty._orientation
: Use to define the switch orientation. horizontal or vertical._verticalTextOrientation
: Use to define the text orientation in vertical mode. empty, mixed or upright._background_Color
: Web viewer's background color. Hexadecimal value like "#FFFFFF" or with an existing css color name like "white" or empty.
⚠️ Parameters not to be modified :
_fieldValue
: calculation of the_fieldName
value parameter._1stValue_FontColor
: calculation of the 1st value's font color._2ndValue_FontColor
: calculation of the 2st value's font color._1stValue
: calculation of the_valueList
1st value._2ndValue
: calculation of the_valueList
2nd value._1stValue_Label
: label of the 1st value._2ndValue_Label
: label of the 2nd value._isChecked
: default state of the switch._jsTab
: parameter for the web viewer calculation._code
: HTML code of the iOS Switch contained in the global fieldIUD_iOSSwitch::gct_WV_FinalCode
._finalCode
: Final HTML code of iOS Switch, value of_code
with the replacement of previous parameters.
3 - Tables / Scripts / Custom functions / Value lists
3.1 - Tables
z_IUD_IOSSWITCH
: Table containing the definition of the add-on
3.2 - Scripts
IUD_fmps_iOSSwitch_check
: Script called from the web viewer to retrieve the value
3.3 - Custom functions
Descriptions of the following functions can be found in their calculation definition.
IUDATA_HexToRGB ( __HexColor ; __Option )
IUDATA_RGBToHex ( __R ; __G ; __B )
IUDATA_DarkenColorHEX ( __colorHEX ; __delta )
3.4 - Value lists
No value list in this add-on.
4 - Dependencies
No dependencie in this add-on.
5 - Compatibility
Operating systems :
- macOS Monterey 12.0
- macOS Big Sur 11.0
- macOS Catalina 10.15
- macOS Mojave 10.14
- Windows 8.1 64-bit
- Windows 10 64-bit
FileMaker :
- Claris FileMaker Pro 19 or greater
- Claris FileMaker Go 19 or greater
FileMaker WebDirect :
- All browser compatible with WebDirect using the add-on on a hosted file by Claris FileMaker Server 19.3 or greater
Please note that on FileMaker Go 19 Switch activation inside the web viewer require a double tap.
6 - End User Licence Agreement
Important Note: Please read this EULA carefully. Downloading, installing, using or modifying this add-on signifies that the end user and their organization accept this EULA.
Definitions :
- The add-on is iOS Switch v2.0.0.
- The end user is the physical person who purchased the add-on on IU-DATA's website.
- The organization is the structure or the company for which the end user works.
- The household refers to the end user's family home.
Contract terms :
IU-DATA authorizes the end user and his organization or household to use, modify, copy the add-on at their convenience. IU-DATA authorizes the end user and his organization to use for commercial purposes the add-on, when the add-on is an integral part of a solution whose spectrum of use is much wider than that defined by the functionalities of the add-on alone. On the other hand, IU-DATA does not authorize the end user and his organization to use for commercial or distribution purposes the add-on, modified or not as a final product.
The end user and his organization / household have free assistance for a period of 2 months from the date of purchase of this add-on, for any questions related to the use and configuration of this add-on.
Full access to FileMaker sources as well as to the source code used in the web viewer gives to the end user and his organization / household full control over modifying this add-on. It is therefore natural that we cannot intervene free of charge on the add-on whose code has been altered compared to the original version that IU-DATA delivered. Likewise, IU-DATA cannot be held responsible for any malfunction of any libraries mentioned in paragraph 4 - Dependencies, as well as malfunctions of the add-on following use on an operating system or a FileMaker platform other than those mentioned in paragraph 5 - Compatibility.
Contact :
For any questions, please contact us to this address: [email protected]
7 - Credits
Creation and development :
- Julien Rouard from IU-DATA
Icon design :
- Christophe Gilet from Gilet Design
8 - Change Log
01/01/2022 - iOS Switch v2.0.0 - Add orientation and vertical text orientation parameters and Webdirect compatibilty
16/02/2021 - iOS Switch v1.0.0 - 1st release