Rebuilding The Tools Palette

Organizing tasks to work on, New Features Ideas, Building LCS & LCB Libraries & Widgets, Redecorating and Modifying the IDE, Hacking / Editing Tools, Compiling the Engine from Source, etc.
User avatar
OpenXTalkPaul
Posts: 1802
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Rebuilding The Tools Palette

Post by OpenXTalkPaul »

Glad you like it.

And yes it's just a normal Polygon-style Graphic control so there shouldn't be any compatibility issues involved.

I was going to add a pre-made triangle shape, but there's two different ways that could be done:
As Polygon with a three-point Points list...
Or as a 'Regular Polygon' with its polygonSides set to 3.

They look and behave slightly different in that a 'Regular Polygon' has an angle property you can use to easily rotate the graphic. While the 'Polygon' with a Points list allows for manually editing the points with click+drag (which I've sort of half-fixed the edit mode, it's still wonky, gets controls 'stuck' in edit mode)

I like the plain (non control) style for the 'type'' setting, with that you 'draw' the graphic shape to your preferred size, instead of having it be a static size that you drag drop and subsequently edit.

Working on this divertion made me want to work more on my Points-to-SVG Paths handlers. If you pass that multiple graphics objects, the handler combines them into one big points list. But then it converts that Points list to an SVGPath string, I'll have to add an option for getting a plain old points list as the result.

It would also be useful to have a handler that goes in the opposite direction: SVG iconPath to Points list, but the 'Polygon' style Graphics objects can't do curved paths, only straight lines from point to point, so there would be some math involved to convert bezier curves to a bunch of straight line. I know it's doable because a long time ago there was a stack that imported SVGL, converting them to a group of many Graphic controls.

I must admit I never really looked too much into how the Graphics and Paint Tools work in the engine. It has surprisingly good graphics capabilities built-in but the Tools palette has sentenced them to the smallest possible icons in the palette, hidden away or completely misplaced some of the Tools over the years. Misplaced like the Paint-Line tool. The opposite of showcasing these features. I'm not saying it could replace Adobe Illustrator or InkScape, but I will say that its vector-graphics capabilities are at the very least equivalent to 'Mac Draw' or similar.

The eyedropper tool is another missing Tool, it still works, though it falsely triggers permission request for 'screen recording' when running on newer macOS versions. You can invoke it manually from the message box. BTW, I'm not sure how he did this (yet), but the great Hermann Hoch made an eyedropper tool in his Color Picker Widget that does NOT invoke the 'screen recording' permissions request when it samples pixels anywhere on the screen.
User avatar
tperry2x
Posts: 1750
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Rebuilding The Tools Palette

Post by tperry2x »

OpenXTalkPaul wrote: Thu May 23, 2024 9:20 pm I was going to add a pre-made triangle shape, but there's two different ways that could be done:
As Polygon with a three-point Points list...
Or as a 'Regular Polygon' with its polygonSides set to 3.
Yes, I've added some more:
shapes.png
shapes.png (38.97 KiB) Viewed 590 times
OpenXTalkPaul wrote: Thu May 23, 2024 9:20 pm there would be some math involved to convert bezier curves to a bunch of straight line. I know it's doable because a long time ago there was a stack that imported SVGL, converting them to a group of many Graphic controls.
Richmond found that if you rotate a beizer curve in the IDE, even by 1 degree, it'll make points out of it. You could rotate it clockwise 1 degree, then back anticlockwise by 1 degree and you have your points (possibly?) - just a random idea.
OpenXTalkPaul wrote: Thu May 23, 2024 9:20 pm the great Hermann Hoch made an eyedropper tool in his Color Picker Widget that does NOT invoke the 'screen recording' permissions request when it samples pixels anywhere on the screen.
I'd be interested to know how that works, so I can avoid the MacOS permissions dialog when getting the effective background colour of a stack. I'd perhaps instead use his method to return the colour.
User avatar
OpenXTalkPaul
Posts: 1802
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Rebuilding The Tools Palette

Post by OpenXTalkPaul »

