Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi vorhandene SMDBGrid Komponente anpassen (https://www.delphipraxis.net/94451-vorhandene-smdbgrid-komponente-anpassen.html)

manfred_h 21. Jun 2007 16:06


vorhandene SMDBGrid Komponente anpassen
 
Hallo zusammen

habe die SMBDGrid Komponente in meiner Anwendung.
Diese unterstüzt von Haus aus leider nicht Unicode.
Der Entwickler der Komp. hat mir aber folgende Mail zugesandt.

Zitat:

by default, the TSMDBGrid inherited from TDBGrid class.

If you use the TntControls, just inherit the TSMDBGrid from TTntDBGrid
instead.
No another changes required
Habe nun im Forum auch schon die Suche bemüht, bin aber noch nicht zu einer funktionierenden
Lösung gekommen. :?

Habe bis jetzt versucht:
habe eineKopie der Sourcen der Komponente gemacht und versucht darin die ableitung von
TDBGrid zu TTntDBGrid ( die ich auch verwende ) zu ändern aber ohne Erfolg...

Ist dieser Weg richtig?

Manfred

mkinzler 21. Jun 2007 16:08

Re: vorhandene SMDBGrid Komponente anpassen
 
Was heißt ohne Erfolg? Kommt ein Fehler? Wenn ja welcher?

manfred_h 21. Jun 2007 16:11

Re: vorhandene SMDBGrid Komponente anpassen
 
Folgende Fehlermeldungen kommen:

[Pascal Hint] Smdbgrid.pas(1183): H2164 Variable 'IsShiftPressed' is declared but never used in 'SortGrid'
[Pascal Hint] Smdbgrid.pas(1184): H2164 Variable 'KeyState' is declared but never used in 'SortGrid'
[Pascal Error] Smdbgrid.pas(1310): E2267 Previous declaration of 'SaveGridToRegistry' was not marked with the 'overload' directive
[Pascal Error] Smdbgrid.pas(1333): E2010 Incompatible types: 'TSMDBColumn' and 'TTntColumn'
[Pascal Error] Smdbgrid.pas(1412): E2010 Incompatible types: 'TSMDBGrid' and 'TDBGrid'
[Pascal Error] Smdbgrid.pas(1488): E2010 Incompatible types: 'TSMDBGrid' and 'TDBGrid'
[Pascal Error] Smdbgrid.pas(1519): E2010 Incompatible types: 'TSMDBGrid' and 'TDBGrid'
[Pascal Error] Smdbgrid.pas(1541): E2010 Incompatible types: 'TSMDBGrid' and 'TDBGrid'
[Pascal Error] Smdbgrid.pas(1616): E2010 Incompatible types: 'TSMDBGrid' and 'TDBGrid'
[Pascal Error] Smdbgrid.pas(4553): E2010 Incompatible types: 'TDBGrid' and 'TSMDBGrid'
[Pascal Error] Smdbgrid.pas(4773): E2010 Incompatible types: 'TDBGrid' and 'TSMDBGrid'
[Pascal Error] Smdbgrid.pas(7019): E2010 Incompatible types: 'TTntColumn' and 'TColumn'
[Pascal Error] Smdbgrid.pas(7065): E2010 Incompatible types: 'TTntColumn' and 'TColumn'
[Pascal Error] Smdbgrid.pas(7089): E2010 Incompatible types: 'TTntColumn' and 'TColumn'
[Pascal Error] Smdbgrid.pas(808): E2065 Unsatisfied forward or external declaration: 'SaveGridToRegistry'
[Pascal Fatal Error] SMCmpntBDS2006.dpk(114): F2063 Could not compile used unit 'Smdbgrid.pas'

mkinzler 21. Jun 2007 16:16

Re: vorhandene SMDBGrid Komponente anpassen
 
Zitat:

[Pascal Error] Smdbgrid.pas(1310): E2267 Previous declaration of 'SaveGridToRegistry' was not marked with the 'overload' directive
Füge das Bei der TNT-Komponente hinzu.
Zeig mal eine der angemeckerten Zeilen mit Typunverträglichkeiten
Schau dir mal die Definition von TTntColumn an

manfred_h 21. Jun 2007 16:24

Re: vorhandene SMDBGrid Komponente anpassen
 
[quote="mkinzler"]
Zitat:

Zeig mal eine der angemeckerten Zeilen mit Typunverträglichkeiten

[Pascal Error] Smdbgrid.pas(1333): E2010 Incompatible types: 'TSMDBColumn' and 'TTntColumn'
Delphi-Quellcode:
 if (grid is TSMDBGrid) and (grid.Columns.Items[i] is TSMDBColumn) then
ein wenig ausführlicher:
Delphi-Quellcode:
      if (grid is TSMDBGrid) and (grid.Columns.Items[i] is TSMDBColumn) then
        with TSMDBColumn(grid.Columns.Items[i]) do
        begin
          RegIniFile.WriteString(RegistrySection, IntToStr(i) + '_Sort',
                                 Format('%d,%s,%d,%d,%s,%d,%d', [Ord(SortType), NormilizedText(SortCaption), BandIndex, Ord(InplaceEditor), NormilizedText(VarToStr(FooterValue)), Ord(FooterType), Tag]));
          if FFooterText<>'' then
            RegIniFile.WriteString(RegistrySection, IntToStr(i) + '_Footer',Format('%s',[NormilizedText(FFooterText)]));
        end;

[Pascal Error] Smdbgrid.pas(1412): E2010 Incompatible types: 'TSMDBGrid' and 'TDBGrid'
Delphi-Quellcode:
  if grid is TSMDBGrid then
ein wenig ausführlicher:
Delphi-Quellcode:
  if grid is TSMDBGrid then
    TSMDBGrid(grid).FAutoFitIsLocked := True;

mkinzler 21. Jun 2007 16:28

Re: vorhandene SMDBGrid Komponente anpassen
 
Kannst du mal den Quellcode der gesamten Komponente hier einstellen oder ein Link, dann werde ich mir die Sache morgrn mal ansehen

manfred_h 21. Jun 2007 17:25

Re: vorhandene SMDBGrid Komponente anpassen
 
Liste der Anhänge anzeigen (Anzahl: 2)
Anbei der Quellcode.
Einmal als Original und die von mir "angepasste" Version.

Wenn von interesse hier die Webseite:
http://www.scalabium.com/smdbgrid.htm

Shalom
Manfred

manfred_h 3. Jul 2007 15:40

Re: vorhandene SMDBGrid Komponente anpassen
 
Zitat:

Zitat von mkinzler
Kannst du mal den Quellcode der gesamten Komponente hier einstellen oder ein Link, dann werde ich mir die Sache morgrn mal ansehen

Hallo
gehe ich richtig in der Annahme das dies doch nicht so einfach ist?

Shalom
Manfred


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:44 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz