Is there a way to remove padding from the checkbox itself in FMX? - delphi

What im trying to achive is that all components are aligned to the left ( red line )
But as you can see checkboxes and radiobuttons has some strange padding even tho padding itself is set to 0.
Can anyone help me with this one?

Seeing your tags I'm assuming you are using the FMX framework. This can be achieved by right clicking the Checkbox in design time > Click Edit Default Style > Click on the little box and set the "Align" property to left. The same applies to the radio button. Lastly close the Style Designer tab and click Yes to save the changes.

Related

hide elements in xcode storyboard

Is there a way to hide elements in storyboard interface? What I am talking about is like in Photoshop how you can hide layers while working. I ask because I have some stacked items and it would be nice to not see everything at once while working sometimes.
While selecting your view/object, in the right panel click the 'Installed' button.
Make you to reenable it when your done!
^
Make sure to select one of the views:
I also cannot see the 'installed' checkbox (Xcode 6.4), but here is my workaround to temporarily hide a layer.
Select one of your views to 'hide' and in Utilities Pane, select Size inspector and set your X (horizontal) value to 1000 - which will slide the view off the screen, allowing you access to layers below. Don't forget to reset X value when done.
The Installed button is visible after Xcode 6 and later, also enable "Use Auto Layout" and "Use Trait Variations".

Borders misaligned after expanding a JQueryUI toggle on Chrome only

I have a bunch of controls that start off hidden. When the Options button is clicked, the controls are displayed in a drop down box with a border. On Chrome, when the box is expanded, it looks like the left hand border is pushing the right hand border out of alignment with the button.
The drop down look like this:
See http://jsfiddle.net/Qs2zp/ for the code for this example.
If I remove the left hand border, the right hand border falls into place
See http://jsfiddle.net/Qs2zp/1/ for the example without the left hand border.
I am not able to reproduce this problem in Firefox or IE.
Has anyone else ever seen anything like this before?
Thanks
Is this acceptable? The CSS I added is in #controls-title and .options-dropdown-expanded. I basically set a left padding on the title bar that gets removed when the dropdown is expanded so that the left border doesn't shift the title bar to the right when it appears. I also set a -2px right margin when the dropdown is expanded so that the right border pops in rather than jutting out.

Why TPanel does not show correct frame/border in Delphi XE?

Tpanel does not show the top and left border under Delphi XE/Win 7.
Why?
Example (I just dropped few TPanel from pallete to my form, inside of a TTabSheet):
How do I make it look like the original Delphi 7 control (with all 4 borders), without changeing its properties every time I place it on my form?
Set ParentBackground to false.
Above is a blue panel on a green form (ParentBackground = false). Notice the white upper-left border and the gray bottom-right border. Of course, if both the form and the panel are white, the white border will become invisible.
That is how it meant to be drawn. The 3D effect is as if there was a light source shining from the top left. That's why the bottom and right edges are in a shadow cast by the raised panel.
Regarding your updated question, it sounds like you want your application to run without themes. The easiest way is to uncheck "Enable runtime themes" in the Application pane of the project settings.
But of course that would look odd nowadays. If you are using the panel to group related controls, perhaps a group box would be better. My instincts are that panels with raised borders will look poor on modern themed Windows.

How to ownerdraw the scroll buttons in a scrollable Tmenu (or Tpopupmenu)?

By setting a MIM_MAXHEIGHT with SetMenuInfo, I can control the max height of a [popup]menu. When the menu appears, if it needs more height than MIM_MAXHEIGHT, it will have 2 scrollbuttons (one at the top, the second at the bottom)
I do draw myself the menuitems to theme them with various flavours.
But my OnDrawItem or OnMeasureItem are never called for drawing the scrollbuttons.
So my question is : How to ownerdraw the scroll buttons in a scrollable Tmenu (or Tpopupmenu)? Is it even possible?
Looking at the MSDN documentaiton, I don't think you can not owerdraw those buttons, as they are not part of the menu items, but of the menu itself.
The menu itself only has very few flags you can define; the only modify the background.
This link describes (an English translation of) how to to this.
Or this link on the Embarcadero forum.
What is possible is to set a background color to the menu (MIM_BACKGROUND) and giving to the hbrBack member a Tbrush.handle with a predefined color.
that is not perfect but often, themes use a single color to backgroud the menuitems. By this way, the scroll buttons will be colored with the background color

How to add background images to Delphi forms

How can I add a background image to my delphi form? I added a TImage, but now the labels aren't visible any more, and the texts of my checkboxes are in a blue "box" (blue is the background color i chose). This blue doesn't look very good on the background image, and the hidden labels also don't look good. How do I fix these problems?
For the labels: make sure that they are transparent (Transparent property in the Object Inspector), and that they are on top of the TImage in the Z-order of controls. To correct this you can execute the "Send to back" command on the TImage component in design mode, it will make all other non-windowed controls appear on top of it.
For the checkboxes I don't know what the problem in your case is, in Delphi 2007 checkboxes appear properly transparent when put over a TImage. Maybe you use an earlier Delphi version? If so it would be good to mention this in the question. There may also be a different behaviour depending on whether themes are active. Again, hard to say without further information.
Move the TImage to the back of the form (right click, order -> send to back).
For labels, set the Transparent property to true. For checkboxes and radio buttons, at least in Delphi 6 which is all I have access to, there is no transparent property. The way round this is to reduce the controls label to zero size and the provide your own additional TLabel, which can be transparent.
Can I also say that I find windows with background images ultra naff, and I know I'm not alone in this.

Resources