![]() |
Re: StringGrid-Zelle während dem editieren farbig?
Willst mir damit sagen das ich etwas übersehen habe, als ich in die Hilfe von TInplaceEdit schaute?
Falls ja wäre ich froh wenn mich aufklärst was, ansonsten war der Tipp nicht sehr hilfreich in diesem Falle. 8) |
Re: StringGrid-Zelle während dem editieren farbig?
So ich habe mal probiert es hinzubekommen. Leider erfolglos, vielleicht kann mir wer helfen?
Ich habe in die neue TExtInplaceEdit Klasse die Eigenschaft Alignment hinzugefügt und will diese im StringGrid dann immer setzen. Momentan ist das Problem das er FEditorAlignment im StringGrid niemals ändert, wenn ich die darüber liegenden if-Bedingungen auskommentiere erhalte ich vom Objektinspector eine Speicherzugriff Verletzung. Wäre toll wenn wer den Fehler sehen würde und verbessern würde. Danke!
Delphi-Quellcode:
TExtInplaceEdit = class(TInplaceEdit)
private FAlignment: TAlignment; protected procedure CreateParams(var Params: TCreateParams); override; procedure SetAlignment(const Value: TAlignment); public Constructor Create(aOwner: TComponent); override; published property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify; end; TTeStringGrid = class(TStringGrid) private FEditorAlignment: TAlignment; protected procedure SetEditorAlignment(const Value: TAlignment); public published property EditorAlignment: TAlignment read FEditorAlignment write SetEditorAlignment default taLeftJustify; end; { TExtInplaceEdit ===============================================================} constructor TExtInplaceEdit.Create(aOwner: TComponent); begin inherited Create(AOwner); FAlignment := taLeftJustify; end; procedure TExtInplaceEdit.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); //if Multiline then // Params.Style := Params.Style or LongWord(ES_MultiLine); case Alignment of taLeftJustify: Params.Style := Params.Style or LongWord(ES_Left); taRightJustify: Params.Style := Params.Style or LongWord(ES_Right); else Params.Style := Params.Style or LongWord(ES_Center); end; //if WordWrap then // Params.Style := Params.Style and (not LongWord(ES_AUTOHSCROLL)) //else // Params.Style := Params.Style and (not LongWord(0)); end; procedure TExtInplaceEdit.SetAlignment(const Value: TAlignment); begin if (FAlignment<>Value) then begin FAlignment := Value; RecreateWnd; end; end; { TTeStringGrid ===============================================================} procedure TTeStringGrid.SetEditorAlignment(const Value: TAlignment); begin if (FEditorAlignment<>Value) then begin if InplaceEditor <> nil then if InplaceEditor is TExtInplaceEdit then begin FEditorAlignment := Value; with TExtInplaceEdit(InplaceEditor) do begin Alignment := FEditorAlignment; end; end; end; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:41 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz