Auto scrolling a locked field when mouse comes to edge

2017-02-01 Thread David Epstein via use-livecode
When the mouse drags across text in an unlocked (horizontally and vertically) scrolling field, the field automatically scrolls at a legible rate to display the (previously hidden) text that the mouse was dragging toward. Has anyone scripted a way to reproduce this effect for a locked field? Many

Re: Auto scrolling a locked field when mouse comes to edge

2017-02-01 Thread David Epstein via use-livecode
To clarify: For a locked field with autohilite and traversalOn both true, the “built in” auto scrolling works the same as with an unlocked field. I’m looking for a way to script this kind of auto scrolling with autohilite and traversalOn both false. David Epstein

Re: Area of regular polygon triangles

2018-06-07 Thread David Epstein via use-livecode
While trying Mike Bonner's suggestion of "manual" measuring, I learned the answer: a regular polygon whose official length is L and width is W is inscribed in the oval whose length is L and width is W. So for an equilateral triangle the area will be 3/4 * 3^.5 * R^2 (where R = L = W). David

HilitedLine of list field lost when unlocked field selected

2018-05-30 Thread David Epstein via use-livecode
This seems like a problem that I’ve solved before, but I can’t recall how. With a line hilited in a locked list-behavior-true field, I can use the mouse to select text in any of a number of unlocked fields without disturbing my list’s hilite. But if I use the tabKey to move the insertion

Text with accented characters

2018-06-03 Thread David Epstein via use-livecode
I am importing some text where certain characters do not look right. When I test their charToNum values I get, for example, 226 and 232. 226 is shown as a comma, but should be a lower case a with a circumflex, and 232 is shown as an upper case e with an umlaut but should be a lower case e

Area of regular polygon triangles

2018-06-06 Thread David Epstein via use-livecode
If a regular polygon has 4 or 8 sides it seems to be inscribed so that all points touch the square defined by the object’s height and width, which means that it should be fairly easy to deduce the polygon’s area. But with 3 sides, the triangle appears slightly smaller than the maximum size

Identifying empty lines of text

2018-01-12 Thread David Epstein via use-livecode
I use “the number of words in myString = 0” to test whether a line of text appears empty, since I want a line with only space characters to be understood as empty. But a line of text I pasted from elsewhere contained an invisible character whose charToNum value is 202, and this was counted as a

Re: FormattedHeight of a field and its contents

2018-02-02 Thread David Epstein via use-livecode
Thanks for the responses on this. I used Bernd’s tool and did some more tests, and found some things that may be helpful to others. While the left and right margins of a field are meant literally (a 5 pixel left margin leaves 5 white pixels to the left of the text), the top margin is more

FormattedHeight of a field and its contents

2018-01-31 Thread David Epstein via use-livecode
Is there somewhere an explanation of how a field’s textSize, borderWidth, margins, and formattedHeight interact? According to the dictionary entry for “formattedHeight”, a field’s formattedHeight is calculated “including top and bottom margins”, while the formattedHeight of a chunk is

Large files crash on Windows 10

2018-10-31 Thread DAVID Epstein via use-livecode
Does anyone else have problems dealing with large files on Windows 10? My main LiveCode tool is a stack of about 1.5 MB, and I use it to create, save, and open LiveCode stacks that store text and graphics. These "content" stacks can be anywhere from a few kilobytes to 50 MB or more. On an

Multiple regression in LiveCode?

2019-01-18 Thread DAVID Epstein via use-livecode
Has anyone written a LiveCode function that will take a table of 2 or more independent variables and 1 dependent variable, and return coefficients, intercept, and standard errors for a multiple regression? David Epstein ___ use-livecode mailing list

Repeat for each line of a variable or field?

2019-01-12 Thread David Epstein via use-livecode
I've done a little bit of speed testing showing extremely slight differences, but wonder if anyone who understands the "engine" can advise on this: Is there a difference between these two approaches? (1) put fld 1 into txt; repeat for each line k in txt; etc. and (2) repeat for each line k in

A question about openCard

2019-06-02 Thread David Epstein via use-livecode
Is there some simple way that an openCard handler can branch based on what card it is coming from? When a user goes to a different card in a stack, or to a different stack, I use an “openCard” handler to set things up. But I do not want those actions taken if the user is merely “returning” to

Re: A question about openCard

2019-06-08 Thread David Epstein via use-livecode
Several people gave helpful replies to my question, including pointing out that this is a case of “resumeStack”, not “openCard”: Is there some simple way that an openCard handler can branch based on what card it is coming from? When a user goes to a different card in a stack, or to a different

Re: A question about openCard

2019-06-08 Thread David Epstein via use-livecode
Jacqueline is correct: if I’m not debugging, the execution contexts is not in the list of recentCards. But my palette still does not appear in the list of recentCards. Further testing reveals: although activating a palette triggers a resumeStack message, and leaving a palette triggers a

