I'm using Delphi 10.4 in an FMX application and, although there is no problem on Windows and Android targets, it is not possible, for the user, to enter a single quote character ' into any TEdit field on the iOS platform...
Note that if the field is initialised by program, ' is properly displayed.
Is there a reason for this or is this a bug ?
Related
I'm developing my first commercial Firemonkey application (also my first commercial application in any language). I have used native FMX controls and also one control from TMSSoftware (TTMSFMXGrid). The keyboard clipboard operations -- Ctrl+X, Ctrl+C, Ctrl+V -- work "out of the box". But I would like my application to provide menu items with the same functionality as the keyboard shortcuts.
I have set my program up so that there is a TMenuBar visible when compiling for Windows. When compiling for OS X, the TMenuBar is invisible but a TMainMenu comes up instead. For simplicity, we could just discuss the scenario of compiling for Windows when the TMenuBar is visible.
It's easy to program the TMenuItems of TMenuBar to perform the cut, copy and paste operations. That is not the issue. I have been unable to figure out how to disable the cut and copy menu items when nothing (or nothing relevant) is selected and how to disable the paste when there is nothing (or nothing relevant) on the clipboard.
How can I do that?
(I am using Berlin 10.1 Update 2.)
You can read about Copy/Cut/Paste with FMX from Embarcadero here:
Multi-Device Apps and Clipboard Support
And because your question is about Windows now you should understand internals of Windows Clipboard. Good start is article from Zarko Gajic:
Basic Clipboard Operations (Cut/Copy/Paste)
And also about listening Clipboard to reseive notifications about clipboard content changing:
Listening to the Clipboard: Clipboard Delphi Spy with Custom Clipboard Formats
Another good article about clipboard in OS X and Windows with FMX:
Copying and pasting the contents of a FireMonkey TBitmap
I develop a delphi7 webbroker multilanguage application for apache2,2. The application is using Oracle xe11 for data storage, and Devart's ODAC components to communicate with the Database. I set up the Orasession component as to use Unicode. The data inside the database was stored properly in Unicode capable data type columns. With another desktop application , also written in Delphi 7 we are able to store, retrieve and display correctly the same data of the database (I’m using Unicode capable components). My problem occurs when I want to display these data with the webbroker appl in html format. I’m using the default components provided by delphi 7 (TWebResponse). All text which are in Latin characters displaying correctly but all the others which are in different languages (not latin) not. Can you suggest me what have I do to solve the problem?
(How) do you encode the unicode output of your components to the non-unicode capable (Ansi)String of TWebResponse.Content?
I guess the system codepage does not contain Ü (probably the same as the German Umlaut Ü -> U+00DC) and you are using an implicit conversion to (Ansi)String that takes the best mapping it can.
At least in Delphi 2006 you can / have to use
function Utf8Encode(const WS: WideString): UTF8String;
in system.pas (utf8string is a string - defined in same unit). As far as I know that function was there also in in Delphi 7.
You can't but you can work around it.
Label1.Font.Charset := TURKISH_CHARSET;
Mess with the Charset property to get what you want.
This is related to a previous question: TMemo cannot handle Unix text (LF as line ending) correctly.
On Delphi XE, TMemo can only handle Windows formatted text (CRLF as enter).
For example this text:
test1+ LF+ test2
is treated/shown as a single line of text: test1test2
instead of:
test1
test2
I realize this is a bigger problem so I am curious how/if they fix this problem in Delphi XE2 (which I think has Mac support). There is a property similar to TMemo.Lines.TextLineBreakStyle (Lazarus)?
(I only own a Delphi XE license.)
As David says, Mac applications in Delphi are only supported using the new FireMonkey framework, as opposed to the VCL controls in previous versions of Delphi. You can still use VCL in XE2 (and later), but only for developing Windows applications. FireMonkey can be used for developing both Mac and Windows applications.
FireMonkey has a memo control, just as the VCL does, and this also has a Text property, so this line of code would be perfectly valid in both a VCL and a FireMonkey (FMX) application:
Memo1.Text := 'Line 1'#10'Line 2'#10'Line 3'#13#10'Final Line';
Where Memo1 is a VCL or FMX Memo control.
However, the VCL control (as of XE4 at least) still does not properly support the #10 (LF) line breaks, but the FMX control does, on both Windows and Mac so although the code above can be used in both VCL and FMX applications, the results will be different.
In VCL (Windows) you will get the following content in the memo:
Line 1Line 2Line 3
Line
Where as with FireMonkey on Windows and/or Mac you will get:
Line 1
Line 2
Line 3
Final Line
So the answer is that FMX behaves differently than the VCL and respects both #10 and #13#10 line break sequences, irrespective of platform where-as the VCL memo behaviour remains unchanged and is only supported on Windows.
A client is reporting an issue whereby she is copying from an e-mail into a screen in a program we have created with Delphi 5. The component on this screen to which she is copying is a TMemo component.
When a line of text contains an ellipsis (...) character or closing quotation marks character ("), the text is replaced with a vertical bar. If the text has two periods in a row, the periods appear correctly. When using the single quotation mark ('), the text appears correctly.
In testing this, I was able to replicate this issue from within an Outlook client and Word document. The error does not occur when copying text from within Notepad. The error also does not occur if I create the text from within the TMemo component, copy it into Outlook or Word, then copy it back into the component.
You are using Delphi 5 which is an ANSI version of Delphi. The characters that you are trying to copy do not exist in the ANSI character set that your client is using. There is no solution to this problem so long as you persist with ANSI controls. Your options:
Switch to a modern version of Delphi that supports Unicode, or
Use TNT Unicode controls with your legacy Delphi.
I have TWebBrowser embedded in a TForm.
Whenever I press Alt button the browser window becomes white. If I drag the form around it repaints correctly.
What I am doing wrong?
I have DevExpress Bars and Quantum Grid if that matters?
I use Delphi 2010 and Windows 7 and XP SP2. IE version is 7 and 8. Reproducible on all.
Before pressing Alt:
After pressing Alt:
I have resolved it by usnig the following:
procedure TMainForm.WndProc(var Message: TMessage);
begin
inherited WndProc(Message);
if Message.Msg = WM_UPDATEUISTATE then
begin
if Assigned(ProblematicWebBrowser) then
ProblematicWebBrowser.Repaint;
end;
end;
You don't say what version of Delphi you're using, what version of Windows you're using, or what version of IE you have installed, which is what TWebBrowser wraps. (As a general note because you're a new user here, you really need to provide more information when asking a question like this. Pretend it was a user of your software reporting this bug - you'd throw your hands up and say "Bah, not reproduced. Why can't they tell me what they're doing?" Same for us when reading your question.)
But, that said, the fact it vanishes when you press the Alt key is a hint. Windows has an option to hide accelerator keys (the underline mark such as the underlined F on a File menu) until the user presses the Alt key. When it does, controls are sent a WM_DRAWITEM message indicating something's changed. See also WM_CHANGEUISTATE.
There have been bugs in past versions of Delphi handling this (see this example bug) including a bug where controls completely vanished when the Alt key was pressed. TWebBrowser isn't listed in that QC item, but it's quite possible it's affected.
So my guess is:
You're using Delphi 7 or earlier
You're using XP or above, and running
themed
You're encountering this bug,
which is affecting either the
TWebBrowser control or a parent of it
Solution: upgrade Delphi or apply the fix listed in the QC item.
FWIW, with a plain vanilla Form with a TWebBrowser in D2010, pressing Alt has not effect on the WebBrowser display.