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.318 by h677, Wed May 26 18:40:54 2004 UTC revision 1.319 by h677, Sun May 30 17:23:09 2004 UTC
# Line 536  type Line 536  type
536      SetFocusForBrowserAction: TAction;      SetFocusForBrowserAction: TAction;
537      SetFocusForThreadListAction: TAction;      SetFocusForThreadListAction: TAction;
538      SetFocusForCabinetAction: TAction;      SetFocusForCabinetAction: TAction;
     Xday1: TMenuItem;  
539      FileRun1: TFileRun;      FileRun1: TFileRun;
540        ThreadlistMaxAndFocusAction: TAction;
541        BrowserMaxAndFocusAction: TAction;
542                                  procedure FormCreate(Sender: TObject);                                  procedure FormCreate(Sender: TObject);
543                  procedure FormDestroy(Sender: TObject);                  procedure FormDestroy(Sender: TObject);
544                  procedure CabinetPanelHide(Sender: TObject);                  procedure CabinetPanelHide(Sender: TObject);
# Line 859  type Line 860  type
860      procedure SetFocusForBrowserActionUpdate(Sender: TObject);      procedure SetFocusForBrowserActionUpdate(Sender: TObject);
861      procedure SetFocusForThreadListActionExecute(Sender: TObject);      procedure SetFocusForThreadListActionExecute(Sender: TObject);
862      procedure SetFocusForCabinetActionExecute(Sender: TObject);      procedure SetFocusForCabinetActionExecute(Sender: TObject);
863      procedure Xday1Click(Sender: TObject);      procedure BrowserMaxAndFocusActionExecute(Sender: TObject);
864        procedure BrowserMaxAndFocusActionUpdate(Sender: TObject);
865        procedure ThreadlistMaxAndFocusActionExecute(Sender: TObject);
866          private          private
867                  { Private 宣言 }                  { Private 宣言 }
868          //RoundList : TRoundList;          //RoundList : TRoundList;
# Line 2487  var Line 2490  var
2490          ActiveFileName: string;          ActiveFileName: string;
2491          e: IHTMLElement;          e: IHTMLElement;
2492          Ext: string;          Ext: string;
2493      buf: string;          buf: string;
2494          PathRec: TPathRec;          PathRec: TPathRec;
2495  begin  begin
2496          if not( TObject(Sender) is TWebBrowser )then          if not( TObject(Sender) is TWebBrowser )then
# Line 2563  begin Line 2566  begin
2566                                  end;                                  end;
2567                          end;                          end;
2568                  end else begin                  end else begin
2569                            threadItem := GetActiveContent;
2570                          if Pos('about:blank..', Text) = 1 then begin                          if Pos('about:blank..', Text) = 1 then begin
                                 threadItem := GetActiveContent;  
2571                                  if AnsiPos('http://jbbs.shitaraba.com/', threadItem.URL) <> 0 then begin                                  if AnsiPos('http://jbbs.shitaraba.com/', threadItem.URL) <> 0 then begin
2572                                          URL := Copy(threadItem.URL, 1,  LastDelimiter('/',threadItem.URL));                                          URL := Copy(threadItem.URL, 1,  LastDelimiter('/',threadItem.URL));
2573                                          Gikosys.GetPopupResNumber(Text,PathRec.FSt,PathRec.FTo);                                          Gikosys.GetPopupResNumber(Text,PathRec.FSt,PathRec.FTo);
# Line 2632  begin Line 2635  begin
2635                                                  threadItem := board.FindThreadFromFileName( PathRec.FKey + '.dat' );                                                  threadItem := board.FindThreadFromFileName( PathRec.FKey + '.dat' );
2636                                          end;                                          end;
2637                                  end;                                  end;
2638                    
2639                                  if threadItem <> nil then begin                                  if threadItem <> nil then begin
2640                                          //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);                                          //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2641                                          FHint.PopupType := gptThread;                                          FHint.PopupType := gptThread;
# Line 5769  var Line 5772  var
5772          Html: string;          Html: string;
5773          URL: string;          URL: string;
5774          idx: Integer;          idx: Integer;
5775            wkIntSt: Integer;
5776            wkIntTo: Integer;
5777  begin  begin
5778    
5779          Cancel := True;          Cancel := True;
5780          if (IHTMLDocument2(TWebBrowser(Sender).Document).activeElement <> nil) then begin          if (IHTMLDocument2(TWebBrowser(Sender).Document).activeElement <> nil) then begin
5781                  Text := IHTMLDocument2(TWebBrowser(Sender).Document).activeElement.Get_outerText;                  Text := IHTMLDocument2(TWebBrowser(Sender).Document).activeElement.Get_outerText;
5782                  Html := IHTMLDocument2(TWebBrowser(Sender).Document).activeElement.Get_outerHTML;                  Html := IHTMLDocument2(TWebBrowser(Sender).Document).activeElement.Get_outerHTML;
5783                    if(AnsiPos('>>', Text) = 1) or (AnsiPos('>', Text) = 1)
5784                            or (AnsiPos('>>', Text) = 1) or (AnsiPos('>', Text) = 1) then begin
5785                            Text := ZenToHan(Text);
5786    
5787                  URL := GikoSys.GetHRefText(Html);                          if(AnsiPos('>>', Text) = 1) then begin
5788                  URL := GikoSys.HTMLDecode(URL);                                  Text := Copy(Text, 3, Length(Text) - 2);
   
                 //アドレスバーの履歴  
                 if GikoSys.Setting.LinkAddAddressBar then begin  
                         idx := AddressComboBox.Items.IndexOf(URL);  
                         if idx = -1 then begin  
                                 AddressComboBox.Items.Insert(0, URL);  
                                 if AddressComboBox.Items.Count > GikoSys.Setting.AddressHistoryCount then  
                                         AddressComboBox.Items.Delete(AddressComboBox.Items.Count - 1);  
