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

Re: Dictionary rewrite - thoughts, please

Postby bn » Wed May 10, 2017 8:39 pm

Hi Alejandro,

did you try the new version of tinyDictionary? You can add notes and can use the notes file to share notes between users.
This is not a full featured bug/technotes system. But may be useful in some cases.

Kind regards
Bernd
bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 3167
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Dictionary rewrite - thoughts, please

Postby AndyP » Thu May 11, 2017 11:01 am

Hi Bernd,

tinyDictionary is great! using it all the time now in preference to LCs own.

Add notes is a really useful feature... have you considered having a community notes section than is stored in the cloud?
That way we would all benefit from others insights.

Anyway again, many thanks for your efforts.
Andy Piddock

http://2108.co.uk/tinyide/ - TinyIDE gives you more space to develop your ideas

http://2108.co.uk/script-editor-themer/ Script Editor Themer - Your code has never looked so good

My software never has bugs. It just develops random features
AndyP
 
Posts: 276
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)

Re: Dictionary rewrite - thoughts, please

Postby bn » Thu May 11, 2017 9:34 pm

Hi Andy,

thank you for your kind words.
have you considered having a community notes section than is stored in the cloud?

actually that would be an obvious extension of the current notes. Others have asked for it too.

However there are a couple of hurdles here for me.
Technically it probably wouldn't be too complicated to add a central repository for notes somewhere in the "cloud".
But the "cloud" is a bit cloudy for me... :) I am not familiar with server stuff.

Then there is a layer of administration. Someone has to look at the notes. Are they still uptodate, are there redundancies, etc.
Who is going to do that, it is not something that can be automated completely in my opinion.

And who knows, the built-in dictionary actually needs a couple of tweaks and tinyDictionary would be redundant. Then what about the notes.

I prefer to think of tinyDictionary as a quick and "dirty" dictionary which probably suits more experienced developers that don't need the structured approach of the built-in dictionary.

By the way I think what Livecode has done to the dictionary is fantastic, it now covers the various sub-languages and extensions, libraries, community contributed widgets etc. I think Ali did it mostly but whoever did it, did a good job. Just the actual framework to display the dictionary seems to be "Bootstrap" and that is not easy to change in layout etc.

Kind regards
Bernd
bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 3167
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Dictionary rewrite - thoughts, please

Postby jmburnod » Fri May 12, 2017 12:33 pm

Hi Bernd,
Thanks again for the job.
I noticed an unexpected behavior (for me) about notes.
If I save a new note, it appears after fld "fRes" but if I use history to change topic and return by history to the topic where I saved my note it disapeared. I have to click on notes icon to see it.
Is it what you want ? (tinyDictionary_0_8_1_0)
the "cloud" is a bit cloudy for me... :)

and as you said, we need humans to manage it
Kind regards
Jean-Marc
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 1844
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève

Re: Dictionary rewrite - thoughts, please

Postby bn » Fri May 12, 2017 2:12 pm

Bonjour Jean-Marc,

glad you like it.

If I save a new note, it appears after fld "fRes" but if I use history to change topic and return by history to the topic where I saved my note it disapeared. I have to click on notes icon to see it.

it is as you describe. The history is not updated until the next time you choose the entry in the table field. Then the note is shown. If you only move using history the note is not yet appended since history currently stores the htmlText of the details when you click an entry in the table field.

Actually I had not thought of this. History for me is just a temporary memory of your reading and as such volatile. But I will look how to add the newly created note to an entry in history.

KInd regards
Bernd
bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 3167
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Dictionary rewrite - thoughts, please

Postby bwmilby » Thu Jun 22, 2017 5:49 am

Not sure how appropriate it is to post to an old thread, but I have a suggestion for tinyDictionary. If you perform a search and there is only a single result, the only way to view the dictionary entry is to click on the result. My suggestion is to add the following handler to the field "fData" code:
Code: Select all
on rawKeyUp pWhich
    if pWhich = 65293 then
        send "arrowKeyChanged" to me in 0 milliseconds
    end if
    pass rawKeyUp
