-
Content Count
43 -
Joined
-
Last visited
Posts posted by CoMPi74
-
-
2 hours ago, darnocian said:It would be useful to raise the Quality Portal issue so that this type of scenario works...
Done 😉 Here is it: [RSP-34616] Object Inspector does not support generic properties - Embarcadero Technologies
- 1
-
@darnocian This is not the case I presented. I wanted to have an event handler which generic parameter T is same as in the class definition. I mean fevent2 should be rather TEvent2<T> instead of TEvent2<integer>. Did you try such a case? I did :/
I need it because I want to implement validation mechanism in TCustomEdit<T>.Change method, like in the code below:
TEvent<V: record> = procedure (AValue: V) of object; TCustomEdit<T: record> = class(TEdit) public fValue: T; fEvent: TEvent<T>; protected procedure Change; override; published property Event: TEvent<T> read fEvent write fEvent; end; procedure TIMEdit<T>.Change; begin if Assigned(fEvent) then fEvent(fValue); end;
Â
-
It is look like none of a generic property is visible in Object Inspector. But, of course, they are accessible from code.
Â
TCustomEdit<T: record> = class; TEvent1 = procedure (AValue: Integer) of object; TEvent2<V: record> = procedure (AValue: V) of object; TEvent3<V: record> = procedure (ASender: TCustomEdit<V>; AValue: V) of object; TCustomEdit<T: record> = class(TEdit) public fEvent1: TEvent1; fEvent2: TEvent2<T>; fEvent3: TEvent3<T>; published property Event1: TEvent1 read fEvent1 write fEvent1; // Accesible from Object Inspector and from code property Event2: TEvent2<T> read fEvent2 write fEvent2; // Only from code property Event3: TEvent3<T> read fEvent3 write fEvent3; // Only from code end; TEditEx = class(TCustomEdit<Integer>); ... RegisterComponents('Test controls', [TEditEx]);
Â
BTW. It looks like Delphi (10.4 CE) crashes because of CnMemProfProject wizard (CnPack, v. 1.2.0.1040 Unstable). But it is just an intermediate reason. The AV comes from System.TypInfo.GetPropInfos so definitely something is up.
-
1 hour ago, darnocian said:I've also had bad experience in the past, and the bug should be re-reported. Does making an 'intermediate' concrete type like the following do anything:
TBaseIntEdit = class abstract(TCustomEdit<Integer>); TIntEdit = class(TBaseIntEdit) ...
Nope. It does not change anything 😕
-
-
3 minutes ago, Uwe Raabe said:Just a guess, but I suspect the Object Inspector cannot cope with the generic event.
I think so too, but it is quite strange, because OnChange of TIntEdit is just TOnChange(ASender: TIntEdit, AValue: Integer). Does not it?
-
Hi there,Â
Â
I have a component like this:Â
TCustomEdit<T: record> = class; TOnValidate<T: record> = function (ASender: TCustomEdit<T>; AValue: T): Boolean of object; TCustomEdit<T: record> = class(TEdit) private fOnValidate: TOnValidate<T>; // code here published property OnValidate: TOnValidate<T> read fOnValidate write fOnValidate; end; TIntEdit = class(TCustomEdit<Integer>) // code here end;
The code compiles and TIntEdit registers without any complaints. But, when I want to drop the component onto a form, Delphi crashes with AV. What I am missing?Â
I tested it on Delphi XE4 and Delphi 10.4 CE. It's a bug, feature of just "by design"? @Stefan Glienke, will you help? Anyone?
-
On 6/25/2021 at 5:05 PM, Der schöne Günther said:I had the same use case a few months ago, and I was glad to find out that you can at least easily select, copy & paste the compiler output as text lines. Writing yourself a tool that filters the output (for example, by unit or severity) should be trivial. The extra step to select, copy & paste might be annoying, but better than nothing.
This is the way I am doing it right now. Though, I do not use a "special" tool ;) Instead I use Notepad++. It is enough for small projects but I am going to cleanup a significantly larger project and I need a better tool.
-
-
-
It's all a song of the future :) I was thinking about a much simpler tool. Because I know best what files interest me, at least initially, I assume that the filtering will be based on a selected list of files (e.g. read from a text file).
-
@Lars Fosdal Such a skill is both a gift and a curse 😉 I know something about it 😉Â
Coming back to the matter, as you mentioned, I also hope that @dummzeuch will be able to help. Or @Uwe Raabe or @David Millington? -
-
9 minutes ago, Lars Fosdal said:When you say messages - do you mean hints and warnings?
(IMO, Hints and warnings are bugs waiting to happen and needs to be fixed on sight)Yes, exactly. And I have to say, I fully agree with above claim :) That is my main reason I am looking for such a tool. Any suggestions?
-
Hi there,
Â
I am looking for some kind of plugin which allows to catch and filter out build / output messages for selected group of files (let say, I have a project with hundreds of units but I just want to see messages for a few units I am assigned to). Is there such a tool? Or any suggestion how to develop such a tool?
Â
Thanks in advance
Â
PiotrÂ
-
Thank you very much! All of you! I did not even realize that there exists so many tools for that. I tried to use all suggested apps but most of them failed. More precisely, I failed because, as I suppose, I did not use it properly. Anyway, finally I used DBeaver and DbSchema (Free edition). Both works as expected and were able to prepare ER Diagrams for PostgreSQL schema with 500+ tables. It looks astonish, really. A small example, generated by DbSchema, can be seen below. 🙂
Â
Thank a lot again.
Â
Piotr
- 1
- 1
-
Hi there!
I want to create ER Diagrams from existing PostgreSQL database (100+ tables) to figure out how the tables relate to each other. I am looking for a tool (preferably standalone one) which I am gonna use once only. Any suggestions?
Best regards,
Piotr
Parnassus Bookmarks for Delphi 11 Alexandria?
in Delphi IDE and APIs
Posted
Any news?