![]()
je suis entrain de realiser un petit composant avec 2 stringlist et j'utilse l'unitè JclUnicode pour gerer l'unicode :
et voici ce que j'ai eu dans l'inspecteur d'objet :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 private FList: TStringList; FListW: TWideStringList; function GetList(const i{index}: Integer): TStrings; function GetListW(const i: Integer): TWideStrings; procedure SetList(const i: Integer; const Value: TStrings); procedure SetListW(const i: Integer; const Value: TWideStrings); public . ... published property MaListe: TStrings index {index} read GetList write SetList stored True; property MaListeW: TWideStrings index {index} read GetListW write SetListW stored True; end;
maLsite avec le petit bouton qui me permet de modifier la liste et malisteW avec un + qui n'a aucun effet.
je ne sais pas si c'est un bug dans la declaration de la TWideStringList dans la jvcl ou c'est quelque chose qui m'echape![]()
voici un bout de l'unitè JclUnicode pour ceux qui n'ont pas la la jvcl :
Je remercie d'avance celui(ceux) qui m'eclairera(ont) sur ce point!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140 TConfirmConversionEvent = procedure (Sender: TWideStrings; var Allowed: Boolean) of object; TWideStrings = class(TPersistent) private FUpdateCount: Integer; FLanguage: LCID; // language can usually left alone, the system's default is used FSaved: Boolean; // set in SaveToStream, True in case saving was successfull otherwise False FNormalizationForm: TNormalizationForm; // determines in which form Unicode strings should be stored FOnConfirmConversion: TConfirmConversionEvent; FSaveFormat: TSaveFormat; // overrides the FSaveUnicode flag, initialized when a file is loaded, // expect losses if it is set to sfAnsi before saving function GetCommaText: WideString; function GetName(Index: Integer): WideString; function GetValue(const Name: WideString): WideString; procedure ReadData(Reader: TReader); procedure SetCommaText(const Value: WideString); procedure SetNormalizationForm(const Value: TNormalizationForm); procedure SetValue(const Name, Value: WideString); procedure WriteData(Writer: TWriter); function GetSaveUnicode: Boolean; procedure SetSaveUnicode(const Value: Boolean); protected procedure DefineProperties(Filer: TFiler); override; procedure DoConfirmConversion(var Allowed: Boolean); virtual; procedure Error(const Msg: string; Data: Integer); function Get(Index: Integer): WideString; virtual; abstract; function GetCapacity: Integer; virtual; function GetCount: Integer; virtual; abstract; function GetObject(Index: Integer): TObject; virtual; function GetTextStr: WideString; virtual; procedure Put(Index: Integer; const S: WideString); virtual; abstract; procedure PutObject(Index: Integer; AObject: TObject); virtual; abstract; procedure SetCapacity(NewCapacity: Integer); virtual; procedure SetUpdateState(Updating: Boolean); virtual; procedure SetLanguage(Value: LCID); virtual; public constructor Create; function Add(const S: WideString): Integer; virtual; function AddObject(const S: WideString; AObject: TObject): Integer; virtual; procedure Append(const S: WideString); procedure AddStrings(Strings: TStrings); overload; virtual; procedure AddStrings(Strings: TWideStrings); overload; virtual; procedure Assign(Source: TPersistent); override; procedure AssignTo(Dest: TPersistent); override; procedure BeginUpdate; procedure Clear; virtual; abstract; procedure Delete(Index: Integer); virtual; abstract; procedure EndUpdate; function Equals(Strings: TWideStrings): Boolean; procedure Exchange(Index1, Index2: Integer); virtual; function GetSeparatedText(Separators: WideString): WideString; virtual; function GetText: PWideChar; virtual; function IndexOf(const S: WideString): Integer; virtual; function IndexOfName(const Name: WideString): Integer; function IndexOfObject(AObject: TObject): Integer; procedure Insert(Index: Integer; const S: WideString); virtual; abstract; procedure InsertObject(Index: Integer; const S: WideString; AObject: TObject); procedure LoadFromFile(const FileName: string); virtual; procedure LoadFromStream(Stream: TStream); virtual; procedure Move(CurIndex, NewIndex: Integer); virtual; procedure SaveToFile(const FileName: string); virtual; procedure SaveToStream(Stream: TStream; WithBOM: Boolean = True); virtual; procedure SetText(const Value: WideString); virtual; property Capacity: Integer read GetCapacity write SetCapacity; property CommaText: WideString read GetCommaText write SetCommaText; property Count: Integer read GetCount; property Language: LCID read FLanguage write SetLanguage; property Names[Index: Integer]: WideString read GetName; property NormalizationForm: TNormalizationForm read FNormalizationForm write SetNormalizationForm default nfC; property Objects[Index: Integer]: TObject read GetObject write PutObject; property Values[const Name: WideString]: WideString read GetValue write SetValue; property Saved: Boolean read FSaved; property SaveUnicode: Boolean read GetSaveUnicode write SetSaveUnicode default True; property SaveFormat: TSaveFormat read FSaveFormat write FSaveFormat default sfUnicodeLSB; property Strings[Index: Integer]: WideString read Get write Put; default; property Text: WideString read GetTextStr write SetText; property OnConfirmConversion: TConfirmConversionEvent read FOnConfirmConversion write FOnConfirmConversion; end; //----- TWideStringList class TDynWideCharArray = array of WideChar; TWideStringItem = record {$IFDEF OWN_WIDESTRING_MEMMGR} FString: PWideChar; // "array of WideChar"; {$ELSE} FString: WideString; {$ENDIF OWN_WIDESTRING_MEMMGR} FObject: TObject; end; TWideStringItemList = array of TWideStringItem; TWideStringList = class(TWideStrings) private FList: TWideStringItemList; FCount: Integer; FSorted: Boolean; FDuplicates: TDuplicates; FOnChange: TNotifyEvent; FOnChanging: TNotifyEvent; procedure ExchangeItems(Index1, Index2: Integer); procedure Grow; procedure QuickSort(L, R: Integer); procedure InsertItem(Index: Integer; const S: WideString); procedure SetSorted(Value: Boolean); {$IFDEF OWN_WIDESTRING_MEMMGR} procedure SetListString(Index: Integer; const S: WideString); {$ENDIF OWN_WIDESTRING_MEMMGR} protected procedure Changed; virtual; procedure Changing; virtual; function Get(Index: Integer): WideString; override; function GetCapacity: Integer; override; function GetCount: Integer; override; function GetObject(Index: Integer): TObject; override; procedure Put(Index: Integer; const S: WideString); override; procedure PutObject(Index: Integer; AObject: TObject); override; procedure SetCapacity(NewCapacity: Integer); override; procedure SetUpdateState(Updating: Boolean); override; procedure SetLanguage(Value: LCID); override; public destructor Destroy; override; function Add(const S: WideString): Integer; override; procedure Clear; override; procedure Delete(Index: Integer); override; procedure Exchange(Index1, Index2: Integer); override; function Find(const S: WideString; var Index: Integer): Boolean; virtual; function IndexOf(const S: WideString): Integer; override; procedure Insert(Index: Integer; const S: WideString); override; procedure Sort; virtual; property Duplicates: TDuplicates read FDuplicates write FDuplicates; property Sorted: Boolean read FSorted write SetSorted; property OnChange: TNotifyEvent read FOnChange write FOnChange; property OnChanging: TNotifyEvent read FOnChanging write FOnChanging; end;
Partager