Re: Numbering lines
On 10/28/18 9:15 PM, hh via use-livecode wrote: Alex, you and JLG are important LiveCoders. What you say has double weight. From that alone you should double check what you claim to be true. Well, at least I have finally become "splendid" at something. I can't decide whether you are being rude or just misunderstanding how your words appear in a different culture. To an American, the above is either an insult or a lecture. You should probably not assign so much weight to what I say here. Sometimes I'm just human. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Will it ever be possible place controls over browser widget?
> Tom G. wrote: > ...just out of curiosityis it just on my system ? or the right click > grab of the widget doesn't work? Sorry, I wrote this while updating my TextEdit widget (which will allow to grab the widget). But the browser widget doesn't pass "mouseDown", so the mouseDown handler here is not usable. But you could use, for example, the "ControlHandles" approach for dragging (see "Sample Stacks"). ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Numbering lines
Alex, you and JLG are important LiveCoders. What you say has double weight. >From that alone you should double check what you claim to be true. Wrong assertions are no argument against a method but speed is one, of course. Anyway, it is fine that David G. has now a fast way to do his work. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Will it ever be possible place controls over browser widget?
excellent demo thank you..just out of curiosityis it just on my system ? or the right click grab of the widget doesn'twork? On Sun, Oct 28, 2018 at 8:51 PM, William Prothero via use-livecode < use-livecode@lists.runrev.com> wrote: > Hermann: > You are sooo DARN CREATIVE! I’m awed. > Bill > > > On Oct 28, 2018, at 10:54 AM, hh via use-livecode < > use-livecode@lists.runrev.com> wrote: > > > > We already know that this is not possible by "ordinary" controls > > because the browser widget has a native layer. > > (Except we"bundle" your controls in a floating window.) > > > > But there is one way more (I use it for updating my Textedit > > widget). > > > > Of course you can overlay a browser widget with a browser widget: > > > > Make using HTML/CSS a "Bar" (containing buttons etc.). > > The HTML/CSS of that is pretty simple and changeable without deep > > knowledge of HTML or CSS. > > You get a clickCallback via a javaScriptHandler and can simply use > > the scripts of your LCS objects from that javaScriptHandler. > > > > I made a simple example stack with 6 rounded buttons here, may be > > I'll update it from time to time: > > > > http://forums.livecode.com/viewtopic.php?p=172729#p172729 > > > > > > > > ___ > > use-livecode mailing list > > use-livecode@lists.runrev.com > > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > > http://lists.runrev.com/mailman/listinfo/use-livecode > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: how to properly use the fullscreenmode and screen scaling
On 10/27/18 11:40 AM, Mike for GDC via use-livecode wrote: > I am new to LC and have learned much so far but I am having an issue with > the proper scaling of my app on different size screens. I have created the > app with the dimensions of 913 w X 636 h. All looks great on the desktop. I've spent 2 years on "this subject" and, like Jacque says The "showAll" fullscreenMode ensures that the full height of the stack contents are visible on screen. This means on narrower screens, left/right edges may be cropped and on wider screens there may be an extra margin." So we that for complex layout, but for simple layout, but if you want to do you own geometry, I finally got working across numerous Android devices, just yesterday! Disclaimer: there more this that meets the eye. But we have a hack and works. You see, Android doesn't know the screenRect until *after* it rendered a card. No amount of preopenstack or openstack will work. What works is (Andre, God bless him, figured this out:) wait until one card is rendered for doing any geometry Note, the "wait with messages" are important in Android, can't tell you why, but eliminate then and you get crashes -- Stack card 1 - "loader" card 2 - your main app or module -- Card 1 "loader" script openCard wait 80 milliseconds with messages go next card end openCard -- card 2 "main module (app)" on opencard # you must give the device to "register" the coords! send "updateUI" to this card in 100 milliseconds end opencard on resizeStack updateUI end resizeStack command updateUI put the long id of widget "body" of card "SivaSivaBrowser" into tBrowser put the rect of card "SivaSivaBrowser" into sCardRect #store in local Variable for later put item 3 of sCardRect into tWidth put item 4 of sCardRect into tHeight put the loc of card "SivaSivaBrowser" into tCardLoc set the loc of widget "spinner" of card "SivaSivaBrowser" to tCardLoc set the loc of fld "Cancel" of card "SivaSivaBrowser" to (item 1 of tCardLoc, item 2 of tCardLoc+200) put (0,0,tWidth,(tHeight - 50)) into tBrowserRect set the rect of tBrowser to tBrowserRect set loc group "footer" of card "SivaSivaBrowser" to ( round(tWidth/2),tHeight - 25) # there four widgets on the footer put tWidth/4 into tUnit set the loc of widget "go-home-portal" of card "SivaSivaBrowser" to (tUnit/2,tHeight-25) set the loc of widget "add-favorites" of card "SivaSivaBrowser" to (tUnit*1.5,tHeight-25) set the loc of widget "share" of card "SivaSivaBrowser" to (tUnit*2.5,tHeight-25) set the loc of widget "settings-gear" of card "SivaSivaBrowser" to (tUnit*3.5,tHeight-25) end updateUI # works on portrait and landscape: on Oreo, Nougat, 2 Pixels, all different screen sizes. Of course are only <10 controls to deal with. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Will it ever be possible place controls over browser widget?
Hermann: You are sooo DARN CREATIVE! I’m awed. Bill > On Oct 28, 2018, at 10:54 AM, hh via use-livecode > wrote: > > We already know that this is not possible by "ordinary" controls > because the browser widget has a native layer. > (Except we"bundle" your controls in a floating window.) > > But there is one way more (I use it for updating my Textedit > widget). > > Of course you can overlay a browser widget with a browser widget: > > Make using HTML/CSS a "Bar" (containing buttons etc.). > The HTML/CSS of that is pretty simple and changeable without deep > knowledge of HTML or CSS. > You get a clickCallback via a javaScriptHandler and can simply use > the scripts of your LCS objects from that javaScriptHandler. > > I made a simple example stack with 6 rounded buttons here, may be > I'll update it from time to time: > > http://forums.livecode.com/viewtopic.php?p=172729#p172729 > > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Numbering lines
(That said, yeah, repeat for each line is going to be faster) On Sun, Oct 28, 2018 at 5:37 PM Geoff Canyon wrote: > > > On Sun, Oct 28, 2018 at 5:27 PM Alex Tweedly via use-livecode < > use-livecode@lists.runrev.com> wrote: > >> My apologies Hermann. I had not been following the original thread >> closely, and got confused by the embedded quoting in the later messages. >> I was looking at Geoff's code - not yours - and he explicitly said " >> >> And of course if retaining the order isn't critical " >> > > We have gone wildly down a troublesome path, but for the record, I posted > two different sets of code. The first bit was functions based on Hermann's > original code, and retained the order given. The second code was the > simplified and not-order-retaining version as an alternative. > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Numbering lines
On Sun, Oct 28, 2018 at 5:27 PM Alex Tweedly via use-livecode < use-livecode@lists.runrev.com> wrote: > My apologies Hermann. I had not been following the original thread > closely, and got confused by the embedded quoting in the later messages. > I was looking at Geoff's code - not yours - and he explicitly said " > > And of course if retaining the order isn't critical " > We have gone wildly down a troublesome path, but for the record, I posted two different sets of code. The first bit was functions based on Hermann's original code, and retained the order given. The second code was the simplified and not-order-retaining version as an alternative. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Numbering lines
My apologies Hermann. I had not been following the original thread closely, and got confused by the embedded quoting in the later messages. I was looking at Geoff's code - not yours - and he explicitly said " And of course if retaining the order isn't critical " So I agree your array method does indeed work properly. However, it is rather 'splendidly' slow compared to the simpler method as recommended by Mark H and myself :-); it takes almost twice as long on my test cases (between 30,000 and 300,000 lines of moderate length, highly repetitive, 9.0.0, Mac Book Pro circa 2011). Full code below -- Alex on mouseUp local tData1, tData2, time1, temp, tText repeat 3 times put "this is a medium length line that can be updated" after tText end repeat local tWith put prependLineNumbers(tText) into tWith put prependLineNumbers2(tText) into tWith -- put prependLineNumbersProgress(tText) into tWith end mouseup function prependLineNumbers pText local timeLastUpdated, time1, time2, temp local tCount put the number of lines in pText into tCount put the millisecs into time1 local I repeat for each line L in pText add 1 to I put I && L after temp end repeat put tCount && the millisecs - time1 after msg return temp end prependLineNumbers function prependLineNumbers2 pText local timeLastUpdated, time1, time2, temp local tCount, S, K put the number of lines in pText into tCount put the millisecs into time1 split pText by return put the keys of pText into K sort K numeric repeat for each line L in K put cr & L && pText[L] after S --> change separator here end repeat put tCount && the millisecs - time1 after msg return char 2 to -1 of S end prependLineNumbers2 On 28/10/2018 20:06, hh via use-livecode wrote: Alex T. wrote: You require to keep the line ordering completely unchanged - and Hermann's superfast method can't meet that need. JLG wrote: You're right, split deletes duplicates. In fact, I use it as a quick way to do just that. You are both spendidly wrong: Could you please simply try my functions and read the dictionary in order to understand why you are wrong? Please! Is it not yet Halloween ... -- D is the separator for numbers and text lines, usually space or ": " -- T is the input text, delimited with return -- prepends the number and separator to each line: function addLineNumbers D,T split T by return put the keys of T into K sort K numeric repeat for each line L in K put cr & L & D & T[L] after S end repeat return char 2 to -1 of S end addLineNumbers -- D is the separator for numbers and text lines, usually space or ": " -- T is the input text, delimited with return -- removes the number and separator from each line: function removeLineNumbers D,T split T by return and D put the keys of T into K sort K numeric repeat for each line L in K put cr & T[L] after S end repeat return char 2 to -1 of S end removeLineNumbers ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Is it not possible to write to the user preference folder in Mojave?
Hi. Today i was informed by a customer that my app BRx Converter is not able to write data to the preference folder ~/library/preferences. The app normally writes some registration info after successful registration to that folder. After that the app is switched from demo to full mode. But under Mojave the app stays in Demo mode. Is there something special in Mojave? Regards, Matthias Rebbe free tools for Livecoders: https://instamaker.dermattes.de https://winsignhelper.dermattes.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Numbering lines
What's interesting with that is once again a comparison LC 6 against LC 9. I tested with 1 lines of text (King James bible, Genesis up to 5|16) and *non-wrapping fields*, separator tab: LC 9.0.1 needs in average 370 ms for numbering, 330 ms for denumbering, LC 6.7.11 needs in average 170 ms for numbering, 140 ms for denumbering. Without field update, only the text handling, this reduces to: LC 9.0.1 needs in average 75 ms for numbering, 75 ms for denumbering, LC 6.7.11 needs in average 45 ms for numbering, 18 ms for denumbering. So, LC 9 has become pretty fast, but reaches, at least with arrays and field updates, not yet the speed of LC 6 (hardware used: Mac mini, 2.5 GHz). ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Numbering lines
> Alex T. wrote: > You require to keep the line ordering completely unchanged - > and Hermann's superfast method can't meet that need. > JLG wrote: > You're right, split deletes duplicates. In fact, I use it as a quick way > to do just that. You are both spendidly wrong: Could you please simply try my functions and read the dictionary in order to understand why you are wrong? Please! Is it not yet Halloween ... -- D is the separator for numbers and text lines, usually space or ": " -- T is the input text, delimited with return -- prepends the number and separator to each line: function addLineNumbers D,T split T by return put the keys of T into K sort K numeric repeat for each line L in K put cr & L & D & T[L] after S end repeat return char 2 to -1 of S end addLineNumbers -- D is the separator for numbers and text lines, usually space or ": " -- T is the input text, delimited with return -- removes the number and separator from each line: function removeLineNumbers D,T split T by return and D put the keys of T into K sort K numeric repeat for each line L in K put cr & T[L] after S end repeat return char 2 to -1 of S end removeLineNumbers ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Numbering lines
>> David G. wrote: >> Thanks Geoff, I did play with Split, but one of the reasons for numbering >> is to make any identical lines unique. With split, for any that are not, >> all but one is deleted. So definitely not the result I wanted. From that previous answer I concluded you intend to index a text file, that is to find different lines of a text and save them together with their line number offsets in the original. But now (after your last post) I think you want still a simple line numbering. But this is what my handlers do: Even if you have 1 identical lines then they are numbered, as they appear, from 1 up to 1. Your answer shows that you didn't even try ... (Following the proposal of Geoff C. here once again the methods as functions: -- D is the separator for numbers and text lines, usually space or ": " -- T is the input text, delimited with return -- prepends the number and separator to each line: function addLineNumbers D,T split T by return put the keys of T into K sort K numeric repeat for each line L in K put cr & L & D & T[L] after S end repeat return char 2 to -1 of S end addLineNumbers -- D is the separator for numbers and text lines, usually space or ": " -- T is the input text, delimited with return -- removes the number and separator from each line: function removeLineNumbers D,T split T by return and D put the keys of T into K sort K numeric repeat for each line L in K put cr & T[L] after S end repeat return char 2 to -1 of S end removeLineNumbers > David G. wrote: > Thanks for this, although I’m not sure I understand. In fact I am sure I > don’t.I know how amazingly fast the array method is, I use it elsewhere > in the same stack, and it is great. > > I also don’t understand the distinction between line numbering and indexing. > If I was guessing, I would go for line numbering prepends to each line in a > text field a number, and indexing is adding a numerical key to a database or > array. The former is what I described in my original post. > > The reason the issue arrises is because some of the text/chat message records > I referred to have the date and time stamps stripped out. So in the > following exchange… > > 1757 Shadowknave: U gotta b there > 1758 What_goes_Moo: kk > 1759 Shadowknave: no let down? > 1760 What_goes_Moo: kk > 1761 Shadowknave: U b there 8? > 1762 What_goes_Moo: I wil > > … lines 2 and 4 would be identical but for the line number I added via the > script. And of course, the integrity of the dialogue must be maintained. > > I had believed that collapsing duplicates and alphabetising are unavoidable > with split. If there is an array method which doesn’t mess with the text > message order or content, then I would be delighted. Is that what this is > below, but I haven’t appreciated it? > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Native Android widgets
That's for the answer, regardless of length. ;) The scripted native field still works so I can use that. There is no replacement for the native button though. On 10/28/18 2:04 PM, JJS via use-livecode wrote: well that answer of me was a bit short. But i like the answer/ask. And i'm using a normal field but on top of that i placed an equal size transparent graphic. The mouseup goes thru transparent parts which in this case was convenient. I don't know exactly anymore why i did it, but it prevented some other issue with the keyboard or something with shifting. When i recall the exact reason i will tell Sphere Op 28-10-2018 om 19:58 schreef JJS via use-livecode: Nope, i'm still not using them Op 28-10-2018 om 18:04 schreef J. Landman Gay via use-livecode: Has anyone else tried the native Android button and field widgets? When I use the field widget, text entered into the field isn't displayed. I figured out it was placed below the bottom edge, out of view. There isn't a way to adjust the textheight so I can't make it visible. This is a single line entry field. The Android button has a label assigned but it isn't displayed either. The button is blank. I'm just checking to see if I need to submit a bug report. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Numbering lines
You're right, split deletes duplicates. In fact, I use it as a quick way to do just that. I don't see any way to add line numbers without looking at each line. But you could keep a counter in a variable and put the text into an array with the counter integer as the key. That might be faster than keeping a text list. I haven't followed this thread closely, so probably that's already been suggested. I think if you remove the speed hit that updates the field scroll, it might get fast enough. On 10/28/18 1:14 PM, David V Glasgow via use-livecode wrote: I had believed that collapsing duplicates and alphabetising are unavoidable with split. If there is an array method which doesn’t mess with the text message order or content, then I would be delighted. Is that what this is below, but I haven’t appreciated it? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Numbering lines
David, I think you are correct - there is no magic version of split or array that will do what you want. You require to keep the line ordering completely unchanged - and Hermann's superfast method can't meet that need. The best solution (AFAIK) will be the one Mark Hsu and/or Jacqueline already gave, and indeed you already tried. However, your test was unsuccessful, because the time spent updating the progress bar swamped the (relatively small) amount of actual work to be done. Without any progress bar updates, my aging MacBookPro does 3000 lines in 14 ms (lines of 50 chars each). If you may encounter much larger data sets, then you should have a progress indicator of some kind. I would say you should NEVER update a progress bar every time round a loop without a check against doing it too frequently. The simple way is something like put the millisecs into timeLastUpdated put 50 into kMinUpdateTime repeat do something ... if the millisecs - timeLastUpdated < kMinUpdateTime then ... update the scrollbar put the millisecs into timeLastUpdated end if where end repeat NB kMinUpdateTime should be adjusted depending on how important the updates are, and how frequently you want them I'd say rarely below 50ms - I'd usually use 200ms or longer. -- Alex. On 28/10/2018 18:14, David V Glasgow via use-livecode wrote: Thanks for this, although I’m not sure I understand. In fact I am sure I don’t.I know how amazingly fast the array method is, I use it elsewhere in the same stack, and it is great. I also don’t understand the distinction between line numbering and indexing. If I was guessing, I would go for line numbering prepends to each line in a text field a number, and indexing is adding a numerical key to a database or array. The former is what I described in my original post. The reason the issue arrises is because some of the text/chat message records I referred to have the date and time stamps stripped out. So in the following exchange… 1757Shadowknave: U gotta b there 1758What_goes_Moo: kk 1759Shadowknave: no let down? 1760What_goes_Moo: kk 1761 Shadowknave: U b there 8? 1762 What_goes_Moo: I wil … lines 2 and 4 would be identical but for the line number I added via the script. And of course, the integrity of the dialogue must be maintained. I had believed that collapsing duplicates and alphabetising are unavoidable with split. If there is an array method which doesn’t mess with the text message order or content, then I would be delighted. Is that what this is below, but I haven’t appreciated it? Cheers, David G On 28 Oct 2018, at 1:47 pm, hh via use-livecode wrote: David G. wrote: Thanks Geoff, I did play with Split, but one of the reasons for numbering is to make any identical lines unique. With split, for any that are not, all but one is deleted. So definitely not the result I wanted. I am not Geoff (who played with the simple array methods I suggested). But your post attacks indirectly my suggested handlers below as wrong, as if they would not hit your question. My handlers (which are at least 600 times faster than your first script) output exactly the same what your first script outputs, seen apart from the optional delimiter. So definitely not the result I wanted. LOL: You mention above the "unique"-side-condition the first time... With your new side condition from above several others (and I) know also how this is doable very fast, once again using arrays. And it is an invertible method, that is, the original text is exactly restorable. But first post YOU your new handler, to see *all* your new side conditions, that is, or to see what you really want: Certainly not a line numbering, rather indexing a text file. David G. wrote: [This is the first script] However…. Sometimes I want to prefix each line with the line number, and do this: put 1 into tcount repeat for each line j in it put tcount & j into line tcount of it put tcount + 1 into tcount set the thumbpos of scrollbar "filterprog" to tcount end repeat put it into field “numberedtext” I use ‘it’ because of a dim memory (superstition? Myth?) from long ago that it is faster than an arbitrarily named variable. Still, the whole process is pretty darned slow. Any brilliant suggestions? Geoff C. wrote: And of course if retaining the order isn't critical you could just go with: function numberText T,D split T by cr combine T by cr and D return T end numberText function unNumberText T,D split T by cr and D combine T by cr return T end unNumberText Hermann H. wrote: 1. Besides removing scroll-update, which takes most of the time, you could try the following array-methods (which are essentially from my stack http://forums.livecode.com/viewtopic.php?p=101301#p101301 , see there card "LineNums, tab "Nb2"). This needs here on a medium fast machine (Mac mini, 2.5GHz) in average with LC 9.0.1 (which is at about
Re: how to properly use the fullscreenmode and screen scaling
Typically you need to handle field placement yourself in script, moving the controls up on keyboardActivated and back down on keyboardDeactivated. However, there's an unintentional side-effect when setting acceleratedRendering to true in a stack; when the keyboard shows up, the whole card scrolls up by the height of the keyboard. I haven't found this useful very often, since it frequently scrolls the field I want to target right off the top of the screen. But if your layout accomodates that behavior it may be useful. The "showAll" fullscreenMode ensures that the full height of the stack contents are visible on screen. This means on narrower screens, left/right edges may be cropped and on wider screens there may be an extra margin. The "noBorder" mode ensures that the full width of the content is visible, which means in portrait mode you'll get a tiny little stack that fits horizontally within the width of the device, and large empty areas at top and bottom. To allow both orientations, you can use the orientationChanged message to set the fullscreenMode to either showAll or noBorder, depending on which way the device is turning. Or you can write scripts that resize and place all card controls depending on the layout you want. On 10/27/18 4:40 PM, Mike for GDC via use-livecode wrote When I deploy it to my 8 inch Samsung Tab A (Android) it is ok in the Landscape mode, with one exception. When I go to enter data, the keyboard covers up some of the screen that I need to enter data. It does not scroll up to let me get to the field of entry. When it is in Portrait mode I can usually see the field but the stack only takes up about half the screen so it is very small. When I deploy it on the Samsung S8, it is even worse in that the entire screen is not used and therefore it is way too small to really use it. I would hope there is a way to take advantage of all the screen space so as the used has a larger screen to view and enter data.It seems the keyboard is the same size and not scaled at all. Here are the script statements that I put in my "preopenstack" of my first card: set the fullscreenMode of this stack to "showAll" put "portrait,portrait upside down,landscape left,landscape right" into theallowed -- Function Call mobileSetAllowedOrientations theallowed I have also used the "exactfit", "noborder" and "soScale" options but they any help with suggestions or example code of how it should work would be greatly appreciated. Thanks. Mike ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Native Android widgets
well that answer of me was a bit short. But i like the answer/ask. And i'm using a normal field but on top of that i placed an equal size transparent graphic. The mouseup goes thru transparent parts which in this case was convenient. I don't know exactly anymore why i did it, but it prevented some other issue with the keyboard or something with shifting. When i recall the exact reason i will tell Sphere Op 28-10-2018 om 19:58 schreef JJS via use-livecode: Nope, i'm still not using them Op 28-10-2018 om 18:04 schreef J. Landman Gay via use-livecode: Has anyone else tried the native Android button and field widgets? When I use the field widget, text entered into the field isn't displayed. I figured out it was placed below the bottom edge, out of view. There isn't a way to adjust the textheight so I can't make it visible. This is a single line entry field. The Android button has a label assigned but it isn't displayed either. The button is blank. I'm just checking to see if I need to submit a bug report. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Native Android widgets
Nope, i'm still not using them Op 28-10-2018 om 18:04 schreef J. Landman Gay via use-livecode: Has anyone else tried the native Android button and field widgets? When I use the field widget, text entered into the field isn't displayed. I figured out it was placed below the bottom edge, out of view. There isn't a way to adjust the textheight so I can't make it visible. This is a single line entry field. The Android button has a label assigned but it isn't displayed either. The button is blank. I'm just checking to see if I need to submit a bug report. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Numbering lines
Thanks for this, although I’m not sure I understand. In fact I am sure I don’t.I know how amazingly fast the array method is, I use it elsewhere in the same stack, and it is great. I also don’t understand the distinction between line numbering and indexing. If I was guessing, I would go for line numbering prepends to each line in a text field a number, and indexing is adding a numerical key to a database or array. The former is what I described in my original post. The reason the issue arrises is because some of the text/chat message records I referred to have the date and time stamps stripped out. So in the following exchange… 1757Shadowknave: U gotta b there 1758What_goes_Moo: kk 1759Shadowknave: no let down? 1760What_goes_Moo: kk 1761 Shadowknave: U b there 8? 1762 What_goes_Moo: I wil … lines 2 and 4 would be identical but for the line number I added via the script. And of course, the integrity of the dialogue must be maintained. I had believed that collapsing duplicates and alphabetising are unavoidable with split. If there is an array method which doesn’t mess with the text message order or content, then I would be delighted. Is that what this is below, but I haven’t appreciated it? Cheers, David G > On 28 Oct 2018, at 1:47 pm, hh via use-livecode > wrote: > >> David G. wrote: >> Thanks Geoff, I did play with Split, but one of the reasons for numbering >> is to make any identical lines unique. With split, for any that are not, >> all but one is deleted. So definitely not the result I wanted. > > I am not Geoff (who played with the simple array methods I suggested). > But your post attacks indirectly my suggested handlers below as wrong, as if > they would not hit your question. > > My handlers (which are at least 600 times faster than your first script) > output exactly the same what your first script outputs, seen apart from the > optional delimiter. > >> So definitely not the result I wanted. > LOL: You mention above the "unique"-side-condition the first time... > > With your new side condition from above several others (and I) know also > how this is doable very fast, once again using arrays. And it is an > invertible method, that is, the original text is exactly restorable. > > But first post YOU your new handler, to see *all* your new side conditions, > that is, or to see what you really want: > Certainly not a line numbering, rather indexing a text file. > > David G. wrote: [This is the first script] > However…. > Sometimes I want to prefix each line with the line number, and do this: > > put 1 into tcount > repeat for each line j in it > put tcount & j into line tcount of it > put tcount + 1 into tcount > set the thumbpos of scrollbar "filterprog" to tcount > end repeat > put it into field “numberedtext” > > I use ‘it’ because of a dim memory (superstition? Myth?) from long ago > that > it is faster than an arbitrarily named variable. Still, the whole process > is pretty darned slow. Any brilliant suggestions? >> >>> Geoff C. wrote: >>> And of course if retaining the order isn't critical you could just go with: >>> >>> function numberText T,D >>> split T by cr >>> combine T by cr and D >>> return T >>> end numberText >>> >>> function unNumberText T,D >>> split T by cr and D >>> combine T by cr >>> return T >>> end unNumberText >> Hermann H. wrote: 1. Besides removing scroll-update, which takes most of the time, you could try the following array-methods (which are essentially from my stack http://forums.livecode.com/viewtopic.php?p=101301#p101301 , see there card "LineNums, tab "Nb2"). This needs here on a medium fast machine (Mac mini, 2.5GHz) in average with LC 9.0.1 (which is at about 30% faster than LC 8.1.10 with that): 680 ms for 1 lines to add the line numbers, 650 ms for 1 lines to remove the line numbers, both incl. the field update (a lot of long lines are to break). -- Add "inline line numbers" [-hh fecit, 2014] -- Uses separator ": " (In LC 6 use one single char, remove below needs that) on mouseUp lock screen; lock messages put the millisecs into m1 set cursor to watch put fld "IN" into T split T by return put the keys of T into K sort K numeric repeat for each line L in K put cr & L & ": " & T[L] after S --> change separator here end repeat set text of fld "OUT" to char 2 to -1 of S put -1+the num of lines of S & " lines: " & \ the millisecs -m1 & " ms" into fld "timing" end mouseUp -- Remove "inline line numbers" [-hh fecit, 2014] -- Uses separator ": " (the above, in LC 6 you have to use one single char) on mouseUp lock screen; lock messages put the millisecs into m1 set cursor to watch
Re: Will it ever be possible place controls over browser widget?
We already know that this is not possible by "ordinary" controls because the browser widget has a native layer. (Except we"bundle" your controls in a floating window.) But there is one way more (I use it for updating my Textedit widget). Of course you can overlay a browser widget with a browser widget: Make using HTML/CSS a "Bar" (containing buttons etc.). The HTML/CSS of that is pretty simple and changeable without deep knowledge of HTML or CSS. You get a clickCallback via a javaScriptHandler and can simply use the scripts of your LCS objects from that javaScriptHandler. I made a simple example stack with 6 rounded buttons here, may be I'll update it from time to time: http://forums.livecode.com/viewtopic.php?p=172729#p172729 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Native Android widgets
Has anyone else tried the native Android button and field widgets? When I use the field widget, text entered into the field isn't displayed. I figured out it was placed below the bottom edge, out of view. There isn't a way to adjust the textheight so I can't make it visible. This is a single line entry field. The Android button has a label assigned but it isn't displayed either. The button is blank. I'm just checking to see if I need to submit a bug report. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Standalone issue
Thanks to both Brian and Jacqueline Of course, no one's code is perfect and errors do occur, particularly in the early going. Interesting that this "fix/issue" deals with an error occurring *in* the standalone as the standalone is being built. Anyway, if there is an error which the standalone build "exploits" because of this condition, GOOD! I'm sure we hope for (but don't always receive) an accurate cause of errors by ANY development system. So, I'm good with the standalone "causing" *any* error if there's an error in my actual code. I appreciate the explanations. Douglas Ruisaard Trilogy Software (250) 573-3935 > > On 10/27/18 10:26 AM, Douglas Ruisaard via use-livecode wrote: > > If that's true then there's (sigh!) one more reason to stay away from LC > > v9... but I really don't > understand the reason why this is necessary in the first place. I've never > had a standalone fail with > a "can't find stack" error: > > If your builds are going smoothly you don't have to change anything. Try > it in LC 9 and see. The problem only occurs if any "open" or "close" > handlers do something that interferes or throws errors. > > > So, does this situation only occur for the first standalone build? Not the > > second time? What is > implied should be done if one of the conditions in the function is false? > very confusing!!! > > A "can't find stack" used to occur the first time you build during any > one session. The updated handler check fixes this so you don't need to > worry about it any more. > > > > > I guess I was looking for something more specific about where to put this > > "fix": > > > > e.g. > > > > In an openStack call, you'd put this ... where? At the end of the code > > just before the "end > openStack"? (that's where I put it): > > > > if isBuildingStandalone() then > >exit openstack > > end if > > The idea is that this fix will prevent the handler from executing at > all, so it needs to be at the very front of the handler, right after the > "on " line. > > > My question, then, is do I have to have a similar "if > > isBuildingStandalone()" call in all the > "opens" and "closes" you list (and others) and do I "exit" the call if > isBuildingStandalone() returns > "true"? > > > > WOW! ... if THAT's needed then I can't imagine anyone editing all of their > > code to do this!!! > > Yes, that's what the additional lines do -- exit the handler before it > can run. And I agree that this is an issue for some apps. The problem it > tries to solve is retention of script local variable values, as well as > preventing unnecessary handlers from running. But I'd rather > reinitialize things when necessary than to add extra lines to so many > engine messages. > > I'd be happy with a simple toggle that lets me turn on lockmessages > before building. I've been accomodating that behavior for years. > > -- > Jacqueline Landman Gay | jac...@hyperactivesw.com > HyperActive Software | http://www.hyperactivesw.com > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Numbering lines
> David G. wrote: > Thanks Geoff, I did play with Split, but one of the reasons for numbering > is to make any identical lines unique. With split, for any that are not, > all but one is deleted. So definitely not the result I wanted. I am not Geoff (who played with the simple array methods I suggested). But your post attacks indirectly my suggested handlers below as wrong, as if they would not hit your question. My handlers (which are at least 600 times faster than your first script) output exactly the same what your first script outputs, seen apart from the optional delimiter. > So definitely not the result I wanted. LOL: You mention above the "unique"-side-condition the first time... With your new side condition from above several others (and I) know also how this is doable very fast, once again using arrays. And it is an invertible method, that is, the original text is exactly restorable. But first post YOU your new handler, to see *all* your new side conditions, that is, or to see what you really want: Certainly not a line numbering, rather indexing a text file. > >>> David G. wrote: [This is the first script] > >>> However…. > >>> Sometimes I want to prefix each line with the line number, and do this: > >>> > >>> put 1 into tcount > >>> repeat for each line j in it > >>> put tcount & j into line tcount of it > >>> put tcount + 1 into tcount > >>> set the thumbpos of scrollbar "filterprog" to tcount > >>> end repeat > >>> put it into field “numberedtext” > >>> > >>> I use ‘it’ because of a dim memory (superstition? Myth?) from long ago > >>> that > >>> it is faster than an arbitrarily named variable. Still, the whole process > >>> is pretty darned slow. Any brilliant suggestions? > >> Geoff C. wrote: >> And of course if retaining the order isn't critical you could just go with: >> >> function numberText T,D >>split T by cr >>combine T by cr and D >>return T >> end numberText >> >> function unNumberText T,D >>split T by cr and D >>combine T by cr >>return T >> end unNumberText > >>> Hermann H. wrote: >>> 1. Besides removing scroll-update, which takes most of the time, you could >>> try the following array-methods (which are essentially from my stack >>> >>> http://forums.livecode.com/viewtopic.php?p=101301#p101301 >>> , see there >>> card "LineNums, tab "Nb2"). >>> >>> This needs here on a medium fast machine (Mac mini, 2.5GHz) in average >>> with LC 9.0.1 (which is at about 30% faster than LC 8.1.10 with that): >>> >>> 680 ms for 1 lines to add the line numbers, >>> 650 ms for 1 lines to remove the line numbers, >>> both incl. the field update (a lot of long lines are to break). >>> >>> -- Add "inline line numbers" [-hh fecit, 2014] >>> -- Uses separator ": " (In LC 6 use one single char, remove below needs >>> that) >>> on mouseUp >>> lock screen; lock messages >>> put the millisecs into m1 >>> set cursor to watch >>> put fld "IN" into T >>> split T by return >>> put the keys of T into K >>> sort K numeric >>> repeat for each line L in K >>> put cr & L & ": " & T[L] after S --> change separator here >>> end repeat >>> set text of fld "OUT" to char 2 to -1 of S >>> put -1+the num of lines of S & " lines: " & \ >>> the millisecs -m1 & " ms" into fld "timing" >>> end mouseUp >>> >>> -- Remove "inline line numbers" [-hh fecit, 2014] >>> -- Uses separator ": " (the above, in LC 6 you have to use one single char) >>> on mouseUp >>> lock screen; lock messages >>> put the millisecs into m1 >>> set cursor to watch >>> put the text of fld "OUT" into S >>> split S by return and ": " --> change separator here >>> put the keys of S into K >>> sort K numeric >>> repeat for each line L in K >>> put cr & S[L] after T >>> end repeat >>> put char 2 to -1 of T into fld "IN2" >>> put -1+the num of lines of T & " lines: " & \ >>> the millisecs -m1 & " ms : " & (fld "IN2" is fld "IN") into fld >>> "timing" >>> end mouseUp ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Numbering lines
Thanks Geoff, I did play with Split, but one of the reasons for numbering is to make any identical lines unique. With split, for any that are not, all but one is deleted. So definitely not the result I wanted. I’ll sacrifice the progress bar and see where that leaves me. Thanks folks. > On 28 Oct 2018, at 1:32 am, Geoff Canyon via use-livecode > wrote: > > And of course if retaining the order isn't critical you could just go with: > > function numberText T,D > split T by cr > combine T by cr and D > return T > end numberText > > function unNumberText T,D > split T by cr and D > combine T by cr > return T > end unNumberText > > On Sat, Oct 27, 2018 at 5:29 PM Geoff Canyon wrote: > >> Sorry, missed a delimiter reference: >> >> function numberText T,D >> split T by return >> put "1" & D & T[1] into R >> repeat with K = 2 to item 2 of the extents of T >> put cr & K & D & T[K] after R --> change separator here >> end repeat >> return R >> end numberText >> >> On Sat, Oct 27, 2018 at 5:27 PM Geoff Canyon wrote: >> >>> Converted to functions with the text and delimiter as paramaters for ease >>> of use: >>> >>> -- Add "inline line numbers" [-hh fecit, 2014] >>> function numberText T,D >>> split T by return >>> put "1:" && T[1] into R >>> repeat with K = 2 to item 2 of the extents of T >>> put cr & K & D & T[K] after R >>> end repeat >>> return R >>> end numberText >>> >>> -- Remove "inline line numbers" [-hh fecit, 2014] >>> function unNumberText T,D >>> split T by return and D >>> put the keys of T into K >>> sort K numeric >>> repeat for each line L in K >>> put cr & T[L] after R >>> end repeat >>> return char 2 to -1 of R >>> end unNumberText >>> >>> >>> >>> On Sat, Oct 27, 2018 at 11:54 AM hh via use-livecode < >>> use-livecode@lists.runrev.com> wrote: >>> 1. Besides removing scroll-update, which takes most of the time, you could try the following array-methods (which are essentially from my stack http://forums.livecode.com/viewtopic.php?p=101301#p101301 , see there card "LineNums, tab "Nb2"). This needs here on a medium fast machine (Mac mini, 2.5GHz) in average with LC 9.0.1 (which is at about 30% faster than LC 8.1.10 with that): 680 ms for 1 lines to add the line numbers, 650 ms for 1 lines to remove the line numbers, both incl. the field update (a lot of long lines are to break). -- Add "inline line numbers" [-hh fecit, 2014] -- Uses separator ": " (In LC 6 use one single char, remove below needs that) on mouseUp lock screen; lock messages put the millisecs into m1 set cursor to watch put fld "IN" into T split T by return put the keys of T into K sort K numeric repeat for each line L in K put cr & L & ": " & T[L] after S --> change separator here end repeat set text of fld "OUT" to char 2 to -1 of S put -1+the num of lines of S & " lines: " & \ the millisecs -m1 & " ms" into fld "timing" end mouseUp -- Remove "inline line numbers" [-hh fecit, 2014] -- Uses separator ": " (the above, in LC 6 you have to use one single char) on mouseUp lock screen; lock messages put the millisecs into m1 set cursor to watch put the text of fld "OUT" into S split S by return and ": " --> change separator here put the keys of S into K sort K numeric repeat for each line L in K put cr & S[L] after T end repeat put char 2 to -1 of T into fld "IN2" put -1+the num of lines of T & " lines: " & \ the millisecs -m1 & " ms : " & (fld "IN2" is fld "IN") into fld "timing" end mouseUp 2. All "big" editors that show line numbers never update the whole long text ** but only a few lines more than the visible line range **. Using that, nearly every LCS method (that locks the screen (and messages)) will be fast enough. > JLG wrote: > Another issue may be the line that updates the scrollbar. Try commenting out > that line as a test just to see if that's the problem. If so, you might opt > for a spinner or progress bar instead. > >> David Glasgow wrote: >> your routine is about the same as mine - 3200 lines in 106 seconds (on my >> fairly old MacBook). >>> Mark Hsu wrote: >>> wrote: >>> >>> I think your issue is where you say “put tcount & j into line tcount of it” >>> — The line X of … call is very slow as it has to count every line from 1 - X. >>> try this: >>> >>> local tBuffer >>> put 1 into tCount >>> repeat for each line j in pText >>> put tCount & j & lf after tBuffer >>> add 1 to tCount >>> set the thumbpos of scrollbar “filterprog” to tCount >>> end repeat >>> delete line -1 of tBuffer
Re: How to find true words that start with a capital letter?
Thanks Alex. The text could be Unicode or ASCII, depending on the source, so I’m assuming the former to be on the safe side. I did think of checking the character number but whilst the ASCII range is neat, identification of Unicode capital letter codes seem to be complex. Perhaps I’ll start with support for Latin languages, where I can at least see and understand the upper/lower case test results! :-) Keith > On 26 Oct 2018, at 19:07, Alex Tweedly via use-livecode > wrote: > > You say "... containing A-Z" > > Are you really using unicode ? Or is it really just ASCII ? > > if so, you could do > >put char 1 of tWord into temp >if 65 <= temp AND temp <= 90 then ... > > Alex. > > > > On 26/10/2018 12:21, Keith Clarke via use-livecode wrote: >> Folks, >> What is the most efficient way to search for trueWords starting with a >> capital letter? >> >> Is there anything more direct than something like... >> >> repeat for each true word tWord in tContainer >> >> If char 1 of tWord is among the codePoints of tUnicodeLetters // a >> variable containing A-Z >> then put tWord into tCapitalised >> >> end repeat >> >> Thanks & regards, >> Keith >> ___ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your subscription >> preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode