What's the difference between ListView and GestureListView? - delphi

What's the difference between ListView and GestureListView? Examples would be helpful.

the TListview is a VCL control, based in the windows listview, this component is for general use and supports different visualizations (styles) like report style, lists, small icons, etc.
by the other hand the TGestureListView is a TCustomListView descendant which was made to display the name of gestures and a small thumbnail with the gesture’s shape.

Related

TImageList/TListview: correct design choice?

This is a question about picking the right Delphi components.
Using Delphi for a new app.
I'm looking to allow my user to have a list of (his own, on harddisk) pictures (just jpg for now, but should support different formats in the future), import them into my app, and then display them to him in a TListView. I was planning to tie that TListView to a TImageList (since this comes out of the box)... but when I tried, I ran into a set of weird problems about importing jpg's into a TImageList, reported here:
TImagelist not adding bitmap
So I'm wondering, am I using components for something they aren't intended for? Specifically, is the TImageList (even with some pre-formatting on import) useful for this kind of freestyle-all-sizes-and-formats-allowed stuff?
Any advice appreciated!
TImageList is designed to contain images of stored with the same format and size. If I am understanding correctly, TImageList doesn't do what you ask for.
TListView is tied to TImageList and therefore has the same limits. In my experience, a component flexible as you ask requires a custom component and manual drawing.
If you could change the requirement and decide a fixed size, you can preprocess the images making a thumbnail of the decided sizes and store them in the image list. This way you avoid building a component specific for your needs.

Painting issues with TScaledLayout & custom styles

I'm experiencing painting issues when combining TScaledLayout and custom styles created from the bitmap style designer in fmx.
To demonstrate, I loaded the default custom style created by chosing "New style for VCL / FMX" -> "save as .style" in the bitmap style designer. I dropped several standard controls on some colored rectangles: The red & green ones on a TScaledLayout, the blue one directly on the form. As I stretch the form, colored lines appear on the controls on the ScaledLayout; the background is partially visible:
If I size the form to exactly match the design-time dimensions, the lines disappear. That seems like a pretty significant issue, I certainly can't use those two together like that. Does anybody have an idea for a possible fix or workaround?
Looks like this is a known issue with scaling and bitmaps. See the Google+ discussion here - https://plus.google.com/+PaulThornton/posts/ACAHkJD3a84. I'll quote Marco Cantu's thoughts:
I've found an internally reported issue of a similar case, but haven't
found one that matches this scenario. Certainly worth adding to quality
portal. Having said this, I fear that bitmap-based operations and
scaling don't really fit together very well, and it might be difficult
to have an all encompassing solution.
Let me explain with an example. Take a button. This is painted by FMX
with 9 sections (borders, corners, central part) so that regardless of
the size the bitmap elements are stretched in one direction at most,
often just draw. Stretching a single bitmap for the button to the
target size would break anti-aliasing and create a blurred image when
using colors.
This is example what happens with a ScaledLayout, given it takes the
complete final image and transforms it. ScaledLayout was originally
introduced with vector styles, and worked very well in that scenario.
With todays's bitmap styles things get a bit more complex.
Regardless of this explanation of there the issue lies, I'd recommend
reporting it on QC, and I'll make sure it doesn't get closed as design
(it could naturally happen, this is how the system works) but that we
do some investigation to address the issue -- turning this into a
feature request.

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

How to zoom images loaded in TImage control in Delphi XE2 Trial?

I have developed a small utility to load different types of image files in TImage control in Delphi XE2. Now I would like to implement and test zooming functionality, with built-in controls only (i.e. not using any 3rd party component).
See the second part of this answer which zooms in and out a TImage by using the mouse wheel.
Note: It repositions the image component.

Looking for a simple graphical component for Delphi

I am looking for a graphical component in Delphi winch have such features:
allows to paint text in different font types, sizes and colors
allows to select previously drawn text and copy it
paints images on a given coords, gif support would be nice
its very fast in terms of CPU usage
I need this component as a main chat window. I don't want to use it as a text editor.
I've tried two solutions so far:
TVirtualStringTree
THtml
Currently I am using THtml. It performs quite nice but it is a bit to slow due to two facts:
It supports many features which are not necessary in my case
Each time I want to add some content to it, I must reload the whole content
I really don't want to go into its sources and modify them until I have no other choice. So maybe someone of you knows some nice lightweight component which I can use instead?
Take a look at TRichView. It's derived from TCustomControl so no external dependencies. It's third party commercial component, but a very good one. Skype Win client uses it.
What about a TRichEdit? Most of the things you mention should be easiliby possible with this component.
Concering the insertion of a bitmap, see this article on Delphi 3000.
Did you consider using TWebBrowser?
At least it ticks all your boxes...

Resources