source: cprs/branches/tmg-cprs/TntWare/Delphi Unicode Controls/Source/TntGrids.pas@ 896

Last change on this file since 896 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

File size: 21.0 KB
Line 
1
2{*****************************************************************************}
3{ }
4{ Tnt Delphi Unicode Controls }
5{ http://www.tntware.com/delphicontrols/unicode/ }
6{ Version: 2.3.0 }
7{ }
8{ Copyright (c) 2002-2007, Troy Wolbrink (troy.wolbrink@tntware.com) }
9{ }
10{*****************************************************************************}
11
12unit TntGrids;
13
14{$INCLUDE TntCompilers.inc}
15
16interface
17
18uses
19 Classes, TntClasses, Grids, Windows, Controls, Messages;
20
21type
22{TNT-WARN TInplaceEdit}
23 TTntInplaceEdit = class(TInplaceEdit{TNT-ALLOW TInplaceEdit})
24 private
25 function GetText: WideString;
26 procedure SetText(const Value: WideString);
27 protected
28 procedure UpdateContents; override;
29 procedure CreateWindowHandle(const Params: TCreateParams); override;
30 public
31 property Text: WideString read GetText write SetText;
32 end;
33
34 TTntGetEditEvent = procedure (Sender: TObject; ACol, ARow: Longint; var Value: WideString) of object;
35 TTntSetEditEvent = procedure (Sender: TObject; ACol, ARow: Longint; const Value: WideString) of object;
36
37{TNT-WARN TCustomDrawGrid}
38 _TTntInternalCustomDrawGrid = class(TCustomDrawGrid{TNT-ALLOW TCustomDrawGrid})
39 private
40 FSettingEditText: Boolean;
41 procedure InternalSetEditText(ACol, ARow: Longint; const Value: string{TNT-ALLOW string}); dynamic; abstract;
42 protected
43 procedure SetEditText(ACol, ARow: Longint; const Value: string{TNT-ALLOW string}); override;
44 end;
45
46 TTntCustomDrawGrid = class(_TTntInternalCustomDrawGrid)
47 private
48 FOnGetEditText: TTntGetEditEvent;
49 FOnSetEditText: TTntSetEditEvent;
50 function GetHint: WideString;
51 procedure SetHint(const Value: WideString);
52 function IsHintStored: Boolean;
53 procedure WMChar(var Msg: TWMChar); message WM_CHAR;
54 protected
55 function CreateEditor: TInplaceEdit{TNT-ALLOW TInplaceEdit}; override;
56 procedure InternalSetEditText(ACol, ARow: Longint; const Value: string{TNT-ALLOW string}); override;
57 function GetEditText(ACol, ARow: Longint): WideString; reintroduce; virtual;
58 procedure SetEditText(ACol, ARow: Longint; const Value: WideString); reintroduce; virtual;
59 protected
60 procedure CreateWindowHandle(const Params: TCreateParams); override;
61 procedure ShowEditorChar(Ch: WideChar); dynamic;
62 procedure DefineProperties(Filer: TFiler); override;
63 function GetActionLinkClass: TControlActionLinkClass; override;
64 procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
65 property OnGetEditText: TTntGetEditEvent read FOnGetEditText write FOnGetEditText;
66 property OnSetEditText: TTntSetEditEvent read FOnSetEditText write FOnSetEditText;
67 published
68 property Hint: WideString read GetHint write SetHint stored IsHintStored;
69 end;
70
71{TNT-WARN TDrawGrid}
72 TTntDrawGrid = class(TTntCustomDrawGrid)
73 published
74 property Align;
75 property Anchors;
76 property BevelEdges;
77 property BevelInner;
78 property BevelKind;
79 property BevelOuter;
80 property BevelWidth;
81 property BiDiMode;
82 property BorderStyle;
83 property Color;
84 property ColCount;
85 property Constraints;
86 property Ctl3D;
87 property DefaultColWidth;
88 property DefaultRowHeight;
89 property DefaultDrawing;
90 property DragCursor;
91 property DragKind;
92 property DragMode;
93 property Enabled;
94 property FixedColor;
95 property FixedCols;
96 property RowCount;
97 property FixedRows;
98 property Font;
99 property GridLineWidth;
100 property Options;
101 property ParentBiDiMode;
102 property ParentColor;
103 property ParentCtl3D;
104 property ParentFont;
105 property ParentShowHint;
106 property PopupMenu;
107 property ScrollBars;
108 property ShowHint;
109 property TabOrder;
110 property Visible;
111 property VisibleColCount;
112 property VisibleRowCount;
113 property OnClick;
114 property OnColumnMoved;
115 property OnContextPopup;
116 property OnDblClick;
117 property OnDragDrop;
118 property OnDragOver;
119 property OnDrawCell;
120 property OnEndDock;
121 property OnEndDrag;
122 property OnEnter;
123 property OnExit;
124 property OnGetEditMask;
125 property OnGetEditText;
126 property OnKeyDown;
127 property OnKeyPress;
128 property OnKeyUp;
129 {$IFDEF COMPILER_9_UP}
130 property OnMouseActivate;
131 {$ENDIF}
132 property OnMouseDown;
133 {$IFDEF COMPILER_10_UP}
134 property OnMouseEnter;
135 property OnMouseLeave;
136 {$ENDIF}
137 property OnMouseMove;
138 property OnMouseUp;
139 property OnMouseWheelDown;
140 property OnMouseWheelUp;
141 property OnRowMoved;
142 property OnSelectCell;
143 property OnSetEditText;
144 property OnStartDock;
145 property OnStartDrag;
146 property OnTopLeftChanged;
147 end;
148
149 TTntStringGrid = class;
150
151{TNT-WARN TStringGridStrings}
152 TTntStringGridStrings = class(TTntStrings)
153 private
154 FIsCol: Boolean;
155 FColRowIndex: Integer;
156 FGrid: TTntStringGrid;
157 function GridAnsiStrings: TStrings{TNT-ALLOW TStrings};
158 protected
159 function Get(Index: Integer): WideString; override;
160 procedure Put(Index: Integer; const S: WideString); override;
161 function GetCount: Integer; override;
162 function GetObject(Index: Integer): TObject; override;
163 procedure PutObject(Index: Integer; AObject: TObject); override;
164 procedure SetUpdateState(Updating: Boolean); override;
165 public
166 constructor Create(AGrid: TTntStringGrid; AIndex: Longint);
167 function Add(const S: WideString): Integer; override;
168 procedure Assign(Source: TPersistent); override;
169 procedure Clear; override;
170 procedure Delete(Index: Integer); override;
171 procedure Insert(Index: Integer; const S: WideString); override;
172 end;
173
174{TNT-WARN TStringGrid}
175 _TTntInternalStringGrid = class(TStringGrid{TNT-ALLOW TStringGrid})
176 private
177 FSettingEditText: Boolean;
178 procedure InternalSetEditText(ACol, ARow: Longint; const Value: string{TNT-ALLOW string}); dynamic; abstract;
179 protected
180 procedure SetEditText(ACol, ARow: Longint; const Value: string{TNT-ALLOW string}); override;
181 end;
182
183 TTntStringGrid = class(_TTntInternalStringGrid)
184 private
185 FCreatedRowStrings: TStringList{TNT-ALLOW TStringList};
186 FCreatedColStrings: TStringList{TNT-ALLOW TStringList};
187 FOnGetEditText: TTntGetEditEvent;
188 FOnSetEditText: TTntSetEditEvent;
189 function GetHint: WideString;
190 procedure SetHint(const Value: WideString);
191 function IsHintStored: Boolean;
192 procedure WMChar(var Msg: TWMChar); message WM_CHAR;
193 function GetCells(ACol, ARow: Integer): WideString;
194 procedure SetCells(ACol, ARow: Integer; const Value: WideString);
195 function FindGridStrings(const IsCol: Boolean; const ListIndex: Integer): TTntStrings;
196 function GetCols(Index: Integer): TTntStrings;
197 function GetRows(Index: Integer): TTntStrings;
198 procedure SetCols(Index: Integer; const Value: TTntStrings);
199 procedure SetRows(Index: Integer; const Value: TTntStrings);
200 protected
201 function CreateEditor: TInplaceEdit{TNT-ALLOW TInplaceEdit}; override;
202 procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState); override;
203 procedure InternalSetEditText(ACol, ARow: Longint; const Value: string{TNT-ALLOW string}); override;
204 function GetEditText(ACol, ARow: Longint): WideString; reintroduce; virtual;
205 procedure SetEditText(ACol, ARow: Longint; const Value: WideString); reintroduce; virtual;
206 protected
207 procedure CreateWindowHandle(const Params: TCreateParams); override;
208 procedure ShowEditorChar(Ch: WideChar); dynamic;
209 procedure DefineProperties(Filer: TFiler); override;
210 function GetActionLinkClass: TControlActionLinkClass; override;
211 procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
212 public
213 constructor Create(AOwner: TComponent); override;
214 destructor Destroy; override;
215 property Cells[ACol, ARow: Integer]: WideString read GetCells write SetCells;
216 property Cols[Index: Integer]: TTntStrings read GetCols write SetCols;
217 property Rows[Index: Integer]: TTntStrings read GetRows write SetRows;
218 published
219 property Hint: WideString read GetHint write SetHint stored IsHintStored;
220 property OnGetEditText: TTntGetEditEvent read FOnGetEditText write FOnGetEditText;
221 property OnSetEditText: TTntSetEditEvent read FOnSetEditText write FOnSetEditText;
222 end;
223
224implementation
225
226uses
227 SysUtils, TntSystem, TntGraphics, TntControls, TntStdCtrls, TntActnList, TntSysUtils;
228
229{ TBinaryCompareAnsiStringList }
230type
231 TBinaryCompareAnsiStringList = class(TStringList{TNT-ALLOW TStringList})
232 protected
233 function CompareStrings(const S1, S2: string{TNT-ALLOW string}): Integer; override;
234 end;
235
236function TBinaryCompareAnsiStringList.CompareStrings(const S1, S2: string{TNT-ALLOW string}): Integer;
237begin
238 // must compare strings via binary for speed
239 if S1 = S2 then
240 result := 0
241 else if S1 < S2 then
242 result := -1
243 else
244 result := 1;
245end;
246
247{ TTntInplaceEdit }
248
249procedure TTntInplaceEdit.CreateWindowHandle(const Params: TCreateParams);
250begin
251 TntCustomEdit_CreateWindowHandle(Self, Params);
252end;
253
254function TTntInplaceEdit.GetText: WideString;
255begin
256 if IsMasked then
257 Result := inherited Text
258 else
259 Result := TntControl_GetText(Self);
260end;
261
262procedure TTntInplaceEdit.SetText(const Value: WideString);
263begin
264 if IsMasked then
265 inherited Text := Value
266 else
267 TntControl_SetText(Self, Value);
268end;
269
270type TAccessCustomGrid = class(TCustomGrid);
271
272procedure TTntInplaceEdit.UpdateContents;
273begin
274 Text := '';
275 with TAccessCustomGrid(Grid) do
276 Self.EditMask := GetEditMask(Col, Row);
277 if (Grid is TTntStringGrid) then
278 with (Grid as TTntStringGrid) do
279 Self.Text := GetEditText(Col, Row)
280 else if (Grid is TTntCustomDrawGrid) then
281 with (Grid as TTntCustomDrawGrid) do
282 Self.Text := GetEditText(Col, Row)
283 else
284 with TAccessCustomGrid(Grid) do
285 Self.Text := GetEditText(Col, Row);
286 with TAccessCustomGrid(Grid) do
287 Self.MaxLength := GetEditLimit;
288end;
289
290{ _TTntInternalCustomDrawGrid }
291
292procedure _TTntInternalCustomDrawGrid.SetEditText(ACol, ARow: Integer; const Value: string{TNT-ALLOW string});
293begin
294 if FSettingEditText then
295 inherited
296 else
297 InternalSetEditText(ACol, ARow, Value);
298end;
299
300
301{ TTntCustomDrawGrid }
302
303function TTntCustomDrawGrid.CreateEditor: TInplaceEdit{TNT-ALLOW TInplaceEdit};
304begin
305 Result := TTntInplaceEdit.Create(Self);
306end;
307
308procedure TTntCustomDrawGrid.CreateWindowHandle(const Params: TCreateParams);
309begin
310 CreateUnicodeHandle(Self, Params, '');
311end;
312
313procedure TTntCustomDrawGrid.DefineProperties(Filer: TFiler);
314begin
315 inherited;
316 TntPersistent_AfterInherited_DefineProperties(Filer, Self);
317end;
318
319function TTntCustomDrawGrid.IsHintStored: Boolean;
320begin
321 Result := TntControl_IsHintStored(Self);
322end;
323
324function TTntCustomDrawGrid.GetHint: WideString;
325begin
326 Result := TntControl_GetHint(Self);
327end;
328
329procedure TTntCustomDrawGrid.SetHint(const Value: WideString);
330begin
331 TntControl_SetHint(Self, Value);
332end;
333
334function TTntCustomDrawGrid.GetEditText(ACol, ARow: Integer): WideString;
335begin
336 Result := '';
337 if Assigned(FOnGetEditText) then FOnGetEditText(Self, ACol, ARow, Result);
338end;
339
340procedure TTntCustomDrawGrid.InternalSetEditText(ACol, ARow: Integer; const Value: string{TNT-ALLOW string});
341begin
342 if not FSettingEditText then
343 SetEditText(ACol, ARow, TntControl_GetText(InplaceEditor));
344end;
345
346procedure TTntCustomDrawGrid.SetEditText(ACol, ARow: Integer; const Value: WideString);
347begin
348 if Assigned(FOnSetEditText) then FOnSetEditText(Self, ACol, ARow, Value);
349end;
350
351procedure TTntCustomDrawGrid.WMChar(var Msg: TWMChar);
352begin
353 if (goEditing in Options)
354 and (AnsiChar(Msg.CharCode) in [^H, #32..#255]) then begin
355 RestoreWMCharMsg(TMessage(Msg));
356 ShowEditorChar(WideChar(Msg.CharCode));
357 end else
358 inherited;
359end;
360
361procedure TTntCustomDrawGrid.ShowEditorChar(Ch: WideChar);
362begin
363 ShowEditor;
364 if InplaceEditor <> nil then begin
365 if Win32PlatformIsUnicode then
366 PostMessageW(InplaceEditor.Handle, WM_CHAR, Word(Ch), 0)
367 else
368 PostMessageA(InplaceEditor.Handle, WM_CHAR, Word(Ch), 0);
369 end;
370end;
371
372procedure TTntCustomDrawGrid.ActionChange(Sender: TObject; CheckDefaults: Boolean);
373begin
374 TntControl_BeforeInherited_ActionChange(Self, Sender, CheckDefaults);
375 inherited;
376end;
377
378function TTntCustomDrawGrid.GetActionLinkClass: TControlActionLinkClass;
379begin
380 Result := TntControl_GetActionLinkClass(Self, inherited GetActionLinkClass);
381end;
382
383{ TTntStringGridStrings }
384
385procedure TTntStringGridStrings.Assign(Source: TPersistent);
386var
387 UTF8Strings: TStringList{TNT-ALLOW TStringList};
388 i: integer;
389begin
390 UTF8Strings := TStringList{TNT-ALLOW TStringList}.Create;
391 try
392 if Source is TStrings{TNT-ALLOW TStrings} then begin
393 for i := 0 to TStrings{TNT-ALLOW TStrings}(Source).Count - 1 do
394 UTF8Strings.AddObject(WideStringToUTF8(WideString(TStrings{TNT-ALLOW TStrings}(Source).Strings[i])),
395 TStrings{TNT-ALLOW TStrings}(Source).Objects[i]);
396 GridAnsiStrings.Assign(UTF8Strings);
397 end else if Source is TTntStrings then begin
398 for i := 0 to TTntStrings(Source).Count - 1 do
399 UTF8Strings.AddObject(WideStringToUTF8(TTntStrings(Source).Strings[i]),
400 TTntStrings(Source).Objects[i]);
401 GridAnsiStrings.Assign(UTF8Strings);
402 end else
403 GridAnsiStrings.Assign(Source);
404 finally
405 UTF8Strings.Free;
406 end;
407end;
408
409function TTntStringGridStrings.GridAnsiStrings: TStrings{TNT-ALLOW TStrings};
410begin
411 Assert(Assigned(FGrid));
412 if FIsCol then
413 Result := TStringGrid{TNT-ALLOW TStringGrid}(FGrid).Cols[FColRowIndex]
414 else
415 Result := TStringGrid{TNT-ALLOW TStringGrid}(FGrid).Rows[FColRowIndex];
416end;
417
418procedure TTntStringGridStrings.Clear;
419begin
420 GridAnsiStrings.Clear;
421end;
422
423procedure TTntStringGridStrings.Delete(Index: Integer);
424begin
425 GridAnsiStrings.Delete(Index);
426end;
427
428function TTntStringGridStrings.GetCount: Integer;
429begin
430 Result := GridAnsiStrings.Count;
431end;
432
433function TTntStringGridStrings.Get(Index: Integer): WideString;
434begin
435 Result := UTF8ToWideString(GridAnsiStrings[Index]);
436end;
437
438procedure TTntStringGridStrings.Put(Index: Integer; const S: WideString);
439begin
440 GridAnsiStrings[Index] := WideStringToUTF8(S);
441end;
442
443procedure TTntStringGridStrings.Insert(Index: Integer; const S: WideString);
444begin
445 GridAnsiStrings.Insert(Index, WideStringToUTF8(S));
446end;
447
448function TTntStringGridStrings.Add(const S: WideString): Integer;
449begin
450 Result := GridAnsiStrings.Add(WideStringToUTF8(S));
451end;
452
453function TTntStringGridStrings.GetObject(Index: Integer): TObject;
454begin
455 Result := GridAnsiStrings.Objects[Index];
456end;
457
458procedure TTntStringGridStrings.PutObject(Index: Integer; AObject: TObject);
459begin
460 GridAnsiStrings.Objects[Index] := AObject;
461end;
462
463type TAccessStrings = class(TStrings{TNT-ALLOW TStrings});
464
465procedure TTntStringGridStrings.SetUpdateState(Updating: Boolean);
466begin
467 TAccessStrings(GridAnsiStrings).SetUpdateState(Updating);
468end;
469
470constructor TTntStringGridStrings.Create(AGrid: TTntStringGrid; AIndex: Integer);
471begin
472 inherited Create;
473 FGrid := AGrid;
474 if AIndex > 0 then begin
475 FIsCol := False;
476 FColRowIndex := AIndex - 1;
477 end else begin
478 FIsCol := True;
479 FColRowIndex := -AIndex - 1;
480 end;
481end;
482
483{ _TTntInternalStringGrid }
484
485procedure _TTntInternalStringGrid.SetEditText(ACol, ARow: Integer; const Value: string{TNT-ALLOW string});
486begin
487 if FSettingEditText then
488 inherited
489 else
490 InternalSetEditText(ACol, ARow, Value);
491end;
492
493{ TTntStringGrid }
494
495constructor TTntStringGrid.Create(AOwner: TComponent);
496begin
497 inherited;
498 FCreatedRowStrings := TBinaryCompareAnsiStringList.Create;
499 FCreatedRowStrings.Sorted := True;
500 FCreatedRowStrings.Duplicates := dupError;
501 FCreatedColStrings := TBinaryCompareAnsiStringList.Create;
502 FCreatedColStrings.Sorted := True;
503 FCreatedColStrings.Duplicates := dupError;
504end;
505
506destructor TTntStringGrid.Destroy;
507var
508 i: integer;
509begin
510 for i := FCreatedColStrings.Count - 1 downto 0 do
511 FCreatedColStrings.Objects[i].Free;
512 for i := FCreatedRowStrings.Count - 1 downto 0 do
513 FCreatedRowStrings.Objects[i].Free;
514 FreeAndNil(FCreatedColStrings);
515 FreeAndNil(FCreatedRowStrings);
516 inherited;
517end;
518
519function TTntStringGrid.CreateEditor: TInplaceEdit{TNT-ALLOW TInplaceEdit};
520begin
521 Result := TTntInplaceEdit.Create(Self);
522end;
523
524procedure TTntStringGrid.CreateWindowHandle(const Params: TCreateParams);
525begin
526 CreateUnicodeHandle(Self, Params, '');
527end;
528
529procedure TTntStringGrid.DefineProperties(Filer: TFiler);
530begin
531 inherited;
532 TntPersistent_AfterInherited_DefineProperties(Filer, Self);
533end;
534
535function TTntStringGrid.IsHintStored: Boolean;
536begin
537 Result := TntControl_IsHintStored(Self);
538end;
539
540function TTntStringGrid.GetHint: WideString;
541begin
542 Result := TntControl_GetHint(Self)
543end;
544
545procedure TTntStringGrid.SetHint(const Value: WideString);
546begin
547 TntControl_SetHint(Self, Value);
548end;
549
550function TTntStringGrid.GetCells(ACol, ARow: Integer): WideString;
551begin
552 Result := UTF8ToWideString(inherited Cells[ACol, ARow])
553end;
554
555procedure TTntStringGrid.SetCells(ACol, ARow: Integer; const Value: WideString);
556var
557 UTF8Str: AnsiString;
558begin
559 UTF8Str := WideStringToUTF8(Value);
560 if inherited Cells[ACol, ARow] <> UTF8Str then
561 inherited Cells[ACol, ARow] := UTF8Str;
562end;
563
564function TTntStringGrid.FindGridStrings(const IsCol: Boolean; const ListIndex: Integer): TTntStrings;
565var
566 idx: integer;
567 SrcStrings: TStrings{TNT-ALLOW TStrings};
568 RCIndex: Integer;
569begin
570 if IsCol then
571 SrcStrings := FCreatedColStrings
572 else
573 SrcStrings := FCreatedRowStrings;
574 Assert(Assigned(SrcStrings));
575 idx := SrcStrings.IndexOf(IntToStr(ListIndex));
576 if idx <> -1 then
577 Result := SrcStrings.Objects[idx] as TTntStrings
578 else begin
579 if IsCol then RCIndex := -ListIndex - 1 else RCIndex := ListIndex + 1;
580 Result := TTntStringGridStrings.Create(Self, RCIndex);
581 SrcStrings.AddObject(IntToStr(ListIndex), Result);
582 end;
583end;
584
585function TTntStringGrid.GetCols(Index: Integer): TTntStrings;
586begin
587 Result := FindGridStrings(True, Index);
588end;
589
590function TTntStringGrid.GetRows(Index: Integer): TTntStrings;
591begin
592 Result := FindGridStrings(False, Index);
593end;
594
595procedure TTntStringGrid.SetCols(Index: Integer; const Value: TTntStrings);
596begin
597 FindGridStrings(True, Index).Assign(Value);
598end;
599
600procedure TTntStringGrid.SetRows(Index: Integer; const Value: TTntStrings);
601begin
602 FindGridStrings(False, Index).Assign(Value);
603end;
604
605procedure TTntStringGrid.DrawCell(ACol, ARow: Integer; ARect: TRect; AState: TGridDrawState);
606var
607 SaveDefaultDrawing: Boolean;
608begin
609 if DefaultDrawing then
610 WideCanvasTextRect(Canvas, ARect, ARect.Left+2, ARect.Top+2, Cells[ACol, ARow]);
611 SaveDefaultDrawing := DefaultDrawing;
612 try
613 DefaultDrawing := False;
614 inherited DrawCell(ACol, ARow, ARect, AState);
615 finally
616 DefaultDrawing := SaveDefaultDrawing;
617 end;
618end;
619
620function TTntStringGrid.GetEditText(ACol, ARow: Integer): WideString;
621begin
622 Result := Cells[ACol, ARow];
623 if Assigned(FOnGetEditText) then FOnGetEditText(Self, ACol, ARow, Result);
624end;
625
626procedure TTntStringGrid.InternalSetEditText(ACol, ARow: Integer; const Value: string{TNT-ALLOW string});
627begin
628 if not FSettingEditText then
629 SetEditText(ACol, ARow, TntControl_GetText(InplaceEditor));
630end;
631
632procedure TTntStringGrid.SetEditText(ACol, ARow: Integer; const Value: WideString);
633begin
634 FSettingEditText := True;
635 try
636 inherited SetEditText(ACol, ARow, WideStringToUTF8(Value));
637 finally
638 FSettingEditText := False;
639 end;
640 if Assigned(FOnSetEditText) then FOnSetEditText(Self, ACol, ARow, Value);
641end;
642
643procedure TTntStringGrid.WMChar(var Msg: TWMChar);
644begin
645 if (goEditing in Options)
646 and (AnsiChar(Msg.CharCode) in [^H, #32..#255]) then begin
647 RestoreWMCharMsg(TMessage(Msg));
648 ShowEditorChar(WideChar(Msg.CharCode));
649 end else
650 inherited;
651end;
652
653procedure TTntStringGrid.ShowEditorChar(Ch: WideChar);
654begin
655 ShowEditor;
656 if InplaceEditor <> nil then begin
657 if Win32PlatformIsUnicode then
658 PostMessageW(InplaceEditor.Handle, WM_CHAR, Word(Ch), 0)
659 else
660 PostMessageA(InplaceEditor.Handle, WM_CHAR, Word(Ch), 0);
661 end;
662end;
663
664procedure TTntStringGrid.ActionChange(Sender: TObject; CheckDefaults: Boolean);
665begin
666 TntControl_BeforeInherited_ActionChange(Self, Sender, CheckDefaults);
667 inherited;
668end;
669
670function TTntStringGrid.GetActionLinkClass: TControlActionLinkClass;
671begin
672 Result := TntControl_GetActionLinkClass(Self, inherited GetActionLinkClass);
673end;
674
675end.
Note: See TracBrowser for help on using the repository browser.