Develop and Download Open Source Software

Browse CVS Repository

Diff of /gikonavigoeson/gikonavi/Giko.pas

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

revision 1.235 by h677, Sun Apr 4 15:55:04 2004 UTC revision 1.236 by yoffy, Sun Apr 4 19:31:46 2004 UTC
# Line 531  type Line 531  type
531                  procedure FormDestroy(Sender: TObject);                  procedure FormDestroy(Sender: TObject);
532                  procedure CabinetPanelHide(Sender: TObject);                  procedure CabinetPanelHide(Sender: TObject);
533                  procedure FormClose(Sender: TObject; var Action: TCloseAction);                  procedure FormClose(Sender: TObject; var Action: TCloseAction);
                 procedure TreeViewChange(Sender: TObject; Node: TTreeNode);  
534                  procedure ListViewData(Sender: TObject; Item: TListItem);                  procedure ListViewData(Sender: TObject; Item: TListItem);
535                  procedure ListViewDataFind(Sender: TObject; Find: TItemFind;                  procedure ListViewDataFind(Sender: TObject; Find: TItemFind;
536                          const FindString: String; const FindPosition: TPoint;                          const FindString: String; const FindPosition: TPoint;
# Line 627  type Line 626  type
626                  procedure ShowThreadActionUpdate(Sender: TObject);                  procedure ShowThreadActionUpdate(Sender: TObject);
627                  procedure ShowBoardActionUpdate(Sender: TObject);                  procedure ShowBoardActionUpdate(Sender: TObject);
628                  procedure SelectThreadReloadActionUpdate(Sender: TObject);                  procedure SelectThreadReloadActionUpdate(Sender: TObject);
                 procedure ListViewSelectItem(Sender: TObject; Item: TListItem;  
                         Selected: Boolean);  
629                  procedure SelectTimerTimer(Sender: TObject);                  procedure SelectTimerTimer(Sender: TObject);
630                  procedure ItemReloadActionUpdate(Sender: TObject);                  procedure ItemReloadActionUpdate(Sender: TObject);
631                  procedure ListViewDblClick(Sender: TObject);                  procedure ListViewDblClick(Sender: TObject);
# Line 840  type Line 837  type
837      procedure BrowserNameToolBarResize(Sender: TObject);      procedure BrowserNameToolBarResize(Sender: TObject);
838      procedure BrowserToolBarResize(Sender: TObject);      procedure BrowserToolBarResize(Sender: TObject);
839      procedure BrowserTabResize(Sender: TObject);      procedure BrowserTabResize(Sender: TObject);
840        procedure ListViewClick(Sender: TObject);
841        procedure TreeViewClick(Sender: TObject);
842        procedure TreeViewKeyDown(Sender: TObject; var Key: Word;
843          Shift: TShiftState);
844          private          private
845                  { Private 宣言 }                  { Private 宣言 }
846          //RoundList : TRoundList;          //RoundList : TRoundList;
# Line 921  type Line 922  type
922                  function Hook(var Message: TMessage): Boolean;                  function Hook(var Message: TMessage): Boolean;
923                  procedure AddRoundNameMenu(MenuItem: TMenuItem);                  procedure AddRoundNameMenu(MenuItem: TMenuItem);
924                  procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string); overload;                  procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string); overload;
925          procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string); overload;                  procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string); overload;
926                  procedure SetSelectRoundName(Sender: TObject);                  procedure SetSelectRoundName(Sender: TObject);
927                  function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;                  function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
928    
# Line 940  type Line 941  type
941  //              procedure SetStdToolBar;  //              procedure SetStdToolBar;
942  //              function GetAction(ActionName: string): TContainedAction;  //              function GetAction(ActionName: string): TContainedAction;
943                  procedure SetLinkBar;                  procedure SetLinkBar;
944          procedure ClearLinkBar;                  procedure ClearLinkBar;
945                  function GetWidthAllToolButton(ToolBar: TToolBar): Integer;                  function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
946                  procedure MenuBarChevronMenu;                  procedure MenuBarChevronMenu;
947                  procedure LinkBarChevronMenu;                  procedure LinkBarChevronMenu;
# Line 956  type Line 957  type
957                  procedure FavoriteMoveTo( SenderNode, SourceNode: TTreeNode );                  procedure FavoriteMoveTo( SenderNode, SourceNode: TTreeNode );
958                  procedure FavoriteAddTo( SenderNode: TTreeNode; Source: TObject );                  procedure FavoriteAddTo( SenderNode: TTreeNode; Source: TObject );
959                  procedure FavoriteDragDrop( SenderNode: TTreeNode; Source: TObject );                  procedure FavoriteDragDrop( SenderNode: TTreeNode; Source: TObject );
960                                  //                  //
961                  procedure BrowserTabClick(Sender: TObject);                  procedure BrowserTabClick(Sender: TObject);
962                  procedure SetListViewBackGroundColor(value: TColor);                  procedure SetListViewBackGroundColor(value: TColor);
963                  procedure BBSMenuItemOnClick( Sender : TObject );                  procedure BBSMenuItemOnClick( Sender : TObject );
964          //                  //
965          procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean);                  procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean);
966                  // CoolBar の設定を変数に保存                  // CoolBar の設定を変数に保存
967                  procedure       SaveCoolBarSettings;                  procedure       SaveCoolBarSettings;
968                  // CoolBar の設定を変数から復元                  // CoolBar の設定を変数から復元
# Line 970  type Line 971  type
971                  procedure OnMinimize;                  procedure OnMinimize;
972                  // CoolBar がサイズ変更された                  // CoolBar がサイズ変更された
973                  procedure       CoolBarResized(Sender: TObject; CoolBar: TCoolBar);                  procedure       CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
974                    // TreeView がクリックされた
975                    procedure TreeClick( Node : TTreeNode );
976                    // TreeView がダブルクリックされた
977                    procedure TreeDoubleClick( Node : TTreeNode );
978                    // ギコナビのメッセージループを横取りします
979                    procedure HandleAppMessage(var Msg: TMsg; var Handled: Boolean);
980                    // ブラウザのキーダウンイベント
981                    // イベントを取り扱った場合は True を返す
982                    function BrowserKeydown(Sender: TObject; Key: Word; State:TShiftState) : Boolean;
983    
984          protected          protected
985                  procedure CreateParams(var Params: TCreateParams); override;                  procedure CreateParams(var Params: TCreateParams); override;
# Line 1146  begin Line 1156  begin
1156          Application.OnDeactivate := AppFormDeactivate;          Application.OnDeactivate := AppFormDeactivate;
1157          Self.OnDeactivate := AppFormDeactivate;          Self.OnDeactivate := AppFormDeactivate;
1158          Application.HookMainWindow(Hook);          Application.HookMainWindow(Hook);
1159            Application.OnMessage := HandleAppMessage;
1160    
1161          FTreeType := gttNone;          FTreeType := gttNone;
1162    
# Line 1176  begin Line 1187  begin
1187    
1188          RoundList.LoadRoundThreadFile;          RoundList.LoadRoundThreadFile;
1189    
1190      if RoundList.OldFileRead or ( RoundList.Count[grtItem] > 0 ) then          if RoundList.OldFileRead or ( RoundList.Count[grtItem] > 0 ) then
1191          GikoSys.ListBoardFile;                  GikoSys.ListBoardFile;
1192    
1193          // メニューに追加          // メニューに追加
1194          for i := Length( BBSs ) - 1 downto 0 do begin          for i := Length( BBSs ) - 1 downto 0 do begin
# Line 1257  begin Line 1268  begin
1268                  ListView.Font.Size := GikoSys.Setting.ListFontSize;                  ListView.Font.Size := GikoSys.Setting.ListFontSize;
1269                  ListView.Font.Color := GikoSys.Setting.ListFontColor;                  ListView.Font.Color := GikoSys.Setting.ListFontColor;
1270                  //ListView.Color := GikoSys.Setting.ListBackColor;                  //ListView.Color := GikoSys.Setting.ListBackColor;
1271                                  ListViewBackGroundColor := GikoSys.Setting.ListBackColor;                  ListViewBackGroundColor := GikoSys.Setting.ListBackColor;
1272                                  FUseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;                  FUseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
1273                                  FOddColor := GikoSys.Setting.OddColor;                  FOddColor := GikoSys.Setting.OddColor;
1274    
1275          finally          finally
1276                  TreeView.Items.EndUpdate;                  TreeView.Items.EndUpdate;
# Line 1410  begin Line 1421  begin
1421          ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;          ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;
1422          BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;          BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;
1423    
1424      KeepDefaultToolButton(StdToolBar, TmpToolBar);          KeepDefaultToolButton(StdToolBar, TmpToolBar);
1425      KeepDefaultToolButton(ListToolBar, TmpToolBar);          KeepDefaultToolButton(ListToolBar, TmpToolBar);
1426      KeepDefaultToolButton(BrowserToolBar, TmpToolBar);          KeepDefaultToolButton(BrowserToolBar, TmpToolBar);
1427    
1428      MakeDefaultINIFile();          MakeDefaultINIFile();
1429          //ツールボタン読み込み          //ツールボタン読み込み
1430          ReadToolBarSetting(ActionList, StdToolBar);          ReadToolBarSetting(ActionList, StdToolBar);
1431          ReadToolBarSetting(ActionList, ListToolBar);          ReadToolBarSetting(ActionList, ListToolBar);
# Line 1503  begin Line 1514  begin
1514          StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);          StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
1515          StatusBarResize(Sender);          StatusBarResize(Sender);
1516    
1517      dummy1.Caption      := ItemReservPMenu.Caption;          dummy1.Caption  := ItemReservPMenu.Caption;
1518      dummy1.Hint     := ItemReservPMenu.Hint;          dummy1.Hint     := ItemReservPMenu.Hint;
1519    
1520      //Samba24のファイルチェック          //Samba24のファイルチェック
1521      GikoSys.SambaFileExists();          GikoSys.SambaFileExists();
1522  end;  end;
1523    
1524  // CoolBar の設定を変数に保存  // CoolBar の設定を変数に保存
# Line 1658  var Line 1669  var
1669  //      CoolSet: TCoolSet;  //      CoolSet: TCoolSet;
1670          wp: TWindowPlacement;          wp: TWindowPlacement;
1671  begin  begin
1672                  if ( GikoSys.Setting.ShowDialogForEnd ) and          if ( GikoSys.Setting.ShowDialogForEnd ) and
1673                                  (MessageDlg('ギコナビを終了してよろしいですか?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin                          (MessageDlg('ギコナビを終了してよろしいですか?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin
1674                          CanClose := false;                  CanClose := false;
1675                                  Exit;                          Exit;
1676                  end else begin          end else begin
1677                          CanClose := True;                  CanClose := True;
1678                  end;          end;
1679  //      Application.OnDeactivate := nil;  //      Application.OnDeactivate := nil;
1680  //      Self.OnDeactivate := nil;  //      Self.OnDeactivate := nil;
1681      try          try
1682                  //column幅                  //column幅
1683                  if GetActiveList is TBBS then begin                  if GetActiveList is TBBS then begin
1684                          for i := 0 to ListView.Columns.Count - 1 do                          for i := 0 to ListView.Columns.Count - 1 do
# Line 1679  begin Line 1690  begin
1690                          for i := 0 to ListView.Columns.Count - 1 do                          for i := 0 to ListView.Columns.Count - 1 do
1691                                  GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;                                  GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
1692                  end;                  end;
1693      except          except
1694      end;          end;
1695      try          try
1696                  //最大化・ウィンドウ位置保存                  //最大化・ウィンドウ位置保存
1697                  wp.length := sizeof(wp);                  wp.length := sizeof(wp);
1698                  GetWindowPlacement(Handle, @wp);                  GetWindowPlacement(Handle, @wp);
# Line 1701  begin Line 1712  begin
1712                  else                  else
1713                          GikoSys.Setting.ListOrientation := gloHorizontal;                          GikoSys.Setting.ListOrientation := gloHorizontal;
1714                  GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;                  GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1715      except          except
1716          end;          end;
1717    
1718    // リアルタイムに保存されるので、また、ウィンドウサイズが CoolBar より    // リアルタイムに保存されるので、また、ウィンドウサイズが CoolBar より
# Line 1709  begin Line 1720  begin
1720      {      {
1721          // CoolBar 保存          // CoolBar 保存
1722          SaveCoolBarSettings;          SaveCoolBarSettings;
1723      }          }
1724      try          try
1725                  GikoSys.Setting.WriteWindowSettingFile;                  GikoSys.Setting.WriteWindowSettingFile;
1726                  GikoSys.Setting.WriteNameMailSettingFile;                  GikoSys.Setting.WriteNameMailSettingFile;
1727      except          except
1728          end;          end;
1729    
1730          //お気に入り保存          //お気に入り保存
1731          try          try
1732          //FavoriteDMは自動生成フォームなので、解放は自動的にされる                  //FavoriteDMは自動生成フォームなので、解放は自動的にされる
1733                  FavoriteDM.WriteFavorite;                  FavoriteDM.WriteFavorite;
1734          FavoriteDM.Clear;                  FavoriteDM.Clear;
1735          except          except
1736          end;          end;
1737    
# Line 1735  begin Line 1746  begin
1746          end;          end;
1747    
1748          try          try
1749          TreeView.Items.BeginUpdate;                  TreeView.Items.BeginUpdate;
1750          for i := TreeView.Items.Count - 1 downto 0 do begin                  for i := TreeView.Items.Count - 1 downto 0 do begin
1751                  TreeView.Items[i].Free;                          TreeView.Items[i].Free;
1752          end;                  end;
1753                  TreeView.Items.Clear;                  TreeView.Items.Clear;
1754          TreeView.Items.EndUpdate;                  TreeView.Items.EndUpdate;
1755          except          except
1756          end;          end;
1757    
1758          //アドレス履歴保存          //アドレス履歴保存
1759          try          try
1760          //AddressHistoryDMは自動生成フォームなので、解放は自動的にされる。                  //AddressHistoryDMは自動生成フォームなので、解放は自動的にされる。
1761                  AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);                  AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1762          except          except
1763          end;          end;
# Line 1756  begin Line 1767  begin
1767                  SaveHistory;                  SaveHistory;
1768          except          except
1769          end;          end;
1770      try          try
1771          try                  try
1772                  ClearHistory;                          ClearHistory;
1773              except                  except
1774          end;                  end;
1775      finally          finally
1776          FHistoryList.Free;                  FHistoryList.Free;
1777      end;          end;
1778    
1779          //巡回リスト保存&破棄          //巡回リスト保存&破棄
1780          try          try
1781                  RoundList.SaveRoundFile;                  RoundList.SaveRoundFile;
1782          except          except
1783          end;          end;
1784      try          try
1785                  try                  try
1786                          RoundList.Clear;                          RoundList.Clear;
1787                  except                  except
1788                  end;                  end;
1789      finally          finally
1790          RoundList.Free;                  RoundList.Free;
1791      end;           end;
1792    
1793      try          try
1794                  try                  try
1795                          FControlThread.Terminate;                          FControlThread.Terminate;
1796                  FControlThread.WaitFor;                          FControlThread.WaitFor;
1797                  except                  except
1798                  end;                  end;
1799      finally          finally
1800              FControlThread.Free;                  FControlThread.Free;
1801      end;          end;
1802    
1803          // TBBS は保持している TCategory, TBoard, TThreadItem すべてを開放する          // TBBS は保持している TCategory, TBoard, TThreadItem すべてを開放する
1804          // TBoard, TThreadItem のデストラクタはプラグインに破棄を伝えるので          // TBoard, TThreadItem のデストラクタはプラグインに破棄を伝えるので
# Line 1811  begin Line 1822  begin
1822          end;          end;
1823    
1824          try          try
1825          if FEvent <> nil then                  if FEvent <> nil then
1826                  FEvent.Free;                          FEvent.Free;
1827    
1828                  //Hint破棄                  //Hint破棄
1829                  if FHint <> nil then begin                  if FHint <> nil then begin
# Line 1827  begin Line 1838  begin
1838                  end;                  end;
1839          except          except
1840          end;          end;
1841      //Application.HookMainWindow(Hook);          //Application.HookMainWindow(Hook);
1842      Application.UnhookMainWindow(Hook);          Application.UnhookMainWindow(Hook);
1843      Application.Terminate;          Application.Terminate;
1844  end;  end;
1845    
1846  procedure TGikoForm.FormDestroy(Sender: TObject);  procedure TGikoForm.FormDestroy(Sender: TObject);
# Line 2146  begin Line 2157  begin
2157          end;          end;
2158  end;  end;
2159    
 procedure TGikoForm.TreeViewChange(Sender: TObject; Node: TTreeNode);  
 var  
         i: Integer;  
 begin  
         if FTreeType = gttHistory then begin  
                 if Node <> nil then  
                         if TObject( Node.Data ) is TFavoriteThreadItem then  
                                 if GetActiveContent <> TFavoriteThreadItem( Node.Data ).Item then  
                                         FavoriteClick( Node );  
                 Exit;  
         end;  
   
         ListView.Selected := nil;  
         ListView.Items.Count := 0;  
         ListView.Items.Clear;  
 //      ListView.Columns.Clear;  
   
         Caption := CAPTION_NAME;  
         //Application.Title := CAPTION_NAME;  
   
   
         if GetActiveList is TBBS then begin  
                 for i := 0 to ListView.Columns.Count - 1 do  
                         GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;  
         end else if GetActiveList is TCategory then begin  
                 for i := 0 to ListView.Columns.Count - 1 do  
                         GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;  
         end else if GetActiveList is TBoard then begin  
                 for i := 0 to ListView.Columns.Count - 1 do  
                         GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;  
         end;  
   
         if TObject(Node.Data) is TBBS then begin  
                 SetActiveList(Node.data);  
         end else if TObject(Node.Data) is TCategory then begin  
                 SetActiveList(Node.data);  
         end else if TObject(Node.Data) is TBoard then begin  
                 if not TBoard(Node.Data).IsThreadDatRead then begin  
                         Screen.Cursor := crHourGlass;  
                         try  
                 if not TBoard(Node.Data).IsThreadDatRead then  
                                         GikoSys.ReadSubjectFile(Node.Data);  
                         finally  
                                 Screen.Cursor := crDefault;  
                         end;  
                 end;  
                 SetActiveList(Node.data);  
         end;  
 end;  
   
2160  procedure TGikoForm.ListViewData(Sender: TObject; Item: TListItem);  procedure TGikoForm.ListViewData(Sender: TObject; Item: TListItem);
2161  var  var
2162  //      FileName: string;  //      FileName: string;
# Line 2206  var Line 2167  var
2167          Board: TBoard;          Board: TBoard;
2168          ThreadItem: TThreadItem;          ThreadItem: TThreadItem;
2169          RepStr: string;          RepStr: string;
2170      ActivListObj : TObject;                  ActivListObj : TObject;
2171  begin  begin
2172      ActivListObj := ActiveList;                  ActivListObj := ActiveList;
2173          if ActivListObj is TBBS then begin          if ActivListObj is TBBS then begin
2174                  BBS := TBBS(ActivListObj);                  BBS := TBBS(ActivListObj);
2175    
# Line 2628  end; Line 2589  end;
2589  procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;  procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2590          Shift: TShiftState);          Shift: TShiftState);
2591  begin  begin
2592          if Key = VK_BACK then begin          if GetActiveList is TBoard then begin
2593                    if Key = VK_BACK then begin
2594  //              UpFolderButtonClick(Sender);  //              UpFolderButtonClick(Sender);
2595          end else if Key = VK_SPACE then begin                  end else if Key = VK_SPACE then begin
2596  //              ListClick;                          ListDoubleClick;
2597          end else if Key = VK_RETURN then begin                  end else if Key = VK_RETURN then begin
2598                  ListDoubleClick;                          ListClick;
2599                    end;
2600            end else begin // TBBS, TCategory
2601                    if Key = VK_BACK then begin
2602    //              UpFolderButtonClick(Sender);
2603                    end else if Key = VK_SPACE then begin
2604                            ListClick;
2605                    end else if Key = VK_RETURN then begin
2606                            ListDoubleClick;
2607                    end;
2608          end;          end;
2609  end;  end;
2610    
# Line 2937  end; Line 2908  end;
2908    
2909  procedure TGikoForm.TreeViewDblClick(Sender: TObject);  procedure TGikoForm.TreeViewDblClick(Sender: TObject);
2910  var  var
         Board: TBoard;  
         ThreadItem: TThreadItem;  
2911          APoint: TPoint;          APoint: TPoint;
2912          HitTest: THitTests;          HitTest: THitTests;
2913  begin  begin
# Line 2946  begin Line 2915  begin
2915          APoint := TreeView.ScreenToClient(APoint);          APoint := TreeView.ScreenToClient(APoint);
2916          HitTest := TreeView.GetHitTestInfoAt(APoint.x, APoint.y);          HitTest := TreeView.GetHitTestInfoAt(APoint.x, APoint.y);
2917          if not (htOnLabel in HitTest) then Exit;          if not (htOnLabel in HitTest) then Exit;
         if TreeView.Selected = nil then Exit;  
2918    
2919          if FTreeType = gtt2ch then begin          TreeDoubleClick( TreeView.Selected );
                 if not (TObject(TreeView.Selected.Data) is TBoard) then Exit;  
                 Board := TBoard(TreeView.Selected.Data);  
                 DownloadList(Board);  
         end else if FTreeType = gttHistory then begin  
                 if not (TObject(TreeView.Selected.Data) is TFavoriteThreadItem) then Exit;  
                 ThreadItem := TFavoriteThreadItem(TreeView.Selected.Data).Item;  
                 DownloadContent(ThreadItem);  
         end;  
2920  end;  end;
2921    
2922  procedure TGikoForm.FavoriteTreeViewClick(Sender: TObject);  procedure TGikoForm.FavoriteTreeViewClick(Sender: TObject);
# Line 3355  begin Line 3315  begin
3315                          ListView.Column[i].Width := GikoSys.Setting.CategoryColumnWidth[i];                          ListView.Column[i].Width := GikoSys.Setting.CategoryColumnWidth[i];
3316                  SetBoardListItem(TCategory(Obj));                  SetBoardListItem(TCategory(Obj));
3317          end else if Obj is TBoard then begin          end else if Obj is TBoard then begin
                 // SetThreadListItem 呼ぶならいらないんじゃねぇ?  
                 {  
                 for i := 0 to ListView.Columns.Count - 1 do  
                         ListView.Column[i].Width := GikoSys.Setting.BoardColumnWidth[i];  
                 }  
3318                  SetThreadListItem(TBoard(Obj));                  SetThreadListItem(TBoard(Obj));
3319          end;          end;
3320    
3321            if GikoSys.Setting.ListOrientation = gloHorizontal then begin
3322                    if GikoSys.Setting.ListWidthState = glsMax then begin
3323                            BrowserMinAction.Execute;
3324                            ListView.SetFocus;
3325                    end;
3326            end else begin
3327                    if GikoSys.Setting.ListHeightState = glsMax then begin
3328                            BrowserMinAction.Execute;
3329                            ListView.SetFocus;
3330                    end;
3331            end;
3332  end;  end;
3333    
3334    
# Line 3720  begin Line 3687  begin
3687                          TreeView.TopItem.Expanded := True;                              //ツリートップ項目だけを開く                          TreeView.TopItem.Expanded := True;                              //ツリートップ項目だけを開く
3688                          //ツリーのトップ項目を選択する                          //ツリーのトップ項目を選択する
3689                          if GetActiveList = nil then                          if GetActiveList = nil then
3690                                  TreeView.Selected := TreeView.Items[0]                                  TreeClick( TreeView.Items[0] )
3691                          else begin                          else begin
3692                                  for i := 0 to TreeView.Items.Count - 1 do begin                                  for i := 0 to TreeView.Items.Count - 1 do begin
3693                                          if TreeView.Items[i].Data = GetActiveList then begin                                          if TreeView.Items[i].Data = GetActiveList then begin
3694                                                  TreeView.Selected := TreeView.Items[i];                                                  TreeClick( TreeView.Items[i] );
3695                                                  Exit;                                                  Exit;
3696                                          end;                                          end;
3697                                  end;                                  end;
3698                                  TreeView.Selected := TreeView.Items[0]                                  TreeClick( TreeView.Items[0] );
3699                          end;                          end;
3700                  end;                  end;
3701          except          except
# Line 3845  begin Line 3812  begin
3812                                  if TreeView.Items[i].Data = Item then begin                                  if TreeView.Items[i].Data = Item then begin
3813                                          TreeView.Items[i].Selected := True;                                          TreeView.Items[i].Selected := True;
3814                                          if CallEvent then                                          if CallEvent then
3815                                                  TreeViewChange(TreeView, TreeView.Items[i]);                                                  TreeClick(TreeView.Items[i]);
3816                                          Break;                                          Break;
3817                                  end;                                  end;
3818                          end;                          end;
# Line 3869  begin Line 3836  begin
3836                  end;                  end;
3837    
3838                  if (Item is TBBS) or (Item is TCategory) then begin                  if (Item is TBBS) or (Item is TCategory) then begin
3839              ListView.Columns.Clear;                          ListView.Columns.Clear;
3840                          SetActiveList( Item );                          SetActiveList( Item );
3841                  end else if Item is TBoard then begin                  end else if Item is TBoard then begin
3842                          if not TBoard( Item ).IsThreadDatRead then begin                          if not TBoard( Item ).IsThreadDatRead then begin
3843                                  Screen.Cursor := crHourGlass;                                  Screen.Cursor := crHourGlass;
3844                                  try                                  try
3845                      if not TBoard( Item ).IsThreadDatRead then                                          if not TBoard( Item ).IsThreadDatRead then
3846                                                  GikoSys.ReadSubjectFile(TBoard( Item ));                                                  GikoSys.ReadSubjectFile(TBoard( Item ));
3847                                  finally                                  finally
3848                                          Screen.Cursor := crDefault;                                          Screen.Cursor := crDefault;
# Line 3938  begin Line 3905  begin
3905  //              SetContent(ThreadItem);  //              SetContent(ThreadItem);
3906                  InsertBrowserTab(ListItem.Data);                  InsertBrowserTab(ListItem.Data);
3907          end;          end;
3908    
3909            if ListView.Selected = nil then
3910                    Exit;
3911            if ListView.Selected.Data = nil then
3912                    Exit;
3913            if TThreadItem( ListView.Selected.Data ).IsLogFile then begin
3914                    if GikoSys.Setting.ListOrientation = gloHorizontal then begin
3915                            if GikoSys.Setting.ListWidthState = glsMin then begin
3916                                    BrowserMaxAction.Execute;
3917                                    Browser.SetFocus;
3918                            end;
3919                    end else begin
3920                            if GikoSys.Setting.ListHeightState = glsMin then begin
3921                                    BrowserMaxAction.Execute;
3922                                    Browser.SetFocus;
3923                            end;
3924                    end;
3925            end;
3926  end;  end;
3927    
3928  procedure TGikoForm.ListDoubleClick;  procedure TGikoForm.ListDoubleClick;
# Line 3981  begin Line 3966  begin
3966                  Application.ProcessMessages;                  Application.ProcessMessages;
3967          end;          end;
3968      }      }
3969            // Access Violation が起きる事があるので今後要チェック
3970          try          try
3971              top := 0;                  top := 0;
3972          nm := AName;                  nm := AName;
3973          item := OleVariant( Browser.Document as IHTMLDocument2).anchors.item(nm);                  item := OleVariant( Browser.Document as IHTMLDocument2).anchors.item(nm);
3974          repeat                  repeat
3975                  top := top + item.offsetTop;                          top := top + item.offsetTop;
3976              item := item.offsetParent;                          item := item.offsetParent;
3977          until AnsiCompareText(item.tagName, 'body' ) = 0;                  until AnsiCompareText(item.tagName, 'body' ) = 0;
3978    
3979          OleVariant(Browser.Document as IHTMLDocument2).body.scrollTop := top;                  OleVariant(Browser.Document as IHTMLDocument2).body.scrollTop := top;
3980            except
3981      except          end;
     end;  
3982  end;  end;
3983    
3984  procedure TGikoForm.TreeViewCollapsed(Sender: TObject; Node: TTreeNode);  procedure TGikoForm.TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
# Line 4848  begin Line 4833  begin
4833          ActiveLogDeleteAction.Enabled := GetActiveContent <> nil;          ActiveLogDeleteAction.Enabled := GetActiveContent <> nil;
4834  end;  end;
4835    
 procedure TGikoForm.ListViewSelectItem(Sender: TObject; Item: TListItem;  
         Selected: Boolean);  
 begin  
         //SelectTimer.Enabled := False;  
         //if Selected then  
         //      SelectTimer.Enabled := True;  
     SelectTimer.Enabled := Selected;  
   
         {  
         if ListView.Selected = nil then  
                 Exit;  
         if ListView.Selected.Data = nil then  
         Exit;  
         if TThreadItem( ListView.Selected.Data ).IsLogFile then begin  
                 if GikoSys.Setting.ListOrientation = gloHorizontal then begin  
                         if GikoSys.Setting.ListWidthState = glsMin then  
                                 BrowserMaxAction.Execute;  
                 end else begin  
                         if GikoSys.Setting.ListHeightState = glsMin then  
                                 BrowserMaxAction.Execute;  
                 end;  
         end;  
         }  
 end;  
   
4836  procedure TGikoForm.SelectTimerTimer(Sender: TObject);  procedure TGikoForm.SelectTimerTimer(Sender: TObject);
4837  begin  begin
4838          SelectTimer.Enabled := False;          SelectTimer.Enabled := False;
# Line 4993  end; Line 4953  end;
4953  function TGikoForm.Hook(var Message: TMessage): Boolean;  function TGikoForm.Hook(var Message: TMessage): Boolean;
4954  begin  begin
4955          Result := False;          Result := False;
4956          if Message.Msg = CM_APPKEYDOWN then Result := True;          case Message.Msg of
4957            CM_APPKEYDOWN:
4958                    Result := True;
4959            end;
4960  end;  end;
4961    
4962  procedure TGikoForm.KokoResActionExecute(Sender: TObject);  procedure TGikoForm.KokoResActionExecute(Sender: TObject);
# Line 9025  procedure TGikoForm.UpBoardActionExecute Line 8988  procedure TGikoForm.UpBoardActionExecute
8988  begin  begin
8989    
8990          SelectTreeNode( GetActiveContent.ParentBoard, True );          SelectTreeNode( GetActiveContent.ParentBoard, True );
         {  
         if GikoSys.Setting.ListOrientation = gloHorizontal then begin  
                 if GikoSys.Setting.ListWidthState = glsMax then  
                         BrowserMinAction.Execute;  
         end else begin  
                 if GikoSys.Setting.ListHeightState = glsMax then  
                         BrowserMinAction.Execute;  
         end;  
         }  
8991    
8992  end;  end;
8993    
# Line 9233  begin Line 9187  begin
9187    
9188  end;  end;
9189    
9190    procedure TGikoForm.ListViewClick(Sender: TObject);
9191    begin
9192            ListClick;
9193    end;
9194    
9195    // TreeView がクリックされた
9196    procedure TGikoForm.TreeClick( Node : TTreeNode );
9197    var
9198            i: Integer;
9199    begin
9200    
9201            if FTreeType = gttHistory then begin
9202                    if Node <> nil then
9203                            if TObject( Node.Data ) is TFavoriteThreadItem then
9204                                    if GetActiveContent <> TFavoriteThreadItem( Node.Data ).Item then
9205                                            FavoriteClick( Node );
9206                    Exit;
9207            end;
9208    
9209            ListView.Selected := nil;
9210            ListView.Items.Count := 0;
9211            ListView.Items.Clear;
9212    //      ListView.Columns.Clear;
9213    
9214            Caption := CAPTION_NAME;
9215            //Application.Title := CAPTION_NAME;
9216    
9217    
9218            if GetActiveList is TBBS then begin
9219                    for i := 0 to ListView.Columns.Count - 1 do
9220                            GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
9221            end else if GetActiveList is TCategory then begin
9222                    for i := 0 to ListView.Columns.Count - 1 do
9223                            GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
9224            end else if GetActiveList is TBoard then begin
9225                    for i := 0 to ListView.Columns.Count - 1 do
9226                            GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
9227            end;
9228    
9229            if TObject(Node.Data) is TBBS then begin
9230                    SetActiveList(Node.data);
9231            end else if TObject(Node.Data) is TCategory then begin
9232                    SetActiveList(Node.data);
9233            end else if TObject(Node.Data) is TBoard then begin
9234                    if not TBoard(Node.Data).IsThreadDatRead then begin
9235                            Screen.Cursor := crHourGlass;
9236                            try
9237            if not TBoard(Node.Data).IsThreadDatRead then
9238                                            GikoSys.ReadSubjectFile(Node.Data);
9239                            finally
9240                                    Screen.Cursor := crDefault;
9241                            end;
9242                    end;
9243                    SetActiveList(Node.data);
9244            end;
9245    
9246    end;
9247    
9248    // TreeView がダブルクリックされた
9249    procedure TGikoForm.TreeDoubleClick( Node : TTreeNode );
9250    var
9251            Board                           : TBoard;
9252            ThreadItem      : TThreadItem;
9253    begin
9254    
9255            if Node = nil then Exit;
9256    
9257            if FTreeType = gtt2ch then begin
9258                    if not (TObject(Node.Data) is TBoard) then Exit;
9259                    Board := TBoard(Node.Data);
9260                    DownloadList(Board);
9261            end else if FTreeType = gttHistory then begin
9262                    if not (TObject(Node.Data) is TFavoriteThreadItem) then Exit;
9263                    ThreadItem := TFavoriteThreadItem(Node.Data).Item;
9264                    DownloadContent(ThreadItem);
9265            end;
9266    
9267    end;
9268    
9269    procedure TGikoForm.TreeViewClick(Sender: TObject);
9270    begin
9271            TreeClick( TreeView.Selected );
9272    end;
9273    
9274    procedure TGikoForm.TreeViewKeyDown(Sender: TObject; var Key: Word;
9275            Shift: TShiftState);
9276    begin
9277            if Key = VK_BACK then begin
9278    //              UpFolderButtonClick(Sender);
9279            end else if Key = VK_SPACE then begin
9280                    TreeDoubleClick( TreeView.Selected );
9281            end else if Key = VK_RETURN then begin
9282                    TreeClick( TreeView.Selected );
9283            end;
9284    end;
9285    
9286    // ブラウザのキーダウンイベント
9287                    // イベントを取り扱った場合は True を返す
9288    function TGikoForm.BrowserKeydown(Sender: TObject; Key: Word; State:TShiftState) : Boolean;
9289    begin
9290    
9291            if Key = VK_BACK then begin
9292                    UpBoardAction.Execute;
9293                    Result := True;
9294            end;
9295    
9296    end;
9297    
9298    // ギコナビのメッセージループを横取りします
9299    procedure TGikoForm.HandleAppMessage(var Msg: TMsg; var Handled: Boolean);
9300    var
9301            key : Word;
9302            h               : Boolean;
9303    begin
9304    
9305            case Msg.message of
9306            WM_KEYFIRST..WM_KEYLAST:
9307                    if IsDialogMessage(Browser.Handle, Msg) then begin
9308                            key := Msg.wParam;
9309                            Handled := BrowserKeyDown( nil, key, KeyDataToShiftState( Msg.lParam ) );
9310                            Msg.wParam := key;
9311                    end;
9312            end;
9313    
9314    end;
9315    
9316  initialization  initialization
9317                                  OleInitialize(nil);                                  OleInitialize(nil);
9318  finalization  finalization

Legend:
Removed from v.1.235  
changed lines
  Added in v.1.236

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