How can I set the Backgoundcolor of an AX2012 Action Pane Button - x++

I'm trying to set the background color of an Action Pane Button so I changed the init-Method to this:
public void init()
{
super();
myButton.colorScheme(FormColorScheme::RGB);
myButton.backgroundColor(WinAPI::RGB2int(255,0,0));
}
but myButton (AutoDeclaration is on) does not become red.
Even when I set these properties by hand, the color does not change.
The Button has an Action, where the Image is defined. But removing that won't help.

It isn't possible to provide a custom background color for buttons in the action pane.
If you just want the button to look different, you can set the ToogleButton property to Check and the ToggleValue property to On to give it a difference appearance, you will also need to add code in the clicked method for the button to prevent it toggling to Off. This will give the button a different background color, but you won't have any control over the color used.

Related

Setting custom UIControl/UIButton Color per 'isEnabled' UIControl property

Goal: Customize the color used to indicate a button's 'isEnabled' boolean value.
Scenario: Normally a button is dimmed when disabled. However I've been requested to use a custom color to indicate a disabled button.
Question: How would I do that?
Does a button/controller's traits offer such option?
Or do I have to juryrig my own function?

Setting UITextField Background in Attribute Inspector

According to the documentation, background property is
The image that represents the background appearance of the text field
when it is enabled.
In the attribute inspector there is a Background Dropdown with a lot of items to choose from, but no matter what I choose, nothing happens if done for the UITextField. If done for a UIButton, it is working fine.
Update: the question is not about setting the background color in code. It is about why does choosing any item from the drop down in attribute inspector does not have any effect for the UITextField.
You can change UItextfield background color through code like this:
textField.backgroundColor = backgroundColor;

How to add custom color in Xcode storyboard color picker?

I am planning to make theme color of UI elements in application.
how we show custom color(Golden Color) like Black color in picker menu
is it possible? like we can add custom Property as shown in snapshot
You can add custom color as folow
Select color property(Background color, text color, etc.). A popup is shown from that select "other" option.
A color picker will be opened. Here you can set your custom color by RGB/Hex Code and you can set opacity.
The color will be applied and visible under "Recently Used Colors". This is how you can add custom colors but as far as I know you can't add colors in that default list.
Create a new palette by clicking "New" here:
A new palette "Unnamed" will be created. You can rename that palette by clicking the cog again and choosing "Rename..." Then, you'll need to click on the objects you want to capture the color of, and drag the color of those objects into the color chip area:
Once you've captured the color, you can even rename it something that indicates where it's normally used, providing more information to the recipient than just the color.
source
As of Xcode 9 you can add colors to your asset catalog.
Open your asset catalog, click the + and add a color set.
Click on the color that was created and you can name it and set the color using the inspector.
Thereafter that color shows up in storyboard color chooses in the area called Named Colors.
To achieve this follow these steps
*) In the Project navigator, select the asset catalog, click the Add button (+) at the bottom. In the pop-up menu, choose the type of asset set to create
*) then you'll see the color asset on storyboard.
Cheers :)

Make a button appear selected

Is there a simple way of making a button appear selected with Swift? I currently have a series of buttons with background images. I want each of the buttons to appear 'selected' once tapped by the user; each button will be used to specify which options the user requires.
When you select your button you could change it's state to selected:
func buttonTapped(button: UIButton) {
button.selected = !button.selected
...
}
And if you want, you could change the background image of your UIButton to have a different image when it's state is selected like this:
button.setBackgroundImage(selectedImage, forState: .Selected)
This can also be done in Interface Builder:
You can make a button appear selected several ways. One is to have a second image which is slightly darker (i.e. looks depressed) and when you set the button's state to button.selected = true then the system will automatically use this second image for it's selected state. If you don't have a separate asset (which I wold recommend you do) then you can set button.userInteractionEnabled = false which will make it unable to be acted on by the user, as well as change it's alpha component or color or some other property to enforce to the user that the button is no longer selectable.

iOS how to change default onPress button color

I have been trying to figure out this problem for a while now and no avail. I have a program I inherited and it uses a a white background image for the buttons. You can change what image you want easily from UI editor. When the user presses down on that button the white background image is switched out for a different image, showing a blue highlight instead. For the life of me I can't find where that is being referenced at. I even tried adding a new button and it is the stock highlight color.
Where is that onPress reference probably at? Or where can I re-reference this new button to have a new onPress image background?
Thank you!
Select the button in Interface Builder. Open the attributes inspector for that button. Under Button you can choose the "State Config". Change that to "Highlighted". Now you can change the Image config for the highlighted state.

Resources