How to change background color of wizard setup buttons? - inno-setup

I'm making my own design for the Inno wizard, but I can't seem to find how to change the background color of the buttons (next/back/cancel).
Does anyone know?
I know it has to be in the [Code] section under procedure InitializeWizard();
And should look something like
WizardForm.NextButton.Color := $464646;
But obviously this one doesn't work, hence I'm looking for any suggestions. And please don't recommend plugins, not going to use any plugins. My style looks the way I wanted it to look aside from the buttons.

This is not possible in vanilla Inno Setup.
In Windows drawing buttons is a complex task because buttons typically contains several "layers" which are painted individually - like frame, shadows, body (not single color).
The easiest to achieve this is to write custom plugin for Inno Setup (either C/C++ or Delphi - based on your preferences) and use the WIndows API, however this requires some additional knowledge.
See https://learn.microsoft.com/en-us/windows/win32/controls/button-styles?redirectedfrom=MSDN#BS_OWNERDRAW for more info.

Related

When do I really need to use ScaleX and ScaleY functions in Inno Setup?

Here's the documentation for ScaleX function: ScaleX. The same thing is for ScaleY: ScaleY. I'm a little bit confused with these. Does it mean that I only need to use them when I use different font sizes on my wizard page? Can anybody give me the real example of why I should always use those instead of absolute/relative values?
You need to use them always, when setting absolute control locations and sizes.
They take care of custom font sizes and window scaling set by the user in Windows preferences. That's not under your installer control.
See also Inno Setup Placing image/control on custom page.

Pop dialog background form color [duplicate]

Is it possible to change inner background color for modal and browse directory windows in Inno Setup? In my case I want it should be white.
UPD: Same behaviour is on the inner pages of Inner Setup, but I've fixed it by setting WizardForm.InnerPage.Color := clWhite;
I'm using VclStylesInno for styling my installer with custom style spreadsheat.
You cannot change the color of these in Inno Setup itself, except by a custom build of Inno Setup or some addon DLL (see below).
All you can do is to re-implement these dialogs from the scratch:
For the "browse" dialog: Handle the WizardForm.DirBrowseButton.OnClick and use CreateCustomForm and TFolderTreeView to implement the browse dialog. Download Inno Setup code and copy the existing implementation from SelFolderForm.pas.
For an example of handling WizardForm.DirBrowseButton.OnClick, see
How to display localized Program Files name (display name) during installation?
For the "cancel" dialog: Implement the CancelButtonClick event function. Make sure you set Confirm to False to get rid of the default prompt. And implement your own. Again, use the CreateCustomForm.
It's a lot of work for a small gain. I'd not do it.
Instead, you can use VCL Styles for Inno Setup (DLL) to style Inno Setup windows (including all modal dialogs).
As turned out, the reason was in the "Colors" option in Bitmap Designer, which I use to modify my installer style. This option makes some additional styling for controls:

Menu Button that does not dismiss options onclick in JavaFX 2

I am quite new in JavaFX and I have a question about the design. I am creating my main menu in FXML using Scene Builder. I have various menu buttons and each of these have a sub-menu. These sub-menu options will open new windows. Is it possible to declare these submenu choices so they do not dissapear after I click on them? If so, can I declare it in my fxml or I have to do it programatically?
Also, is it possible to detach it from the menu button? I would like to have my menu choices around 1 cm away from the menu button itself.
Thank you
Suggested Alternate Solution
If you want more flexibility in positioning a popup menu after a button click as well as fine control over when the menu shows and hides, try using a Button + a ContextMenu rather than a MenuButton.
The relevant methods are:
contextMenu.show(anchorNode, side, dx, dy)
contextMenu.hide()
There is sample code for triggering a context menu on a button press button in the ContextMenu javadoc.
You might also need to monitor the context menu's showingProperty and in a listener show the menu again if the JavaFX system has decided to try and hide it after some user action and you still want the menu visible.
Answers to additional unrelated comments
OK It sounds logical, yet since Im not really good in JavaFX yet, your Idea is quite challenging.
It's not that hard to implement, but from your subsequent comments it sounds like it's probably not the user interface you want for your users anyway (which makes sense to me because the interface you describe in your question seems a little strange).
I thought If it would be easier to have a static xml that have various menu choices, lets say aligned to the right and then whenever I click one of the choices, a new FXML would be loaded in the middle of the screen holding buttons for a submenu?
That seems logical. Sounds like a JavaFX version of a traditional web page layout with a navigation menu on the side controlling a content pane in the center.
A Java only version of that is: How to have menus in java desktop application. You could adapt that to a FXML based version without too much difficulty.
You might also be interested in Managing Multiple Screens in JavaFX.
Also, any tutorial for beginners would be greatly appreciated. These Oracle ones dont make too much sense for me
If you are beginning JavaFX, I recommend using just the Java API portions of JavaFX until you become familiar with them, and then use FXML only after you are comfortable with the Java API.
Personally, I think the Oracle JavaFX Tutorials are excellent. The difficulty for beginners is that the tutorials are also part reference material, which complicates portions of them (especially the deployment related pieces).
If you prefer a different tutorial style see:
Makery JavaFX tutorial (good for beginners)
zenjava tutorials (more advanced)

