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.635 by h677, Sun Apr 15 16:21:29 2007 UTC revision 1.635.2.5 by h677, Sat May 12 02:46:10 2007 UTC
# Line 16  uses Line 16  uses
16          ToolWin, Buttons, IdComponent, UrlMon, Tabs, IdGlobal, StrUtils,          ToolWin, Buttons, IdComponent, UrlMon, Tabs, IdGlobal, StrUtils,
17          CommCtrl, Dialogs, GikoSystem, Setting, BoardGroup, ThreadControl, ItemDownload,          CommCtrl, Dialogs, GikoSystem, Setting, BoardGroup, ThreadControl, ItemDownload,
18          Editor, RoundData, GikoPanel, Favorite, HTMLDocumentEvent,          Editor, RoundData, GikoPanel, Favorite, HTMLDocumentEvent,
19          HintWindow, GikoCoolBar, GikoListView, Search, ExternalBoardManager,          {HintWindow,} GikoCoolBar, GikoListView, Search, ExternalBoardManager,
20          ExternalBoardPlugInMain, StdActns, Variants, ExtActns,IdTCPConnection,          ExternalBoardPlugInMain, StdActns, Variants, ExtActns,IdTCPConnection,
21          IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord, MoveHistoryItem,          IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord, MoveHistoryItem,
22      ShellAPI,Preview, HistoryList;      ShellAPI,Preview, HistoryList, ResPopupBrowser;
23    
24  const  const
25          NGWORDNAME_PANEL = 3;          NGWORDNAME_PANEL = 3;
# Line 560  type Line 560  type
560                  FEnabledCloseButton: Boolean;                  FEnabledCloseButton: Boolean;
561                  FClickNode: TTreeNode;                  FClickNode: TTreeNode;
562                  FHttpState: Boolean;                  FHttpState: Boolean;
                 FHint: TResPopup;  
563                  FPreviewBrowser: TPreviewBrowser;                  FPreviewBrowser: TPreviewBrowser;
564                  FPreviewURL: string;                  FPreviewURL: string;
565                  FBrowserSizeHeight: Integer;                  FBrowserSizeHeight: Integer;
# Line 604  type Line 603  type
603                  FOrigenCaption: String;                         //お気に入りツリーのアイテム編集時の編集前の文字列                  FOrigenCaption: String;                         //お気に入りツリーのアイテム編集時の編集前の文字列
604                  FPreviewBrowserRect: TRect;                     ///< プレビューの表示位置を記憶する                  FPreviewBrowserRect: TRect;                     ///< プレビューの表示位置を記憶する
605                  FActionListGroupIndexes: array of Integer;      ///<GikoDM上のアクションリストの各アクションに設定されたGroupIndexを保存する配列                  FActionListGroupIndexes: array of Integer;      ///<GikoDM上のアクションリストの各アクションに設定されたGroupIndexを保存する配列
606            FResPopupBrowser: TResPopupBrowser;
607                  procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);                  procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
608                  procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);                  procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
609                  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 620  type Line 619  type
619                  procedure FavoriteClick(Sender: TObject); overload;                  procedure FavoriteClick(Sender: TObject); overload;
620                  procedure FavoriteDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);                  procedure FavoriteDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
621                  function OnDocumentContextMenu(Sender: TObject): WordBool;                  function OnDocumentContextMenu(Sender: TObject): WordBool;
                 procedure ShowTextPopup;  
622                  function GetWidthAllToolButton(ToolBar: TToolBar): Integer;                  function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
623                  procedure MenuBarChevronMenu;                  procedure MenuBarChevronMenu;
624                  procedure LinkBarChevronMenu;                  procedure LinkBarChevronMenu;
# Line 910  begin Line 908  begin
908          //これ以後Set〜で再設定するまで、ActionのCheckedをいじるときは注意!          //これ以後Set〜で再設定するまで、ActionのCheckedをいじるときは注意!
909          GetGroupIndex(GikoDM.GikoFormActionList);          GetGroupIndex(GikoDM.GikoFormActionList);
910          FSearchDialog := nil;          FSearchDialog := nil;
911        FResPopupBrowser := nil;
912          CreateBrowsers(BROWSER_COUNT);          CreateBrowsers(BROWSER_COUNT);
913      FIconData.uID := 0;      FIconData.uID := 0;
914        
915          //メニューフォント          //メニューフォント
916          SetMenuFont;          SetMenuFont;
917    
# Line 1244  begin Line 1243  begin
1243          //最終巡回時間          //最終巡回時間
1244  //      FLastRoundTime := 0;  //      FLastRoundTime := 0;
1245    
         //ResHint  
         FHint := TResPopup.Create(Self);  
   