tperry2x wrote: Thu May 23, 2024 10:52 pm
Richmond found that if you rotate a beizer curve in the IDE, even by 1 degree, it'll make points out of it. You could rotate it clockwise 1 degree, then back anticlockwise by 1 degree and you have your points (possibly?) - just a random idea.
Oh I wasn't concerned about getting points from the other styles of graphics controls, I know how to get that and you don't need to rotate either, just do this:
get the effective points of graphic "My Rounded Rectangle"

However IIRC, using that 'revRotate' does creates a custom property on the graphic control that contains a new version of the points list that has a higher decimal precision (so like 'sub-pixel' values).
the great Hermann Hoch made an eyedropper tool in his Color Picker Widget that does NOT invoke the 'screen recording' permissions request when it samples pixels anywhere on the screen.
I'd be interested to know how that works, so I can avoid the MacOS permissions dialog when getting the effective background colour of a stack. I'd perhaps instead use his method to return the colour.
I only just noticed this detail today, I'll look at the lcb source for his palette (that you HH!) when I get a chance later and get back to you on that. HH did some fantastic work, I certainly miss seeing his stuff. Thankfully he put much of it out as Open Source / MIT License.
User avatar
richmond62
Posts: 3024
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Rebuilding The Tools Palette

Post by richmond62 »

Richmond found that if you rotate a beizer curve in the IDE, even by 1 degree, it'll make points out of it.
That's odd, I have no memory of that.

What I do remember is that if one rotates one of the preset vector shapes points 'magically' appear.

And if you want to make me very happy indeed, how about the return of the rectangular graphic WITHOUT the rounded corners?
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 1750
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Rebuilding The Tools Palette

Post by tperry2x »

richmond62 wrote: Fri May 24, 2024 7:20 pm That's odd, I have no memory of that.
I'll try and find it, but it's a pain to find things here sometimes.
It's where we were talking about rotating a graphic and the IDE converting bits to points. (You mentioned it on the other forum and caused a stir :lol: , where it generated a few comments)
richmond62 wrote: Fri May 24, 2024 7:20 pm What I do remember is that if one rotates one of the preset vector shapes points 'magically' appear.
That's about it. That's what I meant.
richmond62 wrote: Fri May 24, 2024 7:20 pm And if you want to make me very happy indeed, how about the return of the rectangular graphic WITHOUT the rounded corners?
You mean, having a tool that isn't the square - but a simple rectangle. I thought the rectangle tool always had rounded corners, but I don't remember for definite. I'd normally either just draw a square and stretch it, or I'd set the radius to 0:
rect.png
rect.png (60.66 KiB) Viewed 547 times
I could add a few more shapes easily enough (thanks Paul for the info), but I wondered about maybe having a popup menu with a whole selection of sample shapes.
User avatar
richmond62
Posts: 3024
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Rebuilding The Tools Palette

Post by richmond62 »

As far as I recall the rectangle with rounded corners came in with LC 8, and very nice too: the only problems being that:

1. The 'plain Jane' square vanished.

2. when a rounded rectangle has its corners set to 0, when lined up against other rectangles it can be seen there is a curve; so background coloured spots!
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 1750
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Rebuilding The Tools Palette

Post by tperry2x »

richmond62 wrote: Sat May 25, 2024 6:34 pm when a rounded rectangle has its corners set to 0, when lined up against other rectangles it can be seen there is a curve
Hmm, okay. I never noticed that before. The only reason I'm a bit hesitant to add a specific tool that produces a rectangle is because it's very similar to the standard square tool.
In as much as, you can just draw a square and drag it out to produce the desired rectangle. I wonder if that's why LC got rid of it: maybe they decided it was almost a duplication of the square tool, I don't know.

I'd possibly add more shapes in future, so could add it in a popup or something. I was thinking about the idea of other vector shapes that people might find handy. Things they could just drop in to projects.
Something like a few symbols people might use when building an IDE: A lightbulb (to show tips / hints), gearwheel (for settings), (as much as I might dislike them): mobile control icons such as 4 horizontal stacked lines, refresh / round chasing arrows (for indeterminate progress)... but just ideas at the moment.
User avatar
OpenXTalkPaul
Posts: 1802
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Rebuilding The Tools Palette

