Develop and Download Open Source Software

Browse CVS Repository

Diff of /gikonavigoeson/gikonavi/InputAssistDataModule.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1 by h677, Sat Jan 14 07:44:14 2006 UTC revision 1.2 by h677, Sun Jan 15 16:44:50 2006 UTC
# Line 17  type Line 17  type
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;
# Line 49  type Line 50  type
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    
# Line 285  begin Line 288  begin
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
# Line 303  begin Line 308  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.

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26