1246          ListView.OnData := TListViewUtils.ListViewData;          ListView.OnData := TListViewUtils.ListViewData;
1247    
1248          // 最後に選択されたキャビネットの復元          // 最後に選択されたキャビネットの復元
# Line 1686  begin Line 1682  begin
1682                  if FEvent <> nil then                  if FEvent <> nil then
1683                          FEvent.Free;                          FEvent.Free;
1684    
1685                  //Hint破棄          // TODO レスポップアップの破棄
1686                  if FHint <> nil then begin  
                         FHint.ReleaseHandle;  
                         FHint.Free;  
                         FHint := nil;  
                 end;  
1687                  //Preview破棄                  //Preview破棄
1688                  if TPreviewBrowser <> nil then begin                  if TPreviewBrowser <> nil then begin
1689                          FPreviewBrowser.Free;                          FPreviewBrowser.Free;
# Line 1903  begin Line 1895  begin
1895          {$IFDEF DEBUG}          {$IFDEF DEBUG}
1896          Writeln('Status Text is not changed!');          Writeln('Status Text is not changed!');
1897          {$ENDIF}          {$ENDIF}
1898            if Text2 = '' then begin
1899                if FResPopupBrowser <> nil then begin
1900                    if not(Sender is TResPopupBrowser) then
1901                        FResPopupBrowser.Clear
1902                    else begin
1903                        TResPopupBrowser(Sender).ChildClear;
1904                    end;
1905                end;
1906            end;
1907          Exit;          Exit;
1908      end;      end;
1909          StatusBar.Panels[1].Text := Text2;          StatusBar.Panels[1].Text := Text2;
1910    
         if FHint <> nil then begin  
                 FHint.ReleaseHandle;  
                 FHint.ClearAllRes;  
         end;  
1911          if FPreviewBrowser <> nil then          if FPreviewBrowser <> nil then
1912                  ShowWindow(FPreviewBrowser.Handle, SW_HIDE);                  ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
1913    
1914        if FResPopupBrowser <> nil then begin
1915            if not(Sender is TResPopupBrowser) then
1916                FResPopupBrowser.Clear
1917            else begin
1918                TResPopupBrowser(Sender).ChildClear;
1919            end;
1920        end;
1921    
1922          if not GikoSys.Setting.UnActivePopup then          if not GikoSys.Setting.UnActivePopup then
1923                  if not GikoForm.Active then                  if not GikoForm.Active then
1924                          Exit;                          Exit;
# Line 1945  begin Line 1950  begin
1950                          p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;                          p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
1951                          e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);                          e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
1952                          if (Assigned(e)) then begin                          if (Assigned(e)) then begin
1953                    if (FResPopupBrowser = nil) then begin
1954                        FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);
1955                        ShowWindow(FResPopupBrowser.Handle, SW_HIDE);
1956                    end;
1957                                  tmp2 := ZenToHan(e.Get_outerText);                                  tmp2 := ZenToHan(e.Get_outerText);
1958                                  if (GikoSys.IsNumeric(tmp2)) then begin                                  if (GikoSys.IsNumeric(tmp2)) then begin
1959                                          //sはレス番号っぽいっす。                                          //sはレス番号っぽいっす。
1960                                          wkIntSt := StrToInt64(tmp2);                                          wkIntSt := StrToInt64(tmp2);
1961                                          wkIntTo := StrToInt64(tmp2);                                          wkIntTo := StrToInt64(tmp2);
1962                                                  //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);                      FResPopupBrowser.PopupType := gptThread;
1963                                          FHint.PopupType := gptThread;                                          HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, GetActiveContent, wkIntSt, wkIntTo, False, False);
                                         HTMLCreater.SetResPopupText(FHint, GetActiveContent, wkIntSt, wkIntTo, False, False);  
