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.529 by h677, Mon Nov 14 15:31:48 2005 UTC revision 1.530 by h677, Mon Nov 14 16:19:19 2005 UTC
# Line 868  type Line 868  type
868      procedure SortActiveColumnActionExecute(Sender: TObject);      procedure SortActiveColumnActionExecute(Sender: TObject);
869      procedure SortNextColumnActionExecute(Sender: TObject);      procedure SortNextColumnActionExecute(Sender: TObject);
870      procedure SortPrevColumnActionExecute(Sender: TObject);      procedure SortPrevColumnActionExecute(Sender: TObject);
         procedure MessageListViewAdvancedCustomDrawItem(  
           Sender: TCustomListView; Item: TListItem; State: TCustomDrawState;  
           Stage: TCustomDrawStage; var DefaultDraw: Boolean);  
871          procedure BeLogInOutActionExecute(Sender: TObject);          procedure BeLogInOutActionExecute(Sender: TObject);
872          procedure BeLogInOutActionUpdate(Sender: TObject);          procedure BeLogInOutActionUpdate(Sender: TObject);
873          procedure UnSelectedListViewActionExecute(Sender: TObject);          procedure UnSelectedListViewActionExecute(Sender: TObject);
# Line 883  type Line 880  type
880                  { Private 宣言 }                  { Private 宣言 }
881                  FSortIndex: Integer;                  FSortIndex: Integer;
882                  FSortOrder: Boolean;                  FSortOrder: Boolean;
   
883                  FEnabledCloseButton: Boolean;                  FEnabledCloseButton: Boolean;
 //              ThreadCreate: TThreadCreate;  
   
884                  FClickNode: TTreeNode;                  FClickNode: TTreeNode;
885                  FHttpState: Boolean;                  FHttpState: Boolean;
886                  FHint: TResPopup;                  FHint: TResPopup;
887                  FPreviewBrowser: TWebBrowser;                  FPreviewBrowser: TWebBrowser;
888                  FPreviewURL: string;                  FPreviewURL: string;
   
889                  FBrowserSizeHeight: Integer;                  FBrowserSizeHeight: Integer;
890                  FBrowserSizeWidth: Integer;                  FBrowserSizeWidth: Integer;
   
 //              FFavorite: TFavorite;  
891                  FTabHintIndex: Integer;                  FTabHintIndex: Integer;
892                  FListStyle: TViewStyle;                         //リストアイコンスタイル                  FListStyle: TViewStyle;                         //リストアイコンスタイル
893                  FItemNoVisible: Boolean;                        //リスト番号表示フラグ                  FItemNoVisible: Boolean;                        //リスト番号表示フラグ
# Line 909  type Line 900  type
900                  FWorkCount: Integer;                  FWorkCount: Integer;
901                  FNameCookie: string;                  FNameCookie: string;
902                  FMailCookie: string;                  FMailCookie: string;
 //              FLastRoundTime: TDateTime;  
903                  BrowserNullTab: TBrowserRecord;                  BrowserNullTab: TBrowserRecord;
 //              DoubleClickOccurred: array [TMouseButton] of Boolean;  
904                  FDownloadTitle: string;                         //ダウンロード中のタイトル名                  FDownloadTitle: string;                         //ダウンロード中のタイトル名
905                  FDownloadMax: Integer;                          //ダウンロード中の最大サイズ                  FDownloadMax: Integer;                          //ダウンロード中の最大サイズ
906                  FEvent: THTMLDocumentEventSink;//ブラウザドキュメントイベント                  FEvent: THTMLDocumentEventSink;//ブラウザドキュメントイベント
   
           //    Fkeynum : Integer; //キーボードレスポップアップ用  
   
907                  IsDraggingSelectComboBox : Boolean;                  IsDraggingSelectComboBox : Boolean;
908                  DraggingSelectComboBoxPosition : TPoint;                  DraggingSelectComboBoxPosition : TPoint;
   
909                  FSearchDialog: TSearchDialog;                  FSearchDialog: TSearchDialog;
   
910                  FDropSpaceNode: TTreeNode;                  FDropSpaceNode: TTreeNode;
   
911                  FDragTime : Cardinal;                                                           ///< リンクのD&D用                  FDragTime : Cardinal;                                                           ///< リンクのD&D用
912                  FDragButton : TToolButton;                                      ///< リンクのD&D用にDragしてるButton保存                  FDragButton : TToolButton;                                      ///< リンクのD&D用にDragしてるButton保存
913                  FDragWFirst : Boolean;                                                  ///< WebTabのD&D用                  FDragWFirst : Boolean;                                                  ///< WebTabのD&D用
   
914                  FListViewBackGroundColor : TColor;      ///< ListViewのBackGroundColor                  FListViewBackGroundColor : TColor;      ///< ListViewのBackGroundColor
915                  FUseOddResOddColor : Boolean;                   ///< 取得レス数とスレッドのレス数が違ったときに他の色で表示                  FUseOddResOddColor : Boolean;                   ///< 取得レス数とスレッドのレス数が違ったときに他の色で表示
916                  FOddColor : TColor;                                                                     ///< その色                  FOddColor : TColor;                                                                     ///< その色
   
917                  FSelectResWord  : string;                                               ///< レス絞込ワード                  FSelectResWord  : string;                                               ///< レス絞込ワード
918                  FIsIgnoreResize : TResizeType;                  ///< リサイズイベントを無視するかどうか                  FIsIgnoreResize : TResizeType;                  ///< リサイズイベントを無視するかどうか
919                  FIsMinimize                     : TMinimizeType;                ///< 最小化している最中か                  FIsMinimize                     : TMinimizeType;                ///< 最小化している最中か
# Line 950  type Line 931  type
931                  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);
932                  procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);                  procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
933                  procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);                  procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
   
   
934                  procedure ListClick;                  procedure ListClick;
935                  procedure ListDoubleClick(Shift: TShiftState);                  procedure ListDoubleClick(Shift: TShiftState);
936                  procedure BrowserMovement(const AName: string); overload;                  procedure BrowserMovement(const AName: string); overload;
# Line 965  type Line 944  type
944                  procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string); overload;                  procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string); overload;
945                  procedure SetSelectRoundName(Sender: TObject);                  procedure SetSelectRoundName(Sender: TObject);
946                  function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;                  function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
   
947                  procedure SetMenuFont;                  procedure SetMenuFont;
948                  procedure CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);                  procedure CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);
949                  procedure FavoriteClick(Sender: TObject; ActiveTab: Boolean); overload;                  procedure FavoriteClick(Sender: TObject; ActiveTab: Boolean); overload;
# Line 973  type Line 951  type
951                  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);
952                  procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);                  procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);
953                  function OnDocumentContextMenu(Sender: TObject): WordBool;                  function OnDocumentContextMenu(Sender: TObject): WordBool;
                 procedure SetResPopupText(ThreadItem : TThreadItem; StNum, ToNum: Integer; Title, First: Boolean);  
954                  procedure ShowTextPopup;                  procedure ShowTextPopup;
955                  procedure SetLinkBar;                  procedure SetLinkBar;
956                  function GetWidthAllToolButton(ToolBar: TToolBar): Integer;                  function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
# Line 1019  type Line 996  type
996                  /// 各所にあるキャビネット・ BBS メニューをセット/更新                  /// 各所にあるキャビネット・ BBS メニューをセット/更新
997                  procedure SetBBSMenu;                  procedure SetBBSMenu;
998                  function WebBrowserClick(Sender: TObject): WordBool;                  function WebBrowserClick(Sender: TObject): WordBool;
                 procedure SkinorCSSFilesCopy(path: string);  
