Currently in the Delphi XE3 release there is a bug in the OnExit processing of TMemo and TEdit (possibly others) controls.
If you make a change in a TEdit or TMemo control and then exit the control, after the OnExit event is called, another OnChange event is called. This shouldn’t happen.
This doesn’t occur in the VCL framework and shouldn’t happen in FireMonkey.
The fix for the TEdit cause is pretty simple. Since the FNeedChange field in TCustomEdit is protected we can use a class cracker to fix it. You could put the fix into either a new control or in either an OnExit or OnChange handler in your application.
TEditClass = class(TEdit);
procedure Form1.OnExit(Sender: TObject);
TEditClass(Edit1).FNeedChange := False;
It’s interesting to note for TEdit, FNeedChange is protected. This is because in the TCustomEditBox descendant (used by TSpinBox and TNumberBox controls), the FNeedChange field is set to False after the overriden Change method is called. Perhaps this should have triggered the developer making that change, to actually fix the issue in the ancester class.
The fix for TMemo is more interesting because unlike the TCustomEdit class, FNeedChange is private. Thankfully extended RTTI comes into play.
I put this code where the memo content was saved to disk, you could put the code in the same spot in your applications (if applicable), or place it in either OnChange or OnExit events.
// save your memo contents
LInst := LCtx.GetType(Memo1.ClassType).AsInstance;
LField := LInst.GetField('FNeedChange');
if LField <> nil then
If your save is triggered by the user selecting a control that takes focus from the memo, the OnExit event will trigger before executing the fix above. Under these circumstances, moving the fix to the OnExit event of the memo is advised.
Another TMemo Issue
The OnChange event is only triggered after typing two characters in a TMemo, the first character typed into the memo doesn’t trigger the OnChange event.
Dear blog readers,
I prepared a short survey and I will appreciate if you can invest 5 minutes of your valuable time answering few questions.
My goal with this survey is to learn more about your software development plans for 2013 and identify potential and useful topics to all of you. Also validate some content ideas I have for 2013.
The survey is pretty straight forward, take less than 5 minutes and is very important to help to define the blog content for 2013.
PS: You can also access the survey directly from this link http://bit.ly/peal2013en
Andreano Lanusse | Technology and Software Development
Follow me on Twitter: @andreanolanusse
Delphi Developers’ plan for mobile, desktop and n-tier development
Why I chose WordPress as Blog Tool
Beginning my personal blog
Release 11 of XE Plus Pack is now available for all supported IDE versions (Delphi XE, Delphi XE2, Delphi XE3).
XE Plus Pack and XE2 Plus Pack now include all features available in XE3 Plus Pack.
Release 11 features:
Visual Forms can now support multiple projects in the same location.
Note: Existing projects with Visual Forms active will need to be rescanned.
Added new commands to the Project Managers’ File Actions menu item.
Open with Notepad
Improved Mouse Scrolling of the designer surface for VCL applications.
Minor UI enhancements to dialogs within Visual Forms expert.
Fix issue with the replace capture dialog not displaying the image to use.
Add “Capture Form” command to a forms context menu so it is even easier to update a form within the Visual Forms view if automatic updating is not active.
Support Resolution guidelines being displayed in the FireMonkey designer.
Looks like Bjarne Stroustrup himself will be part of the C++ portion of CodeRage7. That's quite a coup. LeanTed now has its own URL: http://www.leanted.com Anyone out there know about TSynEdit? Which is the "one true version" that I should be using? I'm using this one: http://sourceforge.net/apps/mediawiki/synedit/index.php?title=SynEdit_Home_Page but it seems like there are/might be other better/different versions out there. Anyone have any advice or thoughts on the matter? Also, anyone know about what encoding it uses? Can I change/set it? I confess I can't seem to figure that out.... Delphi is really popular in Brazil, and Roberto Schneiders is a new blogger from that lovely country. He's written his first post about DataSnap. Nice. Cloud storage certainly is all the rage. As far as I can tell, I have storage in the following places: DropBox, BitCasa, Google Drive, SkyDrive, Asus Cloud Storage, and Amazon. And probably some others I can't even remember. Here's a business idea that I'm sure has already been done because I just thought of it: Create an app that aggregates all those different chunks of space into a single drive. That would be cool. Everyone seems worried about Best Buy -- apparently they are all doomed and everything in the face of Amazon -- but I can tell you they didn't look doomed last night at midnight. I was awake and decided to attend their Black Friday event at my local store, which started at midnight. (I had not intention of, and did not, buy anything...) The place was an absolute mad-house. There was a *huge* line to get in when I arrive right at 12:00a, and they had a large maze set up in the store to keep people moving in the same direction. I didn't notice any outrageous deals, but I can tell you that a lot of merchandise was available and a lot of it went out the door. Plus it was fun -- great people watching.
Part 1 – http://jed-software.com/blog/?p=699
Along with the missing registration of TStyleTag, the following components cannot be used in styles without hand editing FMX or Style files.
I’ve updated the package to now register these missing style components so you can use them in custom styles.
The change is straight forward if you have already downloaded and installed the previous package.
The register procedure should now look something like this:
RegisterComponents('Shapes', [TStyleTag, TFontObject, TBrushObject]);
NOTE: You may want to register them to a different palette location.