1964                                  end else begin                                  end else begin
1965                                          FHint.PopupType := gptRaw;                      FResPopupBrowser.PopupType := gptRaw;
1966                                          FHint.Caption := s;                      FResPopupBrowser.Title := s;
1967                                  end;                                  end;
1968                          end;                          end;
1969                  end else begin                  end else begin
# Line 2011  begin Line 2019  begin
2019                                                  wkIntSt := 1;                                                  wkIntSt := 1;
2020                                                  wkIntTo := 1;                                                  wkIntTo := 1;
2021                                          end;                                          end;
2022                                          FHint.PopupType := gptThread;                      if (FResPopupBrowser = nil) then begin
2023                                          HTMLCreater.SetResPopupText(FHint, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );                          FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);
2024                            ShowWindow(FResPopupBrowser.Handle, SW_HIDE);
2025                        end;
2026                        FResPopupBrowser.PopupType := gptThread;
2027                                            HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
2028                                  end;                                  end;
2029                          end;                          end;
2030                  end;                  end;
2031            if (FResPopupBrowser = nil) then begin
2032                  if FHint.PopupType = gptRaw then begin              FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);
2033                          if FHint.Caption <> '' then              ShowWindow(FResPopupBrowser.Handle, SW_HIDE);
2034                                  ShowTextPopup;          end;
2035                  end else begin          if FResPopupBrowser.PopupType = gptRaw then begin
2036                          if (FHint.ResCount <> 0) or (FHint.Title <> '') then              if FResPopupBrowser.Title <> '' then
2037                                  ShowTextPopup;                  FResPopupBrowser.CreateNewBrowser.TitlePopup;
2038                  end;                  end;
2039          end;          end;
2040  end;  end;
# Line 3715  begin Line 3727  begin
3727          if ( aElement <> nil) then begin          if ( aElement <> nil) then begin
3728                  Text := aElement.Get_outerText;                  Text := aElement.Get_outerText;
3729                  Html := aElement.Get_outerHTML;                  Html := aElement.Get_outerHTML;
3730            if (Sender is TResPopupBrowser) then begin
3731                TResPopupBrowser(Sender).ChildClear;
3732                FActiveContent.Browser.SetFocus;
3733            end;
3734                  if(AnsiPos('>>', Text) = 1) or (AnsiPos('>', Text) = 1)                  if(AnsiPos('>>', Text) = 1) or (AnsiPos('>', Text) = 1)
3735                          or (AnsiPos('>>', Text) = 1) or (AnsiPos('>', Text) = 1) then begin                          or (AnsiPos('>>', Text) = 1) or (AnsiPos('>', Text) = 1) then begin
3736                          if GikoSys.Setting.ResAnchorJamp then begin                          if GikoSys.Setting.ResAnchorJamp then begin
# Line 4759  procedure TGikoForm.WMSetCursor(var Mess Line 4775  procedure TGikoForm.WMSetCursor(var Mess
4775  var  var
4776          Pos : TPoint;          Pos : TPoint;
4777  begin  begin
   
4778          if PreviewTimer.Enabled then          if PreviewTimer.Enabled then
4779                  PreviewTimer.Enabled := False;                  PreviewTimer.Enabled := False;
4780          if (FHint <> nil) and (IsWindowVisible(FHint.Handle)) then begin  
4781                  FHint.ReleaseHandle;          if (FResPopupBrowser <> nil) and (IsWindowVisible(FResPopupBrowser.Handle)) then begin
4782                  FHint.ClearAllRes;          FResPopupBrowser.Clear;
4783          end;          end;
4784    
4785          if (FPreviewBrowser <> nil)          if (FPreviewBrowser <> nil)
# Line 4810  begin Line 4825  begin
4825                          ThreadItem := GetActiveContent;                          ThreadItem := GetActiveContent;
4826                          if ThreadItem <> nil then begin                          if ThreadItem <> nil then begin
4827                                  Num := StrToInt64(s);                                  Num := StrToInt64(s);
4828                                  FHint.PopupType := gptThread;                  if (FResPopupBrowser = nil) then begin
4829                                  HTMLCreater.SetResPopupText(FHint, ThreadItem, Num, Num, False, False);                      FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);
4830                                  if FHint.ResCount <> 0 then                      ShowWindow(FResPopupBrowser.Handle, SW_HIDE);
4831                                          ShowTextPopup;                  end;
4832                    FResPopupBrowser.PopupType := gptThread;
4833                                    HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, ThreadItem, Num, Num, False, False);
4834                                  Result := False;                                  Result := False;
4835                          end else                          end else
4836                                  Result := True;                                  Result := True;
# Line 4823  begin Line 4840  begin
4840          end;          end;
4841  end;  end;
4842    
 procedure TGikoForm.ShowTextPopup;  
 var  
         p: TPoint;  
         ARect: TRect;  
 begin  
 //      if Trim(s) = '' then  
 //              Exit;  
         try  
                 FHint.Font.Name := GikoSys.Setting.HintFontName;  
                 FHint.Font.Size := GikoSys.Setting.HintFontSize;  
                 FHint.Font.Color := GikoSys.Setting.HintFontColor;  
                 FHint.Color := GikoSys.Setting.HintBackColor;  
                 FHint.HeaderBold := GikoSys.Setting.ResPopupHeaderBold;  
                 GetCursorpos(p);  
                 if FHint.PopupType = gptRaw then  
                         ARect := FHint.CalcHintRect(Screen.Width, FHint.Caption, nil)  
                 else  
                         ARect := FHint.CalcHintRect(Screen.Width, '', nil);  
                 case GikoSys.Setting.PopupPosition of  
                         gppRightTop:            OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y - (ARect.Bottom - ARect.Top) -     15);  
                         gppRight:                       OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y - ((ARect.Bottom - ARect.Top) div 2));  
                         gppRightBottom: OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y + 15);  
                         gppTop:                                 OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y - (ARect.Bottom - ARect.Top) -  15);  
                         gppCenter:                      OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y - ((ARect.Bottom - ARect.Top) div 2));  
                         gppBottom:                      OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y + 15);  
                         gppLeftTop:                     OffsetRect(ARect, p.x + 15, p.y - (ARect.Bottom - ARect.Top) -  15);  
                         gppLeft:                                OffsetRect(ARect, p.x + 15, p.y - ((ARect.Bottom - ARect.Top) div 2));  
                         gppLeftBottom:  OffsetRect(ARect, p.x + 15, p.y + 15);          //ギコナビスレ パート1の453氏に感謝  
                 end;  
                 //FHint.ActivateHint(ARect, s);  
                 if FHint.PopupType = gptRaw then  
                         FHint.ActivateHint(ARect, FHint.Caption)  
                 else  
                         FHint.ActivateHint(ARect, '');  
         except  
                 FHint.ReleaseHandle;  
                 FHint.ClearAllRes;  
         end;  
 end;  
   
