| 17 |
FDictionary : TStringList; ///< 登録単語と定型文の辞書 |
FDictionary : TStringList; ///< 登録単語と定型文の辞書 |
| 18 |
function GetSorted: Boolean; ///< ソートの状態の取得 |
function GetSorted: Boolean; ///< ソートの状態の取得 |
| 19 |
procedure SetSorted(Value: Boolean); ///< ソート状態の設定 |
procedure SetSorted(Value: Boolean); ///< ソート状態の設定 |
| 20 |
|
|
| 21 |
public |
public |
| 22 |
{ Public 宣言 } |
{ Public 宣言 } |
| 23 |
property Sorted : Boolean read GetSorted write SetSorted; |
property Sorted : Boolean read GetSorted write SetSorted; |
| 50 |
property Category: String read FCategory write FCategory; |
property Category: String read FCategory write FCategory; |
| 51 |
property Text: String read GetText write SetText; |
property Text: String read GetText write SetText; |
| 52 |
end; |
end; |
| 53 |
|
|
| 54 |
|
function CategorySort(List: TStringList; Index1, Index2: Integer): Integer; |
| 55 |
var |
var |
| 56 |
InputAssistDM: TInputAssistDM; |
InputAssistDM: TInputAssistDM; |
| 57 |
|
|
| 288 |
resWord.GetCategory + ')', resWord); |
resWord.GetCategory + ')', resWord); |
| 289 |
end; |
end; |
| 290 |
end; |
end; |
| 291 |
|
list.CustomSort(CategorySort); |
| 292 |
end; |
end; |
| 293 |
end; |
end; |
| 294 |
|
|
| 295 |
//! ソートの状態の取得 |
//! ソートの状態の取得 |
| 296 |
function TInputAssistDM.GetSorted: Boolean; |
function TInputAssistDM.GetSorted: Boolean; |
| 297 |
begin |
begin |
| 308 |
end; |
end; |
| 309 |
end; |
end; |
| 310 |
|
|
| 311 |
|
//! Keyをカテゴリに持つ登録単語を返す時のソート用比較メソッド |
| 312 |
|
function CategorySort(List: TStringList; Index1, Index2: Integer): Integer; |
| 313 |
|
var |
| 314 |
|
resWord1 : TResistWord; |
| 315 |
|
resWord2 : TResistWord; |
| 316 |
|
begin |
| 317 |
|
Result := 0; |
| 318 |
|
try |
| 319 |
|
resWord1 := TResistWord(List.Objects[Index1]); |
| 320 |
|
resWord2 := TResistWord(List.Objects[Index2]); |
| 321 |
|
Result := AnsiCompareStr(resWord1.GetCategory, resWord2.GetCategory); |
| 322 |
|
if (Result = 0) then begin |
| 323 |
|
Result := AnsiCompareStr(resWord1.GetKey, resWord2.GetKey); |
| 324 |
|
end; |
| 325 |
|
except |
| 326 |
|
end; |
| 327 |
|
end; |
| 328 |
|
|
| 329 |
end. |
end. |