How to update custom button/menu/group icon on the fly? - tinymce

I'm trying to put alignment buttons (left, center, right, justify) behind a single button in the TinyMCE v6 toolbar. I know that I can use editor.ui.registry.addSplitButton() to define the button with a static icon with properties text: "", title: "Text alignment menu", icon: "...".
However, I would want the menu icon to reflect the current status. When text caret is moved in left aligned text, I'd want he menu icon to have the left-aligned text icon and when text caret is moved to centered text, the icon should have centered text icon. And the button action should toggle that alignment on and off and the split feature would allow changing the alignment further.
However, I cannot see anything to dynamically change the menu button in TinyMCE v6. How to change the split button icon in the toolbar when caret is moved?
(I'm looking for a generic answer where the menu opened with the button could also contain additional items to the default alignment options, too.)

Related

Material UI Tooltip title text content has a button that opens a dialog, dialog disappear after opening

I am trying to use the tooltip which has a title text content, say:
title={<>
Some text
<Button onClick={onOpen}>Click Me!</Button>
</>}
and that button's onClick will set the state to open a mui dialog, i've also set the Tooltip's interactive prop to be true. When the button inside the Tooltip's title content is click, the dialog pops up briefly then goes away. I believe that is also due to Tooltip fading away using the interactive prop.
Is there anyway to get the dialog to stay meanwhile having the tooltip title content disappear? Is material ui's tooltip component meant to be use this way?
Thanks for the help.

Need to place icon as button at the top right of the label in swift

I tried to put the image as button at the top right of the label that yo out side the label with autolayots but when I run the app the button would be too far from the text . But I need the button to apper exactly after text at top-right.I want something like in the imagebutton at top right of label

How can I change the + icon position when using material table editable feature

In material-table row can be added by clicking on + icon on top right corner. I want to replace that icon at the bottom of the screen as a button "ADD". But material-table accept the icon object and there is not other prop to do it. Is there any way I can do it? I am using material-table editable feature https://material-table.com/#/docs/features/editable

MenuBar non selectable sub titles

I have a horizontal menu bar with a child vertical drop-down menu bar.
I would like it so that the child vertical menu bar contains something like the following:
Title text 1
Separator 1
Option 1.1
Option 1.2
Title text 2
Separator 2
Option 2.1
Option 2.2
Is there a way to add non-selectable text into a MenuBar as I don't want the user able to select the "Title text" elements?
myTitleMenuItem.setEnabled(false) ?
As T Broyer answered u can do setEnabled(false). You will get a disabled style for the item which would not look good.
And coming to User experience, User usually expects each item in the Menu Bar to perform some action. When he sees some item with text and not performing any action on clicking, he gets a impression like 'App is not working or not responding'.
So, its always better to create a Menu Item 'Title Text' and also create a Menu Bar with required items and set this menu bar as a child or SubMenu of Title Text item.
So, whenever user hovers or clicks on the 'Title Text item' sub menu will be shown.

Interface Builder - Custom Button with Title text

When I set up a custom button in Interface Builder it hides the Title text.
Do you have to create the text for the button too or is it possible to change the Z order so that the Title appears on top?
You are probably setting the 'Image' property of your button instead of the 'Background' property.
'Image' appears over your text, so either programmatically or in NIB(way simpler), set the 'Background' image to your desired png, and set the text for the desired button 'State Config'(default, selected etc), Leaving the 'Image' property blank.
The title by default appears on the top and in no case the text goes behind the button...
Still follow the below steps
1. Drag uibutton to the view
2. Select UIButton
3. Click on the first tab of the Inspector
4. Then Enter the title over there.
The title entered will be on the button..
Hope this helps
For a custom button, I fixed the same problem by going in interface builder and in the tab where you can set up hte title, image, background, etc., if you look lower, there will be a section titled "Control". In that section you can change the alignment and there are also some checkboxes for "Content". Put a checkmark in "Enabled" and "Selected" and it should work. Ensure to have populated the title for the various states of the button.
It may be related to the State Config attribute. I had the same problem and solved it by doing this:
Select your button
In the utilities pane (right pane), select the Attribute inspector (4th tab).
Change the State Config (2nd attribute) to the value "Default".
Enter a Title and press Enter (I tried changing it directly on the button but it is resized automatically).
You may switch back to your previous State Config if it is what you need.