OSDN Git Service

・板一覧更新の処理メッセージを追加
[gikonavigoeson/gikonavi.git] / Kotehan.pas
index b313a8c..ebd3ddb 100644 (file)
@@ -58,24 +58,35 @@ implementation
 
 procedure TKotehanDialog.FormCreate(Sender: TObject);
 var
-       i: Integer;
-       j: Integer;
+       i, j, k: Integer;
        Category: TCategory;
        Board: TBoard;
        KoteData: TKotehanData;
+    CenterForm: TCustomForm;
 begin
+    CenterForm := TCustomForm(Owner);
+    if Assigned(CenterForm) then begin
+        Left := ((CenterForm.Width - Width) div 2) + CenterForm.Left;
+        Top := ((CenterForm.Height - Height) div 2) + CenterForm.Top;
+    end else begin
+        Left := (Screen.Width - Width) div 2;
+        Top := (Screen.Height - Height) div 2;
+    end;
+
        FList := TList.Create;
 
-       for i := 0 to BBS2ch.Count - 1 do begin
-               Category := BBS2ch.Items[i];
-               for j := 0 to Category.Count - 1 do begin
-                       Board := Category.Items[j];
-                       KoteData := TKotehanData.Create;
-                       KoteData.FBoard := Board;
-                       KoteData.FKotehanName := Board.KotehanName;
-                       KoteData.FKotehanMail := Board.KotehanMail;
-                       FList.Add(KoteData);
-               end;
+  for k := 0 to Length( BBSs ) - 1 do begin
+    for i := 0 to BBSs[ k ].Count - 1 do begin
+      Category := BBSs[ k ].Items[i];
+      for j := 0 to Category.Count - 1 do begin
+        Board := Category.Items[j];
+        KoteData := TKotehanData.Create;
+        KoteData.FBoard := Board;
+        KoteData.FKotehanName := Board.KotehanName;
+        KoteData.FKotehanMail := Board.KotehanMail;
+        FList.Add(KoteData);
+      end;
+    end;
        end;
        ViewComboBox.Items.Add('\82·\82×\82Ä\95\\8e¦');
        ViewComboBox.Items.Add('\90Ý\92è\8dÏ\82Ì\82Ý\95\\8e¦');