summaryrefslogtreecommitdiff
path: root/examples/raygui_extensions
diff options
context:
space:
mode:
Diffstat (limited to 'examples/raygui_extensions')
-rw-r--r--examples/raygui_extensions/main.lua1
-rw-r--r--examples/raygui_extensions/tree_view.lua13
2 files changed, 3 insertions, 11 deletions
diff --git a/examples/raygui_extensions/main.lua b/examples/raygui_extensions/main.lua
index f47d396..6efa18d 100644
--- a/examples/raygui_extensions/main.lua
+++ b/examples/raygui_extensions/main.lua
@@ -249,7 +249,6 @@ end
local function addTreeView()
TreeView = Gui:TreeView(
Rect:new( 600, 20, 256, 328 ),
- -- Rect:new( 600, 20, 256, 600 ),
"Tree View",
function( controls ) selected( controls ) end, -- Callback.
function( self ) Gui:set2Top( self ) end, -- Grab callback.
diff --git a/examples/raygui_extensions/tree_view.lua b/examples/raygui_extensions/tree_view.lua
index 05e5ac5..5b231be 100644
--- a/examples/raygui_extensions/tree_view.lua
+++ b/examples/raygui_extensions/tree_view.lua
@@ -197,7 +197,6 @@ function TreeView:itemSelect( item )
for i = #self.selectedItems, 1, -1 do
local moveItem = self.selectedItems[i]
- -- print( moveItem.text, "moveItem._id", moveItem._id, item.text, "item._id", item._id )
if moveItem ~= item and not self:isChild( moveItem, item ) then
local parentControls = self.controls
@@ -206,13 +205,7 @@ function TreeView:itemSelect( item )
parentControls = moveItem._parent.controls
end
- local pos = #self.selectedItems - i + 1
-
- if moveItem._parent == item._parent and moveItem._childId < item._childId then
- pos = 1
- end
-
- table.insert( moveItems, pos, table.remove( parentControls, moveItem._childId ) )
+ table.insert( moveItems, table.remove( parentControls, moveItem._childId ) )
end
moveItem.active = false
@@ -228,7 +221,7 @@ function TreeView:itemSelect( item )
local offset = 0
if moveItem._parent == item._parent and moveItem._childId < item._childId then
- offset = -1
+ offset = -#moveItems
end
if self._movingItem == self.MOVE_ITEM_IN then
@@ -270,7 +263,7 @@ function TreeView:itemSelect( item )
end
if self.callback ~= nil then
- self.callback( self.selectedItems )
+ -- self.callback( self.selectedItems )
end
end