Formatsettings of client are changing when printing in Firemonkey

Formatsettings of client are changing when printing in Firemonkey

By : user2952302
Date : November 19 2020, 12:41 AM
it fixes the issue FormatSettings is global variable. It can be changed anywhere and all the code that uses it will be affected.
Proper approach for using TFormatSettings is, not to rely on global FormatSettings variable and use your own instance when you do formatting. That way you can ensure that some other code beyond your control will not change it and mess up your formatting.
code :
  MyFormat: TFormatSettings;

MyFormat := TFormatSettings.Create;
MyFormat.ThousandSeparator:=' ';
function StrToFloat(const S: string; const AFormatSettings: TFormatSettings): Extended;

Share : facebook icon twitter icon
Printing Firemonkey on Mac OSX

Printing Firemonkey on Mac OSX

By : user3527360
Date : March 29 2020, 07:55 AM
I wish this help you Probably you can't. According to some information given from Embarcadero during the "Delphi-Tage" in Cologne last weekend, the current XE2 version doesn't contain any printing solution for FireMonkey on OSX.
How to launch email client from FireMonkey on Windows/Mac?

How to launch email client from FireMonkey on Windows/Mac?

By : Wesley
Date : March 29 2020, 07:55 AM
will help you As far i know there is not a cross-platform way to send a mail, but using the ShellExecute function in the windows side and the NSWorkspace.openURL for the OSX you can write your own implementation.
Try this OSX implementation.
code :

Procedure SendMail(const Mailto,Subject, Body:string);
  AWorkspace : NSWorkspace;
  encodedBody    : NSString;
  //NSString *encodedSubject = [NSString stringWithFormat:@"SUBJECT=%@", [subject stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
  encodedSubject :=NSSTR(Format('SUBJECT=',[Subject])).stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding);
  //NSString *encodedBody = [NSString stringWithFormat:@"BODY=%@", [body stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
  encodedBody    :=NSSTR(Format('BODY=',[Body])).stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding);
  //NSString *encodedTo = [to stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  encodedTo      :=NSSTR(Mailto).stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding);
  //NSString *encodedURLString = [NSString stringWithFormat:@"mailto:%@?%@&%@", encodedTo, encodedSubject, encodedBody];
  //NSURL *mailtoURL = [NSURL URLWithString:encodedURLString];
  // [[NSWorkspace sharedWorkspace] openURL:mailtoURL];
  URL := TNSURL.Create;
  URL.initWithString(NSSTR(Format('mailto:%s?%s&%s',[ encodedTo.UTF8String, encodedSubject.UTF8String, encodedBody.UTF8String])));
  AWorkspace := TNSWorkspace.Create;
Printing Bitmap Using Bluetooth Thermal Printer With Firemonkey Android

Printing Bitmap Using Bluetooth Thermal Printer With Firemonkey Android

By : user3131278
Date : March 29 2020, 07:55 AM
seems to work fine The error you have in BitmapToStr() is that you never Map the BMPData with the BMP bitmap.
Add this to the beginning of the function:
code :
bmp.Map(TMapAccess.Read, BMPData);
Changing ColumnCount in FireMonkey Delphi XE2

Changing ColumnCount in FireMonkey Delphi XE2

By : Thabo Ntsoane
Date : March 29 2020, 07:55 AM
may help you . I'm trying to load stringgrid from file, in Delphi XE2 Firemonkey. When I doing it in Delphi it looks like that: , From the docs:
Delphi XE5 and FormatSettings

Delphi XE5 and FormatSettings

By : dollardollar
Date : March 29 2020, 07:55 AM
wish of those help You can deal with this by avoiding the global shared format settings variable, FormatSettings, that has been deprecated for years now.
Instead create and populate a local variable of type TFormatSettings. Pass that to all functions that rely on format settings. It's only the global format settings variable that is updated when the user makes changes.
Related Posts Related Posts :
  • How can I check if a specific user has specific access rights on a folder/file in Delphi
  • Firemonkey Rotate Text
  • IBtransaction and Firebird for a multi-user program
  • Clearing all DataSet Bookmarks
  • How is TClientDataSet sending SQL statements on ApplyUpdates
  • Which is current correct indy and open ssl versions to use with delphi2007
  • Delphi Xe2: WH_KEYBOARD won't return left-right virtual key codes
  • Collecting a list/table of version specific information for RAD Studio/Delphi/C++ Builder related development environmen
  • delphi 2009, interface already released
  • chained proxy in delphi
  • Use VCL Styles From Delphi XE7 to Delphi XE2
  • Rotating an image Delphi XE7
  • Understanding waitable timers
  • Delphi Created Images are not displayed
  • former worked code does not work
  • Why does Delphi XE7 IDE hangs and fails on out of memory exception?
  • How to build delphi projects for WIN64 when units inside it uses DesignEditors DesignIntf?
  • Cannot Destroy Dynamically created Menu Item in Delphi
  • How can I set a message unread?? with delphi 7 and imap from indy10
  • How can I save a TTreeview to Windows and keep its hierarchical structure?
  • Nullable scalar types and LiveBindings
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org