How to set transparentedit style to a TEdit in firemonkey? - delphi

When developing a Windows or iOS application in Delphi Seattle 10 we can easily create a transparent TEdit by setting it's StyleLookup property into transparentedit.
However, it doesn't change anything when developing for Android.
How do we create a transparent TEdit for Android in Firemonkey?

Not the best solution - but solves the problem in a simple way.
1 - Add a blank TRectangle to cover up the Tedit line. It will look like it is transparent.
Note : covering it up with 1 px of height will reduce to almost 0 the chances of giving a bad user experience when clicking on the field.

Related

Issue with BringToFront in Firemonkey

I have two controls on my form.
TWebBrowser with Align set to Client
TMemo with Align set to None
I want to display TMemo on top of TWebBrowser for a particular scenario and for that am using Memo.BringToFront but it does nothing.
Am I missing something?
TWebBrowser Is a particular firemonkey Control. Firemonkey control are "paint" according to their z-order on a openGL surface (ie: the form). but TwebBrowser is a native control that is draw on another surface that is placed on the top of the form, hidding in this way everything back to it.
The only way you can do is to show you memo inside another window on the top of the TwebBrowser. for this you can use a native Memo. As far as i know their is only one native memo implemented on android (delphi already have some that work on ios/windows) it's https://github.com/Zeus64/alcinoe

Show TEdit in FireMonkey has an error in it with red border

I'm working on a mobile application where the user needs to login.
The server is returning me if the e-mail is invalid, or subdomain or password and I want to focus the TEdit that has the error. Focus is easy but I would also like to mark the edit as invalid like many web applications do.
What is the best way to do this is a consistent way so it will look correct on both Android as iOS. Is something like this built-in? I'm using Delphi 10.1
Loki's suggestion is a possible solution.
A solution which takes advantage of FMX features would be to use a TGlowEffect for the red frame around the TEdit and then use a TPopup to create the hint.
the style it's just a nightmare in 99% of the case, so i strongly suggest to not touch it. i will instead put a Trectangle as the background of the Tedit, put the Tedit as Transparent (you already have this style ready in the stylelookup in the object inspector), and then simply set the stroke.color of the trectangle.
i m working also right now on a 100% native Tedit on ios/android/windows i guess i will finish this code in around 1 week.

Greyed TWebBrowser control

When TWebBrowser control is too small it becomes greyed.
If TWebBrowser control is aligned to alClient and there are no other controls on the form I can make it really small (50x10 for example). However, when I add other controls like panels, toolbar, main menu and so on which all float on top (alTop) - the more controls I add it seems, the smaller window of TWebBrowser I can get without greying itself. When window is resized to become larger, then it becomes ungreyed again.
In this example I placed TToolBar with 2 buttons aligned to alTop, and TWebBrowser aligned to alClient. If I make toolbar invisible, I can make web browser really small. However, with toolbar visible it greys itself. The more controls I add it seems to have less and less usable space before greying itself.
As you can see in last example web browser is even smaller than in second example but still visible and everything is the same except there is no toolbar on top. Same applies if used on Windows 7 or 8 or with Internet Explorer 10 or 11.
The examples here are just examples. I don't have a problem with having 100x100 control as minimum size. The problem is that when I place quite a bit of controls then it doesn't allow me to have smaller control than 550x250, which is quite large.
Can anyone enlighten me why other controls have an effect on web browser not being able to use smaller size when it can do this perfectly normally when there are no other controls on form?
Many thanks to bummi in the comments up there for finding a following workaround:
It appears that the problem with greyed control doesn't appear in XE3 and later but can be reproduced in earlier versions like XE2, XE, 2010 and 2009.
For these earlier versions the workaround is to place TWebBrowser on another control such as TPanel and then align both controls to alClient (so that the TWebBrowser fills entire TPanel and TPanel fills entire area previously filled by TWebBrowser). Of course, alignment here is not an issue but the workaround is just to place one control on another.
The same works for TEmbeddedWB and probably other controls that host Internet Explorer ActiveX control.
When placed on container control like TPanel, web browser can be resized to any size without the problem described above.

TGridPanel no transparency if themes disabled in Win7

I have a form filled with a TImage. I put over this a TGridPanel. If themes are enabled in Windows 7 the TGirdPanel appears with transparency. If themes are disabled (no visual styles) the TGridPanel loses transparency and hides the part it ocupies. I use Delphi XE2
Is there any workaround for this?
That's a basic fact of life for panels. It's not special to the TGridPanel, you will see the same effect for any control derived from TCustomPanel. The transparency is only supported when the application is themed.
The grid panel is just a convenient way to layout your controls. If you want to support running unthemed then the simplest solution is to remove the TGridPanel and layout your controls manually. That's pretty much trivial to do. Handle the OnResize event of the control that currently contains the panel, and position your controls as desired.

3 TToolBar's on a TCoolbar band

I have TCoolBar with two bands. On the first band I want to put 3 separate TToolBar's in it. I take TToolBar in TCoolBar and set align to alNone but cannot adjust the size of TCoolBar.
I look at my Delphi 5 and it uses TControlBar that the sites tell me to avoid.
I'm installing Speed buttons on my Toolbar with spaces and separators to get flat button effects.
has any one got a good solution to this problem
Thanks in advance.
I can't replicate your problem. Here's what I did (exactly):
Started Delphi 7, which gave me a new blank VCL forms application
Dropped a TCoolBar on the form, and then dropped three TToolBars on the CoolBar.
Hit Escape to change the designer's focus from the last dropped ToolBar.
Used Shift+DownArrow to increase the height of the CoolBar so that all the ToolBars were visible.
EDIT: After posting this, I also tried setting the TCoolBar.AutoSize property to True instead of manually resizing as the last step above describes. This also worked properly.
I don't know what
I look at my Delphi 5 and it uses TControlBar that the sites tell me to avoid.
means. What "sites", and why "avoid"? If you're telling us that the Delphi 5 IDE uses TControlBar, IIRC D5's IDE worked just fine.
Also, don't use SpeedButtons on a TToolBar. A TToolBar is designed to hold TToolButtons, which you can put on the TToolBar by right-clicking it and choosing either "New Button" or "New Separator" from the context menu.

Resources