delphi-xe7

How can I change the colour of the toolbar in a FireMonkey mobile application

六月ゝ 毕业季﹏ 提交于 2019-12-12 01:51:25
问题 I'm using Delphi XE7 for developing mobile application. And how can I change the colour of the TToolbar component in Firemonkey mobile application? I can not find the option in the Object Inspector. Is there any other option to change the colour of this component. And I'm targeting Android platform. 回答1: Method #1: In Firemonkey most components can be contained within most other components. Place a TRectangle inside of your TToolBar component. Align it to Contents. Change the Fill color to

What would the design look like for a class that implements a threaded email sending queue?

牧云@^-^@ 提交于 2019-12-12 01:24:58
问题 So my application is a taxi call dispatch system, in which an operator receives calls over the phone and assigns received calls to a driver. On the Call Details form where the call detail is entered, as soon as the Save button is clicked, the form should close, should send an email to the taxi cab driver in a background thread, and the main form is shown, where he can select the next call and assign it to another driver. The hard bit about the design is that it should be a queue, meaning an

Delphi TParallel not using all available cpu

て烟熏妆下的殇ゞ 提交于 2019-12-11 10:36:48
问题 We are migrating our multi-threaded application to Delphi XE7 and are testing the new TParallel.For function. We have found that it parallelizes well on laptops (Core I-5/Windows 7 with 4 cores) achieving close to consistent 100% cpu usage. When we run exactly the same code on an Intel Xeon/Windows 2008 R2 with 2x12 cores, it only achieves about 3% usage and appears to be only using 2 of the cores. The same problem is evident using the Conways Life demo sample application. We have tried using

App crashes when closing Keyboard on Android Delphi Xe7

混江龙づ霸主 提交于 2019-12-11 07:39:34
问题 Create a new project. Drop two TEdits on a form. Deploy to Android device. Start up App. Tap a TEdit to bring up the keyboard, hit the hardware back button on your phone... Crash... Is this something specific to me? or can other people confirm this? Is there something wrong that I am doing? I've tried setting the Key:=0 on the keydown event of the form and the TEdits but that didn't work - app still crashes. Delphi XE7 update 1 installed. 回答1: Create a new project and add your classes to it.

JSONMarshalled not working in Delphi

我们两清 提交于 2019-12-10 21:09:13
问题 I have the following simple class using Delphi XE7 {$M+} {$RTTI EXPLICIT FIELDS([vcPrivate])} TEntityForCreation = class private [JSONMarshalled(False)] FCreator: Integer; FDescription: String; public property Creator: Integer read FCreator write FCreator; property Description: String read FDescription write FDescription; function ToJsonString: string; class function FromJsonString(AJsonString: string): TEntityForCreation; end; The method ToJsonString uses the built in JSON serializing

How to find index of a method in an interface?

微笑、不失礼 提交于 2019-12-10 17:18:24
问题 How can I find index of procedure/function which is defined in Interface? Can it be done with RTTI? 回答1: First of all we need to enumerate the methods of the interface. Unfortunately this program {$APPTYPE CONSOLE} uses System.SysUtils, System.Rtti; type IMyIntf = interface procedure Foo; end; procedure EnumerateMethods(IntfType: TRttiInterfaceType); var Method: TRttiMethod; begin for Method in IntfType.GetDeclaredMethodsdo Writeln('Name: ' + Method.Name + 'Index: ' + IntToStr(Method

In which uses can I find SharedActivityContext?

不羁的心 提交于 2019-12-10 14:34:39
问题 SharedActivityContext exist in uses FMX.Helpers.Android for XE6 But for XE7 I can't find SharedActivityContext in uses FMX.Helpers.Android. Is there another methode of is it moved into another uses? 回答1: It was moved to the new Androidapi.Helpers unit. 来源: https://stackoverflow.com/questions/25981458/in-which-uses-can-i-find-sharedactivitycontext

Writing a custom property inspector - How to handle inplace editor focus when validating values?

﹥>﹥吖頭↗ 提交于 2019-12-10 13:45:01
问题 Overview I am trying to write my own simple property inspector but I am facing a difficult and rather confusing problem. First though let me say that my component is not meant to work with or handle component properties, instead it will allow adding custom values to it. The full source code of my component is further down the question and it should look something like this once you have installed it in a package and run it from a new empty project: Problem (brief) The issue is regarding the

How to create a default project under Delphi XE7?

霸气de小男生 提交于 2019-12-10 11:25:57
问题 Related to this question: Should "Library path" point to the source files of packages? Fabricio Araujo suggested that is not necessary to set the 'search path' for each new project by creating a 'Default Project Option'. How can this be done in Delphi XE7? 回答1: How this can be done in Delphi XE7? It cannot. This functionality was removed I'm not sure exactly when, but it has not been present for some considerable time. What you can do is: Create a new project. Change its settings however you

Which is the best way to load a string (HTML code) in TWebBrowser?

你说的曾经没有我的故事 提交于 2019-12-09 22:58:58
问题 I have a string var 'HTMLCode' that contains HTML code. I want to load this code into the browser. This is Embarcadero's code: procedure THTMLEdit.EditText(CONST HTMLCode: string); {VAR Doc: IHTMLDocument2; TempFile: string; } begin TempFile := GetTempFile('.html'); StringToFile(TempFile, HTMLCode); wbBrowser.Navigate(TempFile); Doc := GetDocument; if Doc <> NIL then Doc.Body.SetAttribute('contentEditable', 'true', 0); //crash here when I load complex html files DeleteFile(TempFile); end; It