How to Make a form snap to edges of the screen - delphi

I just recently started learning Firemonkey, so if the question is stupid, please do not kick. How can I make a Firemonkey form that sticks to the edges of the screen. In VCL is easily done by using the properties ScreenSnap: = true and SnapBuffer: = 15 for example. Another way - processing messages WM_WWINDOWPOSCHANGING or WM_MOVING. How can I make the same with FireMonkey?
Thanks.

Since FMX is platform neutral, doing platform specific things is a lot harder. It should become a little easier with FM2 that ships with Delphi XE3 now.
For Delphi XE2, probably the easiest way is to wrap your FMX stuff in a VCL form.

Related

Opening XE7 project in 10.1 Berlin - all of the objects are differently scaled and positioned

I am trying to edit a 3D app project, written in XE7, on RAD Studio Berlin. It's a simple 3D app with a few dummy objects and a few meshes.
When I load the project, all of the objects are differently scaled and positioned than in XE7, objects are much smaller and repositioned. When I edit the scale, position and rotation variables, I can get similar results, but that's not the solution.
To simplify, I'd like to know how to open my XE7 3D project in RAD Studio 10.1 Berlin.
I wasn't careful enough (read:at all) so I've missed to see new property of Model3D object called WrapMode. It is set to FIT by default, switching to ORIGINAL solves the problem (which really isn't :) ). Big thanks to Rudy Velthuis and Dalija Prasnikar for the effort!

TChart quality issue

We were using Delphi 2010 with the full VCL edition of TeeChart this worked fine
We have now updated to Delphi XE 5 with the latest version of TeeChart and the quality of the charts is now worse
Please see the image here
2 bars which were seperate are now merged into 1 bar
If I make the charts wider which is not an option it looks better but still not as good as before
Please see here
Has anyone come across any issue like this?
The projects are here for Delphi XE5 and here for Delphi 2010
The search paths may need modifying
Cheers
Paul
The issue might be because of the anti-aliasing function being turned on by default in the newer versions of TChart(!).
We had the same issue with a line series graph.
After writing to the vendor (Steema) they came up with the following solution:
Chart1.Canvas := TTeeCanvas3D.Create; //Disable GDI+ to prevent smooth drawing of the graph.
I don't get why we have to switch off drawing with GDI+ as - to my knowledge - GDI+ can also be used without anti-alias.
Anyway, our graphs now behave like the previous versions of the TChart, which is what we want.
I was also hating the "new" anti-aliased charts that are blurry and slow.
It's pretty easy to fix, when you know where to search for.
Double-click on chart, then go to 3D -> Render -> select GDI instead of GDI+
If you look "behind the scenes" into DFM file you can see the change:
Crisp and fast graph (as in 2010): DefaultCanvas = 'TTeeCanvas3D'
Blurry and slow graph (as in XE5): DefaultCanvas = 'TGDIPlusCanvas'
chart settings
Hope this helps.
Some kind of a clumsy runtime workaround was found here, that is also working:
http://www.teechart.net/support/viewtopic.php?f=3&t=15078

IDE Gradient Toolbars

Sorry for posting a non technical question :(
Look at the attached image:
How can I give the Delphi XE IDE the gradient style toolbars?
For VCL TToolbar you can set DrawingStyle := dsGradient for the same effect, but how may I change this for the IDE, I cannot see a option?
PS, My IDE looks blue because of a Windows theme I am using.
Update with Result:
Thanks :)
There is an expert to disable gradients in BDS 2006. As it comes with source you can probably adapt it to XE and make it enable gradients.

Delphi cutting glass

I'm using Delphi XE2, and I like glass effects, and I want to "cut" glass as in Windows 7 tablet tools.
If you also know how cut a button I'll be happy if you tell me how.
Thanks
Drawing in the top area is simply a matter of using a glass frame and painting in the non-client area, or alternatively, using the DwmExtendFrameIntoClientArea API.
The best code sample I have seen for this is the VCL "Ribbon" control, which provides a "QAT" (quick Access toolbar) area, painted in the "non client area".
Note that the author has to think not only about how to render when Vista/Win7 systems which have Glass ON, but also has to decide how to render on WinXp, Win7 and Vista when the Themes engine is off. There is quite a bit of logic in the Vcl.Ribbon.pas (or just Ribbon.pas if you're in XE or earlier) unit dedicated to that.
Look at procedure TCustomRibbonQuickAccessPopupToolbar.NCPaint(DC: HDC); in the Vcl Ribbon sources.
Drawing a non-rectangular "extended area" that protrudes from the bottom is probably a matter of applying a custom window clipping region.
Did you mean you want shaped forms? If so
Irregularly shaped forms
could help. I imagine this will work on Windows 7 (note Remy's comment in the answer).
hth

Ugly "disabled" images of TMainMenu

Delphi 2010, Win32 VCL. I need to create a main menu for my application with the most standard look. TMainMenu looks nice in all Windows versions, the only bad thing is when it displaying images for items with Enabled=False.
Delphi has some strange method for building that disabled images (b/w extrusion with bevels, for me it looks like spew). I want to make a patch for that procedure in VCL sources and let menu to select disabled images from the same TImageList, but I can't find it.
Is it exists at all or it is some standard windows API call? Do you know where is that procedure located?
Sure OwnerDraw style can fix all this but I want a bit faster solution.
There's a great post on Galfar's Lair blog which describes the problem, and has code for a workaround, overriding the TImageList DoDraw method.
Here's the pic (linked) showing the 'before' and 'after'.
I think this relates to pretty much all Delphi versions.
If you can provide your images as PNG you can use TPngImageList from PngComponents. It has different options to make a blended or grayscaled disabled image. The PNG format allows you to make use of alphablending.

Resources