diff --git a/comp/src/gb.web.gui/.project b/comp/src/gb.web.gui/.project index 58de5a2d2..d18e3b5a8 100644 --- a/comp/src/gb.web.gui/.project +++ b/comp/src/gb.web.gui/.project @@ -1,6 +1,6 @@ # Gambas Project File 3.0 Title=Web application development using processes as session -Startup=FTestDrawingArea +Startup=Webform1 Icon=.hidden/webform.png Version=3.17.90 VersionFile=1 diff --git a/comp/src/gb.web.gui/.src/Session.module b/comp/src/gb.web.gui/.src/Session.module index 1533e7448..5feacc309 100644 --- a/comp/src/gb.web.gui/.src/Session.module +++ b/comp/src/gb.web.gui/.src/Session.module @@ -46,7 +46,7 @@ Private Sub MakeSessionId() As String If $sPrefix Then sId = $sPrefix & ":" & sId Else - sId = CGI["REMOTE_ADDR"] & ":" & sId + sId = CGI["REMOTE_ADDR"] & ":" & CGI["SERVER_PORT"] & ":" & sId Endif Return sId diff --git a/comp/src/gb.web.gui/.src/Test/Webform1.class b/comp/src/gb.web.gui/.src/Test/Webform1.class index 733af82b7..0cba1b27e 100644 --- a/comp/src/gb.web.gui/.src/Test/Webform1.class +++ b/comp/src/gb.web.gui/.src/Test/Webform1.class @@ -347,3 +347,9 @@ Public Sub WebComboBox1_KeyPress() WebForm.Print("WebComboBox1: keypress: " & Key.Shortcut) End + +Public Sub WebTree1_Activate() + + lblTreeEvent.Text = "Activate: " & WebTree1.Item.Key + +End diff --git a/comp/src/gb.web.gui/.src/Test/Webform1.webform b/comp/src/gb.web.gui/.src/Test/Webform1.webform index a07b4b000..f6e347d8a 100644 --- a/comp/src/gb.web.gui/.src/Test/Webform1.webform +++ b/comp/src/gb.web.gui/.src/Test/Webform1.webform @@ -1,7 +1,7 @@ # Gambas Form File 3.0 { WebForm WebForm - #MoveScaled(0,0,138,91) + #MoveScaled(0,0,133,91) Height = "100%" Arrangement = Arrange.Vertical Shortcuts = ["F11"] @@ -67,7 +67,7 @@ } } { WebTabPanel1 WebTabPanel - #MoveScaled(1,1,136,72) + #MoveScaled(1,1,131,72) Expand = True Arrangement = Arrange.Vertical Margin = True @@ -76,7 +76,7 @@ Index = 0 Text = ("Tab 1") { WebHBox1 WebHBox - #MoveScaled(1,1,133.75,6) + #MoveScaled(1,1,128.75,6) Spacing = True { WebButton1 WebButton #MoveScaled(1,1,11,4) @@ -95,32 +95,32 @@ #MoveScaled(32,1,10,4) } { lblSpinBox WebLabel - #MoveScaled(43,1,17,4) + #MoveScaled(43,1,11,4) Border = True } { WebButton6 WebButton - #MoveScaled(61,1,16,4) + #MoveScaled(55,1,16,4) Text = ("Remove tab 2") } { WebButton2 WebButton - #MoveScaled(78,1,11,4) + #MoveScaled(72,1,11,4) Text = ("Logout") } { WebButton9 WebButton - #MoveScaled(90,1,16,4) + #MoveScaled(84,1,16,4) Text = ("Select first") } { WebButton10 WebButton - #MoveScaled(107,1,10,4) + #MoveScaled(101,1,10,4) Text = ("Bip") } { btnCheck WebButton - #MoveScaled(118,1,11,4) + #MoveScaled(112,1,11,4) Text = ("Check") } } { WebHBox3 WebHBox - #MoveScaled(1,8,133.75,6) + #MoveScaled(1,8,128.75,6) Font = "serif,bold" Spacing = True { WebComboBox1 WebComboBox @@ -153,12 +153,12 @@ } } { WebLabel2 WebLabel - #MoveScaled(1,15,133.75,4) + #MoveScaled(1,15,128.75,4) Text = ("Test label alignment") Alignment = Align.Center } { WebTable1 WebTable - #MoveScaled(1,20,133.75,40) + #MoveScaled(1,20,128.75,40) Expand = True Mode = Select.Multiple Header = WebTable.Both @@ -176,34 +176,34 @@ Index = 1 Text = ("Tab 2") { WebVBox1 WebVBox - #MoveScaled(1,1,133.75,12) + #MoveScaled(1,1,128.75,12) { WebRadioButton1 WebRadioButton - #MoveScaled(1,1,131.75,3) + #MoveScaled(1,1,126.75,3) Text = ("Alpha") } { WebRadioButton2 WebRadioButton - #MoveScaled(1,4,131.75,3) + #MoveScaled(1,4,126.75,3) Text = ("Beta") } { WebRadioButton3 WebRadioButton - #MoveScaled(1,7,131.75,3) + #MoveScaled(1,7,126.75,3) Text = ("Gamma") } } { WebListBox1 WebListBox - #MoveScaled(1,14,133.75,31) + #MoveScaled(1,14,128.75,31) Height = "14em" List = [("Élément 1"), ("Élément 2"), ("Élément 3"), ("Élément 4"), ("Élément 5"), ("Élément 6"), ("Élément 7"), ("Élément 8"), ("Élément 9"), ("Élément 10"), ("Élément 11"), ("Élément 12")] UseHTML = True } { WebTextArea1 WebTextArea - #MoveScaled(1,46,133.75,16) + #MoveScaled(1,46,128.75,16) Height = "8em" } Index = 2 Text = ("Tab 3") { WebHBox2 WebHBox - #MoveScaled(1,1,133.75,6) + #MoveScaled(1,1,128.75,6) Spacing = True { WebCheckBox1 WebCheckBox #MoveScaled(1,1,18,4) @@ -231,13 +231,27 @@ } } { WebImage1 WebImage - #MoveScaled(1,8,133.75,6) + #MoveScaled(1,8,128.75,6) Image = "message/question.png" } { lblTime WebLabel - #MoveScaled(1,15,133.75,4) + #MoveScaled(1,15,128.75,4) Font = "4em" } + { WebHBox5 WebHBox + #MoveScaled(1,20,128.75,22) + { WebVBox2 WebVBox + #MoveScaled(1,1,8,20) + Width = "5em" + Margin = True + Border = True + { WebButton12 WebButton + #MoveScaled(1,1,6,4) + Height = "4em" + Image = "icon:/large/add" + } + } + } Index = 3 Text = ("Tab 4") { WebHBox4 WebHBox @@ -256,7 +270,6 @@ { WebTree1 WebTree #MoveScaled(1,8,133.75,49) Expand = True - Mode = Select.Multiple ShowHeader = True } Index = 0 diff --git a/comp/src/gb.web.gui/.src/Tree/WebTree.class b/comp/src/gb.web.gui/.src/Tree/WebTree.class index cf3842dc9..42b700157 100644 --- a/comp/src/gb.web.gui/.src/Tree/WebTree.class +++ b/comp/src/gb.web.gui/.src/Tree/WebTree.class @@ -157,8 +157,8 @@ Public Sub Clear() $sKey = "" $hSelection.UnSelectAll() $sCursor = "" - $sLastKey = "" $hRoot = New _WebTreeItem("", "") As "Item" + _RefreshView End @@ -938,17 +938,17 @@ Public Sub _IsSelected(sKey As String) As Boolean End -Public Sub _SetSelected(sKey As String, bSelected As Boolean) +Public Sub _SetSelected(sKey As String, bSelected As Boolean, Optional bNoRefresh As Boolean) If $iMode = Select.Single Then If bSelected Then $sKey = sKey - Me.Refresh + If Not bNoRefresh Then Me.Refresh Raise Select Else If $sKey = sKey Then $sKey = "" - Me.Refresh + If Not bNoRefresh Then Me.Refresh Endif Endif Return @@ -1485,9 +1485,7 @@ Public Sub _UpdateProperty(sProp As String, vValue As Variant) Endif Else aProp = Split(Mid$(sProp, 2), ":") - Inc Me._NoRefresh - Try _SetSelected(FromBase64(aProp[0]), vValue) - Dec Me._NoRefresh + Try _SetSelected(FromBase64(aProp[0]), vValue, True) Endif Else If Left(sProp) = "?" Then @@ -1496,14 +1494,12 @@ Public Sub _UpdateProperty(sProp As String, vValue As Variant) Else If Left(sProp) = "$" Then - Inc Me._NoRefresh sKey = FromBase64(Mid$(sProp, 2)) If _IsSelected(sKey) Then - If $iMode = Select.Multiple Then _SetSelected(sKey, False) + If $iMode = Select.Multiple Then _SetSelected(sKey, False, True) Else - _SetSelected(sKey, True) + _SetSelected(sKey, True, True) Endif - Dec Me._NoRefresh Else If sProp Begins "%" Then diff --git a/comp/src/gb.web.gui/.src/WebLabel.class b/comp/src/gb.web.gui/.src/WebLabel.class index 4afd93b07..e8aca33f1 100644 --- a/comp/src/gb.web.gui/.src/WebLabel.class +++ b/comp/src/gb.web.gui/.src/WebLabel.class @@ -29,7 +29,7 @@ End Private Sub GetRenderText() As String If Not $sText Then - Return " " + 'Return " " Else Return Replace(Replace(Html($sText), "\n", "
"), " ", " ") Endif diff --git a/comp/src/gb.web.gui/.src/WebTextArea.class b/comp/src/gb.web.gui/.src/WebTextArea.class index 453ba0f27..8536cfbc6 100644 --- a/comp/src/gb.web.gui/.src/WebTextArea.class +++ b/comp/src/gb.web.gui/.src/WebTextArea.class @@ -58,8 +58,13 @@ End Public Sub _BeforeRender() Print "" @@ -97,15 +101,10 @@ End Public Sub _UpdateProperty(sProp As String, vValue As Variant) - If sProp = "text" Then - SetText(vValue, False) - Else If sProp = "change" Then - SetText(vValue, True) - Endif + If sProp = "text" Then SetText(vValue, True) End - Private Function Wrap_Read() As Boolean Return $bWrap diff --git a/comp/src/gb.web.gui/.src/WebTextBox.class b/comp/src/gb.web.gui/.src/WebTextBox.class index 41cc65449..ac3f19cb2 100644 --- a/comp/src/gb.web.gui/.src/WebTextBox.class +++ b/comp/src/gb.web.gui/.src/WebTextBox.class @@ -53,7 +53,6 @@ Private Sub SetText(Value As String, Optional bNoRefresh As Boolean) End - Private Sub Text_Write(Value As String) SetText(Value) @@ -84,8 +83,12 @@ Public Sub _Render() Print "