5789                          end else begin                          end else begin
5790                                  AddressComboBox.Items.Delete(idx);                                  Text := Copy(Text, 2, Length(Text) - 1);
                                 AddressComboBox.Items.Insert(0, URL);  
5791                          end;                          end;
5792                  end;                          if AnsiPos('-', Text) <> 0 then begin
5793                                    wkIntSt := StrToIntDef(Copy(Text, 1, AnsiPos('-', Text) - 1), 0);
5794                                    Text := Copy(Text, AnsiPos('-', Text) + 1, Length(Text));
5795                                    wkIntTo := StrToIntDef(Text, 0);
5796                                    if wkIntTo < wkIntSt then
5797                                            wkIntSt := wkIntTo;
5798                            end else
5799                                    wkIntSt := StrToIntDef(Text, 0);
5800    
5801                            if wkIntSt <> 0 then
5802                                    BrowserMovement(IntToStr(wkIntSt));
5803    
5804                  MoveToURL( URL );                  end else begin
5805                            URL := GikoSys.GetHRefText(Html);
5806                            URL := GikoSys.HTMLDecode(URL);
5807                            //アドレスバーの履歴
5808                            if GikoSys.Setting.LinkAddAddressBar then begin
5809                                    idx := AddressComboBox.Items.IndexOf(URL);
5810                                    if idx = -1 then begin
5811                                            AddressComboBox.Items.Insert(0, URL);
5812                                            if AddressComboBox.Items.Count > GikoSys.Setting.AddressHistoryCount then
5813                                                    AddressComboBox.Items.Delete(AddressComboBox.Items.Count - 1);
5814                                    end else begin
5815                                            AddressComboBox.Items.Delete(idx);
5816                                            AddressComboBox.Items.Insert(0, URL);
5817                                    end;
5818                            end;
5819                            MoveToURL( URL );
5820                    end;
5821          end;          end;
5822    
5823  {       ShiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);  {       ShiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
# Line 9406  end; Line 9431  end;
9431    
9432  procedure TGikoForm.OnlyAHundredResExecute(Sender: TObject);  procedure TGikoForm.OnlyAHundredResExecute(Sender: TObject);
9433  begin  begin
9434            if (FActiveContent <> nil) and (FActiveContent.FBrowser.Busy) then begin
9435                    AHundredResButton.Down := not AHundredResButton.Down;
9436                    Exit;
9437            end;
9438          GikoSys.OnlyAHundredRes := OnlyAHundredRes.Checked;          GikoSys.OnlyAHundredRes := OnlyAHundredRes.Checked;
9439          if FActiveContent <> nil then begin          if FActiveContent <> nil then begin
9440                  SetContent(FActiveContent);                  SetContent(FActiveContent);
# Line 9934  end; Line 9963  end;
9963  // ギコナビのメッセージループを横取りします  // ギコナビのメッセージループを横取りします
9964  procedure TGikoForm.HandleAppMessage(var Msg: TMsg; var Handled: Boolean);  procedure TGikoForm.HandleAppMessage(var Msg: TMsg; var Handled: Boolean);
9965    
9966  var  //var
9967          key                             : Word;  //      key                             : Word;
9968  begin  begin
9969  {       case Msg.message of  {       case Msg.message of
9970          WM_KEYDOWN:          WM_KEYDOWN:
# Line 10059  end; Line 10088  end;
10088  function TGikoForm.WebBrowserClick(Sender: TObject): WordBool;  function TGikoForm.WebBrowserClick(Sender: TObject): WordBool;
10089  begin  begin
10090    result := true;    result := true;
10091    if (Sender <> nil) and (Sender is TWebBrowser) then    if Sender <> nil then
10092    try    try
10093          TWebBrowser(Sender).SetFocus;          TOleControl(Sender).SetFocus;
10094    except    except
10095    end;    end;
10096  end;  end;
10097    
10098  procedure TGikoForm.SetFocusForBrowserActionExecute(Sender: TObject);  procedure TGikoForm.SetFocusForBrowserActionExecute(Sender: TObject);
10099  begin  begin
10100      FActiveContent.FBrowser.SetFocus;          FActiveContent.FBrowser.SetFocus;
10101  end;  end;
10102    
10103  procedure TGikoForm.SetFocusForBrowserActionUpdate(Sender: TObject);  procedure TGikoForm.SetFocusForBrowserActionUpdate(Sender: TObject);
# Line 10095  begin Line 10124  begin
10124                  WebBrowserClick(FActiveContent.Browser); //一回Browserに当てないと動かないときがある                  WebBrowserClick(FActiveContent.Browser); //一回Browserに当てないと動かないときがある
10125          TreeView.SetFocus;          TreeView.SetFocus;
10126  end;  end;
10127    //ブラウザを最大化してフォーカスを当てる。
10128    procedure TGikoForm.BrowserMaxAndFocusActionExecute(Sender: TObject);
10129    begin
10130            BrowserMaxAction.Execute;
10131            SetFocusForBrowserAction.Execute;
10132    end;
10133    
10134  procedure TGikoForm.Xday1Click(Sender: TObject);  procedure TGikoForm.BrowserMaxAndFocusActionUpdate(Sender: TObject);
10135  const  begin
10136          HostsFileName : string = 'hosts';          if( FActiveContent <> nil) and (FActiveContent.Browser <> nil) and
10137  var                  (FActiveContent.Browser <> BrowserNullTab.Browser) then
10138          chrWinPath  : array [0..MAX_PATH] of char;                  BrowserMaxAndFocusAction.Enabled := true
10139          chrSysPath  : array [0..MAX_PATH] of char;          else
10140          tmpPath: string;                  BrowserMaxAndFocusAction.Enabled := false;
10141          OSver : TOSVERSIONINFO;  end;
10142  begin  //スレッド一覧を最大化してフォーカスを当てる
10143          OSver.dwOSVersionInfoSize  :=  SizeOf(OSver);  procedure TGikoForm.ThreadlistMaxAndFocusActionExecute(Sender: TObject);
10144          GetVersionEx(OSver);  begin
10145          case  OSver.dwPlatformId  of          BrowserMinAction.Execute;
10146                  //Windows3.1          SetFocusForThreadListAction.Execute;
                 VER_PLATFORM_WIN32s:  
                         ShowMessage('どうやって動かしてるんですか?');  
                 //Windows95  
                 VER_PLATFORM_WIN32_WINDOWS:  
                 begin  
                         GetWindowsDirectory(chrWinPath, sizeof(chrWinPath));  
                         tmpPath := chrWinPath;  
                         tmpPath := IncludeTrailingPathDelimiter(tmpPath);  
                         tmpPath := tmpPath + HostsFileName;  
                 end;  
                 //WindowsNT  
                 VER_PLATFORM_WIN32_NT:  
                 begin  
                         GetSystemDirectory(chrSysPath, sizeof(chrSysPath));  
                         tmpPath := chrSysPath;  
                         tmpPath := IncludeTrailingPathDelimiter(tmpPath);  
                         tmpPath := tmpPath + 'Drivers\Etc\' + HostsFileName;  
                 end;  
         end;  
         FileRun1.Parameters := tmpPath;  
         FileRun1.Execute;  
10147  end;  end;
10148    
10149  initialization  initialization

Legend:
Removed from v.1.318  
changed lines
  Added in v.1.319

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