From 3a7812a3992639a8ceb599c7d3757aa1b13bc881 Mon Sep 17 00:00:00 2001 From: h677 Date: Sun, 15 Jan 2006 16:44:50 +0000 Subject: [PATCH] =?utf8?q?=E3=82=AB=E3=83=86=E3=82=B4=E3=83=AA=E3=81=A7?= =?utf8?q?=E5=8F=96=E3=82=8B=E3=81=A8=E3=81=8D=E3=81=AB=E3=82=AB=E3=83=86?= =?utf8?q?=E3=82=B4=E3=83=AA=E3=81=A7=E3=82=BD=E3=83=BC=E3=83=88=E3=81=99?= =?utf8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- InputAssistDataModule.pas | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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. -- 2.11.0