999                  /// タブ取得                  /// タブ取得
1000                  function GetTabURLs(AStringList: TStringList) : Boolean;                  function GetTabURLs(AStringList: TStringList) : Boolean;
1001                  /// タブ保存                  /// タブ保存
# Line 1028  type Line 1004  type
1004                  function LoadTabURLs : Boolean;                  function LoadTabURLs : Boolean;
1005                  /// バンド幅を再計算・再設定する                  /// バンド幅を再計算・再設定する
1006                  procedure ResetBandInfo( bar : TGikoCoolBar; band : TToolBar );                  procedure ResetBandInfo( bar : TGikoCoolBar; band : TToolBar );
                 /// ListView の Column を真のカラムに変換  
                 function        ActiveListTrueColumn( column : TListColumn ) : TListColumn;  
1007                  /// ListColumnPopupMenu アイテムのクリックイベント                  /// ListColumnPopupMenu アイテムのクリックイベント
1008                  procedure       ListColumnPopupMenuOnClick( Sender : TObject );                  procedure       ListColumnPopupMenuOnClick( Sender : TObject );
1009                  // BrowserRecordについているFBrowserを外す                  // BrowserRecordについているFBrowserを外す
# Line 1044  type Line 1018  type
1018                  procedure SetSelectWord( const text : string );                  procedure SetSelectWord( const text : string );
1019                  //ブラウザの再描画 true:全てのタブ false:アクティブなタブのみ                  //ブラウザの再描画 true:全てのタブ false:アクティブなタブのみ
1020                  procedure RepaintAllTabsBrowser();                  procedure RepaintAllTabsBrowser();
         //リンクの文字列からレスポップアップ用のURLに変換する  
                 function GetRespopupURL(AText, AThreadURL : string): string;  
1021          protected          protected
1022                  procedure CreateParams(var Params: TCreateParams); override;                  procedure CreateParams(var Params: TCreateParams); override;
1023                  procedure WndProc(var Message: TMessage); override;                  procedure WndProc(var Message: TMessage); override;
# Line 1058  type Line 1030  type
1030                  LastRoundTime: TDateTime;                  LastRoundTime: TDateTime;
1031                  FControlThread: TThreadControl;                  FControlThread: TThreadControl;
1032                  procedure MoveToURL(const inURL: string);                  procedure MoveToURL(const inURL: string);
1033                  function InsertBrowserTab(                  function InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True) : TBrowserRecord;
                         ThreadItem      : TThreadItem;  
                         ActiveTab               : Boolean = True  
                 ) : TBrowserRecord;  
1034                  procedure ReloadBBS;                  procedure ReloadBBS;
1035                  function GetHttpState: Boolean;                  function GetHttpState: Boolean;
1036                  procedure SetEnabledCloseButton(Enabled: Boolean);                  procedure SetEnabledCloseButton(Enabled: Boolean);
# Line 1182  const Line 1151  const
1151          //D&D閾値          //D&D閾値
1152          DandD_THRESHOLD = 5;    //D&Dの閾値(pixcel)          DandD_THRESHOLD = 5;    //D&Dの閾値(pixcel)
1153          //ツリー・リストアイコン          //ツリー・リストアイコン
1154          //ITEM_ICON_2CH1                                        = 0;            //2chアイコン          //ITEM_ICON_CATEGORY1                   = 2;            //カテゴリアイコン
1155          //ITEM_ICON_2CH2                                        = 1;            //2chアイコン          //ITEM_ICON_CATEGORY2                   = 3;            //カテゴリアイコン
1156          ITEM_ICON_CATEGORY1                     = 2;            //カテゴリアイコン          //ITEM_ICON_BOARD_NOSUBJECT     = 3;    //読み込まれていない板アイコン
1157          ITEM_ICON_CATEGORY2                     = 3;            //カテゴリアイコン          //ITEM_ICON_BOARD1                              = 4;            //板アイコン
1158          ITEM_ICON_BOARD_NOSUBJECT       = 3;    //読み込まれていない板アイコン          //ITEM_ICON_BOARD2                              = 5;            //板アイコン
         ITEM_ICON_BOARD1                                = 4;            //板アイコン  
         ITEM_ICON_BOARD2                                = 5;            //板アイコン  
1159          ITEM_ICON_THREADLOG1            = 6;            //スレアイコン(ログあり)          ITEM_ICON_THREADLOG1            = 6;            //スレアイコン(ログあり)
1160          ITEM_ICON_THREADLOG2            = 7;            //スレアイコン(ログあり)          ITEM_ICON_THREADLOG2            = 7;            //スレアイコン(ログあり)
1161          ITEM_ICON_THREAD1                               = 8;            //スレアイコン(ログなし)          //ITEM_ICON_THREAD1                             = 8;            //スレアイコン(ログなし)
1162          ITEM_ICON_THREAD2                               = 9;            //スレアイコン(ログなし)          //ITEM_ICON_THREAD2                             = 9;            //スレアイコン(ログなし)
1163          ITEM_ICON_THREADNEW1            = 10;           //スレアイコン(新着)          //ITEM_ICON_THREADNEW1          = 10;           //スレアイコン(新着)
1164          ITEM_ICON_THREADNEW2            = 11;           //スレアイコン(新着)          //ITEM_ICON_THREADNEW2          = 11;           //スレアイコン(新着)
1165          ITEM_ICON_SORT1                                 = 12;           //ソートアイコン          ITEM_ICON_SORT1                                 = 12;           //ソートアイコン
1166          ITEM_ICON_SORT2                                 = 13;           //ソートアイコン          ITEM_ICON_SORT2                                 = 13;           //ソートアイコン
1167          ITEM_ICON_BOARD_LOG                     = 17;           //スレログあり板アイコン          //ITEM_ICON_BOARD_LOG                   = 17;           //スレログあり板アイコン
1168          ITEM_ICON_BOARD_NEW                     = 18;           //スレ新着板アイコン          //ITEM_ICON_BOARD_NEW                   = 18;           //スレ新着板アイコン
1169    
1170          //ツールバーアイコン          //ツールバーアイコン
1171          TOOL_ICON_HEIGHT_MAX            = 16;           //高さ最大アイコン          TOOL_ICON_HEIGHT_MAX            = 16;           //高さ最大アイコン
# Line 1227  const Line 1194  const
1194          SELECTTIME_INTERBAL                             = 110;          SELECTTIME_INTERBAL                             = 110;
1195    
1196          BROWSER_COUNT           = 5;    //ブラウザの数          BROWSER_COUNT           = 5;    //ブラウザの数
1197    
1198            URL_GIKONAVI: string = 'http://gikonavi.sourceforge.jp/';
1199            URL_MONAZILLA: string = 'http://www.monazilla.org/';
1200            URL_2ch: string = 'http://www.2ch.net/';
1201            URL_Wiki: string = 'http://gikowiki.dyndns.info/index.php?FAQ';
1202    
1203  {$R *.DFM}  {$R *.DFM}
1204    
1205  procedure TGikoForm.CreateParams(var Params: TCreateParams);  procedure TGikoForm.CreateParams(var Params: TCreateParams);
# Line 1922  begin Line 1895  begin
1895                                  GikoSys.Setting.Gengo.Free;                                  GikoSys.Setting.Gengo.Free;
1896          end;          end;
1897      }      }
         //Application.HookMainWindow(Hook);  
1898          Application.UnhookMainWindow(Hook);          Application.UnhookMainWindow(Hook);
1899          Application.Terminate;          Application.Terminate;
1900  end;  end;
# Line 1934  var Line 1906  var
1906          wp                      : TWindowPlacement;          wp                      : TWindowPlacement;
1907          tmpBool : Boolean;          tmpBool : Boolean;
1908  begin  begin
 //      Application.OnDeactivate := nil;  
 //      Self.OnDeactivate := nil;  
