delphi-xe4

How to get “Library” path on actual iOS device

天大地大妈咪最大 提交于 2019-12-10 23:55:25
问题 I am using the following code to my app base directory: // /private/var/mobile/Applications/exampleID/example.app/ FAppDataDirPath := GetHomePath + PathDelim + Application.Title + '.app' + PathDelim; // /private/var/mobile/Applications/exampleID/example.app/Library/ FAppDataLibraryDirPath := FAppDataDirPath + 'Library' + PathDelim; On iOS simulator both these paths exist. However, on the iOS device only FAppDataDirPath exists. The "Library" variation can not be created using e.g

pmAuto ModalPopupMode proper use or bug workaround

坚强是说给别人听的谎言 提交于 2019-12-10 23:34:36
问题 I'm having problems using TApplication.ModalPopupMode=pmAuto and I was wondering if my problems were caused by my usage of pmAuto or a bug in delphi. Simple use case: Form1(MainForm) and Form3 are permanent forms. (Created in the dpr) Form2 is created when needed and freed afterward. Form3 contains a TComboBox with X items. Sequence of actions : Form1 create and show Form2 modal. Form2 show form3 modal. Close Form3 Close and free Form2 Show Form3 <---- The TComboBox now contains 0 items. I

How to change background color of FMX.TGrid row depend on value in XE4

我们两清 提交于 2019-12-10 21:26:17
问题 I'd like to know how to change background color of whole row in Firemonkey TGrid / TColumn . Saw bunch of similar questions, but none of them helped me. I'm using Delphi XE4. TGrid may contain TCheckColumn and TStringColumn . 回答1: TGrid row background style color is divided into two categories : Focus color Selection color Focus color applies to the focused Cell. Selection color applies to the selected Row. Changing focus color is a straight forward process: procedure ChangeGridCellFocusColor

Delphi XE4 - Octal constant is working like decimal constant

亡梦爱人 提交于 2019-12-10 17:11:21
问题 Today i was doing code review of my teammate. It's plain old Delphi, version XE4. I detected the code like this: cWin_CountryIdsSet: array[0..243] of integer = (499, 688, 040, ...) It is the list of decimal IDs but one of them - 040 - looks like octal, right? I immediately told him about the problem but he answered: "No, it works like a decimal, look by yourself". And he was right! I wrote small example: Writeln(080); if 80 = 080 then Writeln('They are equal'); Writeln(IntToStr(080)); It

How to embed the MIDAS.DLL in the client executable

前提是你 提交于 2019-12-10 15:25:33
问题 According to dr. Bob it can be done. Can someone provide step by step example or some tutorial? 回答1: You don't embed MIDAS.DLL; you add MidasLib to your project's USES clause. This embeds the basic functionality into your program without having to rely on a separate DLL for it. 来源: https://stackoverflow.com/questions/21604082/how-to-embed-the-midas-dll-in-the-client-executable

Loading long RTF-Text in TRichEdit does not work

╄→гoц情女王★ 提交于 2019-12-10 14:33:18
问题 If a long RTF-sequenz (eg 150 000 chars) is streamed into a TRichEdit control (in XE4), the control does not display the text but instead shows the raw RTF code: {\rtf1\ansi\ansicpg1252\deff0... What is wrong? procedure TForm1.Button1Click(Sender: TObject); var RtfText: string; Stream: TStringStream; begin RtfText := GenerateRtfText(); Stream := TStringStream.Create(RtfText); try RichEdit2.PlainText := False; RichEdit2.Lines.LoadFromStream(Stream); //<--- ERROR: RichEdit displays raw RTF-Code

TAdoQuery.ParseSql do not work in xe4

时光总嘲笑我的痴心妄想 提交于 2019-12-10 14:16:07
问题 I have a project in Delphi 7 and I use TAdoQuery.ParseSql(); to load parameters. Now I compile it in XE4 and type of parameters is sometimes wrong. It's really ftInteger but created as ftSmallint . What can I do to solve this problem? My DB is SQL Server 2008 R2. Table definition: CREATE TABLE [dbo].[tblTest]( [sysId] [int] IDENTITY(1,1) NOT NULL, [Code] [nvarchar](50) NOT NULL, [Name] [nvarchar](500) NOT NULL, CONSTRAINT [PK_tblTest] PRIMARY KEY CLUSTERED ( [sysId] ASC ) WITH ( PAD_INDEX =

Which midas.dll to use? 32bit datasnap/64bit server

房东的猫 提交于 2019-12-10 11:14:10
问题 Considering the following: We have a 32 bit Datasnap server installed on a 64 BIT Windows Server In embarcadero\rad studio\11.00\redist are 2 folders : 32 bit and 64 bit, with in each a midas.dll. Wich file should we put where? In windows\system32 or windows\syswow64 ? 回答1: Never put anything in the Windows system directories (unless you have a very, very, very good reason to write there). It's a very bad practice (dating back to Windows 3.x times and poor developers skills, because those

How to adjust button size to fit the text in Delphi FireMonkey?

大城市里の小女人 提交于 2019-12-09 16:32:17
问题 I want button size (width and height) to be as small as possible, but I want it to fit the text. Any code example? Delphi XE4 FireMonkey Mobile Application. 回答1: FireMonkey renders text via methods using TTextLayout class. We can access this methods via a class helper and then change the buttons size based on the information provided by the layout. uses FMX.TextLayout; type TextHelper = class helper for TText function getLayout : TTextLayout; end; function TextHelper.getLayout; begin result :

Error opening a dfm file - Class xxxx not found

给你一囗甜甜゛ 提交于 2019-12-08 06:48:13
问题 While opening a dfm file by double clicking, I am getting following error: Class TMyClass not found. Ignore the error and continue? Note: Ignoring the error may cause components to be deleted or property values to be lost. When I click Cancel, I get following message Error creating form: Class TMyClass not found. When I click OK now, pas file is opened only. In pas file MyClass unit is added (which conatins the TMyClass defination) and its path is also added in my search path (Ctrl clicking