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.584 by h677, Wed Jan 18 16:14:58 2006 UTC revision 1.585 by h677, Sun Jan 22 16:40:48 2006 UTC
# Line 543  type Line 543  type
543      procedure GikoApplicationEventsException(Sender: TObject; E: Exception);      procedure GikoApplicationEventsException(Sender: TObject; E: Exception);
544      procedure TreeViewMouseDown(Sender: TObject; Button: TMouseButton;      procedure TreeViewMouseDown(Sender: TObject; Button: TMouseButton;
545        Shift: TShiftState; X, Y: Integer);        Shift: TShiftState; X, Y: Integer);
546        procedure GetResURLMenuClick(Sender: TObject);
547          private          private
548                  { Private 宣言 }                  { Private 宣言 }
549                  FEnabledCloseButton: Boolean;                  FEnabledCloseButton: Boolean;
# Line 592  type Line 593  type
593                  FOrigenCaption: String;                         //お気に入りツリーのアイテム編集時の編集前の文字列                  FOrigenCaption: String;                         //お気に入りツリーのアイテム編集時の編集前の文字列
594                  FPreviewBrowserRect: TRect;                     ///< プレビューの表示位置を記憶する                  FPreviewBrowserRect: TRect;                     ///< プレビューの表示位置を記憶する
595                  FActionListGroupIndexes: array of Integer;      ///<GikoDM上のアクションリストの各アクションに設定されたGroupIndexを保存する配列                  FActionListGroupIndexes: array of Integer;      ///<GikoDM上のアクションリストの各アクションに設定されたGroupIndexを保存する配列
596                    FListDrawTime: TDateTime;  ///< ListViewを描画しようとした時刻(勢いの計算用)
597                  procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);                  procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
598                  procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);                  procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
599                  procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);                  procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
# Line 659  type Line 661  type
661                  procedure GetGroupIndex(ActionList: TActionList);                  procedure GetGroupIndex(ActionList: TActionList);
662                  //! ActionListのGroupIndexの設定                  //! ActionListのGroupIndexの設定
663                  procedure SetGroupIndex(ActionList: TActionList);                  procedure SetGroupIndex(ActionList: TActionList);
664                    //! 指定されたスレッドを開く(ログが無いとき or 指定JUMPまで足りないときはDLする)
665                    procedure OpenThreadItem(Thread: TThreadItem; URL: String);
666          protected          protected
667                  procedure CreateParams(var Params: TCreateParams); override;                  procedure CreateParams(var Params: TCreateParams); override;
668                  procedure WndProc(var Message: TMessage); override;                  procedure WndProc(var Message: TMessage); override;
# Line 696  type Line 700  type
700                  property ScreenCursor : TCursor read GetScreenCursor write SetScreenCursor;                  property ScreenCursor : TCursor read GetScreenCursor write SetScreenCursor;
701                  property ActiveBBS : TBBS read FActiveBBS write FActiveBBS;                  property ActiveBBS : TBBS read FActiveBBS write FActiveBBS;
702                  property WorkCount: Integer read FWorkCount write FWorkCount;                  property WorkCount: Integer read FWorkCount write FWorkCount;
703                    property ListDrawTime: TDateTime read FListDrawTime;
704                  procedure SetContent(inThread: TBrowserRecord);                  procedure SetContent(inThread: TBrowserRecord);
705                  function GetActiveContent: TThreadItem;                  function GetActiveContent: TThreadItem;
706                  function GetActiveList: TObject;                  function GetActiveList: TObject;
# Line 788  type Line 793  type
793                  function WebBrowserClick(Sender: TObject): WordBool;                  function WebBrowserClick(Sender: TObject): WordBool;
794                  //! ツールバーにスレ絞込みコンボボックスを設定する                  //! ツールバーにスレ絞込みコンボボックスを設定する
795                  procedure SetSelectComboBox();                  procedure SetSelectComboBox();
796    
797          published          published
798                  property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;                  property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
799          end;          end;
# Line 2899  begin Line 2905  begin
2905                                                           (ListView.ClientHeight div 2) - (ListView.Canvas.TextHeight(s) div 2));                                                           (ListView.ClientHeight div 2) - (ListView.Canvas.TextHeight(s) div 2));
2906                  ListView.Canvas.TextOut(p.X, p.Y, s);                  ListView.Canvas.TextOut(p.X, p.Y, s);
2907          end else begin          end else begin
2908                    FListDrawTime := Now();
2909                  DefaultDraw := True;                  DefaultDraw := True;
2910          end;          end;
2911  end;  end;
# Line 4563  begin Line 4570  begin
4570          TopPanel.Height := Max(MainCoolBar.Height, AnimePanel.Height);          TopPanel.Height := Max(MainCoolBar.Height, AnimePanel.Height);
4571    
4572  end;  end;
4573    //! 指定されたスレッドを開く(ログが無いとき or 指定JUMPまで足りないときはDLする)
4574    procedure TGikoForm.OpenThreadItem(Thread: TThreadItem; URL: String);
4575    var
4576            stRes, edRes : Int64;
4577            browserRec : TBrowserRecord;
4578            threadNumber : String;
4579    begin
4580            stRes := 0;
4581            edRes := 0;
4582            // タブを生成
4583            browserRec := InsertBrowserTab(Thread);
4584            if (browserRec <> nil) then begin
4585                    // JUMPすべきレス番号があるかチェックする
4586                    threadNumber := ChangeFileExt(Thread.FileName, '');
4587                    GikoSys.GetPopupResNumber( URL, stRes, edRes );
4588                    // スレの番号をレス番と誤って認識しているのをクリア
4589                    if (StrToInt(threadNumber) = stRes) then begin
4590                            if not (AnsiEndsText(threadNumber + '/' + threadNumber, URL))
4591                                    and (Pos('&st=' + threadNumber , URL) = 0) then begin
4592                                    stRes := 0;
4593                            end;
4594                    end;
4595                    if ( stRes > 0 ) then begin
4596                            browserRec.Movement := IntToStr( stRes );
4597                    end;
4598                    // ログを持っていないか JUMPすべきレス番号まで取得していないときはDLする
4599                    if (not Thread.IsLogFile) or (stRes > Thread.Count) then begin
4600                            DownloadContent(Thread);
4601                    end else if (not browserRec.Repaint) then begin
4602                            try
4603                                    if (browserRec.Movement <> '') then begin
4604                                            browserRec.Move(browserRec.Movement);
4605                                            browserRec.Movement := '';
4606                                    end;
4607                            except
4608                            end;
4609                    end;
4610            end;
4611    end;
4612    
4613  procedure TGikoForm.MoveToURL(const inURL: string);  procedure TGikoForm.MoveToURL(const inURL: string);
4614  var  var
# Line 4575  var Line 4621  var
4621          i, bi                                   : Integer;          i, bi                                   : Integer;
4622          boardURL                        : string;          boardURL                        : string;
4623          tmpThread                       : TThreadItem;          tmpThread                       : TThreadItem;
 //      category                        : TCategory;  
 //      categoryNode    : TTreeNode;  
 //      boardNode                       : TTreeNode;  
