delphi-xe5

delphi XE-5 cross platform development - calling a showmodal form

筅森魡賤 提交于 2019-12-23 05:23:05
问题 I am currently developing cross platform applications on my Windows desktop using Delphi XE-5. I have a unit I want to use for cross platform development (for this example, lets just work with Windows and Android). In both my Windows and Android apps, I have a button with the following onClick event procedure TfrmMain.Button1Click(Sender: TObject); begin LPSystem:= TLPSystem.Create; try if LPSystem.execute then begin ShowMessage('Logged in!'); end else ShowMessage('Not logged in!'); finally

How to send multiple attachments using Intent

喜你入骨 提交于 2019-12-23 03:49:09
问题 I've found this code to send multiple attachments using Gmail Android App: public static void email(Context context, String emailTo, String emailCC, String subject, String emailText, List<String> filePaths) { //need to "send multiple" to get more than one attachment final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); emailIntent.setType("text/plain"); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{emailTo}); emailIntent.putExtra(android

Find out the type of file ( GIF, JPG, PNG) - DELPHI

南楼画角 提交于 2019-12-23 03:33:15
问题 I'm carrying images per URL and showing TImage . I will work with JPG , GIF and PNG . But I do not know how to find out what kind of extension possess each file, and then differentiate. How do I get header , or any other method for me to know what type of file: GIF or PNG or JPG? var MS : TMemoryStream; GIf: TGIFImage; jpegimg: TJPEGImage; begin MS := TMemoryStream.Create; GIf := TGIFImage.Create; jpegimg := TJPEGImage.Create; /////// try try IdHTTP1.get('http://forum.wmonline.com.br/uploads

Delphi WebAction - Request.ContentFields.Values['something'] size limit

大憨熊 提交于 2019-12-23 02:36:58
问题 Im having an issue with my web dll, compiled in XE5. I use an AJAX POST via javascript to sumbit a base64 value for an image that was cropped. The length is about 127 000 characters. When logging the Request.ContentFields.Values['Base64Image'] in Delphi, the total length was reduced to 61 000, which then saves half an image. Is there a size limit on Request.ContentFields.Text? If so, how do I overcome this? Can i save a base64 element directly from the HTML page? 来源: https://stackoverflow.com

Trouble synchronizing generic TList and TListBox

风流意气都作罢 提交于 2019-12-23 01:58:48
问题 I have trouble keeping a TListbox in sync with a TList. Each time an item is added to a generic TList, OnNotify is called and the callback calls just one procedure: create_gradients . Its code is below: procedure TColor_Dialog.create_gradients; var Editor: TGradient_Editor; eGradient: Int32; y: single; s: string; begin List_Names.Clear; List_Gradients.Clear; for eGradient := 0 to FColor_Editor.nGradients - 1 do begin List_Names.Items.Add (FColor_Editor [eGradient].Check_Rainbow.Text); end; //

Livebinding JSON objects and arrays

回眸只為那壹抹淺笑 提交于 2019-12-22 18:18:25
问题 Good evening all. I'm currently trying to get to grips with livebindings in Delphi as I'd like to refresh one of my current projects (complete rework from the base for the purpose of pushing to other platforms, optimizing performance and minimizing the code). I'm working with a web API which returns JSON data. The returned JSON format for one example call would look like this; { "response": { "ips": [ { "ip": "111.222.333.444", "classification": "regular", "hits": 134, "latitude": 0.0000,

Do OnMouseDown and OnMouseUp only work as a pair?

与世无争的帅哥 提交于 2019-12-22 17:51:07
问题 My application has a lot of TRectangle's acting as keys of a keyboard. When one is clicked you hear a sound. This is done by handling the OnMouseDown and OnMouseUp event. OnMouseDown: send a sound and OnMouseUp: switch it off. All works fine, except for one thing. On Android I can use several fingers to press several keys. When one OnMouseDown has been processed, no other OnMouseDown Events will be processed until an OnMouseUp event has been processed. It needn't be the OnMouseUp of the key

FireMonkey XE5 - Livebinding - TGrid - Cell text aligment

天大地大妈咪最大 提交于 2019-12-22 12:29:28
问题 I have a Firemonkey Desktop Application for Windows. I have a TGrid which I populate through a visual livebinding TBindSourceDB component. I want some columns to have text aligned to the right, as they are numerical values. I have tried through: onPainting event getting the TTextCell control by number of ColumnxRow typecasting it and setting TextAlignt property to the right None of those measures align the text to the right. I have tried to set it at runtime, unsuccessfully though, getting

CryptoAPI returns incorrect result for HMAC_SHA1

血红的双手。 提交于 2019-12-22 11:07:45
问题 I'm using the code below with the Crypto API and I'm not getting the results I would expect based on testing with other API's and libraries. I'm using the key, " key " and the data is " message " For example, using Indy's TidHMACSHA1, I get 2088df74d5f2146b48146caf4965377e9d0be3a4 I get the same result using online generators (such as http://www.freeformatter.com/hmac-generator.html, for example). With the code I've written (see below) I get 4a52c3c0abc0a06049d1ab648bb4057e3ff5f359 The code

Linking FPC .o files into Delphi

▼魔方 西西 提交于 2019-12-22 07:57:10
问题 How can I link a FPC .o from a library to a Delphi executable. When I try to link the following code I get a bunch of unsatisfied forward or external declarations. library project1; {$mode objfpc}{$H+} uses Classes { you can add units after this }; function Test: Integer; begin Result := -1; end; begin end. [dcc64 Error] Project2.dpr(170): E2065 Unsatisfied forward or external declaration: 'INIT$_$SYSTEM' [dcc64 Error] Project2.dpr(170): E2065 Unsatisfied forward or external declaration: