2 {*****************************************************************************}
4 { Tnt Delphi Unicode Controls }
5 { http://www.tntware.com/delphicontrols/unicode/ }
8 { Copyright (c) 2002-2007, Troy Wolbrink (troy.wolbrink@tntware.com) }
10 {*****************************************************************************}
14 {$INCLUDE TntCompilers.inc}
19 Classes
, Messages
, Controls
, ExtCtrls
, TntClasses
, TntControls
, TntStdCtrls
, TntGraphics
;
23 TTntShape
= class(TShape
{TNT-ALLOW TShape})
25 function GetHint
: WideString
;
26 procedure SetHint(const Value
: WideString
);
27 function IsHintStored
: Boolean;
28 procedure CMHintShow(var Message: TMessage
); message CM_HINTSHOW
;
30 procedure DefineProperties(Filer
: TFiler
); override;
31 function GetActionLinkClass
: TControlActionLinkClass
; override;
32 procedure ActionChange(Sender
: TObject
; CheckDefaults
: Boolean); override;
34 property Hint
: WideString read GetHint write SetHint stored IsHintStored
;
38 TTntPaintBox
= class(TPaintBox
{TNT-ALLOW TPaintBox})
40 function GetHint
: WideString
;
41 procedure SetHint(const Value
: WideString
);
42 function IsHintStored
: Boolean;
43 procedure CMHintShow(var Message: TMessage
); message CM_HINTSHOW
;
45 procedure DefineProperties(Filer
: TFiler
); override;
46 function GetActionLinkClass
: TControlActionLinkClass
; override;
47 procedure ActionChange(Sender
: TObject
; CheckDefaults
: Boolean); override;
49 property Hint
: WideString read GetHint write SetHint stored IsHintStored
;
53 TTntImage
= class(TImage
{TNT-ALLOW TImage})
55 function GetHint
: WideString
;
56 procedure SetHint(const Value
: WideString
);
57 function IsHintStored
: Boolean;
58 procedure CMHintShow(var Message: TMessage
); message CM_HINTSHOW
;
59 function GetPicture
: TTntPicture
;
60 procedure SetPicture(const Value
: TTntPicture
);
62 procedure DefineProperties(Filer
: TFiler
); override;
63 function GetActionLinkClass
: TControlActionLinkClass
; override;
64 procedure ActionChange(Sender
: TObject
; CheckDefaults
: Boolean); override;
66 constructor Create(AOwner
: TComponent
); override;
68 property Hint
: WideString read GetHint write SetHint stored IsHintStored
;
69 property Picture
: TTntPicture read GetPicture write SetPicture
;
73 TTntBevel
= class(TBevel
{TNT-ALLOW TBevel})
75 function GetHint
: WideString
;
76 procedure SetHint(const Value
: WideString
);
77 function IsHintStored
: Boolean;
78 procedure CMHintShow(var Message: TMessage
); message CM_HINTSHOW
;
80 procedure DefineProperties(Filer
: TFiler
); override;
81 function GetActionLinkClass
: TControlActionLinkClass
; override;
82 procedure ActionChange(Sender
: TObject
; CheckDefaults
: Boolean); override;
84 property Hint
: WideString read GetHint write SetHint stored IsHintStored
;
87 {TNT-WARN TCustomPanel}
88 TTntCustomPanel
= class(TCustomPanel
{TNT-ALLOW TCustomPanel})
90 function GetCaption
: TWideCaption
;
91 procedure SetCaption(const Value
: TWideCaption
);
92 function GetHint
: WideString
;
93 procedure SetHint(const Value
: WideString
);
94 function IsCaptionStored
: Boolean;
95 function IsHintStored
: Boolean;
97 procedure Paint
; override;
98 procedure CreateWindowHandle(const Params
: TCreateParams
); override;
99 procedure DefineProperties(Filer
: TFiler
); override;
100 function GetActionLinkClass
: TControlActionLinkClass
; override;
101 procedure ActionChange(Sender
: TObject
; CheckDefaults
: Boolean); override;
102 property Caption
: TWideCaption read GetCaption write SetCaption stored IsCaptionStored
;
104 property Hint
: WideString read GetHint write SetHint stored IsHintStored
;
108 TTntPanel
= class(TTntCustomPanel
)
110 property DockManager
;
122 property BorderWidth
;
123 property BorderStyle
;
126 property Constraints
;
128 property UseDockManager default
True;
134 property FullRepaint
;
137 {$IFDEF COMPILER_10_UP}
140 property ParentBiDiMode
;
141 {$IFDEF COMPILER_7_UP}
142 property ParentBackground
;
144 property ParentColor
;
145 property ParentCtl3D
;
147 property ParentShowHint
;
152 {$IFDEF COMPILER_9_UP}
153 property VerticalAlignment
;
156 {$IFDEF COMPILER_9_UP}
157 property OnAlignInsertBefore
;
158 property OnAlignPosition
;
160 property OnCanResize
;
162 property OnConstrainedResize
;
163 property OnContextPopup
;
173 property OnGetSiteInfo
;
174 {$IFDEF COMPILER_9_UP}
175 property OnMouseActivate
;
177 property OnMouseDown
;
178 {$IFDEF COMPILER_10_UP}
179 property OnMouseEnter
;
180 property OnMouseLeave
;
182 property OnMouseMove
;
185 property OnStartDock
;
186 property OnStartDrag
;
190 {TNT-WARN TCustomControlBar}
191 TTntCustomControlBar
= class(TCustomControlBar
{TNT-ALLOW TCustomControlBar})
193 function IsHintStored
: Boolean;
194 function GetHint
: WideString
;
195 procedure SetHint(const Value
: WideString
);
197 procedure CreateWindowHandle(const Params
: TCreateParams
); override;
198 procedure DefineProperties(Filer
: TFiler
); override;
199 function GetActionLinkClass
: TControlActionLinkClass
; override;
200 procedure ActionChange(Sender
: TObject
; CheckDefaults
: Boolean); override;
202 property Hint
: WideString read GetHint write SetHint stored IsHintStored
;
205 {TNT-WARN TControlBar}
206 TTntControlBar
= class(TTntCustomControlBar
)
220 property BorderWidth
;
221 property Color
{$IFDEF COMPILER_7_UP} nodefault
{$ENDIF};
222 property Constraints
;
223 {$IFDEF COMPILER_10_UP}
230 {$IFDEF COMPILER_10_UP}
231 property DrawingStyle
;
234 {$IFDEF COMPILER_10_UP}
235 property GradientDirection
;
236 property GradientEndColor
;
237 property GradientStartColor
;
239 {$IFDEF COMPILER_7_UP}
240 property ParentBackground default
True;
242 property ParentColor
;
243 property ParentCtl3D
;
245 property ParentShowHint
;
254 {$IFDEF COMPILER_9_UP}
255 property OnAlignInsertBefore
;
256 property OnAlignPosition
;
261 property OnBandPaint
;
262 {$IFDEF COMPILER_9_UP}
263 property OnBeginBandMove
;
264 property OnEndBandMove
;
266 property OnCanResize
;
268 property OnConstrainedResize
;
269 property OnContextPopup
;
279 property OnGetSiteInfo
;
280 {$IFDEF COMPILER_9_UP}
281 property OnMouseActivate
;
283 property OnMouseDown
;
284 {$IFDEF COMPILER_10_UP}
285 property OnMouseEnter
;
286 property OnMouseLeave
;
288 property OnMouseMove
;
292 property OnStartDock
;
293 property OnStartDrag
;
297 {TNT-WARN TCustomRadioGroup}
298 TTntCustomRadioGroup
= class(TTntCustomGroupBox
)
306 function GetButtons(Index
: Integer): TTntRadioButton
;
307 procedure ArrangeButtons
;
308 procedure ButtonClick(Sender
: TObject
);
309 procedure ItemsChange(Sender
: TObject
);
310 procedure SetButtonCount(Value
: Integer);
311 procedure SetColumns(Value
: Integer);
312 procedure SetItemIndex(Value
: Integer);
313 procedure SetItems(Value
: TTntStrings
);
314 procedure UpdateButtons
;
315 procedure CMEnabledChanged(var Message: TMessage
); message CM_ENABLEDCHANGED
;
316 procedure CMFontChanged(var Message: TMessage
); message CM_FONTCHANGED
;
317 procedure WMSize(var Message: TWMSize
); message WM_SIZE
;
319 procedure Loaded
; override;
320 procedure ReadState(Reader
: TReader
); override;
321 function CanModify
: Boolean; virtual;
322 procedure GetChildren(Proc
: TGetChildProc
; Root
: TComponent
); override;
323 property Columns
: Integer read FColumns write SetColumns default
1;
324 property ItemIndex
: Integer read FItemIndex write SetItemIndex default
-1;
325 property Items
: TTntStrings read FItems write SetItems
;
327 constructor Create(AOwner
: TComponent
); override;
328 destructor Destroy
; override;
329 procedure FlipChildren(AllLevels
: Boolean); override;
330 property Buttons
[Index
: Integer]: TTntRadioButton read GetButtons
;
333 {TNT-WARN TRadioGroup}
334 TTntRadioGroup
= class(TTntCustomRadioGroup
)
350 property Constraints
;
351 property ParentBiDiMode
;
352 {$IFDEF COMPILER_7_UP}
353 property ParentBackground default
True;
355 property ParentColor
;
356 property ParentCtl3D
;
358 property ParentShowHint
;
365 property OnContextPopup
;
372 property OnStartDock
;
373 property OnStartDrag
;
377 TTntSplitter
= class(TSplitter
{TNT-ALLOW TSplitter})
379 function GetHint
: WideString
;
380 procedure SetHint(const Value
: WideString
);
381 function IsHintStored
: Boolean;
382 procedure CMHintShow(var Message: TMessage
); message CM_HINTSHOW
;
384 procedure DefineProperties(Filer
: TFiler
); override;
385 function GetActionLinkClass
: TControlActionLinkClass
; override;
386 procedure ActionChange(Sender
: TObject
; CheckDefaults
: Boolean); override;
388 property Hint
: WideString read GetHint write SetHint stored IsHintStored
;
394 Windows
, Graphics
, Forms
, {$IFDEF THEME_7_UP} Themes
, {$ENDIF}
395 TntSysUtils
, TntWindows
, TntActnList
;
399 procedure TTntShape
.DefineProperties(Filer
: TFiler
);
402 TntPersistent_AfterInherited_DefineProperties(Filer
, Self
);
405 function TTntShape
.IsHintStored
: Boolean;
407 Result
:= TntControl_IsHintStored(Self
)
410 function TTntShape
.GetHint
: WideString
;
412 Result
:= TntControl_GetHint(Self
)
415 procedure TTntShape
.SetHint(const Value
: WideString
);
417 TntControl_SetHint(Self
, Value
);
420 procedure TTntShape
.CMHintShow(var Message: TMessage
);
422 ProcessCMHintShowMsg(Message);
426 procedure TTntShape
.ActionChange(Sender
: TObject
; CheckDefaults
: Boolean);
428 TntControl_BeforeInherited_ActionChange(Self
, Sender
, CheckDefaults
);
432 function TTntShape
.GetActionLinkClass
: TControlActionLinkClass
;
434 Result
:= TntControl_GetActionLinkClass(Self
, inherited GetActionLinkClass
);
439 procedure TTntPaintBox
.DefineProperties(Filer
: TFiler
);
442 TntPersistent_AfterInherited_DefineProperties(Filer
, Self
);
445 function TTntPaintBox
.IsHintStored
: Boolean;
447 Result
:= TntControl_IsHintStored(Self
)
450 function TTntPaintBox
.GetHint
: WideString
;
452 Result
:= TntControl_GetHint(Self
)
455 procedure TTntPaintBox
.SetHint(const Value
: WideString
);
457 TntControl_SetHint(Self
, Value
);
460 procedure TTntPaintBox
.CMHintShow(var Message: TMessage
);
462 ProcessCMHintShowMsg(Message);
466 procedure TTntPaintBox
.ActionChange(Sender
: TObject
; CheckDefaults
: Boolean);
468 TntControl_BeforeInherited_ActionChange(Self
, Sender
, CheckDefaults
);
472 function TTntPaintBox
.GetActionLinkClass
: TControlActionLinkClass
;
474 Result
:= TntControl_GetActionLinkClass(Self
, inherited GetActionLinkClass
);
478 {$IFDEF COMPILER_6} // verified against VCL source in Delphi 6 and BCB 6
479 THackImage
= class(TGraphicControl
)
481 FPicture
: TPicture
{TNT-ALLOW TPicture};
484 {$IFDEF DELPHI_7} // verified against VCL source in Delphi 7
485 THackImage
= class(TGraphicControl
)
487 FPicture
: TPicture
{TNT-ALLOW TPicture};
490 {$IFDEF DELPHI_9} // verified against VCL source in Delphi 9
491 THackImage
= class(TGraphicControl
)
493 FPicture
: TPicture
{TNT-ALLOW TPicture};
496 {$IFDEF DELPHI_10} // verified against VCL source in Delphi 10
497 THackImage
= class(TGraphicControl
)
499 FPicture
: TPicture
{TNT-ALLOW TPicture};
505 constructor TTntImage
.Create(AOwner
: TComponent
);
507 OldPicture
: TPicture
{TNT-ALLOW TPicture};
510 OldPicture
:= THackImage(Self
).FPicture
;
511 THackImage(Self
).FPicture
:= TTntPicture
.Create
;
512 Picture
.OnChange
:= OldPicture
.OnChange
;
513 Picture
.OnProgress
:= OldPicture
.OnProgress
;
517 function TTntImage
.GetPicture
: TTntPicture
;
519 Result
:= inherited Picture
as TTntPicture
;
522 procedure TTntImage
.SetPicture(const Value
: TTntPicture
);
524 inherited Picture
:= Value
;
527 procedure TTntImage
.DefineProperties(Filer
: TFiler
);
530 TntPersistent_AfterInherited_DefineProperties(Filer
, Self
);
533 function TTntImage
.IsHintStored
: Boolean;
535 Result
:= TntControl_IsHintStored(Self
)
538 function TTntImage
.GetHint
: WideString
;
540 Result
:= TntControl_GetHint(Self
)
543 procedure TTntImage
.SetHint(const Value
: WideString
);
545 TntControl_SetHint(Self
, Value
);
548 procedure TTntImage
.CMHintShow(var Message: TMessage
);
550 ProcessCMHintShowMsg(Message);
554 procedure TTntImage
.ActionChange(Sender
: TObject
; CheckDefaults
: Boolean);
556 TntControl_BeforeInherited_ActionChange(Self
, Sender
, CheckDefaults
);
560 function TTntImage
.GetActionLinkClass
: TControlActionLinkClass
;
562 Result
:= TntControl_GetActionLinkClass(Self
, inherited GetActionLinkClass
);
567 procedure TTntBevel
.DefineProperties(Filer
: TFiler
);
570 TntPersistent_AfterInherited_DefineProperties(Filer
, Self
);
573 function TTntBevel
.IsHintStored
: Boolean;
575 Result
:= TntControl_IsHintStored(Self
)
578 function TTntBevel
.GetHint
: WideString
;
580 Result
:= TntControl_GetHint(Self
)
583 procedure TTntBevel
.SetHint(const Value
: WideString
);
585 TntControl_SetHint(Self
, Value
);
588 procedure TTntBevel
.CMHintShow(var Message: TMessage
);
590 ProcessCMHintShowMsg(Message);
594 procedure TTntBevel
.ActionChange(Sender
: TObject
; CheckDefaults
: Boolean);
596 TntControl_BeforeInherited_ActionChange(Self
, Sender
, CheckDefaults
);
600 function TTntBevel
.GetActionLinkClass
: TControlActionLinkClass
;
602 Result
:= TntControl_GetActionLinkClass(Self
, inherited GetActionLinkClass
);
607 procedure TTntCustomPanel
.CreateWindowHandle(const Params
: TCreateParams
);
609 CreateUnicodeHandle(Self
, Params
, '');
612 procedure TTntCustomPanel
.DefineProperties(Filer
: TFiler
);
615 TntPersistent_AfterInherited_DefineProperties(Filer
, Self
);
618 function TTntCustomPanel
.IsCaptionStored
: Boolean;
620 Result
:= TntControl_IsCaptionStored(Self
);
623 function TTntCustomPanel
.GetCaption
: TWideCaption
;
625 Result
:= TntControl_GetText(Self
)
628 procedure TTntCustomPanel
.SetCaption(const Value
: TWideCaption
);
630 TntControl_SetText(Self
, Value
);
633 procedure TTntCustomPanel
.Paint
;
635 Alignments
: array[TAlignment
] of Longint = (DT_LEFT
, DT_RIGHT
, DT_CENTER
);
638 TopColor
, BottomColor
: TColor
;
642 procedure AdjustColors(Bevel
: TPanelBevel
);
644 TopColor
:= clBtnHighlight
;
645 if Bevel
= bvLowered
then TopColor
:= clBtnShadow
;
646 BottomColor
:= clBtnShadow
;
647 if Bevel
= bvLowered
then BottomColor
:= clBtnHighlight
;
651 if (not Win32PlatformIsUnicode
) then
654 Rect
:= GetClientRect
;
655 if BevelOuter
<> bvNone
then
657 AdjustColors(BevelOuter
);
658 Frame3D(Canvas
, Rect
, TopColor
, BottomColor
, BevelWidth
);
661 if ThemeServices
.ThemesEnabled
{$IFDEF COMPILER_7_UP} and ParentBackground
{$ENDIF} then
662 InflateRect(Rect
, -BorderWidth
, -BorderWidth
)
666 Frame3D(Canvas
, Rect
, Color
, Color
, BorderWidth
);
668 if BevelInner
<> bvNone
then
670 AdjustColors(BevelInner
);
671 Frame3D(Canvas
, Rect
, TopColor
, BottomColor
, BevelWidth
);
676 if not ThemeServices
.ThemesEnabled
{$IFDEF COMPILER_7_UP} or not ParentBackground
{$ENDIF} then
679 Brush
.Color
:= Color
;
682 Brush
.Style
:= bsClear
;
684 FontHeight
:= WideCanvasTextHeight(Canvas
, 'W');
687 Top
:= ((Bottom
+ Top
) - FontHeight
) div 2;
688 Bottom
:= Top
+ FontHeight
;
690 Flags
:= DT_EXPANDTABS
or DT_VCENTER
or Alignments
[Alignment
];
691 Flags
:= DrawTextBiDiModeFlags(Flags
);
692 Tnt_DrawTextW(Handle
, PWideChar(Caption
), -1, Rect
, Flags
);
697 function TTntCustomPanel
.IsHintStored
: Boolean;
699 Result
:= TntControl_IsHintStored(Self
)
702 function TTntCustomPanel
.GetHint
: WideString
;
704 Result
:= TntControl_GetHint(Self
);
707 procedure TTntCustomPanel
.SetHint(const Value
: WideString
);
709 TntControl_SetHint(Self
, Value
);
712 procedure TTntCustomPanel
.ActionChange(Sender
: TObject
; CheckDefaults
: Boolean);
714 TntControl_BeforeInherited_ActionChange(Self
, Sender
, CheckDefaults
);
718 function TTntCustomPanel
.GetActionLinkClass
: TControlActionLinkClass
;
720 Result
:= TntControl_GetActionLinkClass(Self
, inherited GetActionLinkClass
);
723 { TTntCustomControlBar }
725 procedure TTntCustomControlBar
.CreateWindowHandle(const Params
: TCreateParams
);
727 CreateUnicodeHandle(Self
, Params
, '');
730 procedure TTntCustomControlBar
.DefineProperties(Filer
: TFiler
);
733 TntPersistent_AfterInherited_DefineProperties(Filer
, Self
);
736 function TTntCustomControlBar
.IsHintStored
: Boolean;
738 Result
:= TntControl_IsHintStored(Self
);
741 function TTntCustomControlBar
.GetHint
: WideString
;
743 Result
:= TntControl_GetHint(Self
);
746 procedure TTntCustomControlBar
.SetHint(const Value
: WideString
);
748 TntControl_SetHint(Self
, Value
);
751 procedure TTntCustomControlBar
.ActionChange(Sender
: TObject
; CheckDefaults
: Boolean);
753 TntControl_BeforeInherited_ActionChange(Self
, Sender
, CheckDefaults
);
757 function TTntCustomControlBar
.GetActionLinkClass
: TControlActionLinkClass
;
759 Result
:= TntControl_GetActionLinkClass(Self
, inherited GetActionLinkClass
);
765 TTntGroupButton
= class(TTntRadioButton
)
768 procedure CNCommand(var Message: TWMCommand
); message CN_COMMAND
;
770 procedure KeyDown(var Key
: Word; Shift
: TShiftState
); override;
771 procedure KeyPress(var Key
: Char{TNT-ALLOW Char}); override;
773 constructor InternalCreate(RadioGroup
: TTntCustomRadioGroup
);
774 destructor Destroy
; override;
777 constructor TTntGroupButton
.InternalCreate(RadioGroup
: TTntCustomRadioGroup
);
779 inherited Create(RadioGroup
);
780 RadioGroup
.FButtons
.Add(Self
);
782 Enabled
:= RadioGroup
.Enabled
;
783 ParentShowHint
:= False;
784 OnClick
:= RadioGroup
.ButtonClick
;
785 Parent
:= RadioGroup
;
788 destructor TTntGroupButton
.Destroy
;
790 TTntCustomRadioGroup(Owner
).FButtons
.Remove(Self
);
794 procedure TTntGroupButton
.CNCommand(var Message: TWMCommand
);
800 if ((Message.NotifyCode
= BN_CLICKED
) or
801 (Message.NotifyCode
= BN_DOUBLECLICKED
)) and
802 TTntCustomRadioGroup(Parent
).CanModify
then
805 Application
.HandleException(Self
);
811 procedure TTntGroupButton
.KeyPress(var Key
: Char{TNT-ALLOW Char});
813 inherited KeyPress(Key
);
814 TTntCustomRadioGroup(Parent
).KeyPress(Key
);
815 if (Key
= #8) or (Key
= ' ') then
817 if not TTntCustomRadioGroup(Parent
).CanModify
then Key
:= #0;
821 procedure TTntGroupButton
.KeyDown(var Key
: Word; Shift
: TShiftState
);
823 inherited KeyDown(Key
, Shift
);
824 TTntCustomRadioGroup(Parent
).KeyDown(Key
, Shift
);
827 { TTntCustomRadioGroup }
829 constructor TTntCustomRadioGroup
.Create(AOwner
: TComponent
);
831 inherited Create(AOwner
);
832 ControlStyle
:= [csSetCaption
, csDoubleClicks
{$IFDEF COMPILER_7_UP}, csParentBackground
{$ENDIF}];
833 FButtons
:= TList
.Create
;
834 FItems
:= TTntStringList
.Create
;
835 TTntStringList(FItems
).OnChange
:= ItemsChange
;
840 destructor TTntCustomRadioGroup
.Destroy
;
843 TTntStringList(FItems
).OnChange
:= nil;
849 procedure TTntCustomRadioGroup
.FlipChildren(AllLevels
: Boolean);
851 { The radio buttons are flipped using BiDiMode }
854 procedure TTntCustomRadioGroup
.ArrangeButtons
;
856 ButtonsPerCol
, ButtonWidth
, ButtonHeight
, TopMargin
, I
: Integer;
859 Metrics
: TTextMetric
;
860 DeferHandle
: THandle
;
863 if (FButtons
.Count
<> 0) and not FReading
then
866 SaveFont
:= SelectObject(DC
, Font
.Handle
);
867 GetTextMetrics(DC
, Metrics
);
868 SelectObject(DC
, SaveFont
);
870 ButtonsPerCol
:= (FButtons
.Count
+ FColumns
- 1) div FColumns
;
871 ButtonWidth
:= (Width
- 10) div FColumns
;
872 I
:= Height
- Metrics
.tmHeight
- 5;
873 ButtonHeight
:= I
div ButtonsPerCol
;
874 TopMargin
:= Metrics
.tmHeight
+ 1 + (I
mod ButtonsPerCol
) div 2;
875 DeferHandle
:= BeginDeferWindowPos(FButtons
.Count
);
877 for I
:= 0 to FButtons
.Count
- 1 do
878 with TTntGroupButton(FButtons
[I
]) do
880 BiDiMode
:= Self
.BiDiMode
;
881 ALeft
:= (I
div ButtonsPerCol
) * ButtonWidth
+ 8;
882 if UseRightToLeftAlignment
then
883 ALeft
:= Self
.ClientWidth
- ALeft
- ButtonWidth
;
884 DeferHandle
:= DeferWindowPos(DeferHandle
, Handle
, 0,
886 (I
mod ButtonsPerCol
) * ButtonHeight
+ TopMargin
,
887 ButtonWidth
, ButtonHeight
,
888 SWP_NOZORDER
or SWP_NOACTIVATE
);
892 EndDeferWindowPos(DeferHandle
);
897 procedure TTntCustomRadioGroup
.ButtonClick(Sender
: TObject
);
899 if not FUpdating
then
901 FItemIndex
:= FButtons
.IndexOf(Sender
);
907 procedure TTntCustomRadioGroup
.ItemsChange(Sender
: TObject
);
911 if FItemIndex
>= FItems
.Count
then FItemIndex
:= FItems
.Count
- 1;
916 procedure TTntCustomRadioGroup
.Loaded
;
922 procedure TTntCustomRadioGroup
.ReadState(Reader
: TReader
);
925 inherited ReadState(Reader
);
930 procedure TTntCustomRadioGroup
.SetButtonCount(Value
: Integer);
932 while FButtons
.Count
< Value
do TTntGroupButton
.InternalCreate(Self
);
933 while FButtons
.Count
> Value
do TTntGroupButton(FButtons
.Last
).Free
;
936 procedure TTntCustomRadioGroup
.SetColumns(Value
: Integer);
938 if Value
< 1 then Value
:= 1;
939 if Value
> 16 then Value
:= 16;
940 if FColumns
<> Value
then
948 procedure TTntCustomRadioGroup
.SetItemIndex(Value
: Integer);
950 if FReading
then FItemIndex
:= Value
else
952 if Value
< -1 then Value
:= -1;
953 if Value
>= FButtons
.Count
then Value
:= FButtons
.Count
- 1;
954 if FItemIndex
<> Value
then
956 if FItemIndex
>= 0 then
957 TTntGroupButton(FButtons
[FItemIndex
]).Checked
:= False;
959 if FItemIndex
>= 0 then
960 TTntGroupButton(FButtons
[FItemIndex
]).Checked
:= True;
965 procedure TTntCustomRadioGroup
.SetItems(Value
: TTntStrings
);
967 FItems
.Assign(Value
);
970 procedure TTntCustomRadioGroup
.UpdateButtons
;
974 SetButtonCount(FItems
.Count
);
975 for I
:= 0 to FButtons
.Count
- 1 do
976 TTntGroupButton(FButtons
[I
]).Caption
:= FItems
[I
];
977 if FItemIndex
>= 0 then
980 TTntGroupButton(FButtons
[FItemIndex
]).Checked
:= True;
987 procedure TTntCustomRadioGroup
.CMEnabledChanged(var Message: TMessage
);
992 for I
:= 0 to FButtons
.Count
- 1 do
993 TTntGroupButton(FButtons
[I
]).Enabled
:= Enabled
;
996 procedure TTntCustomRadioGroup
.CMFontChanged(var Message: TMessage
);
1002 procedure TTntCustomRadioGroup
.WMSize(var Message: TWMSize
);
1008 function TTntCustomRadioGroup
.CanModify
: Boolean;
1013 procedure TTntCustomRadioGroup
.GetChildren(Proc
: TGetChildProc
; Root
: TComponent
);
1017 function TTntCustomRadioGroup
.GetButtons(Index
: Integer): TTntRadioButton
;
1019 Result
:= TTntRadioButton(FButtons
[Index
]);
1024 procedure TTntSplitter
.DefineProperties(Filer
: TFiler
);
1027 TntPersistent_AfterInherited_DefineProperties(Filer
, Self
);
1030 function TTntSplitter
.IsHintStored
: Boolean;
1032 Result
:= TntControl_IsHintStored(Self
)
1035 function TTntSplitter
.GetHint
: WideString
;
1037 Result
:= TntControl_GetHint(Self
)
1040 procedure TTntSplitter
.SetHint(const Value
: WideString
);
1042 TntControl_SetHint(Self
, Value
);
1045 procedure TTntSplitter
.CMHintShow(var Message: TMessage
);
1047 ProcessCMHintShowMsg(Message);
1051 procedure TTntSplitter
.ActionChange(Sender
: TObject
; CheckDefaults
: Boolean);
1053 TntControl_BeforeInherited_ActionChange(Self
, Sender
, CheckDefaults
);
1057 function TTntSplitter
.GetActionLinkClass
: TControlActionLinkClass
;
1059 Result
:= TntControl_GetActionLinkClass(Self
, inherited GetActionLinkClass
);