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.2.4 by h677, Fri May 11 16:48:12 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, ResPopupBrowser;      ShellAPI,Preview, HistoryList, ResPopupBrowser;
# 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 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 1245  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 1687  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 1917  begin Line 1908  begin
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    
# Line 1964  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;
                                         FHint.PopupType := gptThread;  
                     if (FResPopupBrowser = nil) then begin  
                         FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);  
                         ShowWindow(FResPopupBrowser.Handle, SW_HIDE);  
                     end;  
1963                                          HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, GetActiveContent, wkIntSt, wkIntTo, False, False);                                          HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, 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 2034  begin Line 2019  begin
2019                                                  wkIntSt := 1;                                                  wkIntSt := 1;
2020                                                  wkIntTo := 1;                                                  wkIntTo := 1;
2021                                          end;                                          end;
                                         FHint.PopupType := gptThread;  
2022                      if (FResPopupBrowser = nil) then begin                      if (FResPopupBrowser = nil) then begin
2023                          FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);                          FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);
2024                          ShowWindow(FResPopupBrowser.Handle, SW_HIDE);                          ShowWindow(FResPopupBrowser.Handle, SW_HIDE);
2025                      end;                      end;
2026                        FResPopupBrowser.PopupType := gptThread;
2027                                          HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );                                          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 4790  procedure TGikoForm.WMSetCursor(var Mess Line 4775  procedure TGikoForm.WMSetCursor(var Mess
4775  var  var
4776          Pos : TPoint;          Pos : TPoint;
4777  begin  begin
         if (FHint <> nil) and (IsWindowVisible(FHint.Handle)) then begin  
                 FHint.ReleaseHandle;  
                 FHint.ClearAllRes;  
     end;  
4778          if PreviewTimer.Enabled then          if PreviewTimer.Enabled then
4779                  PreviewTimer.Enabled := False;                  PreviewTimer.Enabled := False;
4780    
4781          if (FResPopupBrowser <> nil) and (IsWindowVisible(FResPopupBrowser.Handle)) then begin          if (FResPopupBrowser <> nil) and (IsWindowVisible(FResPopupBrowser.Handle)) then begin
4782          FResPopupBrowser.Clear;          FResPopupBrowser.Clear;
4783          end;          end;
# Line 4843  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);
                                 //FHint.PopupType := gptThread;  
4828                  if (FResPopupBrowser = nil) then begin                  if (FResPopupBrowser = nil) then begin
4829                      FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);                      FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);
4830                      ShowWindow(FResPopupBrowser.Handle, SW_HIDE);                      ShowWindow(FResPopupBrowser.Handle, SW_HIDE);
4831                  end;                  end;
4832                    FResPopupBrowser.PopupType := gptThread;
4833                                  HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, ThreadItem, Num, Num, False, False);                                  HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, ThreadItem, Num, Num, False, False);
                                 //if FHint.ResCount <> 0 then  
                                 //      ShowTextPopup;  
4834                                  Result := False;                                  Result := False;
4835                          end else                          end else
4836                                  Result := True;                                  Result := True;
# Line 4860  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 7284  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);

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

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