| View previous topic :: View next topic |
| Author |
Message |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Sat May 29, 2010 3:55 pm Post subject: SSTreeview question [SOLVED] |
|
|
Hi forum ,
I'm here to make an another question, (another time)
I'm writing a script using SsTreeView dll, at now I would create a text search in the treeview element, anyone know how to examine each treeview element to find a text string?
Many Tnx in advance for any info or idea
Byez
Last edited by Tdk161 on Mon Apr 04, 2011 3:59 pm; edited 1 time in total |
|
| Back to top |
|
 |
Claz Newbie
Joined: 03 Jan 2009 Posts: 23 Location: The Netherlands
|
Posted: Sun May 30, 2010 8:37 pm Post subject: Find text in SSTreeView |
|
|
Hi TdK161,
I'm working on the SSTreeView also these days, and I recognize your problem.
As far as I can see, there's no way to do these things in the TreeView control itself, as the data is not very accessible. This is also a problem when trying to save and load a file from and into the tree.
My solution was to keep a copy of the TreeView in a list, making it possible to save and load, but also offering the opportunity to search the list, e.g. with the @match() function.
If you want, I can offer you the source code, but it's integrated into the whole software: I need to isolate it, to make it workable for you.
I will do this this week a.s.a.p. and post it in this thread.
Best regards,
Claz |
|
| Back to top |
|
 |
Claz Newbie
Joined: 03 Jan 2009 Posts: 23 Location: The Netherlands
|
Posted: Mon May 31, 2010 7:33 am Post subject: VDS code to search for text in a treeview control. |
|
|
Hi TDK161,
I isolated the code from the application and tried to post it.
Then I got the following message "Sorry, you have reached your maximum Upload Quota Limit of 512 KB".
The zipped code is only 80 kB...
Does anybody know why I get this message and how it could be solved?
Much obliged.
Regards,
Claz |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Mon May 31, 2010 3:56 pm Post subject: |
|
|
Hi Claz
you can upload your code using two ways (I think)
or copy&paste code in a new post in this thread or upload file into a fileserver like Mediafire or Rapidshare or Megaupload and post the download link here
Many tnx for your job
Byez |
|
| Back to top |
|
 |
Claz Newbie
Joined: 03 Jan 2009 Posts: 23 Location: The Netherlands
|
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Mon May 31, 2010 6:20 pm Post subject: |
|
|
Many many tnx Claz,
your project work well I think the gui is very nice
And I found how to perform a search in the treeview
Thanks again man
Byez  |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
|
| Back to top |
|
 |
Claz Newbie
Joined: 03 Jan 2009 Posts: 23 Location: The Netherlands
|
Posted: Tue Jun 01, 2010 9:43 am Post subject: |
|
|
Hi guys,
thanks for the compliments... it lights up my day
Nice to hear that it seems Tdk161 found his solution.
uvedese: as you can see, I'm using your TreeDSU in this app.
The DSU really makes it much easier to handle the Treeview control.
Unfortunately I had some issues, when using it:
- I needed to see the data without encryption to be able to connect the tree to data in a database and to be able to understand what was happening ;
- The 'ToParent' function reacts unlogical to me: remove the comments in ":ToParentButton" and run the app with Claz.tree.
If I select Item A1 and press the Parent button, then this child is moved one level up (as a sister from ItemA), but child Item A2, being a child of Item A also, is now a child from Item A1. I think the parent function needs to be corrected and avoid undesired changes to other tree elements.
- Dragging elements also behaves unlogical for me, similar to the DragDrop.dsc example from SSTreeview.
If these issues were solved, your TreeDSU would be a perfect wrapper for SSTreeView, offering the most wanted functions in a very easy and convenient way.
Best regards,
Klaas |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
Posted: Wed Jun 02, 2010 11:42 am Post subject: |
|
|
Ooopppps
I'm sorry Claz.
I just tried your software without looking the files contents.
I'm working in those issues now.
I don't use dragging elements because I think there is a bug in SSTreeView original library and we can lost some elements in tree.
And I try to update TreeDSU in order to have a new function to search.
Thanks |
|
| Back to top |
|
 |