1909          // マウスジェスチャー開放          // マウスジェスチャー開放
1910          try          try
1911                  MouseGesture.UnHook;                  MouseGesture.UnHook;
# Line 2096  begin Line 2066  begin
2066          except          except
2067          end;          end;
2068    
         {  
         try  
                 for i := Length( BoardPlugIns ) - 1 downto  0 do begin  
                         if BoardPlugIns[ i ] <> nil then  
                                 BoardPlugIns[ i ].Free;  
                         BoardPlugIns[ i ] := nil;  
                 end;  
         except  
         end;  
     }  
2069          try          try
2070                  if FEvent <> nil then                  if FEvent <> nil then
2071                          FEvent.Free;                          FEvent.Free;
# Line 2286  var Line 2246  var
2246          ActiveFileName: string;          ActiveFileName: string;
2247          e: IHTMLElement;          e: IHTMLElement;
2248          Ext: string;          Ext: string;
 //      buf, buf2: string;  
2249          PathRec: TPathRec;          PathRec: TPathRec;
2250  begin  begin
2251          if not( TObject(Sender) is TWebBrowser )then          if not( TObject(Sender) is TWebBrowser )then
# Line 2360  begin Line 2319  begin
2319                                          wkIntTo := StrToInt(tmp2);                                          wkIntTo := StrToInt(tmp2);
2320                                                  //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);                                                  //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
2321                                          FHint.PopupType := gptThread;                                          FHint.PopupType := gptThread;
2322                                          SetResPopupText(GetActiveContent, wkIntSt, wkIntTo, False, False);                                          HTMLCreater.SetResPopupText(FHint, GetActiveContent, wkIntSt, wkIntTo, False, False);
2323                                  end else begin                                  end else begin
2324                                          FHint.PopupType := gptRaw;                                          FHint.PopupType := gptRaw;
2325                                          FHint.Caption := s;                                          FHint.Caption := s;
# Line 2368  begin Line 2327  begin
2327                          end;                          end;
2328                  end else begin                  end else begin
2329                          threadItem := GetActiveContent;                          threadItem := GetActiveContent;
2330                          URL := GetRespopupURL(Text, threadItem.URL);                          URL := THTMLCreate.GetRespopupURL(Text, threadItem.URL);
2331                          PathRec := Gikosys.Parse2chURL2(URL);                          PathRec := Gikosys.Parse2chURL2(URL);
2332                          if (PathRec.FNoParam) then begin                          if (PathRec.FNoParam) then begin
2333                                  PathRec.FSt := 1;                                  PathRec.FSt := 1;
# Line 2420  begin Line 2379  begin
2379                                                  wkIntTo := 1;                                                  wkIntTo := 1;
2380                                          end;                                          end;
2381                                          FHint.PopupType := gptThread;                                          FHint.PopupType := gptThread;
2382                                          SetResPopupText( threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );                                          HTMLCreater.SetResPopupText(FHint, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
2383                                  end;                                  end;
2384                          end;                          end;
2385                  end;                  end;
2386    
                 //if s <> '' then  
                 //      ShowTextPopup(s);  
2387                  if FHint.PopupType = gptRaw then begin                  if FHint.PopupType = gptRaw then begin
2388                          if FHint.Caption <> '' then                          if FHint.Caption <> '' then
2389                                  ShowTextPopup;                                  ShowTextPopup;
# Line 2440  end; Line 2397  end;
2397  procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);  procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2398  var  var
2399          SysMenu: HMenu;          SysMenu: HMenu;
         //SysMenuApp: HMenu;  
2400  begin  begin
2401          FEnabledCloseButton := Enabled;          FEnabledCloseButton := Enabled;
2402          SysMenu := GetSystemMenu(Handle, False);          SysMenu := GetSystemMenu(Handle, False);
         //SysMenuApp := GetSystemMenu(Application.Handle, False);  
2403    
2404          if Enabled then begin          if Enabled then begin
2405                  EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);                  EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
                 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);  
2406          end else begin          end else begin
2407                  EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);                  EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
                 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);  
2408          end;          end;
2409    
2410          DrawMenuBar(Handle);          DrawMenuBar(Handle);
         //DrawMenuBar(Application.Handle);  
2411  end;  end;
2412    
2413  procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;  procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
# Line 2515  begin Line 2467  begin
2467          Result := FHttpState;          Result := FHttpState;
2468  end;  end;
2469    
 {!  
 \brief          ListView の Column を真のカラムに変換  
   
 Delphi 6 Personal での ListView では ListViewColumnClick イベントで  
 正しいカラムが渡されないため、正しいカラムに変換します。  
 }  
 function        TGikoForm.ActiveListTrueColumn( column : TListColumn ) : TListColumn;  
 {*  
 var  
         i, idx          : Integer;  
         orderList       : TList;  
 *}  
 begin  
   
         // 正しく変換する方法が分からないので保留  
         Result := column;  
         Exit;  
 {*  
         Result := column;  
   
         if TObject( FActiveList ) is TBBS then  
                 orderList := GikoSys.Setting.BBSColumnOrder  
         else if TObject( FActiveList ) is TCategory then  
                 orderList := GikoSys.Setting.CategoryColumnOrder  
         else if TObject( FActiveList ) is TBoard then  
                 orderList := GikoSys.Setting.BoardColumnOrder  
         else  
                 Exit;  
   
         idx := column.Tag;  
   
         for i := 0 to ListView.Columns.Count - 1 do begin  
                 if Integer( orderList[ ListView.Column[ i ].Tag ] ) = 0 then begin  
                         if idx = 0 then  
                                 Result := ListView.Column[ i ]  
                         else if idx <= i then  
                                 Result := ListView.Column[ idx - 1 ];  
                         Exit;  
                 end;  
         end;  
 *}  
   
 end;  
   
2470  procedure TGikoForm.ListViewColumnClick(Sender: TObject;  procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2471          Column: TListColumn);          Column: TListColumn);
2472  var  var
2473          id, idx                 : Integer;          id, idx                 : Integer;
2474          orderList               : TList;          orderList               : TList;
2475  begin  begin
2476          idx := ActiveListTrueColumn( Column ).Tag;          idx := TListViewUtils.ActiveListTrueColumn( Column ).Tag;
2477    
2478          if TObject( FActiveList ) is TBBS then          if TObject( FActiveList ) is TBBS then
2479                  orderList := GikoSys.Setting.BBSColumnOrder                  orderList := GikoSys.Setting.BBSColumnOrder
# Line 4335  begin Line 4243  begin
4243  end;  end;
4244    
4245  procedure TGikoForm.GikoNaviWebPageActionExecute(Sender: TObject);  procedure TGikoForm.GikoNaviWebPageActionExecute(Sender: TObject);
 const  
         URL_GIKONAVI: string = 'http://gikonavi.sourceforge.jp/';  
4246  begin  begin
4247          GikoSys.OpenBrowser(URL_GIKONAVI, gbtAuto);          GikoSys.OpenBrowser(URL_GIKONAVI, gbtAuto);
4248  end;  end;
4249    
4250  procedure TGikoForm.MonazillaWebPageActionExecute(Sender: TObject);  procedure TGikoForm.MonazillaWebPageActionExecute(Sender: TObject);
 const  
         URL_MONAZILLA: string = 'http://www.monazilla.org/';  
4251  begin  begin
4252          GikoSys.OpenBrowser(URL_MONAZILLA, gbtAuto);          GikoSys.OpenBrowser(URL_MONAZILLA, gbtAuto);
4253  end;  end;
4254    
4255  procedure TGikoForm.BBS2chWebPageActionExecute(Sender: TObject);  procedure TGikoForm.BBS2chWebPageActionExecute(Sender: TObject);
 const  
         URL_2ch: string = 'http://www.2ch.net/';  
