I have a problem with a component Editor.

I have a problem with a component Editor.
What I need is create a new contextual option for any TDataSet in the program.

Previously to the installations of my component, the options are like I show next in the first Image.
The las Image shows the problem. The menu options that the component previously had, has been disappear.

The question is. Any one know how to add A New option in the contextual menu, respecting the existing ones?


Comments

  1. you need "inherited getverbcount + 1" I think, and use the inherited instead of 0 at getverb and edit

    ReplyDelete
  2. Sorry David, I can't understand you. In cases I can't put variable expressions. How can I set an unknown position in a case.

    ReplyDelete
  3. I've googled and found this random file, the last class I think does it correctly github.com - FiredacTables

    ReplyDelete
  4. Thank you David. I'm going to see it and write there feedback.

    ReplyDelete
  5. Thank you Attila Kovacs. But, I don't want to create a descendant of any component. What I'm making is a new Component Editor to each TDataSet descendant on the Palette.

    Anyway, I can see that the solution is very similar to the one gived by David.

    ReplyDelete
  6. Thank you Attila and David. Finally the solution was the Attila response. They don't need more explanation, but if anyone want the code here, ask for it, please.
    https://plus.google.com/photos/...

    ReplyDelete
  7. Attila Kovacs Thank you for ask!

    It's not completely ready, but I can enumerate, what are going to be his functionalities.

    For any DataSet, you create the design-time persistent TFields, and the component editor, based on this datafields generates a File with a class inside, that can be added to the project.

    Currently, this class allow the programer, write things like...

    FEditItem := TActivityOrm.Create(Setup.DisplayFormats);
    try
    FEditItem.New;
    FEditItem.CD_ACTIVITY.AsString := '001';
    FEditItem.DS_ACTIVITY.AsString := 'Example of Activity';
    FEditItem.Post;
    FModel.Insert(FEditItem);
    finally
    FEditItem.Free;
    end;

    But not only this. Also is going to contain a subclass similar to this (still not finished).

    TActivityXXXX = class
    CD_ACTIVITY :string;
    DS_ACTIVITY :string;
    end;

    At any time the programer can get an instance of this last with the data of FEditItem, by example. If you has see how TeeGrid runs, this is just the type of Objects that this Grid wait.

    And finally, the programmer is going to have the possibilitiy of get a JSON string of this class, and of course, assign a JSON string to the a new instance.

    I'm working on it.

    All this, and much more, with a little configuration in a Editor, one time for each TDataSet descendant.

    My intention is publish the component and his manual, and examples of use, in a little time from now, but... I'm very very busy in other important things.

    ReplyDelete

Post a Comment