How to change at runtime by code (not for groupskintype), the skin type for a sptbxtoolbar component?
You can only change the skin of all SpTBXLib components at once.
Use this code
SkinManager.SetSkin('Office 2007 Blue');
You can however set for each SpTBXLib component if it is drawed using the skin, Windows look or the default look, by setting assigning the SkinType property.
MyComponent.SkinType := sknWindows;
Hint: Toolbars itself do not have the SkinType property. They are always drawn using the skin.
I don't know that component, but found this with Google. Hope it helps.
Related
i'm using VirtualTreeView (as a grid - in Delphi XE7) in my app and i also chose to use the Carbon VCL style.
The problem arise because i need to color some rows according some status on each line, and the font color keep staying white even when i use a light color on a line. So it is impossible to read the data. When i use the Iceberg Classico style, this issue do not occurs.
So basically, i can change my set of rows color according to the style selected, it is one solution. But i'm looking for a way to modify the font color according to the row color background?
I'm doing the colorization code inside the event: BeforeCellPaint and i tried to modify the font color without any success.
Any idea?
i found a library that helps a lot on this subject:
// unit for the VCL Styles Utils
// github.com/RRUZ/vcl-styles-utils
TargetCanvas.Brush.Color := aColor;
if TStyleManager.ActiveStyle.Name = 'Carbon' then
TCustomStyleExt(TStyleManager.ActiveStyle).SetStyleFontColor(sfTreeItemTextNormal, clBlack)
else
TCustomStyleExt(TStyleManager.ActiveStyle).SetStyleFontColor(sfTreeItemTextNormal, aFontColor);
TargetCanvas.FillRect(CellRect);
With this i can change the font color.
Laurent
I want to make a label, that occupies all empty space, and at the same time has centered text.
// firemonkey code,
// causes compile-time error "E2010 Incompatible types: 'TAlignLayout' and 'Set'"
GreedyLbl.Align := [TAlignLayout.alClient, TAlignLayout.alCenter];
I've also looked for a suitable constant on embarcadero wiki, but with no result. Maybe someone knows how can I make a described label?
It looks like you're pretty close. Try setting the Align to just TAlignLayout.alClient. Then set the TextAlign to TTextAlign.taCenter.
The Align property is part of TControl and comes into play anytime there is a control with a visual aspect to it.
The TextAlign property only involves controls descended from TTextControl, like a TLabel. (Also: TTextControl descends from TControl).
My Application has several TSpeedButtons with which to choose a color and I want each choice to be shown by the color of the TSpeedButton.
I found this answer on Stackoverflow on how to change the color of a TButton. The second answer (change colors dynamically) appears to be the solution I am looking for. It reads as follows:
var r: TRectangle;
begin
// Find the background TRectangle style element for the button
r := (Button1.FindStyleResource('background') as TRectangle);
if Assigned(r) then
begin
r.Fill.Color := claBlue;
end;
end;
This does not work anymore (i use XE5, this is XE2?). It generates an exception at the r := ... statement with:
"illegal cast".
The FindStyleResource returns a FMXObject.
TRectangle is a TShape->TControl->TFMXObject.
I can cast to TControl but not to TShape. In case you wonder, Button1 is a TButton.
Does anyone know how I do change the color of a TSpeedButton?
As an aside: is there a way to determine which type of object exactly is beging returned? I couldn't find out in the debugger.
The answer to the question you linked to relates to vector styles, where the style constructed entirely from shapes etc (such as the TRectangle).
In newer versions of FireMonkey the 'system' styles (which mimic the OS look) and some other styles use bitmaps.
If you want to edit a bitmap style, you'll need to find the bitmap image in the style, edit it, and then redo/edit the button's style to use the new image. (If you're on mobile this will probably be hard enough that you shouldn't even try it).
Another route would be be to change to one of the bitmap styles supplied with Delphi. You will find them under the redist/styles/fmx folder of your Delphi installation.
As for the class of the object, and as per other comments, examine the ClassName property of the object returned.
But bear in mind that not every style will have an object called 'background'. Both the name of the object and it's class can easily vary between styles. You really ought to look at the style you want to pluck objects from to see what's there. (Note that the objects name ('background') will be in the StyleName property).
It would be much easier to use a TColorButton instead, which directly exposes the Color property. You can find it on the Colors page of the component palette. Here are two on a new FMX form in the IDE's form designer:
As far as "which type of object is being returned", you can use the debugger or a ShowMessage for the TFMXObject.ClassName of the return value:
var
Obj: TFmxObject;
begin
Obj := Button1.FindResource('background');
if Assigned(Obj) then
ShowMessage(Obj.ClassName);
end;
We have old QuickReport with Delphi 6 Professional.
We uses QRShape to make "table" (as in html, or Excel), not the frame (because the frame size is commonly different than shape, and in QRLabel/QRDBText we don't have spacing option...
So QRShape used as Rectangles (Cells) and Lines.
The main problem that when I have a Memo Field with AutoStretch option then I cannot set the Height of the Shape.
In these cases it would be good if I can set the shape to AutoStretched, or Aligned...
Have the QR some mechanism to set the Shape height as the parent Band's height dynamically?
Thanks for your help!
Regards: dd
The QuickReport suppor said:
Hi, we have added these features to the later versions of
QuickReport. I can't think of any way to do it with old QR. Regards,
Lut Mentz
Such a life... :-)
For anyone still interested in the solution to this, the component QRFrameLine does the job to change to the height of band
Please have a look at this screenshot
alt text http://www.maclife.com/files/u18/Yep3-big.jpg
I think these are the main features of such a 'tag panel':
1) Each tag on the panel is a standalone control and can be clicked
2) Auto line wrapping when there is not enough space to show the next tag in the current line.
3) Rounded corner rectangle border for each tag is a nice-to-have feature.
I want to implement the similar function in Delphi, Is there an existing control to do this? If not, what's the best way to implement such a control?
Thank you.
When you are on a recent Delphi version use a TFlowPanel and some appropriate controls for the tags. A simple TButton or a TLinkLabel should do for that.
Each clickable tag doesn't necessarily have to be its own control. It just has to be a region that you can detect being clicked.
Suppose you represent each area as a Windows region. You can figure out how wide each one should be based on its text with the TCanvas.TextExtent function. Then create a region with a function like CreateRectRgn. For rounded corners, try CreateRoundRectRgn instead. You can test for mouse events in each region with the PtInRegion function. You can paint borders around them with FrameRgn. The last obstacle is to draw them on the screen so they'll all fit. You're creating the regions and you know their widths, so assign tags to a row until you run out of space, and then start the next line.
There are two possible solutions to custom alignment in Delphi 7. You can make your own flowpanel by deriving from TCustomPanel and override the AlignControls( )-method, or you can set alignment to alCustom and handle the OnAlignPosition-event.
I guess I would have gone for the TCustomPanel-derivative option. TFlowPanel in form Delphi 2007 uses that option- I have to admit, though, that I have never tried either my self...