Re: script for redo/undo text?

2019-07-10 Thread David Epstein via use-livecode
I cannot help with the project of "unlimited" undo/redo, but a simple one-layer undo for fields is not hard to implement. Sean Cole's suggestion that we should record the field state whenever a key is pressed I think does more than is wanted; if you type 10 characters, you don't want to

Reading and writing globals by script

2019-08-10 Thread David Epstein via use-livecode
I want to write a function that will read and write to any named global. What I have below seems to work, but I’m not sure quite why. Usually, “put gName into oldVal” for a global named gName would put the value, not the name, of that global into oldVal. But here it does not. function

Re: DataGrid question...

2020-03-30 Thread David Epstein via use-livecode
This is more or less Jacqueline Gay’s suggestion, but with a couple of wrinkles. You do need to adjust for the horizontal scroll of the field (I’m not sure about borders or margin). And if I am not mistaken sometimes “the tabStops” will not have an entry for each tab, if the column width

Updating a menubar button on Mac

2020-09-21 Thread David Epstein via use-livecode
I can use a “mouseEnter” handler to update a menu button’s contents just before the user displays that menu. But if that menu button is part of the stack’s menubar group on a Mac, the Mac menu does not seem to receive the mouseEnter message and the menu is not updated. Is there a workaround?

Saving stacks before closing

2020-05-24 Thread David Epstein via use-livecode
I want to give the user a choice of whether to save changes before closing a stack. To script this, I will handle the closeStackRequest message, and find a way to keep track of whether the stack in question has been changed since it was last saved. What I am trying to figure out is under what

Re: Implementing UNDO

2021-05-21 Thread David Epstein via use-livecode
LC’s built in undo does not appear to undo anything done by something I have scripted. My approach is to use a global array variable “u” to store information needed to undo the most recent action. On each action, an “undoInit” puts empty into u, after (if necessary) cleaning up anything u’s

Smooth scrolling

2021-02-01 Thread David Epstein via use-livecode
My impression is that a LiveCode field scrolls less smoothly than a comparable field in some other programs, such as MS Word and Scrivener. If I paste about 25,000 words into a word wrapped scrolling field, and then drag the scrolling thumb up and down there is much more jumpiness than I see

Shaping an image to fit in a polygon

2021-10-16 Thread David Epstein via use-livecode
I am trying to create an image that will appear to have the shape of some arbitrary polygon. The idea is to set the image's alphaData so that pixels within the polygon are opaque, and those outside the polygon are transparent. The scripts below create a rectangular image of whatever is under

Re: Shaping an image to fit in a polygon

2021-10-18 Thread David Epstein via use-livecode
Jacqueline Gay’s suggestion is excellent, and by exactly aligning the rect of the polygon with the rect of the image being “trimmed”, I can avoid having the image centered or repeated. See script below. I am still wondering what goes wrong with my alphaChannel approach to showing

Re: Pasting text and images together

2023-09-02 Thread David Epstein via use-livecode
clipboard > end mouseUp > > I tested this in LC 10dp6 and it works. Once you see what keys are > present with your mixed text and images copied to the clipboard, you can > choose which clipboard array and keys to work with to get the data. > > -- Paul > > >> On 9/2/2023

Re: Pasting text and images together?

2023-09-02 Thread David Epstein via use-livecode
Many thanks to Paul Dupuis and Mark Waddingham. The script below tries to test their suggestions. Using 10.0.0 dp5 on an Intel Mac, and watching execution after the breakpoint, I get errors at each "try" in the script. So it does not seem that I can write the fullClipboardData or

Pasting text and images together?

2023-08-30 Thread David Epstein via use-livecode
From a web browser, or from programs like Word or (Apple) Notes, it is possible to copy to the clipboard a single selection that includes both text and images. Is there any way to paste all of this information to LiveCode—for example, placing the text in fields and the imageData in image

Re: Pasting text and images together?

2023-09-01 Thread David Epstein via use-livecode
To clarify my original question: I'm not expecting the built-in paste command to handle this task; I'm wondering if I can script my own paste command to handle it. Richmond, I can write a script to "paste" an image by itself (by creating an image and setting its text to clipboardData["image"]).

Re: Pasting text and images together

2023-09-04 Thread David Epstein via use-livecode
I do not know how my problems accessing the rawClipboardData were overcome, but I succeeded in reading the array values there. So I was able to address my original question of how to reconstruct in LiveCode a combination of text and image copied from another program. Conclusion thus far: no

Detecting when resizeStack is completed

2023-08-18 Thread David Epstein via use-livecode
How can I redraw objects after the user has resized the stack, but not continuously during the resize? Releasing the mouse at the end of a resize does not appear to send a mouseUp message. David Epstein ___ use-livecode mailing list

Using LiveCode with Mac Photos App

