[tw5] Re: TiddlyWiki is so awesome as a macro/scripting tool for BASIC

2022-09-28 Thread Charlie Veniot
Talk is not showing the first line of code.  Missing first line in Google 
Groups post .

On Wednesday, September 28, 2022 at 7:41:47 PM UTC-3 Charlie Veniot wrote:

> Oops.  The sanity check was to see that circles are proper circles for all 
> screen modes despite various screen aspect ratios.
>
> Sure enough, the circles are proper circles regardless of screen aspect 
> ratio.
>
> Which means the CIRCLE command does some fancy math to make sure that 
> circles don't turn into ovals when screen aspect ratios are not 1 to 1 
> (i.e. 1 pixel wide to 1 pixel tall, as opposed to a 2.4 pixels wide to 1 
> pixel tall, for example.)
>
> So the fancy and super-speedy subroutine somebody gave me to create 
> filled-in circles via creation of triangles, fine when in a 1:1 screen 
> ratio, but creates ovals otherwise.
>
> Anyway, that's the details of what I was investigating, just in case you 
> also geek out on this kind of stuff.
>
> On Wednesday, September 28, 2022 at 7:32:34 PM UTC-3 Charlie Veniot wrote:
>
>> I needed to do a sanity check to understand why the CIRCLE statement is 
>> so slow compared to a custom subroutine (creating circles with triangles) 
>> to create circles filled in with color.
>>
>> The interpreter I'm using does not allow variables in the screen 
>> statement, and I couldn't be bothered setting up that ability.
>>
>> To the rescue: TiddlyWiki scripting to generate the code at runtime.
>>
>>
>>
>> ```
>> <$list variable="thisScreen" filter="[range[0,2]] [range[7,21]]">
>> screen _newimage(200,200,<>)
>> locate 1,1 : print "screen mode: " + <>
>> circle (100,100), 75
>> _delay 2
>> 
>> ```
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5151738e-656e-4e11-9ea8-48cb1f01dd87n%40googlegroups.com.


[tw5] Re: TiddlyWiki is so awesome as a macro/scripting tool for BASIC

2022-09-28 Thread Charlie Veniot
Oops.  The sanity check was to see that circles are proper circles for all 
screen modes despite various screen aspect ratios.

Sure enough, the circles are proper circles regardless of screen aspect 
ratio.

Which means the CIRCLE command does some fancy math to make sure that 
circles don't turn into ovals when screen aspect ratios are not 1 to 1 
(i.e. 1 pixel wide to 1 pixel tall, as opposed to a 2.4 pixels wide to 1 
pixel tall, for example.)

So the fancy and super-speedy subroutine somebody gave me to create 
filled-in circles via creation of triangles, fine when in a 1:1 screen 
ratio, but creates ovals otherwise.

Anyway, that's the details of what I was investigating, just in case you 
also geek out on this kind of stuff.

On Wednesday, September 28, 2022 at 7:32:34 PM UTC-3 Charlie Veniot wrote:

> I needed to do a sanity check to understand why the CIRCLE statement is so 
> slow compared to a custom subroutine (creating circles with triangles) to 
> create circles filled in with color.
>
> The interpreter I'm using does not allow variables in the screen 
> statement, and I couldn't be bothered setting up that ability.
>
> To the rescue: TiddlyWiki scripting to generate the code at runtime.
>
>
>
> ```
> <$list variable="thisScreen" filter="[range[0,2]] [range[7,21]]">
> screen _newimage(200,200,<>)
> locate 1,1 : print "screen mode: " + <>
> circle (100,100), 75
> _delay 2
> 
> ```
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9eed194f-e41c-4e69-8467-bf14ec48ff7dn%40googlegroups.com.


[tw5] TiddlyWiki is so awesome as a macro/scripting tool for BASIC

2022-09-28 Thread Charlie Veniot
I needed to do a sanity check to understand why the CIRCLE statement is so 
slow compared to a custom subroutine (creating circles with triangles) to 
create circles filled in with color.

The interpreter I'm using does not allow variables in the screen statement, 
and I couldn't be bothered setting up that ability.

To the rescue: TiddlyWiki scripting to generate the code at runtime.



```
<$list variable="thisScreen" filter="[range[0,2]] [range[7,21]]">
screen _newimage(200,200,<>)
locate 1,1 : print "screen mode: " + <>
circle (100,100), 75
_delay 2

```

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/fbf0add8-9d55-4a3d-b043-884b47d946b7n%40googlegroups.com.


[tw5] Re: coloring dropdown options