4843  procedure TGikoForm.HistoryAllClearToolButtonClick(Sender: TObject);  procedure TGikoForm.HistoryAllClearToolButtonClick(Sender: TObject);
4844  const  const
4845          DEL_MSG = '全履歴を削除します。よろしいですか?';          DEL_MSG = '全履歴を削除します。よろしいですか?';
# Line 7247  begin Line 7224  begin
7224          Application.ProcessMessages;          Application.ProcessMessages;
7225          if not Application.Terminated then begin          if not Application.Terminated then begin
7226                  if PreviewTimer.Enabled then                  if PreviewTimer.Enabled then
7227                          PreviewTimer.Enabled := False;                  PreviewTimer.Enabled := False;
7228                  //フォーカスが他のアプリに変わったときにヒントを消去                  //フォーカスが他のアプリに変わったときにポップアップ消去
7229                  if FHint <> nil then begin          if FResPopupBrowser <> nil then
7230                          FHint.ReleaseHandle;              FResPopupBrowser.Clear;
7231                          FHint.ClearAllRes;  
                 end;  
7232                  //プレビューを隠す                  //プレビューを隠す
7233                  if FPreviewBrowser <> nil then                  if FPreviewBrowser <> nil then
7234                          ShowWindow(FPreviewBrowser.Handle, SW_HIDE);                          ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
# Line 7301  begin Line 7277  begin
7277          BrowserNullTab := TBrowserRecord.Create;          BrowserNullTab := TBrowserRecord.Create;
7278          BrowserNullTab.Browser := Browser;          BrowserNullTab.Browser := Browser;
7279          BrowserNullTab.Browser.Navigate(BLANK_HTML);          BrowserNullTab.Browser.Navigate(BLANK_HTML);
7280    
7281          FBrowsers := TList.Create;          FBrowsers := TList.Create;
7282          for i := 0 to count -1 do begin          for i := 0 to count -1 do begin
7283                  FBrowsers.Add(TWebBrowser.Create(BrowserPanel));                  FBrowsers.Add(TWebBrowser.Create(BrowserPanel));
# Line 7320  begin Line 7297  begin
7297          end;          end;
7298          BrowserNullTab.Browser.BringToFront;          BrowserNullTab.Browser.BringToFront;
7299          ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);          ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);
7300    
7301          //起動時にタブ自動復元を入れていると、空ページ用のBrowserの          //起動時にタブ自動復元を入れていると、空ページ用のBrowserの
7302          //描画が終わっていなくて、クリックイベントの設定等に突入するので          //描画が終わっていなくて、クリックイベントの設定等に突入するので
7303          //ここで終わらせておく          //ここで終わらせておく

Legend:
Removed from v.1.635  
changed lines
  Added in v.1.635.2.5

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