[GB.WEB.FORM]

* NEW: WebMenuBar is a new control that acts as a container of WebMenu controls. It was made as a workaround of the badly designed CSS specifications of the overflow property. It may be removed if I find a way to use the WebHBox instead.
* NEW: WebComboBox: Activate waiting animation when selecting an item.
* BUG: WebForm: They can be resized horizontally again.
* BUG: WebForm: Top level form titlebar is now correctly highlighted again.


git-svn-id: svn://localhost/gambas/trunk@8111 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2017-03-18 12:18:50 +00:00
parent 1184d41881
commit f184669d7e
17 changed files with 73 additions and 32 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

View file

@ -732,6 +732,10 @@ _GetUpdateJS
m
s
(sEvent)s(sProp)s[(sGetValue)s(sMore)s]
_GetUpdateWaitJS
m
s
(sEvent)s(sProp)s[(sGetValue)s(sMore)s]
_UpdateProperty
m
@ -1370,6 +1374,25 @@ _UpdateProperty
m
(sProp)s(vValue)v
#WebMenuBar
WebContainer
C
_Properties
C
s
"*,-Arrangement"
_DefaultArrangement
C
s
"H"
_Similar
C
s
"WebContainer"
_new
m
#WebMenuItem
WebControl
C

View file

@ -20,6 +20,7 @@ WebHtml!
WebImage!
WebLabel!
WebMenu!
WebMenuBar!
WebMenuItem!
WebProgressBar!
WebRadioButton!

View file

@ -1,6 +1,6 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.9.90
Startup=FTestWebUploader
Startup=Webform2
UseHttpServer=1
Version=3.9.90
VersionFile=1

View file

@ -10,7 +10,7 @@ End
Public Sub WebButton1_Click()
WebTabPanel1.Index = 1 - WebTabPanel1.Index
WebTabPanel1.Index = 1
End
@ -129,7 +129,7 @@ End
Public Sub WebForm_Message(Source As WebControl, Action As String)
Debug "Action '"; Action; "' on '"; Source.Name; "'"
'Debug "Action '"; Action; "' on '"; Source.Name; "'"
End

View file

