Mat,What you think if we add a little OOP.
An example would be a button I have just developed, it simply allows the toggling of a [...]
have you ever placed a checkbox in the toolbars for View, Edit, Editor or Page controls?A nicely illustrated button can be much easier to use.
<input type="checkbox" id="myCheckbox" style="display:none"/>
<label for="myCheckbox">{{$:/core/images/done-button}}</label>
This is in html can it work with the checkbox wolidget? Are you proposing something new?
thanks
Tony
\define buttonto(tiddler,image,description,caption,tag)
<$button to="$tiddler$" tooltip="$tooltip$" class=<<tv-config-toolbar-class>>>
<$action-setfield $field="caption" $value="{{$image$}} $caption$"/>
<$action-setfield $field="description" $value="$description$"/>
<$action-setfield $field="tags" $value="$tag$"/>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$image$}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<$text text="$caption$"/>
</$list>
</$button>
\end<<buttonto $:/ControlPanel $:/core/images/options-button "Open control panel" "control panel" "$:/tags/ViewToolbar">>A Quick post script, something very odd occurs on using this button on tiddlywiki.comUser beware - this is a proof of concept only
I was extending your method, and am using your basic model, however I have moved to the template based button, one selects from a set of functionally different buttons, then customises it to a specific need.
- Toggle Tag
- Toggle anything
- Navigate to tiddler name
- Click to action
I am now thinking of
- Config tiddler toggling
- Traffic Lights
- Multi-state cycle eg step through 5 tag values
Perhaps first I will invite challenge here, What button would someone like and see if I can make it from my factory. If it works I may start a dedicated thread.
Thanks for your inspiration.
Ton,Thanks for your feedback. I suspect I broke something not your example was broken, I can't reproduce it now.This may be a "flight of fancy" but I have started to realise anything can be designed from its interface.Many of my home grown solutions involve a button, but now I see If a Build a button in which to design a solution its quicker and simpler, especially If I have templates.Its another level of abstractionCan the whole of tiddlywiki's possiblities start with a button?
- Buttons that open a tiddler with a certain functionality. I call it 'button to' buttons
- Buttons that toggle a certain setting or tag on a tiddler
- Buttons that toggle a certain setting or tag GLOBALY
- Buttons that toggle a macro or plugins operation
- Buttons that Trigger a macro or plugins operation
- Buttons that trigger anything
- Buttons that trigger a modified version of a core button or function
- Buttons that contain a set of buttons (like the more buttons)
- Buttons that operate on text (editor toolbar buttons)
- Buttons that open links, tabs, windows, iframes, dialogues, modals, notify
- Buttons that log something in another tiddler
- Buttons that create a tiddler from a template
\define buttonto(tiddler,image,description,caption,tag)
<$button to="$tiddler$" tooltip="$description$" class=<<tv-config-toolbar-class>>>
<$list filter="[all[current]!has[caption]]">
<$action-setfield $field="caption" $value="{{$image$}} $caption$"/>
<$action-setfield $field="description" $value="$description$"/>
<$action-setfield $field="tags" $value="$tag$"/>
</$list>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$image$}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<$text text="$caption$"/>
</$list>
</$button>
\end
So after the first click (when a tag and fields are created) the action widgets will not be active anymore.
And I corrected the tooltip which uses the text in the description field (the naming in buttons is rather confusing with caption, description, tooltip, hint, text).
Cheers,
Ton
\define buttonto(tiddler,image,description,caption,tag)
<$button to="$tiddler$" tooltip="$description$" class=<<tv-config-toolbar-class>>>
<$list filter="[all[current]!has[caption]]">
<$action-setfield $field="caption" $value="""{{$image$}} $caption$"""/>
<$action-setfield $field="description" $value="""$description$"""/>
<$action-setfield $field="tags" $value="""$tag$"""/>
</$list>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$image$}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<$text text="$caption$"/>
</$list>
</$button>
\end<<buttonto
tiddler
image
description
caption
tag
>>