shuusei21167:コラム幅調整がループに陥るバグを修正(21102,21160参照)

diff --dos -urN 21166/mainform.dfm 21167/mainform.dfm
--- 21166/mainform.dfm	Sat Oct 05 17:52:20 2002
+++ 21167/mainform.dfm	Wed Oct 09 01:44:44 2002
@@ -1060,8 +1060,6 @@
                 item
                   AutoSize = True
                   Caption = 'User'
-                  WidthType = (
-                    -248)
                 end
                 item
                   Alignment = taCenter
@@ -1110,10 +1108,12 @@
                 item
                   Alignment = taRightJustify
                   Caption = 'Up'
+                  Width = 30
                 end
                 item
                   Alignment = taRightJustify
                   Caption = 'Down'
+                  Width = 30
                 end
                 item
                   Alignment = taCenter
@@ -1123,10 +1123,12 @@
                 item
                   Alignment = taRightJustify
                   Caption = 'Total Up'
+                  Width = 50
                 end
                 item
                   Alignment = taRightJustify
                   Caption = 'Total Down'
+                  Width = 50
                 end
                 item
                   Alignment = taCenter
diff --dos -urN 21166/mainform.pas 21167/mainform.pas
--- 21166/mainform.pas	Sat Oct 05 19:37:38 2002
+++ 21167/mainform.pas	Wed Oct 09 01:34:38 2002
@@ -978,22 +978,23 @@
   cb_log_awaypopup.checked:=ini.ReadBool('Interface','AwayPopup',false);
   edit_log_away.Text:=ini.ReadString('Interface','AwayMessage','(自動応答)ただいま近くにおりません。IMありがとう');
   cb_log_awayClick(nil);