Post by OpenXTalkPaul »

I'm working something different here, I spent some time over the (US) holiday long-weekend working on the Paint tools section (I'm going for kind-of like a 'tabbed' interface, sans tabs).

When I get to Vector Graphics card, I'm planning on having all the basic geometric shapes (square, rect, round rect, triangles, etc.) plus a few more like 'star" and "word-balloon(s)", both as drag and drop objects and also as 'Tools' that user can draw with the selected shape instead of placing it. I dunno though, that may be overkill, maybe just have it be a toggle between the two 'modes'?
User avatar
OpenXTalkPaul
Posts: 1802
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Rebuilding The Tools Palette

Post by OpenXTalkPaul »

Still chipping away at this, getting closer:
Tools Redo 0.6.oxtstack
(1.22 MiB) Downloaded 13 times
User avatar
tperry2x
Posts: 1750
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Rebuilding The Tools Palette

Post by tperry2x »

This is probably an obvious question, but is this designed to work only with your 'full-fat' OXT?
Not a problem if that's the case, as it's looking for a curve widget that I don't have in OXT lite, so throwing a script error.
Doing some other weird window focus stuff too, but that probably my fault for trying it in non 'full-fat' OXT.
User avatar
richmond62
Posts: 3024
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Rebuilding The Tools Palette

Post by richmond62 »

I will reiterate my plea to have something later than RC3 of OXT Heavy available for download.
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 1750
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Rebuilding The Tools Palette

Post by tperry2x »

richmond62 wrote: Sat Jun 01, 2024 3:10 pm I will reiterate my plea to have something later that RC3 of OXT Heavy available for download.
I would love to try out the advancements you've made Paul, since RC4, and I see that the RC4 mac version was the latest release.
So, I thought I'd download the 'tools' folder from github...

How do I do that?
how.png
how.png (104.36 KiB) Viewed 352 times
There is no option to download it.

So, I looked at using https://download-directory.github.io
Just to see if I could download it that way, but it gives up (too many files I expect).
Screenshot_2024-06-01_17-10-18.png
Screenshot_2024-06-01_17-10-18.png (88.95 KiB) Viewed 352 times
I was going to take the contents of that tools folder, then put them in this barebones linux folder.
barebones.png
barebones.png (29.46 KiB) Viewed 352 times
The crazy idea I had was to then be able to open the linux engine and see the latest improvements from your github code.
Except I can't, because it won't download.

I do not want to install github cli tools (or whatever) on this machine to do it. I just want a download link for that 'tools' directory.

So, I just tried
downgit.github.io
but when it gets to file 675 of 675, all I get is: Image
Then eventually:
error.png
error.png (4.99 KiB) Viewed 341 times
So the 'Tools' directory is effectively 'stuck' in github it seems. Anyone know how to download it without having to install the cli tools?

Edit: given up expecting there to be a straightforward way to get a folder in github. Because it seems there isn't.
I would've used svn, but can't even do that as they blocked that in January this year.
So, relented and downloading 'everything'.... not sure how long that will be or what the size is as it can't tell me:
Screenshot_2024-06-01_18-38-25.png
Screenshot_2024-06-01_18-38-25.png (14.33 KiB) Viewed 335 times
User avatar
tperry2x
Posts: 1750
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Rebuilding The Tools Palette

Post by tperry2x »

After about a 1.4GB download, I finally got the file from github downloaded.
Then swapped in the files, so I could make my own 'RC4.5?' version.
It opens, and works - so I thought I'd try your new tools palette in it.

Still no joy. So is there stuff that isn't in github that this tools palette relies on?
still-no-joy.png
still-no-joy.png (246.78 KiB) Viewed 332 times
Then I went fiddling about with it and found a few issues, but again, this was probably my own fault for building a "franken-oxt-heavy" in the first place.

None of that is intended to rush you Paul, or anything. I just wanted to see if I could build an OXT-heavy from what's in github, but doesn't seem like it's up to date at the moment.
User avatar
OpenXTalkPaul
Posts: 1802
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Rebuilding The Tools Palette

