Home DADE

Customising TdaDataViewToolWin

edited January 2008 in DADE
Is it possible to customise the TdaDataViewToolWin class? I want some of the
icons not to show. I've successfully customised a TdaQueryDesigner so that
the appropriate pages don't appear, now I need the appropriate buttons to
not appear on the DataViewToolWindow.

I've taken a copy of daDataViewToolWin.pas & dfm & renamed the form and the
unit names to myDataViewToolWin. At the end of this new unit, I have:

initialization
UnRegisterClass(TdaDataViewToolWin);
RegisterClass(TmyDataViewToolWin);

finalization
UnRegisterClass(TmyDataViewToolWin);

This compiles but now I just get the old window and none of the buttons do
anything. Any thoughts, please?

Thanks,
--
Jason Sweby
Software Development Manager,
Carval Computing Limited, Plymouth, UK

Payroll - HR - T&A - Access Control

Comments

  • edited January 2008
    Realising that TdaDataViewToolWin is simply a TForm, I changed my code to
    read:

    TmyDataViewToolWin = class(TdaDataViewToolWin);

    and then removed all of the properties, methods & events of the class so at
    least I should have an exact copy of the original. Same effect though, the
    buttons just do nothing now (except the data Preview button which works).

    J.

  • edited January 2008

    The DataView.EditOptions and EnabledOptions properties can be used to
    control which buttons appear and which buttons are enabled. (These
    properties are defined by TdaDataView defined in ppClass.pas).

    TppDataEditTypes = set of TppDataEditType;

    TppDataEditType = (ppemAll, ppemPreview, ppemTables, ppemFields, ppemCalcs,
    ppemGroup, ppemSearch, ppemSort, ppemLink, ppemText);


    example:

    myDataView.EditOptions := [ppemSearch, ppemPreview];

    The TdaDataViewToolWin.CreateToolbar method reads the DataView.EditOptions
    to create toolbar buttons.



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2008
    Excellent Nard, thank you.

    Jason.

This discussion has been closed.