OSDN Git Service

Temporaly listup of all ghosts when HideGhosts is on
authornaru <bottle@mikage.to>
Sun, 6 Apr 2003 10:10:57 +0000 (10:10 +0000)
committernaru <bottle@mikage.to>
Sun, 6 Apr 2003 10:10:57 +0000 (10:10 +0000)
bottleclient/MainForm.pas

index f98da84..0b40017 100755 (executable)
@@ -1984,22 +1984,42 @@ end;
 
 procedure TfrmSender.cbxTargetGhostDrawItem(Control: TWinControl;
   Index: Integer; Rect: TRect; State: TOwnerDrawState);
+var AlignRight: boolean;
+    w: integer;
 begin
+  //\83S\81[\83X\83g\91I\91ð\83{\83b\83N\83X\82Ì\83I\81[\83i\81[\83h\83\8d\81[
   with cbxTargetGhost do begin
-    if Index > 0 then begin
+    AlignRight := false;
+    if Pref.HideGhosts and not FTargetGhostExpand and (Index = Items.Count-1) then
+    begin
+      // \81u\82·\82×\82Ä\95\\8e¦\81v
+      Canvas.Font.Color := clWindowText;
+      Canvas.Font.Style := [];
+      AlignRight := true;
+    end else if (Index > 0) then
+    begin
+      // \83S\81[\83X\83g\96¼\82ð\91I\91ð
       if SakuraSeeker.ProcessByName[Items[Index]] = nil then
-        Canvas.Font.Color := clRed
+        Canvas.Font.Color := clRed // \91\8dÝ\82µ\82È\82¢\83S\81[\83X\83g
       else
-        Canvas.Font.Color := clBlue;
+        Canvas.Font.Color := clBlue; // \91\8dÝ\82·\82é\83S\81[\83X\83g
       Canvas.Font.Style := [fsBold];
-    end else begin
+    end else
+    begin
       Canvas.Font.Color := clWindowText;
       Canvas.Font.Style := [];
     end;
     if odSelected in State then
       Canvas.Font.Color := clHighlightText;
-    cbxTargetGhost.Canvas.TextRect(Rect, Rect.Left, Rect.Top,
-      cbxTargetGhost.Items[Index]);
+    // \95`\89æ
+    if AlignRight then
+    begin
+      w := Canvas.TextWidth(cbxTargetGhost.Items[Index]);
+      Canvas.TextRect(Rect, Rect.Right - w, Rect.Top,
+        cbxTargetGhost.Items[Index]);
+    end else
+      Canvas.TextRect(Rect, Rect.Left, Rect.Top,
+        cbxTargetGhost.Items[Index]);
   end;
 end;
 
@@ -2025,7 +2045,7 @@ begin
     for i := 0 to SakuraSeeker.Count-1 do begin
       // \94j\91¹FMO\91Î\8dô\81BHWND\82Ì\92f\95Ð\82ª\8ec\82Á\82Ä\82¢\82é\82ªName\82ª\8fÁ\82¦\82Ä\82¢\82é\8fê\8d\87\82ª\82 \82é
       if Length(SakuraSeeker[i].Name) = 0 then Continue;
-      if Pref.HideGhosts then
+      if Pref.HideGhosts and not FTargetGhostExpand then
         if Pref.VisibleGhostsList.IndexOf(SakuraSeeker[i].Name) < 0 then
           Continue;
       if cbxTargetGhost.Items.IndexOf(SakuraSeeker[i].Name) < 0 then
@@ -2046,6 +2066,8 @@ begin
         end;
       end;
     end;
+    if Pref.HideGhosts and not FTargetGhostExpand then
+      Items.Add('\82·\82×\82Ä\95\\8e¦...');
   end;
 
 end;
@@ -2066,7 +2088,12 @@ begin
   UpdateIfGhostBox;
   i := cbxTargetGhost.ItemIndex;
   Dec(i);
-  if i <= -1 then i := cbxTargetGhost.Items.Count-1;
+  if i <= -1 then
+  begin
+    i := cbxTargetGhost.Items.Count-1;
+    if Pref.HideGhosts and not FTargetGhostExpand then
+      i := i - 1;
+  end;
   cbxTargetGhost.ItemIndex := i;
   cbxTargetGhostChange(self);
 end;
@@ -2078,7 +2105,13 @@ begin
   UpdateIfGhostBox;
   i := cbxTargetGhost.ItemIndex;
   Inc(i);
-  if i > cbxTargetGhost.Items.Count-1 then i := 0;
+  if Pref.HideGhosts and not FTargetGhostExpand then
+  begin
+    if  i > cbxTargetGhost.Items.Count-2 then i := 0;
+  end else
+  begin
+    if  i > cbxTargetGhost.Items.Count-1 then i := 0;
+  end;
   cbxTargetGhost.ItemIndex := i;
   cbxTargetGhostChange(self);
 end;
@@ -2283,6 +2316,21 @@ end;
 
 procedure TfrmSender.cbxTargetGhostChange(Sender: TObject);
 begin
+  // \81u\82·\82×\82Ä\95\\8e¦\81v\82ð\91I\91ð\82³\82ê\82½\8fê\8d\87\82Í\83S\81[\83X\83g\91I\91ð\83{\83b\83N\83X\82ð\8dÄ\8d\\92z
+  if Pref.HideGhosts and not FTargetGhostExpand then
+  begin
+    with cbxTargetGhost do
+    begin
+      if ItemIndex = Items.Count-1 then
+      begin
+        FTargetGhostExpand := true;
+        UpdateIfGhostBox;
+        ItemIndex := 0;
+        DroppedDown := true;
+      end;
+    end;
+  end;
+  // \92è\8c^\8bå\83\81\83j\83\85\81[\82ð\8dÄ\8d\\92z
   ConstructMenu(true);
 end;