Post by OpenXTalkPaul »

Oh thanks, this was very interesting actually. Its strange I don't have any problem with this stack in my build on MacOS (BigSur), I tested in LC CE 9.6.3 before upload. Now I retest, still no prob for OXT DPE, but errors out on LC CE now? I may have messed something up somewhere in an IDE file I edited? It can be tough to debug IDE files because many times they will fail silently. I'm going to have to investigate this difference further.

Anyway that error was related to the fact that I hadn't renamed the default name of widget "SVG Icon" to "curve" for that icon yet. 'Curve" is the little 'peanut' shaped icon (from HyperCard?), I'm going to replace that with a standard 'pen-tool' icon. This is very much work-in-progress, I just started building the 'graphics' section card. If you comment that line out it should be good.
-- EDIT -- It's supposed to go to 'Graphics' card and then highlight the 'Curve' tool icon (which is a SVG Icon widget), but I also missed a 'break' in the case/switch in the group script of the icons that changes the 'tools' card so it was going to the next case instead. I'll upload again after some more work on the graphics tab is done.

The video you posted is maybe a different story, I think that is all part of the issues with the Message Box constantly trying to grab focus on Linux. We've already seen this cause problems with other IDE palettes.

The IDE repo is sadly out dated, I'll try to fix that soon, I've been trying to clean up my messes for the past week or so... lots of little experiments lying around.
User avatar
OpenXTalkPaul
Posts: 1802
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Rebuilding The Tools Palette

Post by OpenXTalkPaul »

Got a little bit further today, but hit up against some snags....

1) the templateGraphic seems to reset itself after a graphic 'tool' is used, reverting back to "rectangle" style (I assume that is the default style' for the 'graphic tool'). This may actually be a conflict with my modified revTools stack. I thought I fixed it, but it came back! I can't seem to track it down. The issue is not present in LC CE 9.6.3 so I know that it's my bug to fix.

2) "Reshape polygon" in the main IDE revMenubar and the "Reshape polygon" in the contexual menu popup seems to be two separate handlers, I have to toggle them both off separately to get the selectedGraphic back to a non-editMode state. So that needs fixing, but at least it graphics objects no longer get completely stuck in polygon editMode. There is a similar issue where the "gradient" editMode used in the Property Inspector gets stuck in edit mode.

3) Due to the above I looked in the dictionary to see how to turn off editMode and there isn't anything in the entry to indicate the correct syntax for that. I found it in the entry on the LC Wiki site! The correct syntax is:

Code: Select all

