source: trunk/Components/MultiColumnListBox.pas

Last change on this file was 458, checked in by ataylor, 2 years ago

Update ConfigApps to use dynamic font size & scaling, version set to 1.2.1.
Added SetColumnWidth method to MultiColumnListBox control.

  • Property svn:eol-style set to native
File size: 20.1 KB
RevLine 
[15]1unit MultiColumnListBox;
2
3interface
4
5uses
6 Messages, SysUtils, Classes, Graphics, Forms, Dialogs,
7 StdCtrls, ComCtrls, CustomHeaderControl; // menus for SPCC v2.5+
8
9const
10 mclbImageMarker = #11;
11
12type
13 TMultiColumnListBox = class(TControl)
14 protected
15 FHeader: TCustomHeaderControl;
16 FLIstBox: TListBox;
17 FImageList: TImageList;
18
19 FSavedSelectedObject: TObject;
20
21 FBorderStyle: TBorderStyle;
22 Procedure SetBorderStyle( NewValue: TBorderStyle );
23
24 function GetHeaderPenColor: TColor;
25 procedure SetHeaderPenColor( NewValue: TColor );
26 function GetListPenColor: TColor;
27 procedure SetListPenColor( NewValue: TColor );
28
29 function GetEnabled: boolean; //override;
30 function GetExtendedSelect: boolean;
31 function GetHeaderFont: TFont;
32 function GetHeaderHeight: integer;
33 function GetHeaderParentFont: boolean;
34 function GetItemHeight: integer;
35 function GetListFont: TFont;
36 function GetListParentFont: boolean;
37 function GetMultiSelect: boolean;
38 function GetParentColor: boolean;
39 function GetParentShowHint: boolean;
[458]40 function GetThePopupMenu: TPopupMenu;
[15]41 function GetShowHint: boolean;
42// procedure SetEnabled(NewState:Boolean); override;
43 procedure SetExtendedSelect(const Value: boolean);
44 procedure SetHeaderFont(const Value: TFont);
45 procedure SetHeaderHeight(const Value: integer);
46 procedure SetHeaderParentFont(const Value: boolean);
47 procedure SetItemHeight(const Value: integer);
48 procedure SetListFont(const Value: TFont);
49 procedure SetListParentFont(const Value: boolean);
50 procedure SetMultiSelect(const Value: boolean);
51 procedure SetParentShowHint(const Value: boolean);
52 procedure SetPopupMenu(const Value: TPopupMenu);
53 procedure SetShowHint(const Value: boolean);
54 procedure SetSelectedObject(const Value: TObject);
55 function GetOnClick: TNotifyEvent;
56 procedure SetOnClick(const Value: TNotifyEvent);
57 function GetOnDblClick: TNotifyEvent;
58 procedure SetOnDblClick(const Value: TNotifyEvent);
59 procedure SetSelectedItem(const Value: string);
60 function GetTopObject: TObject;
61 procedure SetTopObject(const Value: TObject);
62
63 function GetItems: TStrings;
64 procedure SetItems( Items: TStrings );
65 function GetHeaderSections: TCustomHeaderSections;
66 procedure SetHeaderSections( Sections: TCustomHeaderSections );
67 function GetSelectedItem: string;
68 function GetSelectedObject: TObject;
69 function GetItemIndex: integer;
70 procedure SetItemIndex( const Value: integer );
71 procedure SetImageList( ImageList: TImageList );
72 procedure Notification( AComponent: TComponent;
73 Operation: TOperation); override;
74
75 procedure SetOnItemFocus( Value: TItemFocusEvent );
76 function GetOnItemFocus: TItemFocusEvent;
77 function GetOnItemSelect: TItemSelectEvent;
78 procedure SetOnItemSelect( Value: TItemSelectEvent );
79
80 function GetOnEnter: TNotifyEvent;
81 procedure SetOnEnter( Value: TNotifyEvent );
82 function GetOnExit: TNotifyEvent;
83 procedure SetOnExit( Value: TNotifyEvent );
84
85 procedure SetSelected( Index: longint; Value: boolean );
86 function GetSelected( Index: longint ): boolean;
87
88 Procedure SetColor(NewColor:TColor); Override;
89
90 procedure Layout;
91 procedure DrawListBoxItem( Sender: TObject;
92 Index: longint;
93 Rect: TRect;
94 State: TOwnerDrawState );
95 procedure ChangeHeader( HeaderControl: TCustomHeaderControl;
96 Section: TCustomHeaderSection );
97 procedure Resize; override;
98 procedure SetupShow; override;
99 procedure SetupComponent; override;
100
101 Procedure ReadSCUResource(Const ResName:TResourceName;Var Data;DataLen:LongInt);Override;
102 Function WriteSCUResource(Stream:TResourceStream):Boolean;Override;
103
104 function GetTabStop:boolean;
105 procedure SetTabStop(Value:boolean);
106
107 procedure WMFocussing( Var Msg: TMessage ); message WM_FOCUSSING;
108 public
109 destructor Destroy; override;
110
111 property ItemIndex: integer read GetItemIndex write SetItemIndex;
112 property SelectedItem: string read GetSelectedItem write SetSelectedItem;
113 property SelectedObject: TObject read GetSelectedObject write SetSelectedObject;
114 property TopObject: TObject read GetTopObject write SetTopObject;
115
116 procedure SetSelectedItemTo( Text: string );
117 property Selected[ Index: longint ]: boolean read GetSelected write SetSelected;
118
[458]119 procedure SetColumnWidth( const Index: Integer;
120 const NewWidth: Integer );
121
[15]122 property Parent;
123
124 published
125 property Items: TStrings
126 read GetItems
127 write SetItems;
128 property HeaderColumns: TCustomHeaderSections
129 read GetHeaderSections
130 write SetHeaderSections;
131 property ImageList: TImageList
132 read FImageList
133 write SetImageList;
134
135 Property BorderStyle:TBorderStyle read FBorderStyle write SetBorderStyle;
136
137 property ListPenColor: TColor read GetListPenColor write SetListPenColor;
138 property HeaderPenColor: TColor read GetHeaderPenColor write SetHeaderPenColor;
139
140 property ListFont: TFont read GetListFont write SetListFont;
141 property ListParentFont: boolean read GetListParentFont write SetListParentFont;
142
143 property HeaderFont: TFont read GetHeaderFont write SetHeaderFont;
144 property HeaderParentFont: boolean read GetHeaderParentFont write SetHeaderParentFont;
145
146 property ShowHint: boolean read GetShowHint write SetShowHint;
147 property ParentShowHint: boolean read GetParentShowHint write SetParentShowHint;
148
149 property PopupMenu: TPopupMenu read GetThePopupMenu write SetPopupMenu;
150
151 property HeaderHeight: integer read GetHeaderHeight write SetHeaderHeight;
152 property ItemHeight: integer read GetItemHeight write SetItemHeight;
153
154 property MultiSelect: boolean read GetMultiSelect write SetMultiSelect;
155 property ExtendedSelect: boolean read GetExtendedSelect write SetExtendedSelect;
156
157 property Enabled; //: boolean read GetEnabled write SetEnabled;
158
159 property Align;
160 property Color;
161 property ParentColor;
162 property TabStop: boolean read GetTabStop write SetTabStop;
163 property TabOrder;
164
165 // Events
166 property OnClick: TNotifyEvent read GetOnClick write SetOnClick;
167 property OnDblClick: TNotifyEvent read GetOnDblClick write SetOnDblClick;
168 property OnItemFocus: TItemFocusEvent read GetOnItemFocus write SetOnItemFocus;
169 property OnItemSelect: TItemSelectEvent read GetOnItemSelect write SetOnItemSelect;
170 property OnEnter: TNotifyEvent read GetOnEnter write SetOnEnter;
171 property OnExit: TNotifyEvent read GetOnExit write SetOnExit;
172 end;
173
174exports
175 TMultiColumnListBox, 'User', 'MultiColumnListBox.bmp';
176
177implementation
178
179uses
[396]180 StringUtilsUnit;
[458]181
[15]182{ TMultiColumnListBox }
183
184procedure TMultiColumnListBox.SetupComponent;
185var
186 Section: TCustomHeaderSection;
187begin
188 inherited SetupComponent;
189
190 Width := 100;
191 Height := 100;
192
193 ParentCOlor := true;
194
195 Name := 'MultiColumnListBox';
196
197 FTabStop := false;
198
199 FHeader := TCustomHeaderControl.Create( Self );
200 FHeader.Parent := self;
201 FHeader.Height := 22;
202 FHeader.BevelWidth := 1;
203 FHeader.TabStop := false;
204 Include( FHeader.ComponentState, csDetail );
205
206 // Create a couple of default header sections
207 // so it's obvious that it's there.
208 Section := FHeader.Sections.Add;
209 Section.Text := 'Column 1';
210 Section.AllowClick := false;
211 Section := FHeader.Sections.Add;
212 Section.Text := 'Column 2';
213
214 FListBox := TListBox.Create( Self );
215 FListBox.Parent := self;
216// FListBox.ItemHeight := 16;
217
218 FListBox.Style := lbOwnerDrawFixed;
219
220 FListBox.OnDrawItem := DrawListBoxItem;
221
222 FListBox.TabStop := true;
223 Include( FListBox.ComponentState, csDetail );
224 FListBox.ParentColor := true;
225
226// FListBox.BorderStyle := bsNone; // we draw it ourselves
227
228 FHeader.OnSectionResize := ChangeHeader;
229
230 FImageList := nil;
231
232// FAlwaysFocusChild := FListBox;
233
234 Layout;
235
236end;
237
238procedure TMultiColumnListBox.SetupShow;
239begin
240 Layout;
241end;
242
243destructor TMultiColumnListBox.Destroy;
244begin
245 inherited Destroy;
246end;
247
248Procedure TMultiColumnListBox.ReadSCUResource( Const ResName: TResourceName;
249 Var Data;DataLen: LongInt );
250begin
251 if ResName = rnHeaders then
252 FHeader.ReadSCUResource( ResName, Data, DataLen )
253 else
254 inherited ReadSCUResource( ResName, Data, DataLen );
255
256end;
257
258Function TMultiColumnListBox.WriteSCUResource( Stream: TResourceStream ): Boolean;
259begin
260 Result := Inherited WriteSCUResource(Stream);
261 If Not Result Then
262 Exit;
263 FHeader.WriteScuResource( Stream );
264end;
265
266procedure TMultiColumnListBox.WMFocussing( Var Msg: TMessage );
267begin
268 // focus listbox instead
269 Msg.Result := LONGWORD( FListBox );
270 msg.Handled := true;
271end;
272
273function TMultiColumnListBox.GetTabStop:boolean;
274begin
275 result:=FListBox.TabStop;
276end;
277
278procedure TMultiColumnListBox.SetTabStop(Value:boolean);
279begin
280 FListBox.TabStop:=Value;
281end;
282
283procedure TMultiColumnListBox.DrawListBoxItem( Sender: TObject;
284 Index: longint;
285 Rect: TRect;
286 State: TOwnerDrawState );
287var
288 ColumnIndex: integer;
289 X: integer;
290 ItemToDraw: string;
291 Line: string;
292 BitmapIndex: integer;
293 ColumnWidth: integer;
294 ItemRect: TRect;
295 Dest: TRect;
296 LineClipRect: TRect;
[396]297 tmpColumns : TStringList;
298 i : longint;
[15]299begin
300 LineClipRect := FListBox.Canvas.ClipRect;
301
302 ColumnIndex := 0;
303
304 Dest := rect;
305 dec( Dest.top ); // minor adjustments since we seem to get a slightly
306 inc( Dest.left ); // incorrect area to draw on...
307
308 X := Dest.Left;
309 Line := FListBox.Items[ Index ];
310
311 with FListBox.Canvas do
312 begin
313 Pen.Color := FListBox.PenColor;
314 Brush.Color := FListBox.Color;
315 IF State * [odSelected] <> [] THEN
316 begin
317 Brush.Color := clHighLight;
318 Pen.Color := Color;
319 end;
320
321 FillRect( Dest, Brush.Color );
322 end;
323
[396]324 tmpColumns := TStringList.Create;
325 StrExtractStrings(tmpColumns, Line, [#9], #0);
326
327 for i := 0 to tmpColumns.Count - 1 do
[15]328 begin
[396]329 ItemToDraw := tmpColumns[i];
[15]330 if ColumnIndex < FHeader.Sections.Count then
331 ColumnWidth := FHeader.Sections[ ColumnIndex ].Width
332 else
333 ColumnWidth := 50;
334
335 ItemRect := Dest;
336 ItemRect.Left := X;
337 ItemRect.Right := X + ColumnWidth - 2;
338 FListBox.Canvas.ClipRect := IntersectRect( LineClipRect,
339 ItemRect );
340
341 if StrLeft( ItemToDraw, 1 ) = mclbImageMarker then
342 begin
343 Delete( ItemToDraw, 1, 1 );
344 try
345 BitmapIndex := StrToInt( ItemToDraw );
346 except
347 BitmapIndex := -1;
348 end;
349 if Assigned( FImageList ) then
350 if ( BitmapIndex >= 0 )
351 and ( BitmapIndex < FImageList.Count ) then
352 begin
353 FImageList.Draw( FListBox.Canvas,
354 X, Dest.Bottom,
355 BitmapIndex );
356 end
357 else
[396]358 begin
359 tmpColumns.Destroy;
[15]360 raise Exception.Create( 'Bitmap index out of range in MultiColumnListBox' )
[396]361 end
[15]362 else
[396]363 begin
364 tmpColumns.Destroy;
[15]365 raise Exception.Create( 'No imagelist assigned in MultiColumnListBox' );
[396]366 end
[15]367 end
368 else
369 begin
370 FListBox.Canvas.TextOut( X, Dest.Bottom,
371 ItemToDraw );
372 end;
373 inc( X, ColumnWidth );
374 inc( ColumnIndex );
375 end;
[396]376 tmpColumns.Destroy;
[15]377end;
378
379procedure TMultiColumnListBox.SetItems( Items: TStrings );
380begin
381 FListBox.Items.Assign( Items );
382end;
383
384function TMultiColumnListBox.GetHeaderSections: TCustomHeaderSections;
385begin
386 Result := FHeader.Sections;
387end;
388
389function TMultiColumnListBox.GetItems: TStrings;
390begin
391 Result := FListBox.Items;
392end;
393
394procedure TMultiColumnListBox.Layout;
395var
396 LastSection: TCustomHeaderSection;
397begin
398 FHeader.Align := alTop;
399
400 //FListBox.Align := alClient;
401{
402 if FBorderStyle = bsNone then
403 begin
404}
405 FListBox.Left := 0;
406 FListBox.Width := Width;
407 FListBox.Bottom := 0;
408 FListBox.Height := Height - FHeader.Height + 2; // hide the top edge under header
409 FListBox.SendToBack;
410{
411 end
412 else
413 begin
414 FListBox.Left := 2;
415 FListBox.Width := Width - 4;
416 FListBox.Bottom := 2;
417 FListBox.Height := Height - FHeader.Height - 4;
418 end;
419}
420
421 if HeaderColumns.Count > 0 then
422 begin
423 // Resize the last column to fit, if possible
424 LastSection := HeaderColumns[ HeaderColumns.Count - 1 ];
425 if LastSection.Left < Width then
426 LastSection.Width := Width - LastSection.Left;
427 end;
428
429end;
430
431procedure TMultiColumnListBox.SetBorderStyle( NewValue: TBorderStyle );
432begin
433 if NewValue = FBorderStyle then
434 exit;
435 FBorderStyle := NewValue;
436 Layout;
437 Invalidate;
438end;
439
440procedure TMultiColumnListBox.SetImageList(ImageList: TImageList);
441begin
442 if FImageList <> nil then
443 // Tell the old imagelist not to inform us any more
444 FImageList.Notification( Self, opRemove );
445
446 FImageList := ImageList;
447
448 if FImageList <> nil then
449 begin
450 // request notification when other is freed
451 FImageList.FreeNotification( Self );
452 end;
453end;
454
455procedure TMultiColumnListBox.SetHeaderSections(Sections: TCustomHeaderSections);
456begin
457 FHeader.Sections.Assign( Sections );
458end;
459
[458]460procedure TMultiColumnListBox.SetColumnWidth( const Index: Integer;
461 const NewWidth: Integer );
462begin
463 FHeader.Sections[ Index ].Width := NewWidth;
464 Layout;
465 Invalidate;
466end;
467
[15]468procedure TMultiColumnListBox.Notification( AComponent: TComponent;
469 Operation: TOperation);
470begin
471 inherited Notification( AComponent, Operation );
472 if AComponent = FImageList then
473 if Operation = opRemove then
474 // Image list is being destroyed
475 FImageList := nil;
476end;
477
478procedure TMultiColumnListBox.ChangeHeader(HeaderControl: TCustomHeaderControl;
479 Section: TCustomHeaderSection);
480begin
481 Layout;
482 FListBox.Invalidate;
483end;
484
485function TMultiColumnListBox.GetSelectedItem: string;
486begin
487 Result := '';
488 if FListBox.ItemIndex <> -1 then
489 Result := FListBox.Items[ FListBox.ItemIndex ];
490end;
491
492function TMultiColumnListBox.GetSelectedObject: TObject;
493begin
494 Result := nil;
495 if FListBox.ItemIndex <> -1 then
496 Result := FListBox.Items.Objects[ FListBox.ItemIndex ];
497
498end;
499
500procedure TMultiColumnListBox.SetItemIndex(const Value: integer );
501begin
502 FListBox.ItemIndex := Value;
503end;
504
505function TMultiColumnListBox.GetItemIndex: integer;
506begin
507 Result := FListBox.ItemIndex;
508end;
509
510function TMultiColumnListBox.GetHeaderPenColor: TColor;
511begin
512 Result := FHeader.PenColor;
513end;
514
515procedure TMultiColumnListBox.SetHeaderPenColor( NewValue: TColor );
516begin
517 FHeader.PenColor := NewValue;
518end;
519
520function TMultiColumnListBox.GetListPenColor: TColor;
521begin
522 Result := FListBox.PenColor;
523end;
524
525procedure TMultiColumnListBox.SetListPenColor( NewValue: TColor );
526begin
527 FListBox.PenColor := NewValue;
528end;
529
530function TMultiColumnListBox.GetEnabled: boolean;
531begin
532 Result := FListBox.Enabled;
533end;
534
535function TMultiColumnListBox.GetExtendedSelect: boolean;
536begin
537 Result := FListBox.ExtendedSelect;
538end;
539
540function TMultiColumnListBox.GetHeaderFont: TFont;
541begin
542 Result := FHeader.Font;
543end;
544
545function TMultiColumnListBox.GetHeaderHeight: integer;
546begin
547 Result := FHeader.Height;
548end;
549
550function TMultiColumnListBox.GetHeaderParentFont: boolean;
551begin
552 Result := FHeader.ParentFont;
553end;
554
555function TMultiColumnListBox.GetItemHeight: integer;
556begin
557 Result := FListBox.ItemHeight;
558end;
559
560function TMultiColumnListBox.GetListFont: TFont;
561begin
562 Result := FListBox.Font;
563end;
564
565function TMultiColumnListBox.GetListParentFont: boolean;
566begin
567 Result := FListBox.ParentFont;
568end;
569
570function TMultiColumnListBox.GetMultiSelect: boolean;
571begin
572 Result := FListBox.MultiSelect;
573end;
574
575function TMultiColumnListBox.GetParentColor: boolean;
576begin
577 Result := FListBox.ParentColor;
578end;
579
580function TMultiColumnListBox.GetParentShowHint: boolean;
581begin
582 Result := FListBox.ParentShowHint;
583end;
584
585function TMultiColumnListBox.GetThePopupMenu: TPopupMenu;
586begin
587 Result := FListBox.PopupMenu;
588end;
589
590function TMultiColumnListBox.GetShowHint: boolean;
591begin
592 Result := FListBox.ShowHint;
593end;
594
595{
596procedure TMultiColumnListBox.SetEnabled(NewState:Boolean);
597begin
598 FListBox.Enabled := NewState;
599 FHeader.Enabled := NewState;
600end;
601}
602
603procedure TMultiColumnListBox.SetExtendedSelect(const Value: boolean);
604begin
605 FListBox.ExtendedSelect := Value;
606end;
607
608procedure TMultiColumnListBox.SetHeaderFont(const Value: TFont);
609begin
610 FHeader.Font := Value;
611end;
612
613procedure TMultiColumnListBox.SetHeaderHeight(const Value: integer);
614begin
615 FHeader.Height := Value;
[458]616 Layout;
[15]617end;
618
619procedure TMultiColumnListBox.SetHeaderParentFont(const Value: boolean);
620begin
621 FHeader.ParentFont := Value;
622end;
623
624procedure TMultiColumnListBox.SetItemHeight(const Value: integer);
625begin
626 FListBox.ItemHeight := Value;
627end;
628
629procedure TMultiColumnListBox.SetListFont(const Value: TFont);
630begin
631 FListBox.Font := Value;
632end;
633
634procedure TMultiColumnListBox.SetListParentFont(const Value: boolean);
635begin
636 FListBox.ParentFont := Value;
637end;
638
639procedure TMultiColumnListBox.SetMultiSelect(const Value: boolean);
640begin
641 FListBox.MultiSelect := Value;
642end;
643
644procedure TMultiColumnListBox.SetParentShowHint(const Value: boolean);
645begin
646 FListBox.ParentShowHint := Value;
647 FHeader.ParentShowHint := Value;
648end;
649
650procedure TMultiColumnListBox.SetPopupMenu(const Value: TPopupMenu);
651begin
652 FListBox.PopupMenu := Value;
653 FHeader.PopupMenu := Value;
654end;
655
656procedure TMultiColumnListBox.SetShowHint(const Value: boolean);
657begin
658 FListBox.ShowHint := Value;
659 FHeader.ShowHint := Value;
660end;
661
662procedure TMultiColumnListBox.SetSelectedObject(const Value: TObject);
663var
664 Index: integer;
665begin
666 Index := FListBox.Items.IndexOfObject( Value );
667 FListBox.ItemIndex := Index;
668end;
669
670function TMultiColumnListBox.GetOnClick: TNotifyEvent;
671begin
672 Result := FListBox.OnClick;
673end;
674
675procedure TMultiColumnListBox.SetOnClick(const Value: TNotifyEvent);
676begin
677 FListBox.OnClick := Value;
678end;
679
680function TMultiColumnListBox.GetOnDblClick: TNotifyEvent;
681begin
682 Result := FListBox.OnDblClick;
683end;
684
685procedure TMultiColumnListBox.SetOnDblClick(const Value: TNotifyEvent);
686begin
687 FListBox.OnDblClick := Value;
688end;
689
690procedure TMultiColumnListBox.SetSelectedItem(const Value: string);
691var
692 Index: integer;
693begin
694 Index := FListBox.Items.IndexOf( Value );
695 FListBox.ItemIndex := Index;
696end;
697
698procedure TMultiColumnListBox.SetSelectedItemTo(Text: string );
699begin
700 if ItemIndex = -1 then
701 raise Exception.Create( 'MultiColumnListBox: no item selected to set!' );
702
703 Items[ ItemIndex ] := Text;
704end;
705
706procedure TMultiColumnListBox.Resize;
707begin
708 Layout;
709end;
710
711
712function TMultiColumnListBox.GetTopObject: TObject;
713begin
714 Result := nil;
715 if ( FListBox.TopIndex >0 )
716 and ( FListBox.TopIndex < FListBox.Items.Count ) then
717 Result := FListBox.Items.Objects[ FLIstBox.TopIndex ];
718
719end;
720
721procedure TMultiColumnListBox.SetTopObject(const Value: TObject);
722var
723 Index: integer;
724begin
725 Index := FListBox.Items.IndexOfObject( Value );
726 if Index <> -1 then
727 FListBox.TopIndex := Index;
728end;
729
730procedure TMultiColumnListBox.SetOnItemFocus( Value: TItemFocusEvent );
731begin
732 FListBox.OnItemFocus := Value;
733end;
734
735function TMultiColumnListBox.GetOnItemFocus: TItemFocusEvent;
736begin
737 Result := FListBox.OnItemFocus;
738end;
739
740function TMultiColumnListBox.GetOnItemSelect: TItemSelectEvent;
741begin
742 Result := FListBox.OnItemSelect;
743end;
744
745procedure TMultiColumnListBox.SetOnItemSelect( Value: TItemSelectEvent );
746begin
747 FListBox.OnItemSelect := Value;
748end;
749
750function TMultiColumnListBox.GetOnEnter: TNotifyEvent;
751begin
752 Result := FListBox.OnEnter;
753end;
754
755procedure TMultiColumnListBox.SetOnEnter( Value: TNotifyEvent );
756begin
757 FListBox.OnEnter := Value;
758end;
759
760function TMultiColumnListBox.GetOnExit: TNotifyEvent;
761begin
762 Result := FListBox.OnExit;
763end;
764
765procedure TMultiColumnListBox.SetOnExit( Value: TNotifyEvent );
766begin
767 FListBox.OnExit := Value;
768end;
769
770procedure TMultiColumnListBox.SetSelected( Index: longint; Value: boolean );
771begin
772 FListBox.Selected[ Index ] := Value;
773end;
774
775function TMultiColumnListBox.GetSelected( Index: longint ): boolean;
776begin
777 Result := FListBox.Selected[ Index ];
778end;
779
780Procedure TMultiColumnListBox.SetColor(NewColor:TColor);
781begin
782 inherited SetColor( NewColor );
783end;
784
785Initialization
786 {Register classes}
787 RegisterClasses([TMultiColumnListBox]);
788end.
Note: See TracBrowser for help on using the repository browser.