Print Page | Close Window

Various request about Component Pack

Printed From: TMS Software
Category: General
Forum Name: Feature Requests
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=188
Printed Date: 20 Oct 2019 at 6:35pm


Topic: Various request about Component Pack
Posted By: Finelli Fabio
Subject: Various request about Component Pack
Date Posted: 23 Sep 2010 at 12:01pm
TAdvSmoothSpeedButton
The Component Pack lacks for that kind of buttons, which i'll need so much.
Or a way to emulate the "AllowAllUp" and "GroupIndex" properties behaviour using TAdvSmoothToggleButtons.

Caption->Text
I am forced to rewrite a lot of code because, using the "smooth" component, the Caption property is no more an AnsiString but instead it is an object.
There's any way to make that writing something like
aSmoothLabel->Caption = "A string";
or
aSmoothLabel->Caption = an_AnsiString;
will work?

TAdvSmoothButton
They lacks some of the "visual properties" there's in TAdvSmoothToggleButton (BevelColorDisabled, BevelColorDown, ColorDisabled,ColorDown).
This make a bit hard to put the two kind of buttons one at the side of the other, because visually they becomes different.
Could be possible to implement the same properties of the SmoothToggleButton in the SmoothButton?





Replies:
Posted By: Bruno Fierens
Date Posted: 24 Sep 2010 at 4:44am
1. Thanks for this feedback. We'll consider this for a future update
2. Caption is complex property that holds much more than just the text. We can't change this to a string property
3. If you set AdvSmoothToggleButton.AutoToggle = false, you can use it as a regular button


Posted By: Finelli Fabio
Date Posted: 24 Sep 2010 at 8:20am
Originally posted by Bruno Fierens

2. Caption is complex property that holds much more than just the text. We can't change this to a string property

I know this. But, you may overload the "=" operator of the caption class, when the type passed is an AnsiString or a char*, to let it just writes the string passed in the Text property.

As a personal opinion, i think that naming that whole class "Caption" breaks the BDS standards. I'd liked more to have a standard Caption property and something like "CaptionAppearance" for the whole class property.


Posted By: Bruno Fierens
Date Posted: 24 Sep 2010 at 8:24am
We can't change this now as it would break backwards compatibility. Caption includes here all properties of the caption.


Posted By: Finelli Fabio
Date Posted: 24 Sep 2010 at 9:34am
If you meant that it is impossible to rename the property, then i (sadly) agree,
But adding the overloaded "=" operator should not affect backward compatibility, because right now assigning an ansistring to the Caption property was not possible, so no one is doing it.


Posted By: Bruno Fierens
Date Posted: 24 Sep 2010 at 10:04am
I doubt that is possible on a published property. It could affect the DFM streaming. I will investigate this though.


Posted By: Finelli Fabio
Date Posted: 01 Oct 2010 at 5:59am
I'm working on a TAdvSmoothListBox.
To get a pointer to an item having the index it is necessary to use some really weird code:
TAdvSmoothListBoxItem* pItem = TAdvSmoothListBox1->Items->operator [](itemindex);
or
TAdvSmoothListBoxItem* pItem = TAdvSmoothListBox1->Items->Items[itemindex];

It could be much better if the [] operator could be reworked to have the following line working:
TAdvSmoothListBoxItem* pItem = TAdvSmoothListBox1->Items[itemindex];
Or at least a new property or method, to write something like:
TAdvSmoothListBoxItem* pItem = TAdvSmoothListBox1->GetItem(itemindex);
TAdvSmoothListBoxItem* pItem = TAdvSmoothListBox1->Item[itemindex];




Posted By: Bruno Fierens
Date Posted: 01 Oct 2010 at 9:42am
This is actually something very typical for Delphi default array properties. You'll see the same in any component, including standard VCL components that have default array properties. It is a Delphi language feature that C++ does not have.


Posted By: Finelli Fabio
Date Posted: 01 Oct 2010 at 10:24am
Not really. No one of the standard VCL components requires ....->Items->Items[]. Usually the first "Items" returns a pointer to a single item, not to the collection, so a single ...->Items[] is working.
But i see now why it is in that way:
imho, it was a bad choice having called "Items" the published property that returns the  TAdvSmoothListBoxItems* in the TAdvSmoothListBox class. As for the the "Caption" property in most of the smooth components, using a "Standardized" BDS name for somewhat different is confusing for the end user (one of them is me).
All my code is full of ALabel->Caption = "AString" but not in the form containing you components.
The same happens with the Items propertiy: from now to the future, any new programmer that will handle my code will have to understand why i've used Somewhat->Items[x] everywhere but Somewhat->Items->Items[x] for your components.

For this reason pls consider adding a method like "GetItem(itemindex). It cost not so much troubles and will make c++ code less confusing.



Print Page | Close Window