WebListBox: Fix behaviour in multiple selection mode.
[GB.WEB.GUI] * BUG: WebListBox: Fix behaviour in multiple selection mode. * BUG: Fix how the executable path is forged.
This commit is contained in:
parent
f5dbf4074e
commit
5675853767
4 changed files with 16 additions and 9 deletions
|
@ -199,7 +199,7 @@ Public Sub GetCurrent() As Integer
|
|||
|
||||
Dim iCurrent As Integer
|
||||
|
||||
If $aSel.Count = 2 Then
|
||||
If $aSel.Count = 2 And $aSel[1] = 1 Then
|
||||
iCurrent = $aSel[0]
|
||||
If iCurrent < GetItemCount() Then Return iCurrent
|
||||
Endif
|
||||
|
|
|
@ -197,6 +197,7 @@ Static Public Sub Main()
|
|||
Dim sVar As String
|
||||
Dim hLock As File
|
||||
Dim iPid As Integer
|
||||
Dim sExec As String
|
||||
|
||||
sTemp = Session.Path
|
||||
|
||||
|
@ -337,7 +338,12 @@ Static Public Sub Main()
|
|||
sCookie = Session.Create()
|
||||
Try hLock = Lock sTemp &/ sCookie & ".lock" Wait 10
|
||||
|
||||
If Not Exist(Application.Path &/ Args[0]) Then
|
||||
PrintLog("EXEC Application.Path = " & Application.Path)
|
||||
PrintLog("EXEC Args = " & Args.All.Join(" | "))
|
||||
|
||||
sExec = Application.Path &/ File.Name(Args[0])
|
||||
|
||||
If Not Exist(sExec) Then
|
||||
If Class.IsLoaded("Debug") Then
|
||||
PrintLog("---------------- EXEC gbx3 -g -f " & Debug.Fifo & " " & Application.Path & " -- " & Application.Handle & " " & sCookie)
|
||||
hProcess = Exec ["gbx3", "-g", "-f", Debug.Fifo, Application.Path, "--", Application.Handle, sCookie] Wait
|
||||
|
@ -346,8 +352,8 @@ Static Public Sub Main()
|
|||
hProcess = Exec ["gbx3", Application.Path, "--", Application.Handle, sCookie] Wait
|
||||
Endif
|
||||
Else
|
||||
PrintLog("---------------- EXEC " & Application.Path &/ Args[0] & " " & Application.Handle & " " & sCookie)
|
||||
hProcess = Exec [Application.Path &/ Args[0], Application.Handle, sCookie] Wait
|
||||
PrintLog("---------------- EXEC " & sExec & " " & Application.Handle & " " & sCookie)
|
||||
hProcess = Exec [sExec, Application.Handle, sCookie] Wait
|
||||
Endif
|
||||
|
||||
While Not Exist(sTemp &/ sCookie, True)
|
||||
|
|
|
@ -65,9 +65,7 @@ Public Sub _Render()
|
|||
Print "<div";
|
||||
If IsSelected(I) Then Print " class=\"gw-selected\"";
|
||||
If $iMode Then
|
||||
Print " onmousedown=\"gw.listbox.select("; JS(Me.Name); ","; I;
|
||||
If $iMode = Select.Multiple Then Print ",event";
|
||||
Print ");\"";
|
||||
Print " onmousedown=\"gw.listbox.select("; JS(Me.Name); ","; I; ",event,"; JS($iMode = Select.Multiple); ");\"";
|
||||
Endif
|
||||
If Object.CanRaise(Me, "Activate") Then Print Me._GetEventJS("ondblclick", "Activate");
|
||||
|
||||
|
|
|
@ -1503,14 +1503,17 @@ gw = {
|
|||
gw.update(id, checked ? '+' : '-', [start, end - start + 1]);
|
||||
},
|
||||
|
||||
select: function(id, row, event)
|
||||
select: function(id, row, event, multiple)
|
||||
{
|
||||
var items = $(id).children;
|
||||
var elt = items[row];
|
||||
var last = $(id).gw_current;
|
||||
var selected = !elt.hasClass('gw-selected');
|
||||
|
||||
if (event)
|
||||
if (event.detail == 2)
|
||||
return;
|
||||
|
||||
if (multiple)
|
||||
{
|
||||
if (event.shiftKey && last)
|
||||
gw.listbox.selectRange(id, last, row, selected);
|
||||
|
|
Loading…
Reference in a new issue