-  if ini.ReadBool('Interface','UsersListHideLevel',false) then SetColumnVisible(list_users,UL_LEVEL+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideShared',false) then SetColumnVisible(list_users,UL_SHARED+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideSize',true) then SetColumnVisible(list_users,UL_SIZE+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideAverage',true) then SetColumnVisible(list_users,UL_AVERAGE+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideSoft',false) then SetColumnVisible(list_users,UL_SOFT+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideSpeed',false) then SetColumnVisible(list_users,UL_SPEED+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideIP',false) then SetColumnVisible(list_users,UL_IP+1,0,false);
-  if ini.ReadBool('Interface','UsersListHidePort',true) then SetColumnVisible(list_users,UL_PORT+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideTime',true) then SetColumnVisible(list_users,UL_TIME+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideUp',true) then SetColumnVisible(list_users,UL_UP+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideDown',true) then SetColumnVisible(list_users,UL_DOWN+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideTransfers',true) then SetColumnVisible(list_users,UL_TRANSFERS+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideTotalUp',true) then SetColumnVisible(list_users,UL_TUP+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideTotalDown',true) then SetColumnVisible(list_users,UL_TDOWN+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideTotal',true) then SetColumnVisible(list_users,UL_TTRANSFERS+1,0,false);
-  if ini.ReadBool('Interface','UsersListHideServer',false) then SetColumnVisible(list_users,UL_SERVER+1,0,false);
+  for i:=0 to 30 do isHide[i]:=false;
+  if ini.ReadBool('Interface','UsersListHideLevel',false) then begin isHide[UL_LEVEL+1]:=true; SetColumnVisible(list_users,UL_LEVEL+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideShared',false) then begin isHide[UL_SHARED+1]:=true; SetColumnVisible(list_users,UL_SHARED+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideSize',true) then begin isHide[UL_SIZE+1]:=true; SetColumnVisible(list_users,UL_SIZE+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideAverage',true) then begin isHide[UL_AVERAGE+1]:=true; SetColumnVisible(list_users,UL_AVERAGE+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideSoft',false) then begin isHide[UL_SOFT+1]:=true; SetColumnVisible(list_users,UL_SOFT+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideSpeed',false) then begin isHide[UL_SPEED+1]:=true; SetColumnVisible(list_users,UL_SPEED+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideIP',false) then begin isHide[UL_IP+1]:=true; SetColumnVisible(list_users,UL_IP+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHidePort',true) then begin isHide[UL_PORT+1]:=true; SetColumnVisible(list_users,UL_PORT+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideTime',true) then begin isHide[UL_TIME+1]:=true; SetColumnVisible(list_users,UL_TIME+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideUp',true) then begin isHide[UL_UP+1]:=true; SetColumnVisible(list_users,UL_UP+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideDown',true) then begin isHide[UL_DOWN+1]:=true; SetColumnVisible(list_users,UL_DOWN+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideTransfers',true) then begin isHide[UL_TRANSFERS+1]:=true; SetColumnVisible(list_users,UL_TRANSFERS+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideTotalUp',true) then begin isHide[UL_TUP+1]:=true; SetColumnVisible(list_users,UL_TUP+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideTotalDown',true) then begin isHide[UL_TDOWN+1]:=true; SetColumnVisible(list_users,UL_TDOWN+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideTotal',true) then begin isHide[UL_TTRANSFERS+1]:=true; SetColumnVisible(list_users,UL_TTRANSFERS+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideServer',false) then begin isHide[UL_SERVER+1]:=true; SetColumnVisible(list_users,UL_SERVER+1,0,false); end;
   // colors
   LogStartup('mainform::loadconfig: loading colors');
   slBackground:=ini.ReadInteger('Colors','clBackground',$FFFFFF);
@@ -2783,7 +2784,29 @@
  for i:=0 to list.Columns.Count-1 do
  begin
   if (list.Columns.Items[i].Width<0) or (list.Columns.Items[i].Width>10000) then
-   list.Columns.Items[i].Width:=0;
+    if isHide[i] then list.Columns.Items[i].Width:=0
+    else
+      case i of
+        0 : list.Columns.Items[i].Width:=120;
+        1 : list.Columns.Items[i].Width:=75;
+        2 : list.Columns.Items[i].Width:=55;
+        3 : list.Columns.Items[i].Width:=60;
+        4 : list.Columns.Items[i].Width:=60;
+        5 : list.Columns.Items[i].Width:=50;
+        6 : list.Columns.Items[i].Width:=70;
+        7 : list.Columns.Items[i].Width:=75;
+        8 : list.Columns.Items[i].Width:=40;
+        9 : list.Columns.Items[i].Width:=55;
+       10 : list.Columns.Items[i].Width:=30;
+       11 : list.Columns.Items[i].Width:=30;
+       12 : list.Columns.Items[i].Width:=50;
+       13 : list.Columns.Items[i].Width:=50;
+       14 : list.Columns.Items[i].Width:=50;
+       15 : list.Columns.Items[i].Width:=50;
+       16 : list.Columns.Items[i].Width:=50;
+       17 : list.Columns.Items[i].Width:=50;
+       else break;
+     end;
   inc(w,list.Columns.Items[i].Width);
   if list.Columns.Items[i].AutoSize then
    inc(s);
@@ -4472,11 +4495,11 @@
  else if Sender=mnu_um_ip then w:=80
  else if Sender=mnu_um_port then w:=40
  else if Sender=mnu_um_time then w:=60
- else if Sender=mnu_um_up then w:=0
- else if Sender=mnu_um_down then w:=0
+ else if Sender=mnu_um_up then w:=30
+ else if Sender=mnu_um_down then w:=30
  else if Sender=mnu_um_transfers then w:=0
- else if Sender=mnu_um_totalup then w:=0
- else if Sender=mnu_um_totaldown then w:=0
+ else if Sender=mnu_um_totalup then w:=50
+ else if Sender=mnu_um_totaldown then w:=50
  else if Sender=mnu_um_total then w:=0
  else if Sender=mnu_um_server then w:=0;
  if w=0 then
diff --dos -urN 21166/vars.pas 21167/vars.pas
--- 21166/vars.pas	Sat Oct 05 01:28:58 2002
+++ 21167/vars.pas	Wed Oct 09 01:08:28 2002
@@ -154,6 +154,7 @@
  allow_multiple_instances, startup_hide: Boolean;
  last_away_user: String;
  last_away_time: Cardinal;
+ isHide: array [0..30] of Boolean;//list_users column visibility
  // log
  log_to_file, log_console_data: Boolean;
  save_stats: Boolean;