From b6becf78b85c6512b42d1f8cbaba89943e1e23fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 11 Jun 2016 14:20:20 +0000 Subject: [PATCH] [GB.WEB.FORM] * NEW: WebCheckBox: Default event is "Click". * NEW: WebRadioButton: Default event is "Click". * NEW: WebControl: Add as specific class for disabled controls. * NEW: WebControl.Enabled now return FALSE as soon as a parent is disabled. * NEW: Disabled look for WebRadioButton and WebCheckBox. * BUG: WebSpinBox minimum height is the same as WebTextBox. git-svn-id: svn://localhost/gambas/trunk@7799 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.web.form/.info | 8 ++++++++ comp/src/gb.web.form/.src/WebCheckBox.class | 1 + comp/src/gb.web.form/.src/WebControl.class | 5 ++++- comp/src/gb.web.form/.src/WebRadioButton.class | 1 + comp/src/gb.web.form/style.css | 13 +++++++++++++ 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/comp/src/gb.web.form/.info b/comp/src/gb.web.form/.info index 6086ebf01..788e272b1 100644 --- a/comp/src/gb.web.form/.info +++ b/comp/src/gb.web.form/.info @@ -219,6 +219,10 @@ _Similar C s "WebButton" +_DefaultEvent +C +s +"Click" :Click : @@ -1332,6 +1336,10 @@ _Similar C s "WebButton" +_DefaultEvent +C +s +"Click" :Click : diff --git a/comp/src/gb.web.form/.src/WebCheckBox.class b/comp/src/gb.web.form/.src/WebCheckBox.class index 6a2a8b9e9..e008a6179 100644 --- a/comp/src/gb.web.form/.src/WebCheckBox.class +++ b/comp/src/gb.web.form/.src/WebCheckBox.class @@ -7,6 +7,7 @@ Public Const _Properties As String = "*,Text,Value" Public Const _DrawWith As String = "CheckBox" Public Const _DefaultSize As String = "24,4" Public Const _Similar As String = "WebButton" +Public Const _DefaultEvent As String = "Click" Event Click diff --git a/comp/src/gb.web.form/.src/WebControl.class b/comp/src/gb.web.form/.src/WebControl.class index baeaa5971..c8b6ffa27 100644 --- a/comp/src/gb.web.form/.src/WebControl.class +++ b/comp/src/gb.web.form/.src/WebControl.class @@ -253,6 +253,7 @@ Public Sub _GetClassId(Optional sClass As String) As String If Not sClass Then sClass = "gw-" & LCase(Mid$(Object.Type(Me), 4)) If $bNoBorder Then sClass &= " gw-noborder" + If Not Me.Enabled Then sClass &= " gw-disabled" If $sClass Then sClass &= " " & $sClass sResult = " class=\"" & sClass & "\" id=\"" & $sName & "\"" If $sTooltip Then sResult &= " title=\"" & Replace($sTooltip, Chr$(34), """) & "\"" @@ -630,7 +631,9 @@ End Private Function Enabled_Read() As Boolean - Return Not $bDisabled + If $bDisabled Then Return + If $iParentId = 0 Then Return True + Return Parent_Read().Enabled End diff --git a/comp/src/gb.web.form/.src/WebRadioButton.class b/comp/src/gb.web.form/.src/WebRadioButton.class index f9aabeaf1..668447fe4 100644 --- a/comp/src/gb.web.form/.src/WebRadioButton.class +++ b/comp/src/gb.web.form/.src/WebRadioButton.class @@ -7,6 +7,7 @@ Public Const _Properties As String = "*,Text,Value" Public Const _DrawWith As String = "RadioButton" Public Const _DefaultSize As String = "24,4" Public Const _Similar As String = "WebButton" +Public Const _DefaultEvent As String = "Click" Event Click diff --git a/comp/src/gb.web.form/style.css b/comp/src/gb.web.form/style.css index 6601bdadc..4c1cc9856 100644 --- a/comp/src/gb.web.form/style.css +++ b/comp/src/gb.web.form/style.css @@ -122,6 +122,14 @@ P:first-child,UL:first-child,OL:first-child { vertical-align: middle; } +.gw-checkbox.gw-disabled > .gw-checkbox-label { + opacity: 0.5; +} + +.gw-radiobutton.gw-disabled > .gw-checkbox-label { + opacity: 0.5; +} + .gw-checkbox-toggle,.gw-radiobutton-toggle { vertical-align: middle; margin: 0; @@ -273,6 +281,10 @@ P:first-child,UL:first-child,OL:first-child { text-overflow: ellipsis; } +.gw-label.gw-disabled { + opacity: 0.5; +} + #gw-modal { display: none; position: fixed; @@ -453,6 +465,7 @@ P:first-child,UL:first-child,OL:first-child { } .gw-spinbox { + min-height: 2rem; padding: 0 0.25em; }