end rawKeyUp

This will map the enter key (at least on the Windows laptop I'm using at the moment) to the code that displays what is currently hilighted. I can think of two other alternatives:
  • Remove bounds checking for left/up arrow keys so arrowKeyChanged handler always gets called
  • Send arrowKeyChanged in the search field handler when the tab key is pressed (display first entry, but I see some code commented out that may have tried that)
P.S. - I really like this dictionary on the smaller screen of my laptop.

Thanks,
Brian
bwmilby
 
Posts: 6
Joined: Wed Jun 07, 2017 5:37 am

Re: Dictionary rewrite - thoughts, please

Postby bwmilby » Fri Jun 23, 2017 3:23 am

After a little though, I think this may be a better approach:

Code: Select all
on tabKey
    focus on field "fData" of group "modTableField 1"
    if the hilitedline of field "fData" of group "modTableField 1" is 1 then
        send "arrowKeyChanged" to field "fData" of group "modTableField 1" in 0 milliseconds
    end if
end tabKey

If you tab back and forth between the list and the search without changing it, the hilite does not move. If you change the search term, then the hilight is normally reset to the first line but the dictionary entry wasn't changed. With the above code, the dictionary entry will always match the hilighted line in the list after a tab (unless there is nothing in the list).

Thanks,
Brian
bwmilby
 
Posts: 6
Joined: Wed Jun 07, 2017 5:37 am

Re: Dictionary rewrite - thoughts, please

Postby bn » Fri Jun 23, 2017 8:13 pm

Hi Brian,

thanks for suggesting this

I would prefer not to change field "fData" itself but to apply a change to the behavior of group "modTableField"

To do that you edit button "behavMTF"

I have put the following code at the end of the script

Code: Select all
###########################
## if only one entry is displayed the arrowkeys don't activate the details display
## this is a patch for that suggested by Brian (bwmilby)

after focusIn
   if the number of lines of field "fData" of me is 1 then  send "arrowKeyChanged" to field "fData" of group "modTableField 1" 
end focusIn

###########################


Now you apply the changes in the script editor and then from the message box you enter
Code: Select all
closecard

and hit the return key this clears all kinds of things and now you save tinyDict.

then again from the message box you enter (just copy the code below)
Code: Select all
preopenCard;opencard

and hit the return key. This will restart the initialization of tinyDict.

The advantage is that you don't save a couple of megabytes of temparary data in tinyDict and it stays small. The temporary data will be generated by preopencard and opencard anyways.

Please tell me if this patch does what you want.

Kind regards
Bernd
bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 3167
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Dictionary rewrite - thoughts, please

Postby bwmilby » Sat Jun 24, 2017 3:36 am

Works great if there is a single result. If there is more than one result, then you have to arrow down and back up to see the first item though.
bwmilby
 
Posts: 6
Joined: Wed Jun 07, 2017 5:37 am

Re: Dictionary rewrite - thoughts, please

Postby jameshale » Sat Jun 24, 2017 4:07 am

Your initial request was to auto show the detail for a single result.
This second request is to auto show the first listed of the found results.
They really are quite different.
While the showing of the detail automatically if there is a single result makes sense.
Showing the detail of the first listed result doesn't and to my mind would become annoying very quickly.
My 2 cents.
jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 174
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: Dictionary rewrite - thoughts, please

Postby bwmilby » Sat Jun 24, 2017 4:59 am

The second idea only displayed the first entry after the tab key was pressed to leave the search field. My thought was that at that point you see the term you want defined and if it is the first one it requires two additional key presses to get. I'm very new to LC though, so maybe I'm missing something.

Also, just found the package for modTextField and understand about not changing the script on the field directly. Reading the documentation on it now. It's a really cool control.
bwmilby
 
Posts: 6
Joined: Wed Jun 07, 2017 5:37 am

Previous

Return to IDE Contributors

Who is online

Users browsing this forum: No registered users and 1 guest