Community widgets

Moderators: LCMark, LCfraser

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1783
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 "Sample Stacks" of the LC toolbar (or download from http://livecodeshare.runrev.com/stack/842/ ). See also this post.

For an easy build of the controls I made moreover a CONTROLKIT* that is also available via "Sample Stacks" (or download from http://livecodeshare.runrev.com/stack/863/ ). 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 1381 times
hhControls100.png
Another example of a hhControls widget.
hhControls100.png (26.13 KiB) Viewed 1425 times
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1783
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 http://forums.livecode.com/viewtopic.ph ... 02#p171902 ]

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

On "Sample Stacks" is a demo-stack "ColorPicker_v101" or download it from
http://livecodeshare.runrev.com/stack/901

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:
http://forums.livecode.com/viewtopic.ph ... 90#p159190
Last edited by [-hh] on Mon Oct 01, 2018 5:42 pm, edited 5 times in total.
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1783
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 http://forums.livecode.com/viewtopic.ph ... 02#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.

Grab the widget from "Sample Stacks of the LC Toolbar" or download DatePicker89_v107 from

http://livecodeshare.runrev.com/stack/903

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).

The widget is free. For commercial use, please give a (small) fee to the LC developer help fund.

The source code is not (yet) included.
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 Mon Oct 01, 2018 5:46 pm, edited 4 times in total.
shiftLock happens

bogs
Posts: 2289
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 896 times
it still cracks me up Image
Image

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1783
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).

    On "Sample Stacks" is the stack "DatePicker89_v108" available, or download it from http://livecodeshare.runrev.com/stack/903
      
  • [#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).

    On "Sample Stacks" is the stack "colorPicker89_v102" available, or download it from http://livecodeshare.runrev.com/stack/901
      
  • [#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):
    http://forums.livecode.com/viewtopic.ph ... 12#p158112

    On "Sample Stacks" is the stack "IconGrid89_v211" available, or download it from http://livecodeshare.runrev.com/stack/904
      
All widgets above are free for non-commercial use and have the the source code included.
For commercial use please give a (small) fee to the LC developer help fund.

_________________
(**) 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...
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1783
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.

    On "Sample Stacks" is the stack "SVGText89_v152" available, or download it from http://livecodeshare.runrev.com/stack/905
     
  • [#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.

    On "Sample Stacks" is the stack "DigitClock89_v121" available, or download it from http://livecodeshare.runrev.com/stack/907
     
  • [#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.

    On "Sample Stacks" is the stack "Polygon_v121" available, or download it from http://livecodeshare.runrev.com/stack/908
     
  • [#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.

    On "Sample Stacks" is the stack "Progress89_v130" available, or download it from http://livecodeshare.runrev.com/stack/909
     
    [#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.

    On "Sample Stacks" is the stack "OrientedText89_v152" available, or download it from http://livecodeshare.runrev.com/stack/910
All widgets above are free for non-commercial use and have the the source code included.
For commercial use please give a (small) fee to the LC developer help fund.

_________________
(**) I needed a unique naming system for the kind of the widget and the widget's name in the Tools palette.
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1783
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.

    On "Sample Stacks" is the stack "ClockAround89_v125" available, or download it from http://livecodeshare.runrev.com/stack/906
shiftLock happens

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1783
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 533 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: 1783
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 446 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.

The widget is free for non-commercial use. For commercial use please give a (small) fee to the LC developer help fund.

Download ImageWidget89_v110 from "Sample Stacks" or
http://livecodeshare.runrev.com/stack/912

This sample stack includes buttons to install (or remove) the widget to/from both LC 8 and LC 9.
  
Attachments
imagewidget_rees.png
SkewX=8 degrees, SkewY=0 degrees.
shiftLock happens

Post Reply

Return to “LiveCode Builder”