How do I get action buttons with custom layouts to be styled like standard action buttons in Android 3.0+

I'm having a bit of trouble with custom action buttons in the honeycomb+ action bar. I'm adding a menu item that uses a custom layout (using the android:actionLayout attribute). The reason for the custom layout is that I want a button that has two lines of text that can be updated dynamically.
However, I still want this action button to operate like the other standard buttons. By this I mean that the background fades in when the button is selected, and fades out again if it is unselected, all in the style of the platform (the colour seems to differ between different platforms/devices - I've seen both grey and blue versions)
I've tried using the action button style for the custom layout:
style="#android:style/Widget.ActionButton"
and I've tried setting the background for the custom layout to:
android:background="?android:attr/actionBarItemBackground"
but to no avail, and I'm kind of trying things fairly randomly as I can't find any documentation on how to do this (or if indeed it is even possible).
I know I can approximate this behaviour myself by setting the background, but it would be nice if I could just set the item to behave like a normal action button in terms of how it appears when the user interacts with it.
Anyone have any ideas?
Thanks in advance!
Ah, sorry to answer my own question but I have just stumbled upon a way to do this. I was halfway there - you need your custom layout's style to inherit from ActionButton:
#android:style/Widget.ActionButton
but then you also need to make the layout clickable:
android:clickable="true"
for it to work. Using both of these makes the custom action buttons look just like the regular ones when you press them.
Hopefully that'll help someone trying to do this!

Modifying the color scheme for an Inno Setup Installer

I've been playing around with Inno Setup 5.3.6; trying to customize the installers colors. Mainly the banner that appears at the head of the installer. But as of yet i have no luck finding a way of doing this easily.
After reading through the documentation I found the BackColor, BackColor2, BackColorDirection and BackSolid parameter. But giving them different values has as of yet not given me any visual change whatsoever.
Quick example of what I'm trying to do
[Setup]
AppName=My Program
AppVerName=My Program version 1.4
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
BackColor=$E6B13A
BackColor2=$E5B13A
BackSolid=no
BackColorDirection=lefttoright
What I'm wondering is, does anyone know what colors BackColor and BackColor2 actually modifies? And if there is no simple way of changing the colors; is there any way to modify the upper banners color gradient programmatically using the [Code] segment?
The four parameters are described in the Cosmetic section of the documentation of the [Setup] section in the Inno Setup help. They do what you would expect, but not for the gradient in the upper area of the setup wizard, but for the background window that was customary a few years ago. This is considered legacy, but can be enabled by setting
[Setup]
...
WindowVisible=yes
(the default value is no). You can try this to see it in action, but IMO you shouldn't enable this for your installations unless you want them to look rather dated.
As for the top area of the wizard: It is not meant to have a gradient. If you use a tool like Spy++ to check the window hierarchy of the wizard, or open the Wizard.dfm.txt text file from the Inno Setup sources, you will find that there is a window of the class TPanel with the colour set to the default window colour (clWindow if you know Delphi, or the result of calling GetSysColor() with the COLOR_WINDOW constant). This is a solid colour, which you can change easily by adding this to your [Code] section:
procedure InitializeWizard();
begin
WizardForm.MainPanel.Color := clYellow;
end;
I don't think it is possible with the current Inno Setup versions to draw a gradient on this panel, because the panel itself has no canvas to draw on, and the TPaintBox class which could maybe be created in the right place and be used to draw the gradient isn't available (see list of classes in the "Support Classes Reference" section of the documentation).
this is an old question, but someone might stumble here like i did. The most elegant way to change the inno setup color schemes is by using a 3rd party tool called ISSkin

Resources