4256  begin  begin
4257          GikoSys.OpenBrowser(URL_2ch, gbtAuto);          GikoSys.OpenBrowser(URL_2ch, gbtAuto);
4258  end;  end;
4259    
4260  procedure TGikoForm.GikoFolderOpenActionExecute(Sender: TObject);  procedure TGikoForm.GikoFolderOpenActionExecute(Sender: TObject);
4261  begin  begin
 //      GikoSys.OpenBrowser(GikoSys.GetAppDir, gbtIE);  
4262          GikoSys.CreateProcess('explorer.exe', '/e,"' + GikoSys.GetAppDir + '"');          GikoSys.CreateProcess('explorer.exe', '/e,"' + GikoSys.GetAppDir + '"');
4263  end;  end;
4264    
# Line 4862  end; Line 4763  end;
4763  //Actionで共通  //Actionで共通
4764  procedure TGikoForm.SelectListReloadActionUpdate(Sender: TObject);  procedure TGikoForm.SelectListReloadActionUpdate(Sender: TObject);
4765  begin  begin
4766  {$IFDEF ACTCHK}          if (GetActiveList is TCategory) and (ListView.SelCount > 0) then
4767          //無くてもいいIF文 コードから無理やり呼ばないならチェックしなくても…                  TAction(Sender).Enabled := True
4768          if (Sender <> nil) and (Sender is TAction) then begin          else if GetActiveList is TBoard then
4769  {$ENDIF}                  TAction(Sender).Enabled := True
4770                  if (GetActiveList is TCategory) and (ListView.SelCount > 0) then          else
4771                          TAction(Sender).Enabled := True                  TAction(Sender).Enabled := False;
                 else if GetActiveList is TBoard then  
                         TAction(Sender).Enabled := True  
                 else  
                         TAction(Sender).Enabled := False;  
 {$IFDEF ACTCHK}  
         end;  
 {$ENDIF}  
4772  end;  end;
4773  //ActiveListがTBoardでスレ一覧で1つ以上選択していると有効になるActionで共通  //ActiveListがTBoardでスレ一覧で1つ以上選択していると有効になるActionで共通
4774  procedure TGikoForm.SelectThreadReloadActionUpdate(Sender: TObject);  procedure TGikoForm.SelectThreadReloadActionUpdate(Sender: TObject);
4775  begin  begin
4776  {$IFDEF ACTCHK}          TAction(Sender).Enabled := (GetActiveList is TBoard) and (ListView.SelCount > 0);
         //無くてもいいIF文 コードから無理やり呼ばないならチェックしなくても…  
         if (Sender <> nil) and (Sender is TAction) then begin  
 {$ENDIF}  
                 TAction(Sender).Enabled := (GetActiveList is TBoard) and (ListView.SelCount > 0);  
 {$IFDEF ACTCHK}  
         end;  
 {$ENDIF}  
4777  end;  end;
4778    
4779  procedure TGikoForm.UpFolderActionUpdate(Sender: TObject);  procedure TGikoForm.UpFolderActionUpdate(Sender: TObject);
# Line 4929  end; Line 4816  end;
4816  //ブラウザタブが1つ以上で有効になるActionで共通化  //ブラウザタブが1つ以上で有効になるActionで共通化
4817  procedure TGikoForm.AllTabCloseActionUpdate(Sender: TObject);  procedure TGikoForm.AllTabCloseActionUpdate(Sender: TObject);
4818  begin  begin
4819  {$IFDEF ACTCHK}          TAction(Sender).Enabled := (BrowserTab.Tabs.Count > 0);
         //無くてもいいIF文 コードから無理やり呼ばないならチェックしなくても…  
         if (Sender <> nil) and (Sender is TAction) then begin  
 {$ENDIF}  
                 TAction(Sender).Enabled := (BrowserTab.Tabs.Count > 0);  
 {$IFDEF ACTCHK}  
         end;  
 {$ENDIF}  
4820  end;  end;
4821    
4822  procedure TGikoForm.LogDeleteActionExecute(Sender: TObject);  procedure TGikoForm.LogDeleteActionExecute(Sender: TObject);
# Line 5272  end; Line 5152  end;
5152  //ActiveListがTBoardかTCategoryでスレ一覧で1つ以上選択していると有効になるActionde共通  //ActiveListがTBoardかTCategoryでスレ一覧で1つ以上選択していると有効になるActionde共通
5153  procedure TGikoForm.SelectItemNameCopyActionUpdate(Sender: TObject);  procedure TGikoForm.SelectItemNameCopyActionUpdate(Sender: TObject);
5154  begin  begin
5155  {$IFDEF ACTCHK}          if ((GetActiveList is TBoard) or (GetActiveList is TCategory))and (ListView.SelCount > 0) then
5156          //無くてもいいIF文 コードから無理やり呼ばないならチェックしなくても…                  TAction(Sender).Enabled := True
5157          if (Sender <> nil) and (Sender is TAction) then begin          else
5158  {$ENDIF}                  TAction(Sender).Enabled := False;
                 if ((GetActiveList is TBoard) or (GetActiveList is TCategory))and (ListView.SelCount > 0) then  
                         TAction(Sender).Enabled := True  
                 else  
                         TAction(Sender).Enabled := False;  
 {$IFDEF ACTCHK}  
         end;  
 {$ENDIF}  
   
5159  end;  end;
5160    
5161  procedure TGikoForm.AllSelectActionUpdate(Sender: TObject);  procedure TGikoForm.AllSelectActionUpdate(Sender: TObject);
# Line 6455  end; Line 6327  end;
6327  //ブラウザタブが1つ以上で左端でないActionで共通  //ブラウザタブが1つ以上で左端でないActionで共通
6328  procedure TGikoForm.LeftTabSelectActionUpdate(Sender: TObject);  procedure TGikoForm.LeftTabSelectActionUpdate(Sender: TObject);
6329  begin  begin
6330  {$IFDEF ACTCHK}          TAction(Sender).Enabled := (BrowserTab.Tabs.Count > 0) and (BrowserTab.TabIndex <> 0);
         //無くてもいいIF文 コードから無理やり呼ばないならチェックしなくても…  
         if (Sender <> nil) and (Sender is TAction) then begin  
 {$ENDIF}  
                 TAction(Sender).Enabled := (BrowserTab.Tabs.Count > 0) and (BrowserTab.TabIndex <> 0);  
 {$IFDEF ACTCHK}  
         end;  
 {$ENDIF}  
6331  end;  end;
6332  //ブラウザタブが1つ以上で右端でないActionで共通  //ブラウザタブが1つ以上で右端でないActionで共通
6333  procedure TGikoForm.RightTabSelectActionUpdate(Sender: TObject);  procedure TGikoForm.RightTabSelectActionUpdate(Sender: TObject);
6334  begin  begin
6335  {$IFDEF ACTCHK}          TAction(Sender).Enabled := (BrowserTab.Tabs.Count > 0) and (BrowserTab.TabIndex <> BrowserTab.Tabs.Count - 1);
         //無くてもいいIF文 コードから無理やり呼ばないならチェックしなくても…  
         if (Sender <> nil) and (Sender is TAction) then begin  
 {$ENDIF}  
                 TAction(Sender).Enabled := (BrowserTab.Tabs.Count > 0) and (BrowserTab.TabIndex <> BrowserTab.Tabs.Count - 1);  
 {$IFDEF ACTCHK}  
         end;  
 {$ENDIF}  
