Hi all:
After searching here in forum and reading the IR help file, Im blocked about one problem as title says. The explanation is as follow:
- AMS 8 version:
8.3.0.0. I know, there is out a new version (currently is 8.5.0.0), but I will not purchase it until Win 10 is released in summer.
- Description of the project:
I have a listbox with multiple select enabled, list mode and listbox's checkboxes enabled.
In that listbox is filled all files found in a "file.find" action for each folder (3 folders with files). This action is perfomed by using one combobox. The combobox stores 1 folder per item that is used to search those files stored in. And finally a button where gets all items checked from listbox to copy to a "x" path or folder to copy all selected files.
- Description of the problem:
If you select a list from combobox I can see correctly all files found on listbox from a specified folder. You select a item from combobox from another items all is okay an so on. Once I picked a item up (or more than one item) by checking his checkbox associated to that item for then install later.
I click the button copy or install by usin the "file.copy" action to a desired folder. All is okay, no problem.
The problem is if you repeat this operation by selecting another item from combobox and then you do all operations I explained above, no error is thrown to screen. Only the combobox once selected one item to search files from a folder, the listbox does not load the found content.
- Code I used to do this task:
* Global functions:
* On Show Event:
*On Select from Combobox1 object:
*On Select from Button1 object (Here's I think it could be the problem):
Am I doing something wrong? where's the problem I did several ways of coding with not success I think I am missing something here?.
Sorry for the long post I needed to be clear with the idea, my english is well, normal but not good. Thanks.
After searching here in forum and reading the IR help file, Im blocked about one problem as title says. The explanation is as follow:
- AMS 8 version:
8.3.0.0. I know, there is out a new version (currently is 8.5.0.0), but I will not purchase it until Win 10 is released in summer.
- Description of the project:
I have a listbox with multiple select enabled, list mode and listbox's checkboxes enabled.
In that listbox is filled all files found in a "file.find" action for each folder (3 folders with files). This action is perfomed by using one combobox. The combobox stores 1 folder per item that is used to search those files stored in. And finally a button where gets all items checked from listbox to copy to a "x" path or folder to copy all selected files.
- Description of the problem:
If you select a list from combobox I can see correctly all files found on listbox from a specified folder. You select a item from combobox from another items all is okay an so on. Once I picked a item up (or more than one item) by checking his checkbox associated to that item for then install later.
I click the button copy or install by usin the "file.copy" action to a desired folder. All is okay, no problem.
The problem is if you repeat this operation by selecting another item from combobox and then you do all operations I explained above, no error is thrown to screen. Only the combobox once selected one item to search files from a folder, the listbox does not load the found content.
- Code I used to do this task:
* Global functions:
Code:
[COLOR="blue"][B][FONT="Tahoma"]function ReloadCB() ComboBox.ResetContent("ComboBox1"); CB_NamePack = {} CB_NamePack[1] = "PLANE PACKS"; CB_NamePack[2] = "CAR PACKS"; CB_NamePack[3] = "TRUCK PACKS"; for i, vItem in pairs (CB_NamePack) do ComboBox.AddItem("ComboBox1", vItem, ""); end end[/FONT][/B][/COLOR]
* On Show Event:
Code:
[COLOR="blue"][B][FONT="Tahoma"]ReloadCB()[/FONT][/B][/COLOR]
Code:
[COLOR="blue"][B] [FONT="Tahoma"] nSelected = ComboBox.GetSelected("ComboBox1"); if nSelected then local sCategory = ComboBox.GetItemText("ComboBox1", nSelected); ListBox.DeleteItem("ListBox1", -1); CB_DATA = {} CB_DATA[1] = "PLANE PACKS"; CB_DATA[2] = "CAR PACKS"; CB_DATA[3] = "TRUCK PACKS"; if sCategory == CB_DATA[1] then ListBox.DeleteItem("ListBox1", -1); Application.SetRedraw(true); strDirData = ComboBox.GetItemText("ComboBox1", nSelected); local tFiles = File.Find("Autoplay\\Docs\\"..strDirData, "*.*", false, false, nil); if tFiles then for i, sFilePath in pairs (tFiles) do tFileParts = String.SplitPath(sFilePath); -- this breaks everypart of the filepath sFileName = tFileParts.Filename; -- this one is the Filename only sFileExtension = tFileParts.Extension; -- this one is File Extension only sFullFileName = sFileName..sFileExtension; ListBox.AddItem("ListBox1", sFullFileName, sFilePath); -- add to the ListBox end end elseif sCategory == CB_DATA[2] then ListBox.DeleteItem("ListBox1", -1); Application.SetRedraw(true); strDirData = ComboBox.GetItemText("ComboBox1", nSelected); local tFiles = File.Find("Autoplay\\Docs\\"..strDirData, "*.*", false, false, nil); if tFiles then for i, sFilePath in pairs (tFiles) do tFileParts = String.SplitPath(sFilePath); -- this breaks everypart of the filepath sFileName = tFileParts.Filename; -- this one is the Filename only sFileExtension = tFileParts.Extension; -- this one is File Extension only sFullFileName = sFileName..sFileExtension; ListBox.AddItem("ListBox1", sFullFileName, sFilePath); -- add to the ListBox end end elseif sCategory == CB_DATA[3] then ListBox.DeleteItem("ListBox1", -1); Application.SetRedraw(true); strDirData = ComboBox.GetItemText("ComboBox1", nSelected); local tFiles = File.Find("Autoplay\\Docs\\"..strDirData, "*.*", false, false, nil); if tFiles then for i, sFilePath in pairs (tFiles) do tFileParts = String.SplitPath(sFilePath); -- this breaks everypart of the filepath sFileName = tFileParts.Filename; -- this one is the Filename only sFileExtension = tFileParts.Extension; -- this one is File Extension only sFullFileName = sFileName..sFileExtension; ListBox.AddItem("ListBox1", sFullFileName, sFilePath); -- add to the ListBox end end end end[/FONT] [/B][/COLOR]
Code:
[COLOR="blue"][B] [FONT="Tahoma"]count = ListBox.GetCheckedCount("ListBox1", BST_CHECKED); Folder.Create(_DesktopFolder.."\\My Folder"); if count == nil then Dialog.TimedMessage("error...", "Pick up some item", 2000, MB_ICONINFORMATION); else for index=1, count do pathing = ListBox.GetItemData("ListBox1", index); File.Copy(pathing, _DesktopFolder.."\\My Folder", false, false, false, false, nil); end end for n=1, (ListBox.GetCount("ListBox1")) do ListBox.SetItemCheck("ListBox1", n, BST_UNCHECKED); end --Reload the Combobox to reuse the combobox once the copy process is fullfilled, resetting the listbox but not the combobox ReloadCB()[/FONT][/B][/COLOR]
Sorry for the long post I needed to be clear with the idea, my english is well, normal but not good. Thanks.
Comment