From: h677 Date: Sun, 15 Jan 2006 16:44:50 +0000 (+0000) Subject: カテゴリで取るときにカテゴリでソートするように変更。 X-Git-Tag: v1_64_1_820~475 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3a7812a3992639a8ceb599c7d3757aa1b13bc881;p=gikonavigoeson%2Fgikonavi.git カテゴリで取るときにカテゴリでソートするように変更。 --- diff --git a/InputAssistDataModule.pas b/InputAssistDataModule.pas index 175f16c..e32220a 100644 --- a/InputAssistDataModule.pas +++ b/InputAssistDataModule.pas @@ -17,6 +17,7 @@ type FDictionary : TStringList; ///< “o˜^’PŒê‚Æ’èŒ^•¶‚ÌŽ«‘ function GetSorted: Boolean; ///< ƒ\[ƒg‚̏ó‘Ԃ̎擾 procedure SetSorted(Value: Boolean); ///< ƒ\[ƒgó‘Ԃ̐ݒè + public { Public éŒ¾ } property Sorted : Boolean read GetSorted write SetSorted; @@ -49,6 +50,8 @@ type property Category: String read FCategory write FCategory; property Text: String read GetText write SetText; end; + + function CategorySort(List: TStringList; Index1, Index2: Integer): Integer; var InputAssistDM: TInputAssistDM; @@ -285,8 +288,10 @@ begin resWord.GetCategory + ')', resWord); end; end; + list.CustomSort(CategorySort); end; end; + //! ƒ\[ƒg‚̏ó‘Ԃ̎擾 function TInputAssistDM.GetSorted: Boolean; begin @@ -303,4 +308,22 @@ begin end; end; +//! Key‚ðƒJƒeƒSƒŠ‚ÉŽ‚“o˜^’PŒê‚ð•Ô‚·Žž‚̃\[ƒg—p”äŠrƒƒ\ƒbƒh +function CategorySort(List: TStringList; Index1, Index2: Integer): Integer; +var + resWord1 : TResistWord; + resWord2 : TResistWord; +begin + Result := 0; + try + resWord1 := TResistWord(List.Objects[Index1]); + resWord2 := TResistWord(List.Objects[Index2]); + Result := AnsiCompareStr(resWord1.GetCategory, resWord2.GetCategory); + if (Result = 0) then begin + Result := AnsiCompareStr(resWord1.GetKey, resWord2.GetKey); + end; + except + end; +end; + end.