-
UIFC Issue
From
Mlong@VERT to
All on Sun Oct 11 20:16:56 2020
I'm trying to use the copy/paste functionality inside of uifc for javascriptããWhile WIN_CUT is available in C, it is not available in javascriptããI see that there are two entires in uifc.h for 1<<17 which is WIN_CUT and WIN_HLPããThen in javascript, in uifcdefs.js, there is just the entry for WIN_HLPããWhen using WIN_HLP though, it enables the Cut option that I am looking forããIt seems maybe this is a bug? Why are there two constants for 1<<17?ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Digital Man@VERT to
Mlong on Sun Oct 11 22:29:04 2020
Re: UIFC Issueã By: Mlong to All on Sun Oct 11 2020 08:16 pmãã > I'm trying to use the copy/paste functionality inside of uifc for javascriptã >ã > While WIN_CUT is available in C, it is not available in javascriptã >ã > I see that there are two entires in uifc.h for 1<<17 which is WIN_CUT andã > WIN_HLPã >ã > Then in javascript, in uifcdefs.js, there is just the entry for WIN_HLPã >ã > When using WIN_HLP though, it enables the Cut option that I am looking forã >ã > It seems maybe this is a bug? Why are there two constants for 1<<17?ããNot really a bug, just multiple "sources of truth" which tend to get out of sync over time.ããThe WIN_HLP mode flag is not used in UIFC/JS, so that's why I reused that bit for WIN_CUT. Now fixed in git.ãã digital manããRush quote #68:ãHe's a radio receiver, tuned to factories and farmsãNorco, CA WX: 65.9øF, 82.0% humidity, 0 mph SSW wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Mlong@VERT to
Digital Man on Mon Oct 12 14:33:39 2020
Re: UIFC Issueã > By: Mlong to All on Sun Oct 11 2020 08:16 pmãã > > It seems maybe this is a bug? Why are there two constants for 1<<17?ãã > Not really a bug, just multiple "sources of truth" which tend to get out ofã > sync over time.ãã > The WIN_HLP mode flag is not used in UIFC/JS, so that's why I reused thatã > bit for WIN_CUT. Now fixed in git.ã ãThanks, getting closer. Still trying to figure out how to read that theyãpressed ctrl-c/ctrl-v and how to handle. I ran into another inconsistency:ããin the c file:ã#define MSK_COPY 0x30000000ã#define MSK_CUT 0x40000000ã#define MSK_PASTE 0x50000000 ããin the js file:ãconst MSK_GET = 0x30000000;ãconst MSK_PUT = 0x40000000;ãconst MSK_EDIT = 0x50000000;ã---ã þ Synchronet þ
Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Mlong@VERT to
Mlong on Mon Oct 12 14:46:44 2020
Here's how I am dealing with this weirdness, if it gives you any hints as toãwhat is wrong in the source:ãã if (selection&MSK_GET) {ã // actually put ctrl-xã selection ^= 0x50000000;ã uifc.msg("You pasted into index " + selection);ã } else if (selection&MSK_PUT) {ã // actually get ctrl-vã selection ^= MSK_PUT;ã uifc.msg("You copied from index " + selection);ã }ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Digital Man@VERT to
Mlong on Mon Oct 12 18:20:07 2020
Re: Re: UIFC Issueã By: Mlong to Digital Man on Mon Oct 12 2020 02:33 pmãã > > Re: UIFC Issueã > > By: Mlong to All on Sun Oct 11 2020 08:16 pmã >ã > > > It seems maybe this is a bug? Why are there two constants for 1<<17?ã >ã > > Not really a bug, just multiple "sources of truth" which tend to get outã > > of sync over time.ã >ã > > The WIN_HLP mode flag is not used in UIFC/JS, so that's why I reused thatã > > bit for WIN_CUT. Now fixed in git.ã >ã > Thanks, getting closer. Still trying to figure out how to read that theyã > pressed ctrl-c/ctrl-v and how to handle. I ran into another inconsistency:ã >ã > in the c file:ã > #define MSK_COPY 0x30000000ã > #define MSK_CUT 0x40000000ã > #define MSK_PASTE 0x50000000ã >ã > in the js file:ã > const MSK_GET = 0x30000000;ã > const MSK_PUT = 0x40000000;ã > const MSK_EDIT = 0x50000000;ããThanks, no fixed.ãã digital manããThis Is Spinal Tap quote #34:ãWe'd love to stand around and chat, but we've gotta sit down in the lobbyãNorco, CA WX: 88.3øF, 30.0% humidity, 8 mph ENE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Digital Man@VERT to
Mlong on Mon Oct 12 18:23:37 2020
Re: Re: UIFC Issueã By: Mlong to Mlong on Mon Oct 12 2020 02:46 pmãã > Here's how I am dealing with this weirdness, if it gives you any hints as toã > what is wrong in the source:ã >ã > if (selection&MSK_GET) {ã > // actually put ctrl-xã > selection ^= 0x50000000;ã > uifc.msg("You pasted into index " + selection);ã > } else if (selection&MSK_PUT) {ã > // actually get ctrl-vã > selection ^= MSK_PUT;ã > uifc.msg("You copied from index " + selection);ã > }ããThe proper way (if it works, which I don't know has been confirmed in JS): would be like this:ã if ((sleection & MSK_ON) == MSK_COPY) {ã selection &= MSK_OFF;ã uifc.msg("You copied from index" + seleection);ã }ãThere have been issues in the past with JS numbers > 0x7fffffff, so it's possible there might be a hitch that needs to be resolved before it works 100% for you. Let me know how you fare,ãã digital manããSling Blade quote #6:ãKarl: he should've had a chance to grow up. He would had fun some time.ãNorco, CA WX: 87.2øF, 30.0% humidity, 6 mph E wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Digital Man@VERT to
Mlong on Mon Oct 12 18:52:05 2020
Re: Re: UIFC Issueã By: Digital Man to Mlong on Mon Oct 12 2020 06:23 pmãã > Re: Re: UIFC Issueã > By: Mlong to Mlong on Mon Oct 12 2020 02:46 pmã >ã > > Here's how I am dealing with this weirdness, if it gives you any hints asã > > to what is wrong in the source:ã >ã > > if (selection&MSK_GET) {ã > > // actually put ctrl-xã > > selection ^= 0x50000000;ã > > uifc.msg("You pasted into index " + selection);ã > > } else if (selection&MSK_PUT) {ã > > // actually get ctrl-vã > > selection ^= MSK_PUT;ã > > uifc.msg("You copied from index " + selection);ã > > }ã >ã > The proper way (if it works, which I don't know has been confirmed in JS):ã > would be like this:ã > if ((sleection & MSK_ON) == MSK_COPY) {ã > selection &= MSK_OFF;ã > uifc.msg("You copied from index" + seleection);ã > }ã > There have been issues in the past with JS numbers > 0x7fffffff, so it'sã > possible there might be a hitch that needs to be resolved before it worksã > 100% for you. Let me know how you fare,ããI played around with JS uifc the copy/cut/paste mode flags and it seemed to work as expected. Here's a little test script I wrote, if it's of any help:ããload("uifcdefs.js");ãif(!uifc.init("Test app"))ã exit(-1);ãjs.on_exit("uifc.bail()");ãdo {ã var selection = uifc.list(WIN_CUT|WIN_COPY|WIN_PASTE, "test", ["one",ã "two", "three"]);ã uifc.msg(format("selection = %x", selection));ã} while(selection != -1);ããã digital manããSynchronet "Real Fact" #94:ãSynchronet v3.16c was released in August of 2015 (5 years after v3.15b).ãNorco, CA WX: 85.0øF, 32.0% humidity, 8 mph E wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Mlong@VERT to
Digital Man on Mon Oct 12 20:18:59 2020
It works fine now for cut and paste, but I cannot get it to work for copy. Itãjust never seems to match the MSK_COPY. I'll have to play around with it someãmore laterã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Digital Man@VERT to
Mlong on Mon Oct 12 22:38:27 2020
Re: Re: UIFC Issueã By: Mlong to Digital Man on Mon Oct 12 2020 08:18 pmãã > It works fine now for cut and paste, but I cannot get it to work for copy.ã > It just never seems to match the MSK_COPY. I'll have to play around with itã > some more laterããSeems to work for me. The test script I pasted, if you hit Ctrl-C while teh 3rd item is highlighted, it displays:ãÉ[þ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͻ㺠selection = 30000002 ºãÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹㺠³OK ºãÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼããAnd MSK_COPY is 0x30000000 and the 3rd option index is 2. So that makes perfect sense.ãã digital manããThis Is Spinal Tap quote #8:ãDerek Smalls: Making a big thing out of it would have been a good idea.ãNorco, CA WX: 78.4øF, 31.0% humidity, 0 mph SSW wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Mlong@VERT to
Digital Man on Tue Oct 13 06:57:46 2020
Thanks for your help digital man, I was able to get it working now. Still lotsãto do but I hope to have something cool to show you all soonã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã