Community widgets

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Community widgets

Post by [-hh] » Fri Feb 02, 2018 4:58 am

[#55] Community LCB widget "hhControls" v1.0.2

(Tested to work on newer MacOS/ Win 7+10/ Ubuntu 1604)
This is for LC 8 (version > 8.1.4).
LC 9 is currently (as of 9.0.0-dp11) not supported, sorry.

hhControls is a widget that lets you create a widget that contains controls:

One or several of

++ push buttons,
++ check boxes,
++ (groupable) radio buttons,
++ info text,
++ number steppers,
++ text steppers,
++ popup menus,
++ (horizontal) sliders,
++ color swatches (needs widget hhColorpicker)

The controls are automatically placed, you only select whether they start a new row or reside in the same row as the previous control.

Hint. Start to play with the ControlKit (see below).

The controls have a lot of properties that you can set in the property editor or by script. Find these properties documented in the dictionary.

You can set the font for the names/labels and set the fontSize.

The fontSize controls the size of the widget. All controls scale with the selected fontSize. LCB does a real good job with that, you will be surprised.

The demo stack has 5 scripted widget. The scripts show how to use the MESSAGE that is sent by the widget on mouseUp (or by hitting a push button if popped up) to its script object/the card.

For downloading the widget and a demo stack use the hh-widgets-un-installer from (Download: Sorry, currently not available). See also this post.

For an easy build of the controls I made moreover a CONTROLKIT* that is also available (Download: Sorry, currently not available). This stack lets you build a control widget by clicks and generates moreover a script that builds your widget (especially for use with "popup widget"). All widgets from the demo stack were made with the ControlKit in a few minutes. You can use this stack also for an easy edit of your built widgets (just copy the widget back to the controlKit for that).
____________
*Feb 02, 2018: New version 102b (removed a bug in the script generation)
 
Attachments
hhControls101.png
One example of a hhControls widget.
hhControls101.png (14.07 KiB) Viewed 23555 times
hhControls100.png
Another example of a hhControls widget.
hhControls100.png (26.13 KiB) Viewed 23599 times
Last edited by [-hh] on Sat Feb 22, 2020 4:02 pm, edited 3 times in total.
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Community widgets

Post by [-hh] » Mon Sep 17, 2018 11:08 pm

[#53a] Community LCB widget "hhColorPicker" v1.0.1
[Updated to 1.0.2, is now a "fat" widget (for LC 8 and 9), see viewtopic.php?p=171902#p171902 ]

Just upgraded the color picker to run with LC 9.0.1 (and added an opaque background).

The stack contains buttons to install / remove the widget.

Examples in the stack (incl. scripts to evaluate the results):
1. Use as non-popup widget, can be hidden and dragged around
2. Use as popup widget (as a modal dialog).

See the more detailed description of the widget here:
viewtopic.php?p=159190#p159190
Last edited by [-hh] on Sat Feb 22, 2020 3:59 pm, edited 7 times in total.
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Community widgets

Post by [-hh] » Sun Sep 30, 2018 5:49 pm

[#56] Community LCB widget "datePicker89" v1.0.7
[Updated to 1.0.8, see viewtopic.php?p=171902#p171902 ]

This is a *sample-stack* that has also buttons to install or remove the widget.

The widget is "fat" (contains LC 8 and 9 modules), loaded will by LC only the needed module. Both modules are of size 45 KByte, no matter how many copies of the picker you have on your cards. The widget incl. all resources has 200 KByte.

For creating new standard widgets ...
... Dragging from Tools does NOT work (is an IDE bug)
... Choose from menu Object/New Widget or
... DoubleClick the Date icon in Tools.
OR
use it, without creating, as popup.

Examples in the stack:

1. Use as standard (non-popup) widget, can be dragged around,
2. Use as popup widget (a modal dialog).

For the popup dialog you have to give at least one argument: The date to display as year, month, day. Optionally you can give 33 more properties (of which 10 are colors and 8 are styles for different parts).
Especially can you
  • set english, system or custom naming,
  • start the week on saturday, sunday or monday,
  • see the lunar phase of the picked date and
  • scale the widget to 80-280% (done by affine transforms).
Simplest usage as popup: Make a new stack and add a button with the following script, nothing else needed. Then click the button to have the modal dialog.

Code: Select all

on mouseUp
    put "today" into tP["selectedDate"]
    popup widget "community.livecode.hermann.datepicker" \
           at the botright of me with properties tP
    if it is not empty then answer it
end mouseUp
 -- it is 7 items: year, month, day, dayOfWeek number,
 -- dayOfWeek name, month name, day's lunar phase
For the standard widget you have 36 options available (additionally grabbing and a default pickerScale for use in the property inspector).

Thanks to Bernd Niggemann (bn, berndN) for valuable hints and comments.

### v1.0.7 Sep 30, 2018 ... first version on "Sample Stacks"
Attachments
datePicke_scaled2.png
The widget scaled to 200%.
Click to enlarge to oneToOne screenshot.
Last edited by [-hh] on Sat Feb 22, 2020 3:59 pm, edited 6 times in total.
shiftLock happens

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Community widgets

Post by bogs » Sun Sep 30, 2018 7:18 pm

Nice versatility on the plugin, but you know, no matter how many times I look at this ~
Selection_001.png
Selection_001.png (10.29 KiB) Viewed 23071 times
it still cracks me up Image
Image

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Community widgets

Post by [-hh] » Mon Oct 01, 2018 5:39 pm

  • [#56a] Community LCB widget DatePicker v1.0.8
    v1.0.8: Added source code (and a new name for the widget in the Tools palette).
      
  • [#53b] Community LCB widget ColorPicker v1.0.2
    v1.0.2: Made also to a fat widget (for LC 8 and 9) and added a new naming system**

    IMPORTANT.
    The kind of the widget has changed to "community.livecode.hermann.colorpicker".
    You may have to adjust some of your scripts accordingly (sorry).
      
  • [#52a] Community LCB widget IconGrid v2.1.1
    v2.1.1: Made also to a fat widget (for LC 8 and 9) and gave a new name in the Tools palette.

    For the description of the widget please see here (the widget's functionality is of v2.1.0):
    viewtopic.php?p=158112#p158112
      
Download the widgets and a corresponding sample stack from
(EU) http://hyperhh.de/widgets or
(US) http://hh.on-rev.com/widgets
_________________
(**) I needed a unique naming system for the kind of the widget and the widget's name in the Tools palette. To get less confused when developing...
Last edited by [-hh] on Sat Feb 22, 2020 3:57 pm, edited 4 times in total.
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Community widgets

Post by [-hh] » Wed Oct 10, 2018 9:17 am

  • [#42a] Community LCB widget SVGText v1.5.2
    v1.5.1: Made to a fat widget (for LC 8 and 9) and added a new name naming system**.
    v1.5.2: Removed flicker of opening.

    IMPORTANT.
    The kind of the widget has changed to "community.livecode.hermann.svgtext".
    You may have to adjust some of your scripts accordingly (sorry), or use on LC 8 the old widget parallel to the new one.
  • [#46a] Community LCB widget DigitClock v1.2.1
    v1.2.1: Made to a fat widget (for LC 8 and 9) and gave a new name for the tools palette.
  • [#47a] Community LCB widget Polygon v1.2.1
    v1.2.1: Made to a fat widget (for LC 8 and 9) and added a new name naming system**.

    IMPORTANT.
    The kind of the widget has changed to "community.livecode.hermann.polygon".
    You may have to adjust some of your scripts accordingly (sorry), or use on LC 8 the old widget parallel to the new one.
  • [#49a] Community LCB widget Progress v1.3.0
    v1.2.1: Made to a fat widget (for LC 8 and 9) and added a new name naming system**.
    v1.2.5: Added parameter to size inner/outer ring in ellipse mode.
    v1.3.0: Added text display (percentage) for both bar and ellipse mode.

    IMPORTANT.
    The kind of the widget has changed to "community.livecode.hermann.progress".
    You may have to adjust some of your scripts accordingly (sorry), or use on LC 8 the old widget parallel to the new one.
     
    [#50a] Community LCB widget OrientedText v1.5.2
    v1.5.2: Made to a fat widget (for LC 8 and 9) and gave a new name for the tools palette.
Download each of the above widgets and corresponding sample stacks from
(EU) http://hyperhh.de/widgets or
(US) http://hh.on-rev.com/widgets
_________________
(**) I needed a unique naming system for the kind of the widget and the widget's name in the Tools palette.
Last edited by [-hh] on Sat Feb 22, 2020 3:55 pm, edited 2 times in total.
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Community widgets

Post by [-hh] » Thu Oct 11, 2018 6:46 pm

  • [#43a] Community LCB widget ClockAround v1.2.5
    v1.2.1: Made to a fat widget (for LC 8 and 9) and gave a new name for the tools palette.
    v1.2.2: Added option to colorise the center (inner face).
    v1.2.5: Added options for the dots display, text display, context menu and grab.
Download the widget and a sample stack from
(EU) http://hyperhh.de/widgets or
(US) http://hh.on-rev.com/widgets
 
Last edited by [-hh] on Sat Feb 22, 2020 3:51 pm, edited 3 times in total.
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Community widgets

Post by [-hh] » Sun Oct 14, 2018 9:30 pm

[#57] Community LCB widget "baseClock" v1.0.5

BaseClock is a widget that displays by special "digits" the time encoded to a number base in range 2-60.
Encoded is each of the time items (hours, minutes, seconds). For base 2 this is known as "Binary encoded decimals".

The display is unique (I invented that) as it doesn't use characters for digits > 9 but decimal "columns".

This is easy to read and (manually) to write, for the electronic "writing" we use pathes.
If the math seems difficult to you start with base 11. This means the first digit has to be multiplied by 11, the second digit adds to that, for example 42 is 4 x 11 +2 = 46.
Then go to base 12, where 42 is 4 x 12 + 2 = 50.
In base 9 is 42 read as 4 x 9 + 2 = 38.
And so on (up to base 60and down to base 5, bases 2-4 have no digit 4).
  
baseClock.png
A BaseClock to base 15 (= quarters of 60).
The displayed time is 1x15+7=22 hours,
0x15+5=5 minutes and 3x15+12=57 seconds.
The base is (optionally) indicated at most right.
 
baseClock.png (7.49 KiB) Viewed 22714 times
  
The sample stack contains an installer and displays 17 clocks to different number bases. One display cycle for a seconds display is done by each widget in < 3 millisecs (compute and paint)!

This stack shows especially an essential improvement of LCB 9 over LCB 8: The clocks are much more "in sync" than in LC 8. Compare yourself.
And it has a substack that is prepared for displaying a baseClock "window shaped".

There are 16 options for the display, see the dictionary or open the property inspector.
Note.
Some properties of the widget are triggered by the timer, which is (as all timers) stopped in the property inspector. So you may see the changes not before going back to browse mode.


Download the widget from "Sample Stacks" or from
http://livecodeshare.runrev.com/stack/911

The widget is free for non-commercial use and has the source code included. For commercial use please give a (small) fee to the LC developer help fund.
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Community widgets

Post by [-hh] » Wed Oct 17, 2018 4:43 pm

[#58] Community LCB widget "ImageWidget" v1.1.0
Someday, everything is gonna be diff'rent when I paint my masterpiece. (Bob Dylan)
ImageWidget demonstrates the enormous possibilities that LiveCode Builder already provides. I tried to do everything in pure LCB. There is only script access where I was forced to do because LCB is not yet ready: Networking and adjusting the widget's size. So:

ImageWidget is dedicated to the LC team, the makers of LCB.

The widgets lets you
  • load raw imagedata from your stack,
  • load an image from a local file,
  • load an image or (with saving) raw data from an URL.
You can also overlay an (also shaped) text/caption.

The widget transforms images of up to screen size in "real time".
The base position of the 9 handles are:
  
imagewidget.png
imagewidget.png (5.57 KiB) Viewed 22627 times
  
Affine Transformations by Click and/or Drag actions:
[M=Midth, T=Top, L=Left, R=Right, B=Bottom]
  • Near 0=MM but not 0=MM: Rotate,
  • RightClick 0=MM: ResetImage,
  • 0=MM: ResetShape (width 360),
  • 2=TM: SkewX (= shearX),
  • 4=MR: SkewY (= shearY),
  • 6=BM: TrueHeight,
  • 8=ML: TrueWidth,
  • 1=TL,3=TR,5=BR,7=BL: TrueResize.
[True = preserves current shape.]

ImageWidget is a "fat" widget that works with LC 8 and LC 9 identically and also in all LC editions, from community up to business. [Except that you need LC 9 when using drawingSVGcompile for loading an SVG file to the image.]

The code has 3500 lines (incl. 800 lines for the dictionary), there is a lot of math to do when getting the affine transforms: the widget computes the current transform from the current position of the handles. The source (lcb-file) is not included.

Download the widget and a sample stack from
(EU) http://hyperhh.de/widgets or
(US) http://hh.on-rev.com/widgets
 
Attachments
imagewidget_rees.png
SkewX=8 degrees, SkewY=0 degrees.
Last edited by [-hh] on Sat Feb 22, 2020 3:50 pm, edited 2 times in total.
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Community widgets

Post by [-hh] » Tue Feb 12, 2019 4:17 am

[#59] Community LCB widget "TurnImage" v1.3.5
[v1.3.5 Adds new features: The two images are saved with the stack, you can scale/resize the widget and you can set rotation axes also at the images left, top, right and bottom.]

TurnImage is a pure LiveCode Builder widget (there is no essential script access and no use of JavaScript).

The widgets lets you
  • turn an image horizontally or vertically with a 2D-perspective view,
  • rotate and then turn around diagonal axes (axes are resettable to the ordinary ones).
  • switch from an image to a second image while turning or rotating.
Thus it is essentially an animation tool for displaying LC objects.
For example two groups of same size that make up the front and back of a turning "card". Just try the demo in the sample stack.

The widget is fast enough to "turn" a video by grabbing frames from it. For this we need to use a browser widget to play the video (just play, nothing else) because the LC player object is essentially blocking.

TurnImage is a "fat" widget that works with LC 8 and LC 9 identically and also in all LC editions, from community up to business.

This sample stack containes several examples for scripting the widget's properties.
Download the widget, this stack and another (large) example stack "FlipCards2" (that requires the TurnImage widget v135) from
(EU) http://hyperhh.de/widgets or
(US) http://hh.on-rev.com/widgets
 
Attachments
turnImage.png
turnImage.png (11.53 KiB) Viewed 21639 times
Last edited by [-hh] on Sat Feb 22, 2020 3:47 pm, edited 4 times in total.
shiftLock happens

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 365
Joined: Mon Jun 10, 2013 1:32 pm

Re: Community widgets

Post by Lagi Pittas » Thu Jul 11, 2019 12:58 pm

Hi Hermann,

Just loaded the turnimage stack

pressed START then stop at varying times - 5 seconds 10 seconds etc - the whole ive livecode exits without any spinning or dialogs or anything.

I tried it on LC 9.04 rc3 and livecode 9.5 dp1 - exactly the same

O/S is Windows 10

Lagi

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Community widgets

Post by [-hh] » Thu Jul 11, 2019 2:33 pm

Lagi,

the widget and demo works here in Windows10-64bit using LC 8.1.10 and 9.0.2. and 9.5.0-dp1.

Did you install / do you use the widget that comes with the turnImage stack (and uninstall old versions)? The widget version is shown in the property inspector and should read "turnImage_v135".

The widget is pure LCB, has no OS dependencies. Do the other demos work?
Please try also in a new stack whether the turnImage widget works (rightClick for a menu).

If so, alone the video demo of the sample stack, which works here, is OS dependent because it uses a browser widget. The browser widget had memory leaks until 9.0.4 that could cause a crash after long usage but later versions should work without any problems.

Before you hit "Start", does the video run in the browser widget?

Hermann
shiftLock happens

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 365
Joined: Mon Jun 10, 2013 1:32 pm

Re: Community widgets

Post by Lagi Pittas » Thu Jul 11, 2019 8:09 pm

Thanks Herman,

Will try again tomorrow
Bogged down at the. Moment

lagi

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Community widgets

Post by [-hh] » Thu Feb 20, 2020 9:59 am

Hope you are meanwhile recovered from using LC 9.5.1 on Win10 ...
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Community widgets

Post by [-hh] » Thu Feb 20, 2020 10:13 am

[#60] Community LCB widget "ChangeImage" v1.0.6

This is a (partial) extension of the TurnImage widget v135.
It adds masking of the images and several transition animations (from one image to a second one). These animations are made with pathes filled with image patterns what works in LC 8/9.
[With LC 9.5, LCB introduced CanvasOperationClipPath. Parts of the masking and some animations could also be generated with that new operation. But this doesn't work in any earlier version of LC, not even in 9.0.5, so we don't use it.]

We now have the following transition animations:
zoom, barn door horiz/vert, move horiz/vert, squeeze horiz/vert, swipe diag/horiz/vert, (perspective) turn horiz/vert and rotate.
(Note: Animations don't work in pointer mode!)

You can easily generate a "dia show" of images *of same size* with the widget.
The widget sample stack has a script for that (btn "ALL").

The widget works using LC 8/9 on MacOS, Win 7/10 and linux-ubuntu 1604 (all tested). Should also work on mobile (untested).

You can use ChangeImage Widget v106 for free.
Note. The source code (lcb-file) is NOT included.

Read more, download the widget and a sample stack from https://hyperhh.de/widgets/changeimage.html
 
changeimage.png
changeimage.png (30.35 KiB) Viewed 19276 times

p.s. https://hyperhh.de/widgets/ or https://hh.on-rev.com/widgets/ is now the overview from where you can find all updated widgets (and their sample stacks), especially most of those that were "unlinked" above (earlier) in this thread.
shiftLock happens

Post Reply

Return to “LiveCode Builder”