Author |
Topic: [ANN] for devs: SMDialog, create user interfaces like Danièl, but easier :) (Read 539 times) |
|
Sylvain Machefert
Administrator
WWW |
Gender:
Posts: 7090
|
|
[ANN] for devs: SMDialog, create user interfaces like Danièl, but easier :)
« on: Jun 16th, 2022, 11:50pm » |
|
1. Introduction Hi devs! Danièl's scripts are very inspirating. When you create a floatting window or interface composer, HA allow you to use "DialogItem" such as button, static text, radio, checkbox, text editor, note head/duration selector... These items are very useful but you may bump into their limit, e.g. create a small square button is impossible, it has minimal width. An example of script made of "native" DialogItems is Target Editor. Danièls approch is to graphically create buttons with background of palettes' buttons, display a text, and handle, in "Idle" and "Draw" functions, what to do for each button whil you move mouse pointer or click. The result is really more like a palette than a "dialog", and there is no such limitations as DialogItem have : - like in palettes, color change when mouse pointer is over a button
- like some palette button, you can display 2 states: active, inactive
- No size limit
- You can insert text (caption), image or draw a polygon
A simple example of what Danièl scripts look like: Active layers (but I'm sure you already installed and enjoyed all his wonderful scripts! ) If you have a look to the source code, you'll see a lot of variables for each button B1G, B1H, B1D, B1B (gauche, haut, droite, bas) which stands for "button #1" left, top, right and bottom. You'll see also two large Idle and Draw functions. So I was looking for a way to simplify that and makie it more human readable... and God my brain show me the way! Download the demo here ! This will install in Scripts menu > Unsorted > SMDialog demo After this long introduction, let's go coding! 2. SMCore version SMDialog is part of SMCore library since version 20220616, if you are curious, read this topic, it explains how you can update it. Current version is: 20221110 To continue reading the doc, please visit SMDialog documentation and API. This is easier to read than here, and doesn't slow down the forum.
|
« Last Edit: Nov 16th, 2022, 6:35pm by Sylvain Machefert » |
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
WWW |
Gender:
Posts: 7090
|
|
Re: [ANN] for devs: SMDialog, create user interfaces like Danièl, but easier :)
« Reply #1 on: Jun 18th, 2022, 11:47pm » |
|
Notes about the demo script and HA version 996c and earlier. Some DialogItems don't like to be hidden/moved then shown, the text editor never hide. So you may experience graphical bugs with edit box and dialog items containing a scrollbar. This has been reported to Myriad team. Note about the 2022-11-10 version of the script Grid is in a beta test mode, it displays, but event and custom column drawing are not yet handleded.
|
« Last Edit: Nov 16th, 2022, 4:58pm by Sylvain Machefert » |
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
WWW |
Gender:
Posts: 7090
|
|
Re: [ANN] for devs: SMDialog, create user interfaces like Danièl, but easier :)
« Reply #2 on: Jul 25th, 2022, 12:11am » |
|
Hi devs! Coming in next version: addLabel: a shortcut for addPaletteButton with label attributes addSlider: a palette button with min/max value, common drawing and get/set value functions. It handles vertical and horizontal sliders. This avoid tons of code Working hard on editable caption (or value) of a palette button. Hope I'll find a solution.
|
|
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
WWW |
Gender:
Posts: 7090
|
|
Re: [ANN] for devs: SMDialog, create user interfaces like Danièl, but easier :) teaser-slider-grid.png
« Reply #3 on: Oct 19th, 2022, 5:50am » |
|
DEV NEWS - Sliders are functional
- In progress: keyboard navigation between buttons:
- Tab or Shift+Tab to move focus to next/previous button
- Space or Enter to click the focused button
- Just started: grid component to display a 2D table like Excel. I need it to display vertical aligned datas or pictures, and handle different OnClick function for each column, using less space than the built-in list item.
|
|
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
WWW |
Gender:
Posts: 7090
|
|
Re: [ANN] for devs: SMDialog, create user interfaces like Danièl, but easier :)
« Reply #4 on: Nov 16th, 2022, 4:59pm » |
|
RELEASE NEWS Documentation has been moved here: http://sylvain-machefert.myriad-users.com/archive/api/class-SMDialog.htm l The demo script is here: SMDialog-demo.msa Enjoy! Edit April 2023 Follow all news on this topic. I created 2 topics because of massive informations in each, but all doc has moved, topic are lighter now
|
« Last Edit: Apr 16th, 2023, 10:17am by Sylvain Machefert » |
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
|