4624          shiftDown                       : Boolean;          shiftDown                       : Boolean;
4625          ctrlDown                        : Boolean;          ctrlDown                        : Boolean;
         stRes, edRes    : Int64;  
         browserRec              : TBrowserRecord;  
4626  begin  begin
4627    
4628          GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );          GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
# Line 4637  begin Line 4678  begin
4678                                                                          if TBoard(ActiveList) = Board then                                                                          if TBoard(ActiveList) = Board then
4679                                                                                  ListView.Items.Count := ListView.Items.Count + 1;                                                                                  ListView.Items.Count := ListView.Items.Count + 1;
4680                                                                  end;                                                                  end;
                                                                 GikoSys.GetPopupResNumber( inURL, stRes, edRes );  
                                                                 browserRec := InsertBrowserTab( ThreadItem );  
                                                                 if (browserRec <> nil) and (stRes > 0) then  
                                                                         browserRec.Movement := IntToStr( stRes );  
                                                                 DownloadContent( ThreadItem );  
                                                                 Exit;  
4681                                                          end else begin                                                          end else begin
4682                                                                  tmpThread.Free;                                                                  tmpThread.Free;
                                                                 GikoSys.GetPopupResNumber( inURL, stRes, edRes );  
                                                                 browserRec := InsertBrowserTab( ThreadItem );  
                                                                 if ThreadItem.IsLogFile then begin  
                                                                         if (browserRec <> nil) and (stRes > 0) then begin  
                                                                                 browserRec.Movement := IntToStr( stRes );  
                                                                                 if (stRes > ThreadItem.Count) then begin  
                                                                                         DownloadContent( ThreadItem );  
                                                                                 end else begin  
                                                                                         try  
                                                                                                 browserRec.Move(browserRec.Movement);  
                                                                                         except  
                                                                                         end;  
                                                                                         browserRec.Movement := '';  
                                                                                 end;  
                                                                         end;  
                                                                 end else begin  
                                                                         if (browserRec <> nil) and (stRes > 0) then  
                                                                                 browserRec.Movement := IntToStr( stRes );  
                                                                         DownloadContent( ThreadItem );  
                                                                 end;  
                                                                 Exit;  