Claz Newbie
Joined: 03 Jan 2009 Posts: 23 Location: The Netherlands
|
Posted: Wed Jun 02, 2010 6:04 pm Post subject: |
|
|
No need to apologize: the only way to avoid making mistakes is to do nothing...
I tend to agree on your remark about drag & drop: though I did not spent time to look at it, I noticed that the SSTreeView example behaved a bit strange, so I did not use it (yet).
I could not find a solution to search in the TreeView itself by looking at the commands and functions, but I didn't care a lot, because the user needs to search in the associated data mostly anyway.
I put this data in a separate list or table when opening the file.
If you look at Claz.tree with an ascii text editor, you will notice that I placed the level indicator at front, followed by the child ID, name, state, icon & bold settings and a key at the end.
This key is just an ordinary timestamp; I deleted the comma to avoid problems with the scripting.
I'm very curious if you can find a solution to search without the need of a separate datafile, because it could be very convenient in other applications.
Last question: is there a reason why you save the treelist data encrypted?
Good luck with your work ! |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
Posted: Wed Jun 02, 2010 10:02 pm Post subject: |
|
|
Hi Claz:
I have already implemented a function of search for TreeDSU. To do this, I use the list with the same ID that Tree control (command Tree init) where I load all data of tree in order to search the query words.
I had the idea of encript tree data because I thought to create TreeDSU to associate each tree item with general data (as rich text documents, databases, etc.)
About functions "ToParent" and "ToChild", in fact, there were some bugs... I will try to depurate them.
I will continue working on it...
See you  |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Wed Jun 02, 2010 11:13 pm Post subject: |
|
|
Hi Claz
I changed little bit the part of your script to search
| Code: | :SearchButton
%%SearchText = @dlgtext(SearchText)
if %%SearchText
List seek,Cerca,0
%%Lins = @Next(Cerca)
While @Ok()
PARSE "%%Level;%%ID;%%Text;%%State;%%Image;%%SelImage;%%Children;%%Data",%%Lins
If @Zero(@Pos(%%SearchText,%%Lins))
treeview setBold,TreeDsu1,%%ID,0
Else
treeview setBold,TreeDsu1,%%ID,1
End
%%Lins = @Next(Cerca)
Wend
End
GOTO Loop |
in my script I use Cerca instead of List1
Simply I set to Bold any occurence
Hope to be interested to you
Byez and thank's again |
|
| Back to top |
|
 |
Claz Newbie
Joined: 03 Jan 2009 Posts: 23 Location: The Netherlands
|
Posted: Mon Jun 07, 2010 9:24 am Post subject: |
|
|
Hi guys,
Seems we're really progressing in using the Treeview control!
@tdk161: I integrated your code into the TreeManager: works very nice indeed! Thanks
Regards,
Claz |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
Posted: Mon Jun 07, 2010 3:18 pm Post subject: |
|
|
Hi guys:
I updated TreeDSU to ver 1.1.
http://vds.uvedese.es/index.php?option=com_content&task=view&id=161&Itemid=52
In this version I fixed some problems (toParent) and I added two new functions to search into the tree control (searchNext & searchPrev). This functions can match (find) a string into extra-data too.
Enjoy
_______________
uVeDeSe
_______________ |
|
| Back to top |
|
 |
Claz Newbie
Joined: 03 Jan 2009 Posts: 23 Location: The Netherlands
|
Posted: Tue Jun 08, 2010 5:43 pm Post subject: |
|
|
Hi Uvedese,
Just downloaded V1.1 and it works great!
The ToParent and ToChild functions now behave very naturally and the Search function is working good also.
Thanx for the good work: I'm definitely going to use more in the future!
Claz |
|
| Back to top |
|
 |
|