2022-09-28 Thread Eric Shulman
The background and foreground colors for the option that currently has the 
FOCUS are determined by the browser's implementation of the underlying HTML 
select element.  Using my X11 color list example, if you select 
"Burlywood", then it will be displayed using the default "white text on a 
blue background" because the selected item also has the FOCUS.  However, if 
you then mouseover other list items -- i.e. changing the FOCUS, but not the 
current SELECTION -- then the selected item DOES appear using the specified 
"Burlywood" background color.  Unfortunately, there doesn't seem to be a 
CSS rule that can specify the colors used by the FOCUSED item, so we are 
stuck with the browser-defined defaults.

-e

On Wednesday, September 28, 2022 at 12:22:23 AM UTC-7 Samir S. wrote:

> Thank you Eric.
>
> I tried your example it works fine except that the chosen option does not 
> remain colored.
> Is this behavior on purpose ?
>
> On Tuesday, 27 September 2022 at 16:54:30 UTC+2 Eric Shulman wrote:
>
>> You can you CSS `class` or `style` attributes to specify the `background` 
>> color attribute, like this:
>>
>> Using classnames:
>> ```
>> 
>> .red { background:red; }
>> .green { background:green; }
>> .blue { background:blue; }
>> 
>>
>> <$select field="color">
>>item 1
>>item 2
>>item 3
>> 
>> ```
>>
>> Using direct styles and a $list of colors:
>> ```
>> <$select field="color">
>><$list filter="red green blue" variable=thisColor>
>>   ] [[;]] +[join[]] }}}>
>>  <>
>>   
>>
>> 
>> ```
>>
>> In fact, I have used this technique myself to create a "select a color" 
>> drop list that shows a list of "X11 Color Names"
>> ```
>> \define X11Colors()
>> AliceBlue AntiqueWhite Aqua Aquamarine Azure Beige Bisque Black 
>> BlanchedAlmond Blue BlueViolet Brown Burlywood CadetBlue Chartreuse 
>> Chocolate Coral CornflowerBlue Cornsilk Crimson Cyan DarkBlue DarkCyan 
>> DarkGoldenrod DarkGray DarkGreen DarkKhaki DarkMagenta DarkOliveGreen 
>> DarkOrange DarkOrchid DarkRed DarkSalmon DarkSeaGreen DarkSlateBlue 
>> DarkSlateGray DarkTurquoise DarkViolet DeepPink DeepSkyBlue DimGray 
>> DodgerBlue Firebrick FloralWhite ForestGreen Fuchsia Gainsboro GhostWhite 
>> Gold Goldenrod Gray Green GreenYellow Honeydew HotPink IndianRed Indigo 
>> Ivory Khaki Lavender LavenderBlush LawnGreen LemonChiffon LightBlue 
>> LightCoral LightCyan LightGoldenrodYellow LightGray LightGreen LightPink 
>> LightSalmon LightSeaGreen LightSkyBlue LightSlateGray LightSteelBlue 
>> LightYellow Lime LimeGreen Linen Magenta Maroon MediumAquamarine MediumBlue 
>> MediumOrchid MediumPurple MediumSeaGreen MediumSlateBlue MediumSpringGreen 
>> MediumTurquoise MediumVioletRed MidnightBlue MintCream MistyRose Moccasin 
>> NavajoWhite Navy OldLace Olive OliveDrab Orange OrangeRed Orchid 
>> PaleGoldenrod PaleGreen PaleTurquoise PaleVioletRed PapayaWhip PeachPuff 
>> Peru Pink Plum PowderBlue Purple RebeccaPurple Red RosyBrown RoyalBlue 
>> SaddleBrown Salmon SandyBrown SeaGreen Seashell Sienna Silver SkyBlue 
>> SlateBlue SlateGray Snow SpringGreen SteelBlue Tan Teal Thistle Tomato 
>> Turquoise Violet Wheat White WhiteSmoke Yellow YellowGreen
>> \end
>>
>> <$select field="color">
>><$list filter="[enlist]" variable=thisColor>
>>   ] [[;]] +[join[]] }}}>
>>  <>
>>   
>>
>> 
>> ```
>> enjoy,
>> -e
>> On Tuesday, September 27, 2022 at 5:08:23 AM UTC-7 Samir S. wrote:
>>
>>> Greetings,
>>>
>>> Is there a way to change the color of each option values inside the 
>>> $select widget.
>>>
>>> I've tried adding a class attribute but it does not work.
>>>
>>> Thank you in advance for your help.
>>>
>>> Sincerely.
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/fe23015f-fa16-46f1-90f3-6d02eeb65dd2n%40googlegroups.com.