6336  end;  end;
6337    
6338  procedure TGikoForm.WMSettingChange(var Message: TWMWinIniChange);  procedure TGikoForm.WMSettingChange(var Message: TWMWinIniChange);
# Line 7280  begin Line 7138  begin
7138                          if ThreadItem <> nil then begin                          if ThreadItem <> nil then begin
7139                                  Num := StrToInt(s);                                  Num := StrToInt(s);
7140                                  FHint.PopupType := gptThread;                                  FHint.PopupType := gptThread;
7141                                  SetResPopupText(ThreadItem, Num, Num, False, False);                                  HTMLCreater.SetResPopupText(FHint, ThreadItem, Num, Num, False, False);
7142                                  if FHint.ResCount <> 0 then                                  if FHint.ResCount <> 0 then
7143                                          ShowTextPopup;                                          ShowTextPopup;
7144                                  Result := False;                                  Result := False;
# Line 7292  begin Line 7150  begin
7150          end;          end;
7151  end;  end;
7152    
 procedure TGikoForm.SetResPopupText(threadItem: TThreadItem; StNum, ToNum: Integer; Title, First: Boolean);  
 var  
         i: Integer;  
         tmp: string;  
         FileName: string;  
         Line: Integer;  
   
         wkInt: Integer;  
   
         Res: TResRec;  
         Header: string;  
         Body: string;  
     boardPlugIn : TBoardPlugIn;  
 begin  
         try  
                 if StNum > ToNum then begin  
                         wkInt := StNum;  
                         StNum := ToNum;  
                         ToNum := wkInt;  
                 end;  
   
                 //最大10レスまで表示  
                 if StNum + MAX_POPUP_RES < ToNum then  
                         ToNum := StNum + MAX_POPUP_RES;  
   
                 //タイトル表示  
                 if Title then  
                                 if ThreadItem <> nil then  
                                         FHint.Title := ThreadItem.Title;  
   
         if ThreadItem <> nil then begin  
             //if ThreadItem.IsBoardPlugInAvailable then begin  
             if ThreadItem.ParentBoard.IsBoardPlugInAvailable then begin  
                 //===== プラグインによる表示  
                 //boardPlugIn           := ThreadItem.BoardPlugIn;  
                 boardPlugIn             := ThreadItem.ParentBoard.BoardPlugIn;  
   
                 // フォントやサイズの設定  
                 // 文字コードはプラグインに任せる  
                 for i := StNum to ToNum do begin  
                     Line := i;  
                                         //ここで2ちゃんねるのdatの形式で1行読み込めれば・・・。↓読めるようになった  
                                         tmp := boardPlugIn.GetDat( DWORD( threadItem ), i );  
                     if (tmp <> '') And ( not GikoSys.FAbon.CheckAbonPopupRes(tmp) And( not GikoSys.FAbon.CheckIndividualAbonList(line))) then begin  
                                                 Res := DivideStrLine(tmp);  
                         if (GikoSys.Setting.ShowMail = false) or (Length(res.FMailTo) = 0) then  
                                 Header := IntToStr(Line) + ' 名前: ' + Res.FName + ' 投稿日: ' + Res.FDateTime  
                         else  
                                 Header := IntToStr(Line) + ' 名前: ' + Res.FName + ' [' + res.FMailTo + '] 投稿日: ' + Res.FDateTime;  
                                                 Header := DeleteFontTag(Header);  
                                                 Header := CustomStringReplace(Header, '<br>', '',true);  
   
                                                 Body := CustomStringReplace(Res.FBody, '<br> ', #10,true);  
                                                 Body := CustomStringReplace(Body, '<br>', #10,true);  
                         Body := CustomStringReplace(Body, '</a>', '',true);  
                         Body := GikoSys.DeleteLink(Body);  
                         Body := CustomStringReplace(Body, '&lt;', '<');  
                         Body := CustomStringReplace(Body, '&gt;', '>');  
                         Body := CustomStringReplace(Body, '&quot;', '"');  
                         Body := CustomStringReplace(Body, '&amp;', '&');  
                         Body := CustomStringReplace(Body, '&nbsp;', ' ');  
   
                         FHint.Add(Header, Body);  
                         //FHint.Title := '';  
                     end;  
                 end;  
             end else begin  
                 for i := StNum to ToNum do begin  
                     Line := i;  
                     FileName := ThreadItem.FilePath;  
                     tmp := GikoSys.ReadThreadFile(FileName, Line);  
                     if (tmp <> '') And ( not GikoSys.FAbon.CheckAbonPopupRes(tmp) And( not GikoSys.FAbon.CheckIndividualAbonList(line))) then begin  
                                                 Res := DivideStrLine(tmp);  
                         if (GikoSys.Setting.ShowMail = false) or (Length(res.FMailTo) = 0) then  
                                 Header := IntToStr(Line) + ' 名前: ' + Res.FName + ' 投稿日: ' + Res.FDateTime  
                         else  
                                 Header := IntToStr(Line) + ' 名前: ' + Res.FName + ' [' + res.FMailTo + '] 投稿日: ' + Res.FDateTime;  
   
                                                 Body := DeleteFontTag(Res.FBody);  
                                                 Body := CustomStringReplace(Body, '<br> ', #10,true);  
                         Body := CustomStringReplace(Body, '<br>', #10,true);  
                         Body := CustomStringReplace(Body, '</a>', '',true);  
                         Body := GikoSys.DeleteLink(Body);  
                         Body := CustomStringReplace(Body, '&lt;', '<');  
                         Body := CustomStringReplace(Body, '&gt;', '>');  
                         Body := CustomStringReplace(Body, '&quot;', '"');  
                         Body := CustomStringReplace(Body, '&amp;', '&');  
                          Body := CustomStringReplace(Body, '&nbsp;', ' ');  
                         FHint.Add(Header, Body);  
                         //FHint.Title := '';    //たぶんこれはいらないんだけどね。もじゅ   やっぱりいらなかった(2004/01/13)  
                     end;  
                 end;  
             end;  
         end;  
     finally  
     end;  
 end;  
   
7153  procedure TGikoForm.ShowTextPopup;  procedure TGikoForm.ShowTextPopup;
7154  var  var
7155          p: TPoint;          p: TPoint;
# Line 8757  begin Line 8517  begin
8517                          SenderNode := FDropSpaceNode;                          SenderNode := FDropSpaceNode;
8518    
8519          if Source = FavoriteTreeView then begin          if Source = FavoriteTreeView then begin
   
8520                  SourceNode := FavoriteTreeView.Selected;                  SourceNode := FavoriteTreeView.Selected;
8521                  FavoriteMoveTo( SenderNode, SourceNode );                  FavoriteMoveTo( SenderNode, SourceNode );
   
8522          end else if Source is TLinkToolButton then begin          end else if Source is TLinkToolButton then begin
   
8523                  LinkToolButton := TLinkToolButton( Source );                  LinkToolButton := TLinkToolButton( Source );
                 //ShowMessage(LinkToolButton.Text);  
8524                  SourceNode := TreeNodeDataFind( FavoriteTreeView.Items.GetFirstNode, LinkToolButton.Data );                  SourceNode := TreeNodeDataFind( FavoriteTreeView.Items.GetFirstNode, LinkToolButton.Data );
8525                  FavoriteMoveTo( SenderNode, SourceNode );                  FavoriteMoveTo( SenderNode, SourceNode );
   
8526          end else if Source = BrowserTab then begin          end else if Source = BrowserTab then begin
   
8527                  idx := BrowserTab.TabIndex;                  idx := BrowserTab.TabIndex;
8528                  FavoriteAddTo( SenderNode, BrowserTab.Tabs.Objects[idx] );                  FavoriteAddTo( SenderNode, BrowserTab.Tabs.Objects[idx] );
8529          end else if Source = ListView then begin          end else if Source = ListView then begin
   
8530                  FavoriteAddTo( SenderNode, ListView.Selected.Data );                  FavoriteAddTo( SenderNode, ListView.Selected.Data );
   
8531          end else if Source = TreeView then begin          end else if Source = TreeView then begin
   
8532                  FavoriteAddTo( SenderNode, TreeView.Selected.Data );                  FavoriteAddTo( SenderNode, TreeView.Selected.Data );
   
8533          end;          end;
   
   
   
8534  end;  end;
8535    
8536  procedure TGikoForm.FavoriteTreeViewDragDrop(Sender, Source: TObject; X,  procedure TGikoForm.FavoriteTreeViewDragDrop(Sender, Source: TObject; X,
# Line 8887  begin Line 8634  begin
8634                  FavoriteTreeDeletePopupMenu.Visible := False;                  FavoriteTreeDeletePopupMenu.Visible := False;
8635                  FavoriteTreeRenamePopupMenu.Visible := False;                  FavoriteTreeRenamePopupMenu.Visible := False;
8636                  FavoriteTreeNewFolderPopupMenu.Visible := False;                  FavoriteTreeNewFolderPopupMenu.Visible := False;
                 //FavoriteTreeBrowseBoardPopupMenu.Visible := False;  
                 //FavoriteTreeBrowseThreadPopupMenu.Visible := False;  
8637                  FavoriteTreeURLCopyPopupMenu.Visible := False;                  FavoriteTreeURLCopyPopupMenu.Visible := False;
8638                  FavoriteTreeNameCopyPopupMenu.Visible := False;                  FavoriteTreeNameCopyPopupMenu.Visible := False;
8639                  FavoriteTreeNameURLCopyPopupMenu.Visible := False;                  FavoriteTreeNameURLCopyPopupMenu.Visible := False;
# Line 8899  begin Line 8644  begin
8644                  FavoriteTreeDeletePopupMenu.Visible := False;                  FavoriteTreeDeletePopupMenu.Visible := False;
8645                  FavoriteTreeRenamePopupMenu.Visible := False;                  FavoriteTreeRenamePopupMenu.Visible := False;
8646                  FavoriteTreeNewFolderPopupMenu.Visible := True;                  FavoriteTreeNewFolderPopupMenu.Visible := True;
                 //FavoriteTreeBrowseBoardPopupMenu.Visible := False;  
                 //FavoriteTreeBrowseThreadPopupMenu.Visible := False;  
8647                  FavoriteTreeURLCopyPopupMenu.Visible := False;                  FavoriteTreeURLCopyPopupMenu.Visible := False;
8648                  FavoriteTreeNameCopyPopupMenu.Visible := True;                  FavoriteTreeNameCopyPopupMenu.Visible := True;
8649                  FavoriteTreeNameURLCopyPopupMenu.Visible := False;                  FavoriteTreeNameURLCopyPopupMenu.Visible := False;
# Line 8911  begin Line 8654  begin
8654                  FavoriteTreeDeletePopupMenu.Visible := True;                  FavoriteTreeDeletePopupMenu.Visible := True;
8655                  FavoriteTreeRenamePopupMenu.Visible := False;                  FavoriteTreeRenamePopupMenu.Visible := False;
8656                  FavoriteTreeNewFolderPopupMenu.Visible := True;                  FavoriteTreeNewFolderPopupMenu.Visible := True;
                 //FavoriteTreeBrowseBoardPopupMenu.Visible := False;  
                 //FavoriteTreeBrowseThreadPopupMenu.Visible := False;  
8657                  FavoriteTreeURLCopyPopupMenu.Visible := False;                  FavoriteTreeURLCopyPopupMenu.Visible := False;
8658                  FavoriteTreeNameCopyPopupMenu.Visible := True;                  FavoriteTreeNameCopyPopupMenu.Visible := True;
8659                  FavoriteTreeNameURLCopyPopupMenu.Visible := False;                  FavoriteTreeNameURLCopyPopupMenu.Visible := False;
# Line 8923  begin Line 8664  begin
8664                  FavoriteTreeDeletePopupMenu.Visible := True;                  FavoriteTreeDeletePopupMenu.Visible := True;
8665                  FavoriteTreeRenamePopupMenu.Visible := True;                  FavoriteTreeRenamePopupMenu.Visible := True;
8666                  FavoriteTreeNewFolderPopupMenu.Visible := True;                  FavoriteTreeNewFolderPopupMenu.Visible := True;
                 //FavoriteTreeBrowseBoardPopupMenu.Visible := False;  
                 //FavoriteTreeBrowseThreadPopupMenu.Visible := False;  
8667                  FavoriteTreeURLCopyPopupMenu.Visible := False;                  FavoriteTreeURLCopyPopupMenu.Visible := False;
8668                  FavoriteTreeNameCopyPopupMenu.Visible := True;                  FavoriteTreeNameCopyPopupMenu.Visible := True;
8669                  FavoriteTreeNameURLCopyPopupMenu.Visible := False;                  FavoriteTreeNameURLCopyPopupMenu.Visible := False;
# Line 8935  begin Line 8674  begin
8674                  FavoriteTreeDeletePopupMenu.Visible := True;                  FavoriteTreeDeletePopupMenu.Visible := True;
8675                  FavoriteTreeRenamePopupMenu.Visible := True;                  FavoriteTreeRenamePopupMenu.Visible := True;
8676                  FavoriteTreeNewFolderPopupMenu.Visible := True;                  FavoriteTreeNewFolderPopupMenu.Visible := True;
                 //FavoriteTreeBrowseBoardPopupMenu.Visible := True;  
                 //FavoriteTreeBrowseThreadPopupMenu.Visible := True;  
8677                  FavoriteTreeURLCopyPopupMenu.Visible := True;                  FavoriteTreeURLCopyPopupMenu.Visible := True;
8678                  FavoriteTreeNameCopyPopupMenu.Visible := True;                  FavoriteTreeNameCopyPopupMenu.Visible := True;
8679                  FavoriteTreeNameURLCopyPopupMenu.Visible := True;                  FavoriteTreeNameURLCopyPopupMenu.Visible := True;
# Line 8947  begin Line 8684  begin
8684                  FavoriteTreeDeletePopupMenu.Visible := True;                  FavoriteTreeDeletePopupMenu.Visible := True;
8685                  FavoriteTreeRenamePopupMenu.Visible := True;                  FavoriteTreeRenamePopupMenu.Visible := True;
8686                  FavoriteTreeNewFolderPopupMenu.Visible := True;                  FavoriteTreeNewFolderPopupMenu.Visible := True;
                 //FavoriteTreeBrowseBoardPopupMenu.Visible := True;  
                 //FavoriteTreeBrowseThreadPopupMenu.Visible := False;  
8687                  FavoriteTreeURLCopyPopupMenu.Visible := True;                  FavoriteTreeURLCopyPopupMenu.Visible := True;
8688                  FavoriteTreeNameCopyPopupMenu.Visible := True;                  FavoriteTreeNameCopyPopupMenu.Visible := True;
8689                  FavoriteTreeNameURLCopyPopupMenu.Visible := True;                  FavoriteTreeNameURLCopyPopupMenu.Visible := True;
# Line 8959  begin Line 8694  begin
8694                  FavoriteTreeDeletePopupMenu.Visible := False;                  FavoriteTreeDeletePopupMenu.Visible := False;
8695                  FavoriteTreeRenamePopupMenu.Visible := False;                  FavoriteTreeRenamePopupMenu.Visible := False;
8696                  FavoriteTreeNewFolderPopupMenu.Visible := False;                  FavoriteTreeNewFolderPopupMenu.Visible := False;
                 //FavoriteTreeBrowseBoardPopupMenu.Visible := False;  
                 //FavoriteTreeBrowseThreadPopupMenu.Visible := False;  
8697                  FavoriteTreeURLCopyPopupMenu.Visible := False;                  FavoriteTreeURLCopyPopupMenu.Visible := False;
8698                  FavoriteTreeNameCopyPopupMenu.Visible := False;                  FavoriteTreeNameCopyPopupMenu.Visible := False;
8699                  FavoriteTreeNameURLCopyPopupMenu.Visible := False;                  FavoriteTreeNameURLCopyPopupMenu.Visible := False;
# Line 9077  end; Line 8810  end;
8810  procedure TGikoForm.FavoriteTreeViewBrowseFolderActionExecute(  procedure TGikoForm.FavoriteTreeViewBrowseFolderActionExecute(
8811          Sender: TObject);          Sender: TObject);
8812  begin  begin
   
8813          FavoriteBrowseFolder( FClickNode );          FavoriteBrowseFolder( FClickNode );
         //BrowserTab.OnChange(nil);  
   
8814  end;  end;
8815    
8816  procedure TGikoForm.FavoriteTreeViewDblClick(Sender: TObject);  procedure TGikoForm.FavoriteTreeViewDblClick(Sender: TObject);
# Line 9497  end; Line 9227  end;
9227    
9228  procedure TGikoForm.UpBoardActionExecute(Sender: TObject);  procedure TGikoForm.UpBoardActionExecute(Sender: TObject);
9229  begin  begin
   
9230          SelectTreeNode( GetActiveContent.ParentBoard, True );          SelectTreeNode( GetActiveContent.ParentBoard, True );
   
9231  end;  end;
9232    
9233  procedure TGikoForm.BrowserTabContextPopup(Sender: TObject;  procedure TGikoForm.BrowserTabContextPopup(Sender: TObject;
# Line 9512  begin Line 9240  begin
9240                  BrowserTab.TabIndex := idx;                  BrowserTab.TabIndex := idx;
9241                          BrowserTab.OnChange(nil);                          BrowserTab.OnChange(nil);
9242                  end;                  end;
   
9243  end;  end;
9244    
9245  procedure TGikoForm.KoreCopyExecute(Sender: TObject);  procedure TGikoForm.KoreCopyExecute(Sender: TObject);
# Line 10028  end; Line 9755  end;
9755  //ブラウザがあって、NULLタブ用のなければ有効になるActionで共通  //ブラウザがあって、NULLタブ用のなければ有効になるActionで共通
9756  procedure TGikoForm.SetFocusForBrowserActionUpdate(Sender: TObject);  procedure TGikoForm.SetFocusForBrowserActionUpdate(Sender: TObject);
9757  begin  begin
9758  {$IFDEF ACTCHK}          if( FActiveContent <> nil) and (FActiveContent.Browser <> nil) and
9759          //無くてもいいIF文 コードから無理やり呼ばないならチェックしなくても…                  (FActiveContent.Browser <> BrowserNullTab.Browser) then
9760          if (Sender <> nil) and (Sender is TAction) then begin                  TAction(Sender).Enabled := true
9761  {$ENDIF}          else
9762                  if( FActiveContent <> nil) and (FActiveContent.Browser <> nil) and                  TAction(Sender).Enabled := false;
                         (FActiveContent.Browser <> BrowserNullTab.Browser) then  
                         TAction(Sender).Enabled := true  
                 else  
                         TAction(Sender).Enabled := false;  
 {$IFDEF ACTCHK}  
         end;  
 {$ENDIF}  
9763  end;  end;
9764    
9765  procedure TGikoForm.SetFocusForThreadListActionExecute(Sender: TObject);  procedure TGikoForm.SetFocusForThreadListActionExecute(Sender: TObject);
# Line 10166  begin Line 9886  begin
9886                                                  try                                                  try
9887                                                          HTMLCreater.CreateHTML3(html, TThreadItem(List[i]), title);                                                          HTMLCreater.CreateHTML3(html, TThreadItem(List[i]), title);
9888                                                          html.SaveToFile(FileSaveAs1.Dialog.FileName);                                                          html.SaveToFile(FileSaveAs1.Dialog.FileName);
9889                                                          SkinorCSSFilesCopy(ExtractFilePath(FileSaveAs1.Dialog.FileName));                                                          THTMLCreate.SkinorCSSFilesCopy(ExtractFilePath(FileSaveAs1.Dialog.FileName));
9890                                                  finally                                                  finally
9891                                                          html.Free;                                                          html.Free;
9892                                                  end;                                                  end;
# Line 10179  begin Line 9899  begin
9899                  List.Free;                  List.Free;
9900          end;          end;
9901  end;  end;
 procedure TGikoForm.SkinorCSSFilesCopy(path: string);  
 var  
         tmp, tmpD, tmpF: string;  
         current: string;  
         dirs: TStringList;  
         files: TStringList;  
         i, j: Integer;  
 begin  
         if GikoSys.Setting.UseSkin then begin  
                 current := ExtractFilePath(GikoSys.GetSkinDir);  
                 tmp := GikoSys.Setting.CSSFileName;  
         end else if GikoSys.Setting.UseCSS then begin  
                 current := ExtractFilePath(GikoSys.GetStyleSheetDir);  
                 tmp := ExtractFilePath(GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName);  
         end;  
         dirs := TStringList.Create;  
         try  
                 dirs.Add(tmp);  
                 if tmp <> current then begin  
                         GikoSys.GetDirectoryList(current, '*.*', dirs, true);  
                         for i := 0 to dirs.Count - 1 do begin  
                                 files := TStringList.Create;  
                                 try  
                     files.BeginUpdate;  
                                         gikoSys.GetFileList(dirs[i], '*.*', files, true);  
                     files.EndUpdate;  
                                         tmpD := CustomStringReplace(dirs[i], GikoSys.GetConfigDir, path);  
                                         if (AnsiPos(dirs[i], tmp) <> 0) and not (DirectoryExists(tmpD)) then  
                                                 ForceDirectories(tmpD);  
   
                                         if(dirs[i] = tmp) and (dirs[i] <> current) then begin  
                                                 for j := 0 to files.Count - 1 do begin  
                                                         tmpF := CustomStringReplace(files[j], GikoSys.GetConfigDir, path);  
                                                         if not FileExists(tmpF) then begin  
                                                                 CopyFile(PChar(files[j]), PChar(tmpF),True);  
                                                         end;  
                                                 end;  
                                         end;  
                                 finally  
                                         files.Free;  
                                 end;  
                         end;  
                 end else begin  
                         tmpD := CustomStringReplace(dirs[0], GikoSys.GetConfigDir, path);  
                         if not DirectoryExists(tmpD) then  
                                 ForceDirectories(tmpD);  
                         tmpF := CustomStringReplace(GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName  
                                         , GikoSys.GetConfigDir, path);  
                         if not FileExists(tmpF) then begin  
                                 CopyFile(PChar(GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName)  
                                         , PChar(tmpF), True);  
                         end;  
                 end;  
         finally  
                 dirs.Free;  
         end;  
   
   
 end;  
9902  procedure TGikoForm.KidokuActionExecute(Sender: TObject);  procedure TGikoForm.KidokuActionExecute(Sender: TObject);
9903  var  var
9904          List: TList;          List: TList;
# Line 10997  end; Line 10658  end;
10658  //ブラウザタブが2つ以上あれば有効になるアクションで共通化  //ブラウザタブが2つ以上あれば有効になるアクションで共通化
10659  procedure TGikoForm.RightTabCloseActionUpdate(Sender: TObject);  procedure TGikoForm.RightTabCloseActionUpdate(Sender: TObject);
10660  begin  begin
10661  {$IFDEF ACTCHK}          TAction(Sender).Enabled := (BrowserTab.Tabs.Count > 1);
         //無くてもいいIF文 コードから無理やり呼ばないならチェックしなくても…  
         if (Sender <> nil) and (Sender is TAction) then begin  
 {$ENDIF}  
                 TAction(Sender).Enabled := (BrowserTab.Tabs.Count > 1);  
 {$IFDEF ACTCHK}  
         end;  
 {$ENDIF}  
10662  end;  end;
10663    
10664  procedure TGikoForm.LeftTabCloseActionExecute(Sender: TObject);  procedure TGikoForm.LeftTabCloseActionExecute(Sender: TObject);
# Line 11352  begin Line 11006  begin
11006    
11007  end;  end;
11008    
 procedure TGikoForm.MessageListViewAdvancedCustomDrawItem(  
   Sender: TCustomListView; Item: TListItem; State: TCustomDrawState;  
   Stage: TCustomDrawStage; var DefaultDraw: Boolean);  
 begin  
                 //if DiffComp then begin  
                  //if Odd(Item.Index) then Sender.Canvas.Brush.Color := clBlue;  
                                 //DiffComp := False;  
 //        end;  
 end;  
   
11009  procedure TGikoForm.BeLogInOutActionExecute(Sender: TObject);  procedure TGikoForm.BeLogInOutActionExecute(Sender: TObject);
11010  begin  begin
11011      GikoSys.Setting.BeLogin := not GikoSys.Setting.BeLogin;      GikoSys.Setting.BeLogin := not GikoSys.Setting.BeLogin;
# Line 11377  begin Line 11021  begin
11021                  BeLogInOutAction.Enabled := false;                  BeLogInOutAction.Enabled := false;
11022    
11023  end;  end;
 //リンクの文字列からレスポップアップ用のURLに変換する  
 function TGikoForm.GetRespopupURL(AText, AThreadURL : string): string;  
 var  
         wkInt: Integer;  
 begin  
     Result := '';  
     if Pos('about:blank..', AText) = 1 then begin  
         wkInt := LastDelimiter( '/', AThreadURL );  
                 if Pos( '?', Copy( AThreadURL, wkInt, MaxInt ) ) = 0 then begin  
             // Thread.URL は PATH_INFO 渡し  
             Result := Copy( AThreadURL, 1,  LastDelimiter( '/', AThreadURL ) );  
             wkInt := LastDelimiter( '/', AText );  
             if Pos( '?', Copy( AText, wkInt, MaxInt ) ) = 0 then  
                 // Text も PATH_INFO 渡し  
                 Result := Result + Copy( AText, LastDelimiter( '/', AText ) + 1, MaxInt )  
                         else  
                                 // Text は QUERY_STRING 渡し  
                                 Result := Result + Copy( AText, LastDelimiter( '?', AText ) + 1, MaxInt );  
                 end else begin  
                         // Thread.URL は QUERY_STRING 渡し  
                         Result := Copy( AThreadURL, 1,  LastDelimiter( '?', AThreadURL ) );  
                         wkInt := LastDelimiter( '/', AText );  
                         if Pos( '?', Copy( Text, wkInt, MaxInt ) ) = 0 then begin  
                                 // Text は PATH_INFO 渡し  
                                 // URL に板とキーが足らないので Text から頂戴する  
                                 wkInt := LastDelimiter( '/', Copy( AText, 1, wkInt - 1 ) );  
                                 wkInt := LastDelimiter( '/', Copy( AText, 1, wkInt - 1 ) );  
                                 Result := Copy( Result, 1, Length( Result ) - 1 ) + Copy( AText, wkInt, MaxInt );  
                         end else begin  
                                 // Text も QUERY_STRING 渡し  
                                 Result := Result + Copy( Text, LastDelimiter( '?', AText ) + 1, MaxInt )  
                         end;  
                 end;  
         end else if Pos('about:blank/bbs/', AText) = 1 then begin  
                 //したらばJBBSの仕変の吸収  
                 AText := CustomStringReplace(AText, 'about:blank/bbs/', 'about:blank../../bbs/');  
                 Result := GetRespopupURL(AText, AThreadURL);  
         end else begin  
                 Result := AText;  
         end;  
   
 end;  
11024  //ListViewの選択状態を解除する  //ListViewの選択状態を解除する
11025  procedure TGikoForm.UnSelectedListViewActionExecute(Sender: TObject);  procedure TGikoForm.UnSelectedListViewActionExecute(Sender: TObject);
11026  begin  begin
# Line 11448  end; Line 11050  end;
11050  //TActionでGetActiveContentがnil以外で有効になる  //TActionでGetActiveContentがnil以外で有効になる
11051  procedure TGikoForm.DependActiveCntentActionUpdate(Sender: TObject);  procedure TGikoForm.DependActiveCntentActionUpdate(Sender: TObject);
11052  begin  begin
11053  {$IFDEF ACTCHK}          TAction(Sender).Enabled := (GetActiveContent <> nil);
         //無くてもいいIF文 コードから無理やり呼ばないならチェックしなくても…  
         if (Sender <> nil) and (Sender is TAction) then begin  
 {$ENDIF}  
                 TAction(Sender).Enabled := (GetActiveContent <> nil);  
 {$IFDEF ACTCHK}  
         end;  
 {$ENDIF}  
11054  end;  end;
11055  //TActionでGetActiveContentがnil以外かつログを持っている  //TActionでGetActiveContentがnil以外かつログを持っている
11056  procedure TGikoForm.DependActiveCntentLogActionUpdate(Sender: TObject);  procedure TGikoForm.DependActiveCntentLogActionUpdate(Sender: TObject);
11057  begin  begin
11058  {$IFDEF ACTCHK}          TAction(Sender).Enabled := (GetActiveContent <> nil) and (GetActiveContent.IsLogFile);
         //無くてもいいIF文 コードから無理やり呼ばないならチェックしなくても…  
         if (Sender <> nil) and (Sender is TAction) then begin  
 {$ENDIF}  
                 TAction(Sender).Enabled := (GetActiveContent <> nil) and (GetActiveContent.IsLogFile);  
 {$IFDEF ACTCHK}  
         end;  
 {$ENDIF}  
11059  end;  end;
11060  //TActionでActiveListがTBoardで有効になる  //TActionでActiveListがTBoardで有効になる
11061  procedure TGikoForm.DependActiveListTBoardActionUpdate(Sender: TObject);  procedure TGikoForm.DependActiveListTBoardActionUpdate(Sender: TObject);
11062  begin  begin
11063  {$IFDEF ACTCHK}          TAction(Sender).Enabled := (GetActiveList is TBoard);
         //無くてもいいIF文 コードから無理やり呼ばないならチェックしなくても…  
         if (Sender <> nil) and (Sender is TAction) then begin  
 {$ENDIF}  
                 TAction(Sender).Enabled := (GetActiveList is TBoard);  
 {$IFDEF ACTCHK}  
         end;  
 {$ENDIF}  
11064  end;  end;
11065    
11066  procedure TGikoForm.FavoriteTreeViewEditing(Sender: TObject;  procedure TGikoForm.FavoriteTreeViewEditing(Sender: TObject;
# Line 11503  begin Line 11084  begin
11084  end;  end;
11085    
11086  procedure TGikoForm.WikiFAQWebPageActionExecute(Sender: TObject);  procedure TGikoForm.WikiFAQWebPageActionExecute(Sender: TObject);
 const  
         URL_Wiki: string = 'http://gikowiki.dyndns.info/index.php?FAQ';  
11087  begin  begin
11088          GikoSys.OpenBrowser(URL_Wiki, gbtAuto);          GikoSys.OpenBrowser(URL_Wiki, gbtAuto);
11089  end;  end;

Legend:
Removed from v.1.529  
changed lines
  Added in v.1.530

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