Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 406 to 420 of 886, page 28 of 60
<< previous next >>
TAdvOfficePager
How to set the Metro style in code
How to set the Metro style in code
To set the default Metro tones, add the unit AdvStyleIF and the code:
procedure TForm18.FormCreate(Sender: TObject); begin AdvOfficePager1.SetColorTones(DefaultMetroTones); end;
TMS FlexCel for VCL & FMX
Where are the FlexCel 5 components installed?
Where are the FlexCel 5 components installed?
FlexCel 5 replaced the non visual components by just classes, so they won't install in the toolbox.
For more information, please read:
https://www.tmssoftware.com/site/blog.asp?post=228
TMS FlexCel for VCL & FMX
Internal error F2084 when installing in Delphi XE
Internal error F2084 when installing in Delphi XE
If you get an error similar to this while running the setup:
c:\program files\embarcadero\rad studio\8.0\Bin\CodeGear.Delphi.Targets(188,5): error F2084: F2084 Internal Error: AV03786F4A-R00000014-0 Done building target "_PasCoreCompile" in project "FlexCel_XlsAdapter.dproj" -- FAILED. Done building project "FlexCel_XlsAdapter.dproj" -- FAILED. Build FAILED. c:\program files\embarcadero\rad studio\8.0\Bin\CodeGear.Delphi.Targets(188,5): error F2084: F2084 Internal Error: AV03786F4A-R00000014-0 0 Warning(s) 1 Error(s)
THTMLTreeView
How to have all Child items checked or unchecked depending on the parent check state
How to have all Child items checked or unchecked depending on the parent check state
This is a code snippet that demonstrates this applied to a default THTMLTreeView on the form:
procedure TForm4.FormCreate(Sender: TObject); var tn,sn: TTreeNode; begin tn := htmltreeview1.Items.Add(nil,'Parent node'); htmltreeview1.SetNodeCheck(tn, false); sn := htmltreeview1.Items.AddChild(tn,'Child 1'); htmltreeview1.SetNodeCheck(sn, false); sn := htmltreeview1.Items.AddChild(tn,'Child 2'); htmltreeview1.SetNodeCheck(sn, false); sn := htmltreeview1.Items.AddChild(tn,'Child 3'); htmltreeview1.SetNodeCheck(sn, false); tn := htmltreeview1.Items.Add(nil,'Parent node'); htmltreeview1.SetNodeCheck(tn, false); end; procedure TForm4.HTMLTreeview1CheckBoxClick(Sender: TObject; Node: TTreeNode; Check: Boolean); var i: integer; sn: TTreeNode; begin sn := Node.getFirstChild; while assigned(sn) do begin Htmltreeview1.SetNodeCheck(sn,check); sn :=sn.getNextSibling; end; end;
TMS FlexCel Studio for .NET
How to autofit merged cells
How to autofit merged cells
Please take a look at the section Autofitting Merged Cells at page 13 in the TMS Flexcel Studio for .NET - API Developers Guide
TCabFile
An error message 'Failure opening file to be stored in Cabinet' appears when compressing a file which is located in C:\Windows\System32\...
An error message 'Failure opening file to be stored in Cabinet' appears when compressing a file which is located in C:\Windows\System32\...
TcabFile needs to create temporary files during compression and it is not allow to write these under \Windows\System32
TCabFile
Compressing 3 files into 1 Cab file
Compressing 3 files into 1 Cab file
procedure TForm4.Button1Click(Sender: TObject); begin cabfile1.CABFileContents.Clear; cabfile1.CABFileContents.Add.Name := 'c:\tmssoftware\CARS.CSV'; cabfile1.CABFileContents.Add.Name := 'c:\tmssoftware\dbadvgrid.pas'; cabfile1.CABFileContents.Add.Name := 'c:\tmssoftware\AppWebUpdater.pas'; cabfile1.CABFile := 'c:\tmssoftware\testfile.cab'; if cabfile1.Compress then ShowMessage('success'); end;
TAdvMemo
How to insert text in a new line
How to insert text in a new line
You can use the function:
AdvMemo.MouseToCursor(X,Y, var CurX, CurY: integer);
TAdvTouchKeyBoard
How to calculate precisely where the TAdvPopUpTouchKeyBoard will appear
How to calculate precisely where the TAdvPopUpTouchKeyBoard will appear
You can see the code how the coordinates are automatically calculated in the source code of ADVTOUCHKEYBOARD.PAS under procedure TAdvPopupTouchKeyBoard.TimerProc(Sender: TObject);
The function GetWindowRect(wnd,r); gets the coordinates of the active edit control and this is used to position the keyboard.
TAdvSmoothTrackBar
How to customize the text of the value inside the TAdvSmoothTrackBar
How to customize the text of the value inside the TAdvSmoothTrackBar
You can use the OnDrawNumber event that has a String parameter that can be changed. Following code:
procedure TForm1.AdvSmoothTrackBar1DrawNumber(Sender: TObject; value: Double; var s: string; var AllowDrawText: Boolean; var TickMarkColorLeft, TickMarkColorRight: TColor; var AllowDrawTickMarkLeft, AllowDrawTickMarkRight: Boolean); begin s := 'test'; end;
TAdvOfficeImage
How to load an image programmatically
How to load an image programmatically
AdvOfficeImage.Picture.LoadFromStream()
TAdvStringGrid
When "<" is in a cell text, the text in front of the "<" is always doubled when you click into the cell
When "<" is in a cell text, the text in front of the "<" is always doubled when you click into the cell
Set grid.EditWithTags = true to edit this type of text.
TMS TableView for FireMonkey
FireMonkey Guidelines
FireMonkey Guidelines
More information on developing FireMonkey components and building / deploying on other platforms can be found on http://docwiki.embarcadero.com/RADStudio/en/FireMonkey_Components_Guide
TMS TableView for FireMonkey
My First Firemonkey Component
My First Firemonkey Component
Below is a sample that is useful to understand the design of a new FireMonkey component. These three code snippets will result in your first control which has a backgroundrectangle, a button, an edit, and an additional rectangle.
This component only loads the style file as a layout, and is static. You can click on the button and type in the edit field, but the component has no properties to interact with.
fmx.MyFirstControl.pas unit fmx.MyFirstControl; interface uses FMX.Types, Types, Classes; TMyFirstControl = class(TStyledControl) private public constructor Create(AOwner: TComponent); override; protected function GetClassName: String; virtual; function GetClassStyleName: String; virtual; function GetStyleObject: TControl; override; function LoadFromResource: TControl; end; procedure Register; implementation {$R fmx.myfirstcontrol.res} procedure Register; begin RegisterComponents(‘My First FireMonkey Control’, [TMyFirstControl]); end; function TMyFirstControl.GetClassName: String; begin Result := ClassName; end; constructor TMyFirstControl.Create(AOwner: TComponent); override; begin inherited; Width := 209; Height := 105; end; function TMyFirstControl.GetClassStyleName: String; begin Result := GetClassName + 'style'; Delete(Result, 1, 1); end; function TMyFirstControl.GetStyleObject: TControl; var obj: TControl; begin obj := inherited GetStyleObject; if not Assigned(obj) then begin // not found in default or custom style book, so create from resource obj := LoadFromResource; end; Result := obj; end; function TMyFirstControl.LoadFromResource: TControl; var S: TResourceStream; str: String; begin Result := nil; // create resource class name str := GetClassStyleName; if FindRCData(HInstance, str) then begin // load from RT_RCDATA resource type S := TResourceStream.Create(HInstance, str, RT_RCDATA); try Result := TControl(CreateObjectFromStream(nil, S)); finally S.Free; end; end; end; initialization RegisterFmxClasses([TMyFirstControl]); end.
fmx.myfirstcontrol.style object TRectangle StyleName = 'MyFirstControlStyle' Position.Point = '(184,248)' Width = 209.000000000000000000 Height = 105.000000000000000000 Fill.Kind = bkNone Stroke.Kind = bkNone object TRectangle StyleName = 'background' Align = alClient Width = 209.000000000000000000 Height = 105.000000000000000000 object TButton StyleName = 'Button1' Position.Point = '(10,20)' Width = 80.000000000000000000 Height = 22.000000000000000000 TabOrder = 0 Text = 'Button1' end object TEdit StyleName = 'Edit1' Position.Point = '(102,20)' Width = 100.000000000000000000 Height = 22.000000000000000000 TabOrder = 1 KeyboardType = vktDefault Password = False end object TRectangle StyleName = 'rectangleElement' Position.Point = '(11,48)' Width = 65.000000000000000000 Height = 49.000000000000000000 Fill.Color = xFFFF4B4B end end end
fmx.myfirstcontrol.rc MyFirstControlStyle RCDATA "fmx.myfirstcontrol.style"
rt := (FindStyleResource(‘rectangleElement’) as TRectangle); rt.RotationAngle := MyRotationAngleProperty; //sample below 45°
TMS Instrumentation WorkShop for FireMonkey
Compiling / Distributing in xcode
Compiling / Distributing in xcode
When creating your project in Delphi, and afterwards, generate a xcode compatible project (dpr2xcode.exe) there are some additional steps to be taken before the project will compile in xcode.
In the generated iOS version you will notice an xcode folder, with an xcode project file. Before opening this project file in xcode you need to copy the correct source files from the installation directory to the directory of this your xcode project:
- All the FMX_*.pas files - All the FMX_*.res files - The tmsdefsios.inc file
The last step to take is to rename the tmsdefsios.inc file to tmsdefs.inc file in order to compile correctly. After opening the project in xcode, click the run button, which will automatically compile and run the project in the simulator. Of course you can select to run it on a real device as well.