set the editMode of graphic "myGraphic" to "none" 
Important to note that you MUST use the quoted form of "none" because non-quoted 'none' is a numeric constant that is equal to 0 (zero) (which is due to 'the way 'the cursor' works).
User avatar
OpenXTalkPaul
Posts: 1802
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Rebuilding The Tools Palette

Post by OpenXTalkPaul »

Still has some glitches but its getting better:
Tools Redo 0.7.oxtstack
(1.22 MiB) Downloaded 11 times
For super tall single column view that's taller than the height of screen 1, I think I might try using the stack scaleFactor setting to make it fit on screen. Another option perhaps to add zoom-level controls (magnifying glass +/- Icons, popup menu or something). The palette was woking well and looked fine to me at 75% and 50% scale size, maybe I should allow up to 200% scale for us old people with failing eyesight?

I tested this stack briefly with OXT Lite 1.05 and the 'shape tools' like 'Star' didn't reset back to the default templateGraphic on Lite build which is good, I just need to track down what I messed up. One thing I noticed is the palette window reshaping process isn't quite as smooth as it is on OXT DPE (RC5) for some reason, which is really odd since they're essentially the same, same engine anyway.

The paint and graphics tools do not use the IDE theme icons and currently it does not use any of the previous revTools handlers. The icons for everything except 'classic' objects. are SVG Path widgets, so that the icons can be easily switched out. I've been trying to build a cohesive OXT set of all of the IDE icons (some of these are vectorized versions HyperCard icons I manually made myself). That isn't as easy as one might think because size and line weights should be close to same for all, but the nice thing with this set-up is that I can easily tweak the paths until I'm satisfied with the set. I may put some more of the previous revTools 'wiring' back in when I'm done with the Graphics tools, that way we can still add or edit edit properties of objects by editing those property files as posted about previously.
User avatar
OpenXTalkPaul
Posts: 1802
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Rebuilding The Tools Palette

Post by OpenXTalkPaul »

richmond62 wrote: Fri Apr 26, 2024 5:19 pm Since when was LC able to muck around with an operating system's settings?
You could always sort of muck around with an operating system's settings, I've used it for that many times, usually via shell() (for example: defaults write com.apple.finder "AppleShowAllFiles" -bool "false" && killall Finder to show invisible files/folders). Of course you may need to be an admin privileged user to muck around with some settings.
Mucking around with OS settings can be also be done more directly by using XBuilder + FFI since v9.x.

Some more examples of using defaults write here:
https://macos-defaults.com/
User avatar
OpenXTalkPaul
Posts: 1802
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Rebuilding The Tools Palette

Post by OpenXTalkPaul »

Getting a bit closer still to being a complete tools replacement. Mostly just need to re-add the 'Tool Controls' (Paint Color Selectors, Brush picker, etc.)
Tools Redo 0.8.oxtstack
(1.15 MiB) Downloaded 7 times
This version includes the new-paint-image fix from OXT Lite for now, but I think I might try to change that so it only triggers new 'suitable-image' when user actually clicks while a paint tool is the current tool.

I noticed that because this palette is a resizable window, we get this macOS native behavior for free:
Screen Shot 2024-06-10 at 2.04.18 PM.png
Screen Shot 2024-06-10 at 2.04.18 PM.png (115.68 KiB) Viewed 170 times
User avatar
tperry2x
Posts: 1750
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Rebuilding The Tools Palette

Post by tperry2x »

OpenXTalkPaul wrote: Mon Jun 10, 2024 6:08 pm I noticed that because this palette is a resizable window, we get this macOS native behavior for free
That is indeed quite handy, but what of Windows and Linux? - or is your intention that OXT 'heavy' is going to be a MacOS-only-build?
(That's not a dig, even though it might read like one :lol: - it's a genuine question). I wondered how we might produce the same menu in Windows or Linux?
User avatar
OpenXTalkPaul
Posts: 1802
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Rebuilding The Tools Palette

Post by OpenXTalkPaul »

tperry2x wrote: Tue Jun 11, 2024 4:49 pm
OpenXTalkPaul wrote: Mon Jun 10, 2024 6:08 pm I noticed that because this palette is a resizable window, we get this macOS native behavior for free
That is indeed quite handy, but what of Windows and Linux? - or is your intention that OXT 'heavy' is going to be a MacOS-only-build?
(That's not a dig, even though it might read like one :lol: - it's a genuine question). I wondered how we might produce the same menu in Windows or Linux?
I didn't test this on Linux or Windows but they have their own window managers and I believe most WM will react to a window's zoom button in their own standard way (whatever that may be for a particular window manager). I didn't do any scripting to enable this if that's what you're thinking. I'm not even sure it's possible to intercept and trap "window zoom button clicked"(whatever) message before the OS window manager handles it?

Emscripten / web "platform" there is no window manager, so I'll have to script a window controller for a tools palette to run work with that. Which is why I've been thinking about making some sort of window manager library or window-controller widget.

Scripting the same behavior would be easy, just set palette's width to half of screen 1's width and then send 'DoResize' message to whatever card it's currently on and it will auto-fit to the new width.

I spent most of this morning trying to redo the "suitable-image" fix. Dealing with paint tools is a real pain because the paint tools do not send normal mouse messages: mouseDown, mouseUp, etc. I had to resorted to using 'subscribe to ideMouseMove' + check if tool is a paint tool + check topStack has no images + wait until mouse is "down" (because 'wait until the mouseClick' doesn't work with paint tools either) and then it will create the "suitable-image". But It's only slightly better behavior IMO, it doesn't create an image just by selecting a paint tool, you have move mouse within a stack with no images while a paint tool is in use before it will create an image.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests