This might be useful for some (New AGAIN)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: This might be useful for some (New AGAIN)
Thanks Mark,marksmithhfx wrote: ↑Tue Apr 27, 2021 11:24 pm. I did run into one error when hovering over the gears. The version I downloaded from livecodeshare had a .rev extension, but the code is looking for a file with a .livecode extension.
https://postimg.cc/YjhzWjtq
Shouldn’t be a .Rev file - all my files are .liveCode... not sure why that changed. Also can’t really remember why it’s looking for a file type! (Haven’t looked at some the code in a while )
There is an issue with the gears: if you’re editing the group and hover over it, it WILL generate an error - I’m not sure what message I could trap to change this... if anyone is aware of that message I could use when starting to edit group that would help fix this!
(holding down the shift key will ignore the gears, maybe I should reverse that - but this was borne out of my laziness so I think I prefer the immediacy)
Will see if I can address these issues (and work on changing length of arrow) when possible...
Stam
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Re: This might be useful for some (New AGAIN)
Have a look at the image I just posted with the extension in my dloads folder after using the download button on Livecodeshare. I changed it to .livecode and the gear errors I was having disappeared. Your tool is very useful, and very functional. For myself, I don't expect something in this "helper class" to be completely polished. If it gets the job done...
Now we have a choice
See my next message when I post a side-by-side comparison of "guidance" dialogs created by yours and Michaels tool. I am just grateful they both exist.
Mark
https://postimg.cc/ykWpdT8f
Last edited by marksmithhfx on Thu Jul 15, 2021 9:58 pm, edited 1 time in total.
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Re: This might be useful for some (New AGAIN)
Side by side comparing skpopover and Fair and Square...
They both get the job done but in different ways. Thanks guys!
Mark
https://postimg.cc/n9rnLwrF
They both get the job done but in different ways. Thanks guys!
Mark
https://postimg.cc/n9rnLwrF
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Re: This might be useful for some (New AGAIN)
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
Re: This might be useful for some (New AGAIN)
No problems
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: This might be useful for some (New AGAIN)
(catching up on some older reading here...)
Stam-
Finally looking at your skPopover plugin. Nicely done.
The skPopover stack on livecodeShare has a .rev extension instead of .livecode.
After changing the file extension in my plugins path I still threw an error hovering over the red gears icon.
The problem is the hard-coded address when you're starting to use the plugin stack.
Changing
to
fixes the problem.
Also, the red gears icon doesn't appear at first, even though I'm in pointer mode. It's only when switching from browse mode to pointer mode that it appears. Initializing the icon on starting the plugin depending on the current tool would fix this:
Stam-
Finally looking at your skPopover plugin. Nicely done.
The skPopover stack on livecodeShare has a .rev extension instead of .livecode.
After changing the file extension in my plugins path I still threw an error hovering over the red gears icon.
The problem is the hard-coded address when you're starting to use the plugin stack.
Changing
Code: Select all
--start using stack (specialFolderPath("documents") & "/My LiveCode/plugins/skPopover.livecode")
Code: Select all
start using stack (revEnvironmentUserPluginsPath() & "/skPopover.livecode")
Also, the red gears icon doesn't appear at first, even though I'm in pointer mode. It's only when switching from browse mode to pointer mode that it appears. Initializing the icon on starting the plugin depending on the current tool would fix this:
Code: Select all
on openControl
if the environment is "development" then
revIDESubscribe "ideToolChanged"
end if
ideToolChanged
end openControl
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: This might be useful for some (New AGAIN)
Thank you for the tips @mwieder! I'll implement and upload a new version when possible (right now bogged down between my IRL non-coding work and coding projects that are long overdue for said work... but will implement these changes along with some others that have been bothering me with the plugin...mwieder wrote: ↑Sat Jul 03, 2021 4:33 am...fixes the problem.Code: Select all
start using stack (revEnvironmentUserPluginsPath() & "/skPopover.livecode")
...
Initializing the icon on starting the plugin depending on the current tool would fix this:Code: Select all
on openControl if the environment is "development" then revIDESubscribe "ideToolChanged" end if ideToolChanged end openControl
Thank you once again!
Stam
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: This might be useful for some (New AGAIN)
Oooo... looking forward to a new version.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: This might be useful for some (New AGAIN)
I've redesigned this and uploaded to liveCodeShare: http://livecodeshare.runrev.com/stack/990/SkPopover
As always, while i use this for my own purposes i share freely in case others find this helpful - any feedback welcome.
Version 0.94 changes:
- redesigned the plugin for much narrower layout, using my radial slider skRadial
- skPopover handlers moved to a behaviour script (invisible button inside the popover) to free up the popover's script for user defined functions (with the exception of 2 short handlers that ensure that the behaviour script is assigned on openControl and on resizeControl - required as the id of the button changes on copy/pasting).
- changed the way existing skPopovers can be edited: The 'red gears' graphic has been removed as that way of launching the plugin for editing was causing too many issues. Instead, select the skPopover to be edited, and click the "Edit popover" button in the plugin. Any changes made will be shown both in the selected control and in the prototype skPopover in the plugin.
If the selected object is not an skPopover or if no object is selected, it will instead set up the skPopover prototype in the plugin for editing.
- new custom property isSkPopover boolean, which identifies the group as an skPopover; this means you can iterate through controls assessing this instead of the group name, for example when hiding all popovers.
For example, to hide all popovers (eg when user clicks outside it) this can be in the card script:
Code: Select all
on mouseDown
repeat with x = 1 to the number of groups of this card
if the isSkPopover of group x of this card then hide group x of this card
end repeat
end mouseDown
API
# Custom properties:
- uSide : the side on which the arrow appears (left/top/right/bottom)
- uPercentageOfLength : the percentage of the side selected where the middle of the 'arrow' will appear
- uScaleFactor : the percentage of the side that will form the base of the arrow
- uLineSize : line size for visible elements
- uCornerRadius : corner radius of the popover box
- isSkPopover - boolean declaring thie group as an skPopover (new as of 0.94)
# Handlers
- setSide pSide : select a side of the popover to display hte arrow
- setLocation pPercentageOfLength : position the middle of the arrow at the passed percentage of length of uSide
- scaleArrow pScaleFactor : scale the width of the arrow as percentage of uside
- setCornerRadius pRadius : self explanatory
- setLineSize pSize : self explanatory
- setLineColor pColor : self explanatory
- setFillColor pColor : self explanatory
- setPositionForArrowAt pX, pY : positions the skPopover so the apex of the arrow is located at the passed coordinates (new as of 0.94)
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: This might be useful for some (New AGAIN)
Nice. Added to my plugins folder now.
Made a couple of changes though:
Button "skPopoverBehavior" still has a bnGuides button as its behavior script. Obviously a relic of some object placement - its lack is mostly harmless, but it shows up as a red flag in the Project Browser, so I deleted the behavior.
I unchecked the selectGroupedControls checkbox for the prototypePopover group. This makes it possible to move the popover once it's been copied to the topstack. Did the same for group "skRadial" in stack "skRadial"
Made a couple of changes though:
Button "skPopoverBehavior" still has a bnGuides button as its behavior script. Obviously a relic of some object placement - its lack is mostly harmless, but it shows up as a red flag in the Project Browser, so I deleted the behavior.
I unchecked the selectGroupedControls checkbox for the prototypePopover group. This makes it possible to move the popover once it's been copied to the topstack. Did the same for group "skRadial" in stack "skRadial"
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: This might be useful for some (New AGAIN)
Thanks @mwieder - that bnGuides thing was probably an accidental leftover/bug from Bernd’s bnGuides plug-in. Certainly not intended. But in the other hand, since the button is invisible and serves only to store the behaviour script is of no consequence - but will make sure it’s removed!mwieder wrote: ↑Sat Oct 23, 2021 2:50 amNice. Added to my plugins folder now.
Made a couple of changes though:
Button "skPopoverBehavior" still has a bnGuides button as its behavior script. Obviously a relic of some object placement - its lack is mostly harmless, but it shows up as a red flag in the Project Browser, so I deleted the behavior.
I unchecked the selectGroupedControls checkbox for the prototypePopover group. This makes it possible to move the popover once it's been copied to the topstack. Did the same for group "skRadial" in stack "skRadial"
Didn’t realise the selectGroupedControls setting was stored (it isn’t in mine) - but thanks for picking these points up, will correct and upload a new version.
I can also post a simple stack with some examples of how to use (eg how to dynamically set the arrow, how to position automatically for example to point at a row in a data grid etc) if that would be helpful…
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Re: This might be useful for some (New AGAIN)
Stam, if you get round to it I'd be interested in trying it out.
Best,
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
Re: This might be useful for some (New AGAIN)
Hi Mark, i had some time spare (well, more like i was trying to avoid other work )marksmithhfx wrote: ↑Sat Oct 23, 2021 5:44 pmStam, if you get round to it I'd be interested in trying it out.
Best,
Mark
Here's a small stack (4 cards) with some tips and the last card includes my standard script for triggering the popover from a data grid and dynamically moving the arrow so it doesn't get clipped by the window (note that this script lives in a mouseDown handler in the behaviour for the data grid form).
Hope that helps, but let me know if something doesn't make sense.
Stam
- Attachments
-
- skPopover tutorial.livecode.zip
- (23.09 KiB) Downloaded 109 times
Re: This might be useful for some (New AGAIN)
Just FYI - in card 2 i forgot to catch the 'mouseDown' message in the 'toggle' button.
Just add an empty mouseDown handler in the button's script and it will toggle (because i later added a handler to the card to hide popovers, it seems clicking on the button triggers the card's mouseDown unless caught in the button).
Just add an empty mouseDown handler in the button's script and it will toggle (because i later added a handler to the card to hide popovers, it seems clicking on the button triggers the card's mouseDown unless caught in the button).