[tw5] $set possible bug

2022-09-28 Thread Samir S.
Greetings,

I may have discovered a bug related to the $set widget in tiddlywiki 5.2.2

The following code outputs a correct result but the syntax is incorrect 
(missing > on the $set statement).

<$set name="thisColor" value=<$transclude tiddler=stateColor 
index={{!!Phase}}>
<$text text=<> />


the current tiddler has field Phase set to "étude" (index from the data 
tiddler)

The stateColor is a data tiddler with properties like
étude: "#FF"
révision: "#00FF00"
rattrapage: "#FFC700"

What do you think ?

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/07f2aae7-0cac-44ea-8187-4e8225bb10c6n%40googlegroups.com.


[tw5] Re: coloring dropdown options

2022-09-28 Thread Samir S.
Thank you Eric.

I tried your example it works fine except that the chosen option does not 
remain colored.
Is this behavior on purpose ?

On Tuesday, 27 September 2022 at 16:54:30 UTC+2 Eric Shulman wrote:

> You can you CSS `class` or `style` attributes to specify the `background` 
> color attribute, like this:
>
> Using classnames:
> ```
> 
> .red { background:red; }
> .green { background:green; }
> .blue { background:blue; }
> 
>
> <$select field="color">
>item 1
>item 2
>item 3
> 
> ```
>
> Using direct styles and a $list of colors:
> ```
> <$select field="color">
><$list filter="red green blue" variable=thisColor>
>   ] [[;]] +[join[]] }}}>
>  <>
>   
>
> 
> ```
>
> In fact, I have used this technique myself to create a "select a color" 
> drop list that shows a list of "X11 Color Names"
> ```
> \define X11Colors()
> AliceBlue AntiqueWhite Aqua Aquamarine Azure Beige Bisque Black 
> BlanchedAlmond Blue BlueViolet Brown Burlywood CadetBlue Chartreuse 
> Chocolate Coral CornflowerBlue Cornsilk Crimson Cyan DarkBlue DarkCyan 
> DarkGoldenrod DarkGray DarkGreen DarkKhaki DarkMagenta DarkOliveGreen 
> DarkOrange DarkOrchid DarkRed DarkSalmon DarkSeaGreen DarkSlateBlue 
> DarkSlateGray DarkTurquoise DarkViolet DeepPink DeepSkyBlue DimGray 
> DodgerBlue Firebrick FloralWhite ForestGreen Fuchsia Gainsboro GhostWhite 
> Gold Goldenrod Gray Green GreenYellow Honeydew HotPink IndianRed Indigo 
> Ivory Khaki Lavender LavenderBlush LawnGreen LemonChiffon LightBlue 
> LightCoral LightCyan LightGoldenrodYellow LightGray LightGreen LightPink 
> LightSalmon LightSeaGreen LightSkyBlue LightSlateGray LightSteelBlue 
> LightYellow Lime LimeGreen Linen Magenta Maroon MediumAquamarine MediumBlue 
> MediumOrchid MediumPurple MediumSeaGreen MediumSlateBlue MediumSpringGreen 
> MediumTurquoise MediumVioletRed MidnightBlue MintCream MistyRose Moccasin 
> NavajoWhite Navy OldLace Olive OliveDrab Orange OrangeRed Orchid 
> PaleGoldenrod PaleGreen PaleTurquoise PaleVioletRed PapayaWhip PeachPuff 
> Peru Pink Plum PowderBlue Purple RebeccaPurple Red RosyBrown RoyalBlue 
> SaddleBrown Salmon SandyBrown SeaGreen Seashell Sienna Silver SkyBlue 
> SlateBlue SlateGray Snow SpringGreen SteelBlue Tan Teal Thistle Tomato 
> Turquoise Violet Wheat White WhiteSmoke Yellow YellowGreen
> \end
>
> <$select field="color">
><$list filter="[enlist]" variable=thisColor>
>   ] [[;]] +[join[]] }}}>
>  <>
>   
>
> 
> ```
> enjoy,
> -e
> On Tuesday, September 27, 2022 at 5:08:23 AM UTC-7 Samir S. wrote:
>
>> Greetings,
>>
>> Is there a way to change the color of each option values inside the 
>> $select widget.
>>
>> I've tried adding a class attribute but it does not work.
>>
>> Thank you in advance for your help.
>>
>> Sincerely.
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d24bccc6-eafb-444d-a964-6cd7fe24e194n%40googlegroups.com.