Leaderboard
Popular Content
Showing content with the highest reputation on 09/07/20 in Posts
-
Open array parameters and subranges
Stefan Glienke posted a topic in Tips / Blogs / Tutorials / Videos
How to use open array parameters to handle array subranges: https://delphisorcery.blogspot.com/2020/09/open-array-parameters-and-subranges.html -
Still not able to reproduce.... This morning works always fine but now I have grep windows blank again so I run this tool https://www.nirsoft.net/utils/gui_prop_view.html and what I could see is that the grep result window is composed by 7 delphi components and all of them are "marked" as not visible when the form is blank. If I force with the GUIPropView application the TPanel component as visible (without exiting the IDE) the grep result returns as aspected. I don't know why all the components are not visible sometimes... maybe some wrong initialization with the new Delphi IDE 10.4.1
-
It's just in the comments but anyhow - from line 66 onwards the version is wrong (both 2007 versions were 11, 2009 was 12, 13 was skipped and so on, 10.4 is 27 - hence the 270 suffix on the packages) See: https://delphi.fandom.com/wiki/Delphi_Release_Dates
-
@dummzeuch, With TortoiseSVN you could implement a local pre-commit hook that removes the Explicit properties from all or just the modified .dfm files. We do this to normalize .dproj files before commit.
-
Here is the explanation: http://jedqc.blogspot.com/2006/02/d2006-what-on-earth-are-these-explicit.html
-
Maybe "git diff" and "git blame" would show something useful. You are a team of developers and go with "something is messed up" statements? Usually this come from the clients.
-
Why would there be conflicts in files that you have not modified? My advice to you is that before you try to change the process to fix the problem, you make sure that you have fully diagnosed the problem.
-
You should only get conflicts when trying to apply a stash if the files you've stashed have changed since you stashed them. If you haven't changed them then something's broken. If you have, well, then there's your conflict. I really would suggest that you try to use a GUI Git client. That would make it much more clear what's going on.
-
I've been using Git for a few weeks only, so I could be way off base here... but doesn't every conflict have details on who changed what that conflict occurred in the specific file? Is it your username for all the changes?
-
Delphi IDE uses System.Classes.TStream.WriteDescendentRes to serialize the form/components properties. Property that belongs to the class is handled by System.Classes.TWriter.WriteProperty. However internal property such ExplicitXxx is handled by System.Classes.TWriter.DefineProperty. // TPersistent.DefineProperties defines Explicit properties. and TWriter.DefineProperty encode them. procedure TControl.DefineProperties(Filer: TFiler); begin ... Filer.DefineProperty('IsControl', ReadIsControl, WriteIsControl, DoWriteIsControl); Filer.DefineProperty('ExplicitLeft', ReadExplicitLeft, WriteExplicitLeft, not (csReading in ComponentState) and DoWriteExplicit(edLeft)); Filer.DefineProperty('ExplicitTop', ReadExplicitTop, WriteExplicitTop, not (csReading in ComponentState) and DoWriteExplicit(edTop)); Filer.DefineProperty('ExplicitWidth', ReadExplicitWidth, WriteExplicitWidth, not (csReading in ComponentState) and DoWriteExplicit(edWidth)); Filer.DefineProperty('ExplicitHeight', ReadExplicitHeight, WriteExplicitHeight, not (csReading in ComponentState) and DoWriteExplicit(edHeight)); end; In a nutshell, hooking TWriter.DefineProperty will get you off EplicitXxx: procedure InterceptDefineProperty(Obj: TWriter; const Name: string; ReadData: TReaderProc; WriteData: TWriterProc; HasData: Boolean); begin // do nothing !!! or write a filter to allow certain ExplicitXxx. end; // install the hook : DefinePropertyPtr := GetProcAddress(GetModuleHandle('rtl260.bpl'), '@System@Classes@TWriter@DefineProperty$qqrx20System@UnicodeStringynpqqrp22System@Classes@TReader$vynpqqrp22System@Classes@TWriter$vo'); @TrampolineDefineProperty := InterceptCreate(DefinePropertyPtr, @InterceptDefineProperty);
-
10.4.1 Released today
dummzeuch replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
Around that time Borland developed JBuilder, so maybe it really came from Java. -
Use of Ansistring in Unicode world?
David Heffernan replied to Mike Torrettinni's topic in General Help
Read Andy's comments to my answer in the SO post. If you care about performance, measure it. -
More accurately, UTF-8 is the default encoding used by Lazarus, not by FreePascal itself. On Windows, FPC's RTL sets the default encoding to the system encoding, just as Delphi does (on Linux/OSX, the default encoding is set to UTF-8). Lazarus overrides that RTL setting. https://wiki.freepascal.org/Unicode_Support_in_Lazarus#RTL_with_default_codepage_UTF-8 That is still a beta feature, and it doesn't work quite as well as everyone had hoped it would. Maybe in the future, it will be better.
-
Agree with all the above, except that UTF8String is an an AnsiString with a Code Page 65001 and is also Unicode compliant and incurs no conversion loss. It is the default string type in FPC. In Linux systems everything is UTF8. And nowadays 65001 it can be set as the default code page in Windows.
-
Use of Ansistring in Unicode world?
Dalija Prasnikar replied to Mike Torrettinni's topic in General Help
Don't use AnsiString if anyhow possible. Only if you exclusively work with 7bit ASCII subset then you can safely use AnsiStrings. The reason is that AnsiString - Unicode conversions is potentially lossy. You can lose original data. Using 8-bit strings instead of 16-bit strings can be faster under some circumstances, and they also use less memory. But if you have use case where 8-bit string performance and memory consumption is needed you should use UTF8String instead of AnsiString. -
looking for UI design ideas for tracking a process
Lars Fosdal replied to David Schwartz's topic in VCL
Unless you are some sort of color blind? I also use color, but where there is a critical significance that requires attention, I usually add an icon or symbol in addition. -
Well, that is pretty easy to accomplish using TRttiContext.GetType() or TRttiContext.FindType(), and then using TRttiType.GetField() and TRttiType.GetProperty().
-
@MikeMon I forgot that in Delphi Rio there was a bug in the android permissions and I noticed that it is still in Delphi Sydney. You have to fix the FMX.Platform.Android.pas procedure TFMXNativeActivityListener.onRequestPermissionsResult(ARequestCode: Integer; APermissions: TJavaObjectArray<JString>; AGrantResults: TJavaArray<Integer>); // ----------------------------------------------------------------------------- // [iPub - github.com/viniciusfbb] - 28/05/2020 - Delphi 10.4 // The delphi messages system isn't thread-safe and this request result can be // called in background threads {$IFDEF DELPHI_FIXES} // ------------------------------------------------------- begin TThread.Queue(nil, procedure() var MsgData: TPermissionsRequestResultData; Msg: TPermissionsRequestResultMessage; begin MsgData.RequestCode := ARequestCode; MsgData.Permissions := APermissions; MsgData.GrantResults := AGrantResults; Msg := TPermissionsRequestResultMessage.Create(MsgData); TMessageManager.DefaultManager.SendMessage(nil, Msg); end); {$ELSE} // --------------------------------------------------------------------- var MsgData: TPermissionsRequestResultData; Msg: TPermissionsRequestResultMessage; begin MsgData.RequestCode := ARequestCode; MsgData.Permissions := APermissions; MsgData.GrantResults := AGrantResults; Msg := TPermissionsRequestResultMessage.Create(MsgData); TMessageManager.DefaultManager.SendMessage(nil, Msg); {$ENDIF} // -------------------------------------------------------------------- end;