Dictionary rewrite - thoughts, please

This forum is a working group for community contributors to the LiveCode IDE included in the main LiveCode distribution.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 474
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: Dictionary rewrite - thoughts, please

Post by jameshale » Thu Mar 02, 2017 2:49 pm

I have just modified Bernd's last upload to include parameter and value entries of the dictionary items. eg, see entry for "textencode"
DictionarySplitter_0_7_6_1.livecode.zip
Dictionary with parameter and value entries
(125.4 KiB) Downloaded 520 times
All the changes were in the behaviour of the Modfield, btn "behavMTF".

James

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3975
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Dictionary rewrite - thoughts, please

Post by bn » Thu Mar 02, 2017 3:30 pm

Hi James,

that looks good. I was hesitating about adding this because I was pondering how to best display parameter and values as tables.
But this might work just as well. We'll have to see how it works with LCB dictionary. LCB dictionary makes heavy use of tabular display.
Interestingly "Field" (object) has more entries in Livecode Dictionary than in the community dictionary.

Gee, and I thought my code was so convoluted that it was kind of encrypted.. :)

Could you please use strict compilation mode for code changes i.e. declare all variables, thank you. And also please prepend your local variables with t and script local variables with s. That way it the scope of the variale is immediately obvious.

Thanks for this very useful addition

Kind regards
Bernd

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 474
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: Dictionary rewrite - thoughts, please

Post by jameshale » Thu Mar 02, 2017 3:57 pm

Hi Bernd,

Yes, it took a little time to find the script and then work out what you were doing.

Here is an update. Seems "value" can be the end of a line as well as heading.
Changed the heading to "Values"
Given that each section is identified by the offset of ["heading" & cr] it is possible that any lines ending with one of the heading words, preceding the respective heading, will upset the formatting for that heading. In the case I just fixed a preceding line ended with the characters "value" and so the lineoffset of ["value" & cr] found that line and not the heading, which was later on.
DictionarySplitter_0_7_6_2.livecode.zip
corrected Dictionary
(83.25 KiB) Downloaded 454 times
I have adjusted the variables as requested and declared them, turned on strict compilation mode to ensure.

BTW the "Field" object entry has an extra section called "Property" which is a listing of all properties of the object. This is not in the field.ldoc. It is also not in the array entry for "Field <object>" so it must get generated by LC's dictionary. I notice that other "objects" have the Property table too.

James

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3975
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Dictionary rewrite - thoughts, please

Post by bn » Thu Mar 02, 2017 3:58 pm

Hi all,

to keep the versions in sync I post here a version that incorporates the changes James Hale made i.e. he added Parameter and Value to the dictionary.

Additionally this version has minor bug fixes and a collapse/expand option. In the search bar there is an icon with a - minus sign which collapses the dictionary. Currently only hard coded into widget "toggleSize" -> the one with the minus sign. You would have to change it there if you want the collapsed dictionary to appear somewhere else.

Until there is a preference system it has to be hard coded I guess.
newVersion.png
newVersion.png (6.48 KiB) Viewed 32134 times
DictionarySplitter_0_7_6_2.livecode.zip
(52.72 KiB) Downloaded 470 times
Kind regards
Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3975
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Dictionary rewrite - thoughts, please

Post by bn » Thu Mar 02, 2017 4:04 pm

Hi James,

midair collision. I just posted also a version of the same name. Will incorporate your changes into a next update.

The joys of collaborative work.

I also noted that e.g. the field(object) in the Livecode dictionary has an enumerations which is not contained in the big array. I did not investigate that yet.

Kind regards

Bernd

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Dictionary rewrite - thoughts, please

Post by Mikey » Thu Mar 02, 2017 4:21 pm

Before sending this to the mother ship, we should move it over to git, and move the various behaviors into script-only-stacks. That would also fix the collision issue.

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 474
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: Dictionary rewrite - thoughts, please

Post by jameshale » Thu Mar 02, 2017 4:22 pm

Hi Bernd,
Yes I was worried that might happen. After I made the corrections I looked at the field object entries. Should have posted first :-)
Anyway, trust you got my point about the current method of identifying the section heading. Might need a tweak'?
Also I am pretty sure the <object> entries must trigger an extra handler that collates all the property entries that have the <object> mentioned. This would not be difficult to do, but it would be a bugger to try and format without a table. Maybe just listing the properties (as links) would be enough?

James

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Dictionary rewrite - thoughts, please

Post by jmburnod » Thu Mar 02, 2017 6:36 pm

Hi Bernd and others dictionary workers,
Thanks a lot for your work.
I just dowloaded "DictionarySplitter_0_7_6_2".
First feeling is very nice. Simple, clear, shrink/expand dictionary is very useful.
Remains an important question "where is the best place for "DarkTheme" button :roll:
Kind regards
Jean-Marc
Last edited by jmburnod on Fri Mar 10, 2017 7:28 am, edited 1 time in total.
https://alternatic.ch

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3975
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Dictionary rewrite - thoughts, please

Post by bn » Thu Mar 02, 2017 6:51 pm

Hi Jean-Marc,

Thank you.
Remains an important question "wehre is the best place for "DarkTheme" button
I consider the left hand pane as an area for configuration. This is not done yet.

Kind regards
Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3975
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Dictionary rewrite - thoughts, please

Post by bn » Wed Mar 22, 2017 3:32 pm

Hi all,

it has been a while but now I have uploaded a new version to "Sample Stacks".
It is "tinyDictionary"

James Hale contributed to tinyDictionary
newVersion.png
newVersion.png (6.48 KiB) Viewed 32011 times
http://livecodeshare.runrev.com/stack/8 ... ry_0_7_7_7


Thanks to all that made suggestions and tested. Comments and bug reports welcome.

Kind regards
Bernd

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Dictionary rewrite - thoughts, please

Post by capellan » Sun Apr 02, 2017 5:01 am

How could we add to this Dictionary all confirmed bugs and workarounds?

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Dictionary rewrite - thoughts, please

Post by Mikey » Sun Apr 02, 2017 12:15 pm

I think Berns is talking about a user section

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3975
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Dictionary rewrite - thoughts, please

Post by bn » Sun Apr 02, 2017 9:38 pm

@Alejandro, what do you mean by
How could we add to this Dictionary all confirmed bugs and workarounds?
where is that information coming from? Or do you mean user notes that the user maintains himself.


@Mikey, I am exploring the option of user notes. But this is in early stages and needs some consideration. Since tinyDictionary currently is only the empty stack and the dictionary is pulled from the current version of LiveCode and only preferences are saved externally. A user notes system has to be fairly robust and reliable and also stored externally. Imagine the user notes get somehow corrupted. I would not like to answer that support question if it turns out that it was a bug I did not catch.

So user notes are a bit further down the road.

Kind regards
Bernd

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 474
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: Dictionary rewrite - thoughts, please

Post by jameshale » Tue May 09, 2017 8:20 am

The current release of this stack (with user notes!) is now available on livecodeshare.
you can access from within LC by clicking on the "Sample Stascks" button in the toolbar or you can go to the livecodeshare site:
http://livecodeshare.runrev.com/stack/8 ... Dictionary

currently version 8.1 as of this writing.

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Dictionary rewrite - thoughts, please

Post by capellan » Wed May 10, 2017 7:44 pm

Hi Bernd, Sorry for replying so late, but I lost track of this message thread :(
bn wrote:@Alejandro, what do you mean by: How could we add to this Dictionary all confirmed bugs and workarounds? Where is that information coming from? Or do you mean user notes that the user maintains himself.
This information comes from releases notes (PDF files), bug reports (LC Quality Center), forum postings and mail list messages. Collecting this information requires participation from users and developers.

Look, for example, comment number 13 from this bug report:
http://quality.livecode.com/show_bug.cgi?id=16612
Hi all,

Neil Roger observed something very useful:

[[ I've come across this issue before when LiveCode was present in the "Security"section of System preferences.

To test, Go to "System Preferences--->Security & Privacy--->Privacy" and in the tab "Accessibility" check that LiveCode is **not** present in the section "Allow the apps below to control your computer"

I tested this tonight and when LiveCode is in here, it takes between 15- 30 secs for the file dialog to appear and my system locks up until it shows. ]]

I just tried this and I confirm his findings.

Could you please check if this improves the problem for you?

Best regards,
Panos
This is exactly the kind of information that I am talking about.
A really useful addition that could be included in this Dictionary.

Al

Locked

Return to “IDE Contributors”