X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Giko.pas;h=d601fa0dbcb56362dafd65baffec2fa9d19fe429;hb=ed262f6cd989d300228e6de1a3546e80dbbfa3f3;hp=9fc829b66830f55dfa585e26fd13b05824e931a1;hpb=479f995b4869c4e43e7627097d2934006d3c4cce;p=gikonavigoeson%2Fgikonavi.git diff --git a/Giko.pas b/Giko.pas index 9fc829b..d601fa0 100644 --- a/Giko.pas +++ b/Giko.pas @@ -24,8 +24,7 @@ uses const NGWORDNAME_PANEL = 3; THREADSIZE_PANEL = 2; - USER_RESPOPUPCLEAR = WM_USER + 2005; ///< wParam : TWebBrowser - + USER_POPUPCLEAR = WM_USER + 2005; ///< wParam : TWebBrowser type TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser); @@ -85,6 +84,7 @@ type ToolMenu: TMenuItem; Find1: TMenuItem; RoundMenu: TMenuItem; + Search1: TMenuItem; MMSep04: TMenuItem; OptionMenu: TMenuItem; HelpMenu: TMenuItem; @@ -422,8 +422,17 @@ type N83: TMenuItem; UpdateGikonaviAction1: TMenuItem; N84: TMenuItem; + N85: TMenuItem; + URL2: TMenuItem; + URLPATHINFO1: TMenuItem; + URLQUERYSTRING1: TMenuItem; + N86: TMenuItem; + K4: TMenuItem; + WikiFAQ1: TMenuItem; + ThrNGEdit: TMenuItem; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); + procedure SaveSettingAll(); procedure BrowserStatusTextChange(Sender: TObject; const Text: WideString); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); @@ -608,6 +617,10 @@ type FPreviewBrowserRect: TRect; ///< ƒvƒŒƒrƒ…[‚Ì•\Ž¦ˆÊ’u‚ð‹L‰¯‚·‚é FActionListGroupIndexes: array of Integer; /// '') then begin - PostMessage( Handle, USER_DOCUMENTCOMPLETE, Integer( FActiveContent.Browser ), 0 ); if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin while (FActiveContent.Browser.ReadyState <> READYSTATE_COMPLETE) and (FActiveContent.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin - Application.ProcessMessages; + // ƒƒbƒZ[ƒW‚ðŽó‚¯Žæ‚ç‚È‚¢‚悤‚ɃXƒŠ[ƒv‚ɕύX + Sleep(1); end; end; item := BBSsFindThreadFromURL( GikoSys.Setting.LastCloseTabURL ); + GikoSys.Setting.LastCloseTabURL := ''; if (item <> nil) and (item.IsLogFile) then begin OpenThreadItem(item, item.URL); end; - GikoSys.Setting.LastCloseTabURL := ''; + //ShowWindow(Self.Handle, SW_SHOW); end; end; - //ActionList‚ÌGroupIndex‚ðŒ³‚É–ß‚· - SetGroupIndex(GikoDM.GikoFormActionList); +//===== ƒ}ƒ‹ƒ`ƒ‚ƒjƒ^ŠÂ‹«‚ÅFormCreate‚ł̓tƒH[ƒ€ˆÊ’u‚ª³‚µ‚­”½‰f‚³‚ê‚È‚¢ê‡ +//===== ‚ª‚ ‚邽‚ßFormShow‰‰ñ‚ōÀ•WÝ’è‚ðs‚¤ + Top := GikoSys.Setting.WindowTop; + Left := GikoSys.Setting.WindowLeft; + Height := GikoSys.Setting.WindowHeight; + Width := GikoSys.Setting.WindowWidth; + + //ƒEƒBƒ“ƒhƒE‚ª‰æ–ÊŠO‚È‚ç‰æ–Ê“à‚Ɉړ®‚·‚é + Right := Left + Width; + Bottom := Top + Height; + MonOk := False; + MonCnt := 0; + while (MonCnt < Screen.MonitorCount) do begin + MonR := Screen.Monitors[MonCnt].Left + Screen.Monitors[MonCnt].Width; + MonB := Screen.Monitors[MonCnt].Top + Screen.Monitors[MonCnt].Height; + + if ((Left >= Screen.Monitors[MonCnt].Left) and (Left < MonR) and + (Top >= Screen.Monitors[MonCnt].Top) and (Top < MonB) and + (Right > Screen.Monitors[MonCnt].Left) and (Right <= MonR) and + (Bottom > Screen.Monitors[MonCnt].Top) and (Bottom <= MonB)) then begin + MonOk := True; + Break; + end; + + MonCnt := MonCnt + 1; + end; + + if (MonOk = False) then begin + Left := 0; + Top := 0; + end; - FStartUp := false; + if GikoSys.Setting.WindowMax then + WindowState := wsMaximized; +//========================================================================== end; end; @@ -1525,6 +1613,8 @@ begin Exit; end; + g_AppTerminated := True; + GikoSys.Setting.LastCloseTabURL := ''; if GikoSys.Setting.TabAutoLoadSave then begin GikoDM.TabsSaveAction.Execute; @@ -1550,38 +1640,30 @@ begin Application.UnhookMainWindow(Hook); //ƒAƒvƒŠƒP[ƒVƒ‡ƒ“I—¹‚Ì‘O‚Ƀ_ƒEƒ“ƒ[ƒhƒXƒŒƒbƒh‚ɐ³íI—¹‚𑣂· + FControlThread.DownloadAbort; FControlThread.Terminate; + + //OnDestory‚¾‚ƍċN“®‚ð‚©‚¯‚½‚Æ‚«‚È‚Ç‚É•Û‘¶‚³‚ê‚È‚¢‚Ì‚ÅOnCloseQuery‚Őݒè•Û‘¶ + SaveSettingAll(); + Application.Terminate; end; -procedure TGikoForm.FormDestroy(Sender: TObject); +procedure TGikoForm.SaveSettingAll(); var - i : Integer; wp : TWindowPlacement; - tmpBool : Boolean; WindowPlacement: TWindowPlacement; begin - // ƒ^ƒXƒNƒgƒŒƒC‚̃AƒCƒRƒ“íœ - if (FIconData.uID <> 0) then begin - Shell_NotifyIcon(NIM_DELETE, @FIconData); - end; - - // ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[ŠJ•ú try - if GikoSys.Setting.GestureEnabled then begin - MouseGesture.OnGestureStart := nil; - MouseGesture.OnGestureMove := nil; - MouseGesture.OnGestureEnd := nil; - end; - MouseGesture.Clear; - MouseGesture.UnHook; - MouseGesture.Free; + GikoDM.SaveThreadSearchSetting; except end; + try ActiveListColumnSave; except end; + try WindowPlacement.length := SizeOf(TWindowPlacement); GetWindowPlacement(Self.Handle, @WindowPlacement); @@ -1614,21 +1696,13 @@ begin GikoSys.Setting.ResRange := FResRangeMenuSelect; except end; - if WindowState <> wsNormal then - WindowState := wsNormal; - SaveCoolBarSettings; - try - GikoSys.Setting.WriteWindowSettingFile; - GikoSys.Setting.WriteNameMailSettingFile; - except - end; - // ƒŠƒAƒ‹ƒ^ƒCƒ€‚É•Û‘¶‚³‚ê‚é‚̂ŁA‚Ü‚½AƒEƒBƒ“ƒhƒEƒTƒCƒY‚ª CoolBar ‚æ‚è - // ¬‚³‚­‚È‚Á‚Ä‚¢‚é‚Æ‚«‚É•Û‘¶‚·‚é‚Æ’l‚ªã‘‚«‚³‚ê‚Ä‚µ‚Ü‚¤‚Ì‚Å‚±‚±‚Å‚Í•Û‘¶‚µ‚È‚¢ - - // ªFormDestroy’†‚Ɉړ®‚µ‚½‚̂ŁA‚±‚±‚Å•Û‘¶‚µ‚È‚¢‚Æ‚¢‚¯‚È‚¢‚ÆŽv‚¤Bi‚à‚¶‚ã@2004/04/09j - // CoolBar •Û‘¶ - //if (GikoForm.WindowState <> wsMinimized) and (GikoForm.WindowState <> wsMaximized) then - + //¡‚Ìwinodw‚̃Xƒ^ƒCƒ‹‚ÅCoolBar‚̈ʒuAƒEƒBƒ“ƒhƒE‚̈ʒu‚ð•Û‘¶ + SaveCoolBarSettings; + GikoSys.Setting.WriteWindowSettingFile; + // –¼‘O‚ƃ[ƒ‹‚Ì•Û‘¶‚Ȃ̂ŃGƒfƒBƒ^‚ª•Â‚¶‚½Œã‚È‚ç‚¢‚Â‚Å‚à‚¢‚¢ + GikoSys.Setting.WriteNameMailSettingFile; + // –`Œ¯‚̏‘‚Ì•Û‘¶ + GikoSys.Setting.WriteBoukenSettingFile; //“ü—̓AƒVƒXƒg‹@\‚̐ݒè‚Ì•Û‘¶ InputAssistDM.SaveToFile(GikoSys.GetInputAssistFileName); @@ -1639,10 +1713,71 @@ begin if not (FavoriteDM.AbEnd) then begin FavoriteDM.WriteFavorite; end; + except + end; + + //ƒAƒhƒŒƒX—š—ð•Û‘¶ + try + //AddressHistoryDM‚ÍŽ©“®¶¬ƒtƒH[ƒ€‚Ȃ̂ŁA‰ð•ú‚ÍŽ©“®“I‚É‚³‚ê‚éB + AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount); + except + end; + + //ƒqƒXƒgƒŠƒŠƒXƒg•Û‘¶ + try + FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml'); + except + end; + + //„‰ñƒŠƒXƒg•Û‘¶ + try + RoundList.SaveRoundFile; + except + end; + + // ƒ^ƒXƒNƒgƒŒƒC‚̃AƒCƒRƒ“íœ + if (FIconData.uID <> 0) then begin + Shell_NotifyIcon(NIM_DELETE, @FIconData); + end; + +end; + +procedure TGikoForm.FormDestroy(Sender: TObject); +var + i : Integer; + tmpBool : Boolean; +begin + //ˆêŽž“I‚ɒʏíƒXƒ^ƒCƒ‹‚É–ß‚µ‚ÄCoolBar‚̈ʒuAƒEƒBƒ“ƒhƒE‚̈ʒu‚ð•Û‘¶ + //¦’ˆÓFOnDestroy‚ÅŽg‚¤‚±‚Æ‚µ‚©l—¶‚³‚ê‚Ä‚¢‚È‚¢ + // ‘¼‚Å‚â‚é‚ƍĕ`‰æ‚ª”­¶‚·‚é + if WindowState <> wsNormal then begin + WindowState := wsNormal; + try + SaveCoolBarSettings; + GikoSys.Setting.WriteWindowSettingFile; + except + end; + end; + + // ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[ŠJ•ú + try + if GikoSys.Setting.GestureEnabled then begin + MouseGesture.OnGestureStart := nil; + MouseGesture.OnGestureMove := nil; + MouseGesture.OnGestureEnd := nil; + end; + MouseGesture.Clear; + MouseGesture.UnHook; + MouseGesture.Free; + except + end; + + //‚¨‹C‚É“ü‚è”jŠü + try FavoriteDM.Clear; except end; - //LockWindowUpdate(Self.Handle); + try //ƒ^ƒuƒNƒ[ƒY tmpBool := GikoSys.Setting.ShowDialogForAllTabClose; @@ -1651,6 +1786,7 @@ begin GikoSys.Setting.ShowDialogForAllTabClose := tmpBool; except end; + try for i := FBrowsers.Count - 1 downto 0 do begin GikoSys.ShowRefCount('browser' + IntToStr(i), TWebBrowser(FBrowsers[i]).ControlInterface); @@ -1665,6 +1801,7 @@ begin finally FBrowsers.Free; end; + try if BrowserNullTab <> nil then begin BrowserNullTab.Browser := nil; {*BrowserNullTab‚ÌBrowser‚͐݌vŽž‚É“\‚è•t‚¯‚Ä‚é“z @@ -1683,18 +1820,6 @@ begin except end; - //ƒAƒhƒŒƒX—š—ð•Û‘¶ - try - //AddressHistoryDM‚ÍŽ©“®¶¬ƒtƒH[ƒ€‚Ȃ̂ŁA‰ð•ú‚ÍŽ©“®“I‚É‚³‚ê‚éB - AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount); - except - end; - - //ƒqƒXƒgƒŠƒŠƒXƒg•Û‘¶ - try - FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml'); - except - end; try try FHistoryList.Clear; @@ -1704,11 +1829,7 @@ begin FHistoryList.Free; end; - //„‰ñƒŠƒXƒg•Û‘¶&”jŠü - try - RoundList.SaveRoundFile; - except - end; + try try RoundList.Clear; @@ -1720,7 +1841,7 @@ begin try try - FControlThread.DownloadAbort; + //FControlThread.DownloadAbort; FControlThread.Terminate; FControlThread.WaitFor; except @@ -1753,6 +1874,8 @@ begin except end; + ThreadNgList.Free; + try if FEvent <> nil then FEvent.Free; @@ -1772,7 +1895,14 @@ begin end; except end; - //LockWindowUpdate(0); + + // Update‚ª‚¢‚ê‚ÎŽÀs‚·‚é + if FileExists(FUpdateExePath) then begin + // ƒAƒbƒvƒf[ƒgŽÀs + GikoSys.CreateProcess(FUpdateExePath, FUpdateExeArgs); + end; + // ƒ[ƒŠ„—áŠO‚ðŒ³‚É–ß‚· + Set8087CW(FCwSave); end; // ŠeŠ‚É‚ ‚éƒLƒƒƒrƒlƒbƒgE BBS ƒƒjƒ…[‚ðƒZƒbƒg^XV @@ -2004,7 +2134,7 @@ begin if FResPopupBrowser <> nil then begin if not(Sender is TResPopupBrowser) then begin - if (FResPopupBrowser.Visible) then begin + if ((doc <> nil) and (FResPopupBrowser.Visible)) then begin if ResPopupClearTimer.Interval > 0 then begin ResPopupClearTimer.Enabled := True; ResPopupClearTimer.Tag := 0; @@ -2038,8 +2168,10 @@ begin end; s := ''; Ext := AnsiLowerCase(ExtractFileExt(Text2)); - if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and - ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin +// if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and + if ((Pos('http://', Text2) = 1) or (Pos('https://', Text2) = 1)) and (GikoSys.Setting.PreviewVisible) and + ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) or + (Pos('http://www.nicovideo.jp/watch/', Text2) = 1) then begin if FPreviewBrowser = nil then begin FPreviewBrowser := TPreviewBrowser.Create(Self); ShowWindow(FPreviewBrowser.Handle, SW_HIDE); @@ -2326,9 +2458,10 @@ begin {$IFDEF DEBUG} Writeln(URL); {$ENDIF} + FKokoPopupThreadItem := nil; if Pos(kMenuName, URL) <> 0 then begin sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) ); - + if not GikoSys.IsNumeric(sNo) then Exit; Cancel := True; @@ -2336,6 +2469,17 @@ begin KokoPopupMenu.PopupComponent := nil; if (Sender is TComponent) then KokoPopupMenu.PopupComponent := TComponent(Sender); + // Œë”š‘΍ô ƒNƒŠƒbƒN‚µ‚½ƒuƒ‰ƒEƒU‚ƈقȂé‚Æ‚«‚ɏÁ‚·ˆ—‚ð’ljÁ + if not (Sender is TResPopupBrowser) then begin + if (FResPopupBrowser <> nil) and (FResPopupBrowser.CurrentBrowser.Visible = True) then begin + FResPopupBrowser.Clear; + end; + end else begin + if (Sender <> FResPopupBrowser.CurrentBrowser) then begin + TResPopupBrowser(Sender).ChildClear; + end; + end; + FKokoPopupThreadItem := GetActiveContent(true); KokoPopupMenu.Tag := StrToInt(sNo); KokoPopupMenu.Popup(p.x, p.y); end else if Pos('mailto', LowerCase(URL)) <> 0 then begin @@ -2926,7 +3070,7 @@ begin if (Thread <> nil) and (ThreadItem <>nil) then begin BrowserBoardNameLabel.Caption := ThreadPTitle; ItemIcon16.GetBitmap(4, ItemBoardImage.Picture.Bitmap); - BrowserNameLabel.Caption := ThreadTitle; + BrowserNameLabel.Caption := GikoSys.TrimThreadTitle(ThreadTitle); ItemImage.Picture := nil; if ThreadIsLog then if ThreadNewArraical then @@ -2959,7 +3103,7 @@ begin end; end else begin - Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + ThreadTitle + ']'; + Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + GikoSys.TrimThreadTitle(ThreadTitle) + ']'; //ƒXƒe[ƒ^ƒXƒo[‚É•\Ž¦‚µ‚Ä‚¢‚éƒXƒŒ‚Ì—e—Ê‚ð•\Ž¦ StatusBar.Panels[THREADSIZE_PANEL].Text := Format('%6.2f kB', [ThreadItem.Size / 1024]); StatusBar.Panels[THREADSIZE_PANEL].Width := @@ -3022,7 +3166,7 @@ begin if (FActiveContent <> nil) and (FActiveContent.Thread <> nil) and (FActiveContent.Thread.IsLogFile) then begin try - Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + FActiveContent.Thread.Title + ']' + Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + GikoSys.TrimThreadTitle(FActiveContent.Thread.Title) + ']' except on E: Exception do begin //ƒXƒŒˆê——DLŒã‚È‚Ç‚ÉFActiveContent‚ÌŽ‚ÂThread‚ª @@ -3798,6 +3942,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := False; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := False; end else if TObject(FClickNode.Data) is TBoard then begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := True; @@ -3808,6 +3953,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := True; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := True; end else if TObject(FClickNode.Data) is TFavoriteBoardItem then begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := True; @@ -3818,6 +3964,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := True; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := False; end else if (TObject(FClickNode.Data) is TThreadItem) then begin TreeSelectThreadPupupMenu.Visible := True; TreeSelectBoardPupupMenu.Visible := False; @@ -3828,6 +3975,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := True; TreeSelectLogDeleteSeparator.Visible := True; TreeSelectLogDeletePopupMenu.Visible := True; + SearchBoardName.Visible := False; end else if (TObject(FClickNode.Data) is TFavoriteThreadItem) then begin TreeSelectThreadPupupMenu.Visible := True; TreeSelectBoardPupupMenu.Visible := False; @@ -3838,6 +3986,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := True; TreeSelectLogDeleteSeparator.Visible := True; TreeSelectLogDeletePopupMenu.Visible := True; + SearchBoardName.Visible := False; end else if (TObject(FClickNode.Data) is TCategory) then begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := False; @@ -3848,6 +3997,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := False; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := True; end else if FClickNode.IsFirstNode then begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := False; @@ -3858,6 +4008,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := False; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := True; end else begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := False; @@ -3868,6 +4019,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := False; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := False; end; end; @@ -4323,7 +4475,7 @@ procedure TGikoForm.SetSelectItemRound(RoundFlag: Boolean; RoundName: string; Pa var threadItem : TThreadItem; begin - if ParentName <> 'dummy1' then begin + if ParentName <> 'RoundItem' then begin SetSelectItemRound(RoundFlag, RoundName); end else begin threadItem := GetActiveContent; @@ -4640,7 +4792,7 @@ begin end; end; -procedure TGikoForm.MoveToURL(const inURL: string); +procedure TGikoForm.MoveToURL(const inURL: string; KeyMask: Boolean = False); var protocol, host, path, document, port, bookmark : string; URL, protocol2, host2, path2, document2, port2, bookmark2 : string; @@ -4657,17 +4809,18 @@ begin GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark ); GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey ); - - - shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001); - ctrlDown := GetAsyncKeyState(VK_CONTROL) = Smallint($8001); - if shiftDown then begin - GikoSys.OpenBrowser(inURL, gbtUserApp); - Exit; - end else if ctrlDown then begin - GikoSys.OpenBrowser(inURL, gbtIE); - Exit; - end; + // ƒAƒNƒVƒ‡ƒ“‚©‚çŒÄ‚΂ê‚é‚Æshift/ctrl‚Í‚¨‚µ‚Á‚ς̏ꍇ‚ª‚Ù‚Æ‚ñ‚ǂȂ̂Ń}ƒXƒN‚·‚é + if not KeyMask then begin + shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001); + ctrlDown := GetAsyncKeyState(VK_CONTROL) = Smallint($8001); + if shiftDown then begin + GikoSys.OpenBrowser(inURL, gbtUserApp); + Exit; + end else if ctrlDown then begin + GikoSys.OpenBrowser(inURL, gbtIE); + Exit; + end; + end; //===== ƒvƒ‰ƒOƒCƒ“ try @@ -4866,12 +5019,16 @@ begin senderBrowser := TWebBrowser( Message.WParam ); BrowserDocumentComplete( senderBrowser, senderBrowser.Parent, url ); end; - USER_RESPOPUPCLEAR: + USER_POPUPCLEAR: if (TObject(Message.WParam) is TResPopupBrowser) then begin try TResPopupBrowser( Message.WParam ).Clear; except end; + end else if (TObject(Message.WParam) is TPreviewBrowser) then begin + if FPreviewBrowser <> nil then begin + ShowWindow(FPreviewBrowser.Handle, SW_HIDE); + end; end; end; @@ -5198,8 +5355,7 @@ begin SenderNode.Selected := False; FavoriteDragDrop( SenderNode, Source ); - SetLinkBar; - + PostMessage( Handle, USER_SETLINKBAR, 0, 0 ); end; procedure TGikoForm.LinkToolButtonOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); @@ -6424,17 +6580,24 @@ end; procedure TGikoForm.BrowserTabPopupMenuPopup(Sender: TObject); +var + i:Integer; begin - AddRoundNameMenu(dummy1); - AddMenuSameBoardThread; + for i := 0 to BrowserTabPopupMenu.Items.Count - 1 do begin + if (BrowserTabPopupMenu.Items[i].Name='RoundItem') then begin + AddRoundNameMenu(BrowserTabPopupMenu.Items[i]); + end else if (BrowserTabPopupMenu.Items[i].Name='BoardThreadItem') then begin + AddMenuSameBoardThread(BrowserTabPopupMenu.Items[i]) + end; + end; end; //! ƒAƒNƒeƒBƒu‚ȃ^ƒu‚Æ“¯‚¶”‚̊J‚¢‚Ä‚¢‚éƒXƒŒƒbƒh‚ðƒƒjƒ…[ƒAƒCƒeƒ€‚ɒljÁ -procedure TGikoForm.AddMenuSameBoardThread; +procedure TGikoForm.AddMenuSameBoardThread(MenuItem: TMenuItem); var i: Integer; Item: TMenuItem; begin - SameBoardThreadItem.Clear; + MenuItem.Clear; for i := 0 to BrowserTab.Tabs.Count - 1 do begin // “¯‚¶”‚©‚Ç‚¤‚© if (FActiveContent.Thread.ParentBoard = @@ -6444,23 +6607,23 @@ begin TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread then begin Item := TMenuItem.Create(Self); Item.Caption := TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.Title; + Item.Hint := TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.URL; Item.OnClick := SameBoardThreadSubItemOnClick; - SameBoardThreadItem.Add(Item); + MenuItem.Add(Item); end; end; end; // ‰½‚à–³‚¢‚È‚çŽg—p‚Å‚«‚È‚¢‚悤‚É‚·‚é - SameBoardThreadItem.Enabled := SameBoardThreadItem.Count > 0; + MenuItem.Enabled := MenuItem.Count > 0; end; //! ƒAƒNƒeƒBƒu‚ȃ^ƒu‚Æ“¯‚¶”‚̊J‚¢‚Ä‚¢‚éƒXƒŒƒbƒhƒNƒŠƒbƒNƒCƒxƒ“ƒg procedure TGikoForm.SameBoardThreadSubItemOnClick(Sender: TObject); var - i, j: Integer; + i: Integer; MenuItem: TMenuItem; begin if Sender is TMenuItem then begin try - j := 0; MenuItem := TMenuItem(Sender); for i := 0 to BrowserTab.Tabs.Count - 1 do begin // “¯‚¶”‚©‚Ç‚¤‚© @@ -6468,12 +6631,11 @@ begin TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.ParentBoard) then begin if FActiveContent.Thread <> TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread then begin - if (SameBoardThreadItem.Items[j] = MenuItem) then begin - MoveToURL( TBrowserRecord(BrowserTab.Tabs.Objects[i]) - .Thread.URL); + if (MenuItem.Hint = TBrowserRecord(BrowserTab.Tabs.Objects[i]) + .Thread.URL) then begin + MoveToURL( MenuItem.Hint); Exit; end; - Inc(j); end; end; end; @@ -7279,17 +7441,26 @@ var wordCount : TWordCount; {$ENDIF} id, dateStr: String; + ThreadTitle: String; + Idx: Integer; begin No := KokoPopupMenu.Tag; if No = 0 then Exit; - ThreadItem := GetActiveContent(True); + ThreadItem := GikoForm.KokoPopupThreadItem; if ThreadItem = nil then Exit; id := GikoSys.GetResID(No, ThreadItem); if (id <> '') and (not IsNoValidID(id)) then begin + ThreadTitle := ThreadItem.Title; + while (True) do begin + Idx := Pos(#9, ThreadTitle); + if (Idx < 1) then + Break; + Delete(ThreadTitle, Idx, 1); + end; // ƒRƒƒ“ƒg‚Æ‚µ‚āAƒXƒŒƒbƒh–¼‚ƍ¡“ú‚Ì“ú•t‚ð’ljÁ DateTimeToString(dateStr, 'yyyymmdd', Now); - id := id + #9'>>add ' + dateStr + ',' + ThreadItem.Title; + id := id + #9'>>add ' + dateStr + ',' + ThreadTitle; if (GikoSys.FAbon.AddToken(id, invisible)) then begin GikoSys.FAbon.ReLoadFromNGwordFile; FActiveContent.Repaint := True; @@ -7341,7 +7512,7 @@ var begin No := KokoPopupMenu.Tag; if No = 0 then Exit; - ThreadItem := GetActiveContent(True); + ThreadItem := GikoForm.KokoPopupThreadItem; if ThreadItem = nil then Exit; body := TStringList.Create; try @@ -8005,6 +8176,33 @@ begin end; end; +//! ƒXƒŒƒ^ƒC•\Ž¦XV +procedure TGikoForm.UpdateThreadTitle; +var + i: Integer; + DspTitle: String; +begin + BrowserTab.Tabs.BeginUpdate; + for i := 0 to BrowserTab.Tabs.Count - 1 do begin + BrowserTab.Tabs.Strings[i] := + GikoSys.GetShortName(TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.Title, 20); + end; + BrowserTab.Tabs.EndUpdate; + + if (FActiveContent <> nil) and (FActiveContent.Thread <> nil) then begin + DspTitle := GikoSys.TrimThreadTitle(FActiveContent.Thread.Title); + BrowserNameLabel.Caption := DspTitle; + Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + DspTitle + ']'; + end; +end; + +//! ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[“ǂݍž‚Ý +procedure TGikoForm.LoadPopupMenu(); +begin + + +end; + initialization OleInitialize(nil); finalization