2022-04-18 Thread David Epstein via use-livecode
I want to allow selection of some images from my Mac Photos library and show them as “referenced” images in a LiveCode stack. Is there an efficient way to do this? What would be great is to open Photos, drag images from there to my LiveCode stack, and record in LiveCode the file location of

Re: Livecode performance problem

2022-08-20 Thread David Epstein via use-livecode
I didn’t text the speed, but why not put fld A into x[1] put fld B into x[2] put fld C into x[3] put fld D into x[4] combine x by column return x > > I have a set of fields, call them A, B, C, and D. Each has the same > number of lines. Each field has different text (per line) > > I need to

Is there a way to create a generic setprop handler?

2022-08-03 Thread David Epstein via use-livecode
Control “A” has many custom properties that are set by a variety of other controls. If Control “A” has a "setProp property1” handler, it can react when property1 gets set. But is there a way to give Control “A” a general handler that will be triggered whenever any of its custom properties is

Chart widget question

2022-08-03 Thread David Epstein via use-livecode
Using LC 10 dp2, I am trying to script the creation of a chart widget. My command “create widget myName as chart in group myMain” creates only a small gray box. The LC command “New Widget/Chart” creates a line chart, ready to be modified. What is the LC command doing that I am not? Or:

Re: Maximum field size

2023-01-19 Thread David Epstein via use-livecode
Thanks to Bernd for this: > Maximum length of a line in a field: > 65,536 characters storage > No more than 32,786 pixels wide for display This seems to mean we can have a 65k long line only if each character’s width is around half a pixel. And that if the character width is 10 pixels the

Re: Maximum field size

2023-01-20 Thread David Epstein via use-livecode
My testing attempts, like Bernd’s, show that the important “limits” are not just what LC can display in a field but what it can display without making things too slow. I am also wondering if the new polyGrid has different characteristics, either its absolute limits or its performance when

Maximum field size

2023-01-18 Thread David Epstein via use-livecode
How many rows or columns or characters can reasonably be displayed in a LiveCode field? A 1.39 GB text file seems pretty clearly to surpass the limit, but how much do I need to subdivide it? David Epstein ___ use-livecode mailing list

Re: Remote debugger error message

2023-07-02 Thread David Epstein via use-livecode
the problem has something to do with a message that calls a handler in a stack-in-use. Best wishes, David > > > On Thu, Jun 29, 2023 at 8:40?PM David Epstein via use-livecode > mailto:use-livecode@lists.runrev.com>> wrote: >> >> I?ve just started using LiveCode 9.6.

PDF widget and XPDFviewer

2023-06-17 Thread David Epstein via use-livecode
What is the relation between the widget “PDF” and the external “XPDFViewer” (both in Pro Features)? The latter offers more direct access to a few properties (e.g., totalCharacterCount), while the widget syntax is a little simpler. It does not appear that a PDF widget is a PDF Viewer, at least

Remote debugger error message

2023-06-29 Thread David Epstein via use-livecode
I’ve just started using LiveCode 9.6.9 and 10.0.0 DP 5 on two Intel Macs, and can do very little without getting this error message: “There was an error executing a script in stack com.livecode.library.remotedebugger. No more information is available because the stack is password protected.”

LockLoc and grab

2024-01-22 Thread David Epstein via use-livecode
A group with lockLoc set to false does not resize itself when an object in it is moved by a “grab” command. Is this a bug? Is there a simple workaround? Recipe using 10.0.0 dp6 on an intel Mac: Create a button with this script: on mouseDown; grab me; end mouseDown. Group the button.

PDF widget print quality

2024-02-20 Thread David Epstein via use-livecode
I want to use the PDF widget to print a PDF with additional markings added in LiveCode. Showing a simple PDF tax form in Widget 1 at 100% scale, I tried this script: on p1 get the pageRect of widget 1 open printing with dialog print card from (item 1 to 2 of it) to (item 3 to 4 of it) into

Comparative speed in switching among groups

2023-11-25 Thread David Epstein via use-livecode
Does anyone have practical experience or an understanding of the engine that would cast light on the relative speed of some alternative ways of doing things? I want to switch among a number of different groups, each of which may contain its own fields, graphics, buttons, and images. Possible

Re: Comparative speed in switching among groups

2023-11-28 Thread David Epstein via use-livecode
Many thanks to Richard, for his interesting results and for the reminder that speed testing is pretty easy. I ran a similar test on a slightly different task--flipping among 50 different groups, or 50 different cards--and got similar results. Adding a “lock messages” sped up the card option

Re: LockLoc and grab

2024-01-23 Thread David Epstein via use-livecode
Let me try to clarify the problem I stated. I am not trying to remove the button, I am trying to use the “grab” command to let a user move the button around the window by dragging it. If I use a script to “set the loc” of a button to somewhere outside that group’s rectangle - the group