4683                                                          end;                                                          end;
4684                                                            OpenThreadItem(ThreadItem, inURL);
4685                                                            Exit;
4686                                                  end;                                                  end;
4687                                          end;                                          end;
4688    
# Line 4693  begin Line 4709  begin
4709          if (Length( Trim(BBSKey) ) > 0) and (Length( Trim(BBSID) ) > 0) then begin          if (Length( Trim(BBSKey) ) > 0) and (Length( Trim(BBSID) ) > 0) then begin
4710                  boardURL := GikoSys.Get2chThreadURL2BoardURL( inURL );                  boardURL := GikoSys.Get2chThreadURL2BoardURL( inURL );
4711                  Board := BBSsFindBoardFromURL( boardURL );                  Board := BBSsFindBoardFromURL( boardURL );
                 //if Board = nil then  
                 //      Board := BBSsFindBoardFromBBSID( BBSID );  
                 { この部分もBBSsFindBoardFromURLに持たせた 20050523  
                 if Board = nil then begin  
                         // ※作っても追加するところが無いので激しく保留  
                         // 過去ログ倉庫から、ダウソしたスレが発見できないのでここで探すようにする (2004/01/22)  
                         Board := BBSs[ 0 ].FindBBSID( BBSID );  
                 end;  
                 }  
4712                  if Board = nil then begin                  if Board = nil then begin
4713                           // 入るべき板が見つからなかったので、普通のブラウザで開く                           // 入るべき板が見つからなかったので、普通のブラウザで開く
4714                           GikoSys.OpenBrowser(inURL, gbtUserApp);                           GikoSys.OpenBrowser(inURL, gbtUserApp);
# Line 4726  begin Line 4733  begin
4733                  if ThreadItem = nil then begin                  if ThreadItem = nil then begin
4734                          ThreadItem := Board.FindThreadFromFileName( BBSKey + '.dat' );                          ThreadItem := Board.FindThreadFromFileName( BBSKey + '.dat' );
4735                  end;                  end;
4736                  if ThreadItem = nil then begin                  try
4737                          //shift -> 設定ブラウザ(無ければIE)                          // スレッドアイテムがないなら生成する。
4738                          //ctrl  -> IE                          if ThreadItem = nil then begin
4739                          {shiftDown      := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);                                  ThreadItem := TThreadItem.Create( nil, Board, URL );
4740                          ctrlDown        := GetAsyncKeyState(VK_CONTROL) = Smallint($8001);                                  ThreadItem.FileName := ChangeFileExt(BBSKey, '.dat');
4741                          if shiftDown then                                  Board.Insert(0, ThreadItem);
4742                                  GikoSys.OpenBrowser(URL1, gbtUserApp)                                  if ActiveList is TBoard then begin
4743                          else if ctrlDown then                                          if TBoard(ActiveList) = Board then
4744                                  GikoSys.OpenBrowser(URL1, gbtIE)                                                  ListView.Items.Count := ListView.Items.Count + 1;
                         else begin  
                         }  
                         ThreadItem := TThreadItem.Create( nil, Board, URL );  
                         ThreadItem.FileName := ChangeFileExt(BBSKey, '.dat');  
                         if AnsiPos(Host, Board.URL) = 0 then  
                                 ThreadItem.DownloadHost := Host  
                         else  
                                 ThreadItem.DownloadHost := '';  
                         Board.Insert(0, ThreadItem);  
                         if ActiveList is TBoard then begin  
                                 if TBoard(ActiveList) = Board then  
                                         ListView.Items.Count := ListView.Items.Count + 1;  
                         end;  
                         GikoSys.GetPopupResNumber( inURL, stRes, edRes );  
                         browserRec := InsertBrowserTab(ThreadItem);  
                         if (browserRec <> nil) and (stRes > 0) then  
                                 browserRec.Movement := IntToStr( stRes );  
                         DownloadContent(ThreadItem);  
                         {end;}  
                 end else begin  
                         if ThreadItem.IsLogFile then begin  
                                 GikoSys.GetPopupResNumber( inURL, stRes, edRes );  
                                 browserRec := InsertBrowserTab(ThreadItem);  
                                 if (browserRec <> nil) and (stRes > 0) then begin  
                                         browserRec.Movement := IntToStr( stRes );  
                                         if (stRes > ThreadItem.Count) then begin  
                         DownloadContent(ThreadItem);  
                                         end else begin  
                                                 try  
                                                         browserRec.Move(browserRec.Movement);  
                                                 except  
                                                 end;  
                                                 browserRec.Movement := '';  
                                         end;  
4745                                  end;                                  end;
4746                          end else begin                          end;
4747                            // ログなしスレッドのときは、ホスト名のチェックをする
4748                            if not ThreadItem.IsLogFile then begin
4749                                  if AnsiPos(Host, Board.URL) = 0 then                                  if AnsiPos(Host, Board.URL) = 0 then
4750                                          ThreadItem.DownloadHost := Host                                          ThreadItem.DownloadHost := Host
4751                                  else                                  else
4752                                          ThreadItem.DownloadHost := '';                                          ThreadItem.DownloadHost := '';
                                 GikoSys.GetPopupResNumber( inURL, stRes, edRes );  
                                 browserRec := InsertBrowserTab(ThreadItem);  
                                 if (browserRec <> nil) and (stRes > 0) then  
                                         browserRec.Movement := IntToStr( stRes );  
                                 DownloadContent(ThreadItem);  
4753                          end;                          end;
4754                            OpenThreadItem(ThreadItem, inURL);
4755                    except
4756                  end;                  end;
4757          end else begin          end else begin
4758                  Board := BBSsFindBoardFromURL( inURL );                  Board := BBSsFindBoardFromURL( inURL );
# Line 4790  begin Line 4762  begin
4762                          if FActiveBBS <> Board.ParentCategory.ParenTBBS then                          if FActiveBBS <> Board.ParentCategory.ParenTBBS then
4763                                  ShowBBSTree( Board.ParentCategory.ParenTBBS );                                  ShowBBSTree( Board.ParentCategory.ParenTBBS );
4764                          SelectTreeNode( Board, True );                          SelectTreeNode( Board, True );
4765          end;                  end;
4766          end;          end;
4767  end;  end;
4768    
# Line 7832  begin Line 7804  begin
7804                  end;                  end;
7805          end;          end;
7806  end;  end;
7807    //! このレスのURL取得
7808    procedure TGikoForm.GetResURLMenuClick(Sender: TObject);
7809    begin
7810    ;
7811    end;
7812    
7813  initialization  initialization
7814                                  OleInitialize(nil);                                  OleInitialize(nil);

Legend:
Removed from v.1.584  
changed lines
  Added in v.1.585

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