TextButton hover option, or something similar? - button

As I know, there are three types of buttons in LibGDX:
TextButton, ImageButton and ImageTextButton
I need to create a button with my own background and own text and of course, but I also need a hover option.
The hover is available in ImageButton, but ImageButton doesn't have a label so I can't assign any text to it.
There is a third option, ImageTextButton, but it's not a normal button, it's a button and a label which is set next to it (which is unacceptable, cause I need the text on the button).
Is there any option to achieve this?

Related

Blazor - turning off text selection when moving with mouse after mousedown event

I'm working on table in Blazor. I want to use mousedown and mouseup event to add posibility for selecting more cells in the table. When user holds mouse button, he can move and select cells until he release mouse button. Everything works fine, there is just one problem: together with selecting cells, I'm selecting every text, even outside of cells, which doesn't look good.
Is there any easy way in Blazor how to turn off the text selection after holding mouse button?
Thank you!
If you only want the text to be un-selectable while dragging the mouse (so the only way to select text if you do this would be with the keyboard)...
In the onmousedown handler, change the CSS style of the table to user-select: none; and then remove that style in onmouseup.

How to select two buttons in a screen at the same time in UWP

I used button PointerFocus event to set the button border. Need to set border on two buttons in the same screen. Is There a way to set the border of one button without remove the border from a previously selected button in UWP.
The act of getting focus is unique. In other words, when a control gets focus, the previous control loses focus.
If you need the button to remain selected, you may not need Button, but ToggleButton.
ToggleButton has two states (selected/unselected), while retaining the appearance of Button. You can have multiple ToggleButtons selected at the same time.
Here is the document about the ToggleButton.
Best regards.

How to style the value of different types of input widgets through code?

I have a form which contains multiple input widgets like textbox, dropdown, textarea, suggestbox, radiogroup and multiselect etc
The input widgets are by default in disabled state.
When I click on a button all of them get enabled.
I would also like their text-color to change when I click on that button.
Note: I dont want to change the widget's label color. Only the value color.
How to do it in code for each? If you could give one example for each widget i.e textbox, dropdown, multiselect,radigroup etc
Looking for a generic solution.
Say you want to change your text box text red when you click the button. add a class to your styles tab like
.red{
color: red;
}
then say you have text box called textbox1 in the onclick event of your button put the following code:
widget.root.descendants.textbox1.styles = ['red'];
same for all the other types
To give you an idea I was testing with TextBox and worked but with TextAreas the Input or Value did not change, as well as the other multiselect and radioGroup options it did not take the css as expected.
When you click on the text box and from the CSS Page Style you start typing "." you will find different options for the widget selected. Using TextBox there is an Input option so you create a Global Style like this one.
.color Input{
color:teal;
}
This will change the Input of the TextBox, the same as if you do with Label, just use the same css class just change the option you want to modify. .color Label {}.
Also to apply the change to the widget just create a function like this one.
function textBoxColorChange() {
app.pages.NewPage.descendants.TextArea1.styles = ["color"];
}
And create an OnClick event to a button to make the change.
With the other widgets I don't have the time to keep testing but I hope this helps to get the idea. Greetings.

display text on hovering mouse over a button in gwt

I am using gwt 2.4. And I am not using uibinder.
I have a button which has a background image. when I place mouse on this button it should display a text saying "submit" . The kind of text which says what the button does.
Button is a UIObject and so you can use setTitle method on a Button to set the tooltip.
Or if you want to do something else on mouse over. Just make use of the mouse handlers.
Read Button documentation for more details.

jquery radiobutton focus

On some of my pages I am setting focus on a first input element:
$(':input:visible:first').trigger('focus');
If the first input element is a checkbox or a radiobutton it receives a focus fine but that's not clearly visible, so it's label is not highlighted and screen reader doesn't recognize that, too, i.e. it doesn't read out that field. Is there any way using JQuery to make focus on checkbox or radoibuttons more pronounced?
Can't you assign a suitably clear css class to it?
$(':input:visible:first').focus(function() {
$(this).addClass("superClear")
})
.blur(function() {
$(this).removeClass("superClear");
}).focus();
Also, this might be helpful:
How do I style (css) radio buttons and labels?

Resources