@ -5,15 +5,11 @@
Height = "100%"
Arrangement = Arrange.Vertical
Title = ("This is webform2")
{ WebSeparator8 WebSeparator
#MoveScaled(1,1,136,3)
Height = "1px"
}
{ WebHBox1 WebHBox
#MoveScaled(1,4,136,17)
{ WebMenuBar1 WebMenuBar
#MoveScaled(1,1,136,48)
Spacing = True
{ WebMenu3 WebMenu
#MoveScaled(1,1,32,15)
#MoveScaled(1,1,32,46)
Text = ("File")
{ WebMenuItem7 WebMenuItem
#MoveScaled(1,1,30,4)
@ -66,7 +62,7 @@
}
}
{ WebMenu1 WebMenu
#MoveScaled(34,1,30,15)
#MoveScaled(34,1,30,46)
Text = ("Project")
{ WebMenuItem2 WebMenuItem
#MoveScaled(1,1,28,4)
@ -97,10 +93,9 @@
}
}
{ WebContainer1 WebHBox
#MoveScaled(1,21,136,6)
#MoveScaled(1,49,136,6)
{ WebButton1 WebButton
#MoveScaled(1,1,13,4)
Border = False
Text = ("A button")
}
{ WebButton2 WebButton
@ -132,7 +127,7 @@
}
}
{ WebContainer9 WebContainer
#MoveScaled(1,27,136,88)
#MoveScaled(1,55,136,88)
Expand = True
Arrangement = Arrange.Vertical
Margin = True

View file

@ -64,7 +64,7 @@ Public Sub _Render()
Print "<div class=\"gw-combobox-arrow\">";
Endif
Print "<select id=\""; Me.Name; "-select\" autocomplete=\"off\""; Me._GetUpdateJS("onchange", "index", "this.selectedIndex");
Print "<select id=\""; Me.Name; "-select\" autocomplete=\"off\""; Me._GetUpdateWaitJS("onchange", "index", "this.selectedIndex");
If Not Me.Enabled Then Print " disabled";
Print ">"

View file

@ -161,7 +161,7 @@ Public Sub _RenderStyleSheet()
Select Case $iArrangement
Case Arrange.Horizontal
Me._AddStyleSheet("flex-flow:row;")
Me._AddStyleSheet("overflow:hidden;")
Me._AddStyleSheet("overflow-x:hidden;")
Case Arrange.Vertical
Me._AddStyleSheet("flex-flow:column;")
Case Arrange.Column

View file

@ -569,18 +569,18 @@ End
Public Sub _GetUpdateJS(sEvent As String, sProp As String, Optional sGetValue As String = "null", Optional sMore As String) As String
Dim sStr As String
sStr = " " & sEvent & "=\"gw.update(" '& JS(Me.Form.Name) & ","
'If Me Is WebForm Then
' sStr &= "null"
'Else
sStr &= JS($sName)
'Endif
sStr &= "," & JS(sProp) & "," & sGetValue & ");"
sStr = " " & sEvent & "=\"gw.update(" & JS($sName) & "," & JS(sProp) & "," & sGetValue & ");"
If sMore Then sStr &= sMore
sStr &= "\""
Return sStr & "\""
Return sStr
End
Public Sub _GetUpdateWaitJS(sEvent As String, sProp As String, Optional sGetValue As String = "null", Optional sMore As String) As String
Dim sStr As String
sStr = " " & sEvent & "=\"gw.updateWait(" & JS($sName) & "," & JS(sProp) & "," & sGetValue & ");"
If sMore Then sStr &= sMore
Return sStr & "\""
End

View file

@ -285,7 +285,7 @@ End
Public Sub Render()
Dim sImage As Variant
Dim sImage As String
Response.Buffered = True
Response.Begin

View file

@ -18,7 +18,7 @@ Private $sImage As String
Public Sub _new()
Me.Arrangement = Arrange.Vertical
'Me.Arrangement = Arrange.Vertical
End

View file

@ -0,0 +1,14 @@
' Gambas class file
Export
Inherits WebContainer
Public Const _Properties As String = "*,-Arrangement"
Public Const _DefaultArrangement As String = "H"
Public Const _Similar As String = "WebContainer"
Public Sub _new()
Me.Arrangement = Arrange.Horizontal
End

View file

@ -124,7 +124,7 @@ Public Sub _Render()
Print "\" style=\"display:flex;flex-flow:row;\">"
For I = 0 To $aTab.Max
Print "<div class=\""; If(I = $iIndex, "gw-tab-selected", "gw-tab"); "\"";
If I <> $iIndex Then Print Me._GetUpdateJS("onclick", "index", CStr(I));
If I <> $iIndex Then Print Me._GetUpdateWaitJS("onclick", "index", CStr(I));
Print ">"; $aText[I]; "</div>"
Next
Print "</div>"

View file

@ -59,7 +59,7 @@ Public Sub _RenderStyleSheet()
If $sWidth Then
Me._AddStyleSheet("width:" & $sWidth & ";")
Me._AddStyleSheet("max-width:" & $sWidth & ";")
'Me._AddStyleSheet("max-width:" & $sWidth & ";")
Endif
If $sHeight Then Me._AddStyleSheet("height:" & $sHeight & ";")

View file

@ -1,4 +1,4 @@
FTestWebUploader
Webform2
0
0

View file

@ -329,6 +329,11 @@ gw = {
gw.send(['update', id, prop, value, true], after);
},
updateWait: function(id, prop, value, after)
{
gw.send(['update', id, prop, value, false], after);
},
command: function(action)
{
gw.send(null, action);
@ -697,7 +702,7 @@ gw = {
{
var i, win, last;
for (i = 0; i < gw.windows.length - 1; i++)
for (i = 0; i < gw.windows.length; i++)
{
win = gw.windows[i];
if ($(win).gw_popup)

View file

@ -400,6 +400,9 @@ P:first-child,UL:first-child,OL:first-child {
border: none;
}
.gw-menubar {
overflow: visible !important;
}
.gw-menu-title {
display: inline-table;