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.98.2.3 by yoffy, Thu Sep 9 16:20:31 2004 UTC revision 1.98.2.4 by yoffy, Fri Oct 8 05:44:50 2004 UTC
# Line 28  type Line 28  type
28          TGikoTreeType = (gttNone, gtt2ch, gttHistory, gttFavorite);          TGikoTreeType = (gttNone, gtt2ch, gttHistory, gttFavorite);
29          TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser);          TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser);
30          TMinimizeType = (mtNone, mtMinimizing, mtMinimized);          TMinimizeType = (mtNone, mtMinimizing, mtMinimized);
31            TResizeType = (rtNone, rtResizing);
32    
33          TBrowserRecord = class;          TBrowserRecord = class;
34    
# Line 527  type Line 528  type
528      N65: TMenuItem;      N65: TMenuItem;
529      BBSSelectPopupMenu: TPopupMenu;      BBSSelectPopupMenu: TPopupMenu;
530                  PlugInMenu: TMenuItem;                  PlugInMenu: TMenuItem;
531      TmpToolBar: TToolBar;          TmpToolBar: TToolBar;
532      TreeSelectNameCopy: TAction;      TreeSelectNameCopy: TAction;
533      TreeSelectNamePupupMenu: TMenuItem;      TreeSelectNamePupupMenu: TMenuItem;
534      BrowserPanel: TPanel;      BrowserPanel: TPanel;
# Line 550  type Line 551  type
551                  OpenLogFolder: TMenuItem;                  OpenLogFolder: TMenuItem;
552      Browser: TWebBrowser;      Browser: TWebBrowser;
553      TabSave: TMenuItem;      TabSave: TMenuItem;
554      TabOpen: TMenuItem;          TabOpen: TMenuItem;
555                  TabsSaveAction: TAction;                  TabsSaveAction: TAction;
556      TabsOpenAction: TAction;      TabsOpenAction: TAction;
557      ResRangePopupMenu: TPopupMenu;      ResRangePopupMenu: TPopupMenu;
# Line 573  type Line 574  type
574      N69: TMenuItem;      N69: TMenuItem;
575      S7: TMenuItem;      S7: TMenuItem;
576      ThreadRangeButton: TToolButton;      ThreadRangeButton: TToolButton;
577      TabAutoSaveAction: TAction;          TabAutoSaveAction: TAction;
578      TabAutoLoadAction: TAction;      TabAutoLoadAction: TAction;
579        ListColumnPopupMenu: TPopupMenu;
580        JumpToNumOfResAction: TAction;
581        FavoriteTreeViewCollapseAction: TAction;
582                                  procedure FormCreate(Sender: TObject);                                  procedure FormCreate(Sender: TObject);
583                  procedure FormDestroy(Sender: TObject);                  procedure FormDestroy(Sender: TObject);
584                  procedure CabinetPanelHide(Sender: TObject);                  procedure CabinetPanelHide(Sender: TObject);
                 procedure FormClose(Sender: TObject; var Action: TCloseAction);  
585                  procedure ListViewData(Sender: TObject; Item: TListItem);                  procedure ListViewData(Sender: TObject; Item: TListItem);
586                  procedure ListViewDataFind(Sender: TObject; Find: TItemFind;                  procedure ListViewDataFind(Sender: TObject; Find: TItemFind;
587                          const FindString: String; const FindPosition: TPoint;                          const FindString: String; const FindPosition: TPoint;
# Line 806  type Line 809  type
809                  procedure SelectComboBoxExit(Sender: TObject);                  procedure SelectComboBoxExit(Sender: TObject);
810                  procedure SelectResActionExecute(Sender: TObject);                  procedure SelectResActionExecute(Sender: TObject);
811                  procedure SelectResActionUpdate(Sender: TObject);                  procedure SelectResActionUpdate(Sender: TObject);
                 procedure FormKeyUp(Sender: TObject; var Key: Word;  
                         Shift: TShiftState);  
812                  procedure AllResActionExecute(Sender: TObject);                  procedure AllResActionExecute(Sender: TObject);
813                  procedure AllResActionUpdate(Sender: TObject);                  procedure AllResActionUpdate(Sender: TObject);
814                  procedure ReloadClick(Sender: TObject);                  procedure ReloadClick(Sender: TObject);
# Line 872  type Line 873  type
873        var Handled: Boolean);        var Handled: Boolean);
874      procedure KoreCopyExecute(Sender: TObject);      procedure KoreCopyExecute(Sender: TObject);
875      procedure BrowserTabPopupMenuPopup(Sender: TObject);      procedure BrowserTabPopupMenuPopup(Sender: TObject);
876      procedure MenuToolBarResize(Sender: TObject);          procedure MenuToolBarResize(Sender: TObject);
877      procedure StdToolBarResize(Sender: TObject);      procedure StdToolBarResize(Sender: TObject);
878      procedure LinkToolBarResize(Sender: TObject);      procedure LinkToolBarResize(Sender: TObject);
879      procedure ListNameToolBarResize(Sender: TObject);      procedure ListNameToolBarResize(Sender: TObject);
# Line 895  type Line 896  type
896                  procedure SetFocusForBrowserActionUpdate(Sender: TObject);                  procedure SetFocusForBrowserActionUpdate(Sender: TObject);
897      procedure SetFocusForThreadListActionExecute(Sender: TObject);      procedure SetFocusForThreadListActionExecute(Sender: TObject);
898      procedure SetFocusForCabinetActionExecute(Sender: TObject);      procedure SetFocusForCabinetActionExecute(Sender: TObject);
899      procedure BrowserMaxAndFocusActionExecute(Sender: TObject);          procedure BrowserMaxAndFocusActionExecute(Sender: TObject);
900      procedure BrowserMaxAndFocusActionUpdate(Sender: TObject);      procedure BrowserMaxAndFocusActionUpdate(Sender: TObject);
901      procedure ThreadlistMaxAndFocusActionExecute(Sender: TObject);      procedure ThreadlistMaxAndFocusActionExecute(Sender: TObject);
902      procedure ListViewExit(Sender: TObject);      procedure ListViewExit(Sender: TObject);
# Line 918  type Line 919  type
919      procedure OnlyAHundredResActionExecute(Sender: TObject);      procedure OnlyAHundredResActionExecute(Sender: TObject);
920      procedure OnlyKokoResActionExecute(Sender: TObject);      procedure OnlyKokoResActionExecute(Sender: TObject);
921      procedure OnlyNewResActionExecute(Sender: TObject);      procedure OnlyNewResActionExecute(Sender: TObject);
922      procedure BrowsBoradHeadActionExecute(Sender: TObject);          procedure BrowsBoradHeadActionExecute(Sender: TObject);
923      procedure BrowsBoradHeadActionUpdate(Sender: TObject);      procedure BrowsBoradHeadActionUpdate(Sender: TObject);
924      procedure EditNGActionExecute(Sender: TObject);      procedure EditNGActionExecute(Sender: TObject);
925      procedure ThreadRangeActionUpdate(Sender: TObject);      procedure ThreadRangeActionUpdate(Sender: TObject);
926      procedure ThreadRangeActionExecute(Sender: TObject);      procedure ThreadRangeActionExecute(Sender: TObject);
927      procedure TabAutoSaveActionExecute(Sender: TObject);                  procedure TabAutoSaveActionExecute(Sender: TObject);
928      procedure TabAutoLoadActionExecute(Sender: TObject);      procedure TabAutoLoadActionExecute(Sender: TObject);
929                    procedure ListViewColumnRightClick(Sender: TObject;
930          Column: TListColumn; Point: TPoint);
931        procedure JumpToNumOfResActionExecute(Sender: TObject);
932        procedure JumpToNumOfResActionUpdate(Sender: TObject);
933        procedure FavoriteTreeViewCollapseActionExecute(Sender: TObject);
934          private          private
935                  { Private 宣言 }                  { Private 宣言 }
936          //RoundList : TRoundList;          //RoundList : TRoundList;
# Line 972  type Line 978  type
978    
979                  FDropSpaceNode: TTreeNode;                  FDropSpaceNode: TTreeNode;
980    
981                  FDragTime : Cardinal;   //リンクのD&D用                  FDragTime : Cardinal;                                                           ///< リンクのD&D用
982                  FDragButton : TToolButton;      //リンクのD&D用にDragしてるButton保存                  FDragButton : TToolButton;                                      ///< リンクのD&D用にDragしてるButton保存
983                  FDragWFirst : Boolean;  //WebTabのD&D用                  FDragWFirst : Boolean;                                                  ///< WebTabのD&D用
984    
985                  FListViewBackGroundColor : TColor; //ListViewのBackGroundColor                  FListViewBackGroundColor : TColor;      ///< ListViewのBackGroundColor
986                  FUseOddResOddColor : Boolean; //取得レス数とスレッドのレス数が違ったときに他の色で表示                  FUseOddResOddColor : Boolean;                   ///< 取得レス数とスレッドのレス数が違ったときに他の色で表示
987                  FOddColor : TColor;                                      //その色                  FOddColor : TColor;                                                                     ///< その色
988    
989                  FSelectResWord  : string;                                       // レス絞込ワード                  FSelectResWord  : string;                                               ///< レス絞込ワード
990                  FIsIgnoreResize : Boolean;                              // リサイズイベントを無視するかどうか                  FIsIgnoreResize : TResizeType;                  ///< リサイズイベントを無視するかどうか
991                  FIsMinimize                     : TMinimizeType;        // 最小化している最中か                  FIsMinimize                     : TMinimizeType;                ///< 最小化している最中か
992                  FOldFormWidth           : Integer;                              // 直前のウィンドウの幅                  FOldFormWidth           : Integer;                                      ///< 直前のウィンドウの幅
993                  FToolBarSettingSender : TToolBarSettingSenderType;      // ツールバー設定をクリックしたクールバー                  FToolBarSettingSender : TToolBarSettingSenderType;      ///< ツールバー設定をクリックしたクールバー
994                  FMouseDownPos           : TPoint;                               // ブラウザタブでマウスを押したときの座標                  FMouseDownPos           : TPoint;                                       ///< ブラウザタブでマウスを押したときの座標
995                  FBrowsers: TList;                  FBrowsers: TList;
996                  FResRangeMenuSelect     : Longint;              ///< ResRangeButton で選択されている項目 (フォーマットは ResRange 互換)                  FResRangeMenuSelect     : Longint;                      ///< ResRangeButton で選択されている項目 (フォーマットは ResRange 互換)
997                    FStartUp : Boolean;
998                    FIsHandledWheel : Boolean;                      ///< 既に受け取った WM_MOUSEWHEEL かどうか
999                  procedure SetBoardTreeNode( inBBS : TBBS );                  procedure SetBoardTreeNode( inBBS : TBBS );
1000                  function SetCategoryListItem(ABBS2ch: TBBS): Integer;                  function SetCategoryListItem(ABBS2ch: TBBS): Integer;
1001                  function SetBoardListItem(Category: TCategory): Integer;                  function SetBoardListItem(Category: TCategory): Integer;
# Line 1000  type Line 1008  type
1008                  procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);                  procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
1009                  procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);                  procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
1010    
1011                  procedure SetActiveList(Obj: TObject);  
1012                  procedure ListClick;                  procedure ListClick;
1013                  procedure ListDoubleClick(Shift: TShiftState);                  procedure ListDoubleClick(Shift: TShiftState);
1014                  procedure BrowserMovement(const AName: string); overload;                  procedure BrowserMovement(const AName: string); overload;
# Line 1051  type Line 1059  type
1059                  procedure BBSMenuItemOnClick( Sender : TObject );                  procedure BBSMenuItemOnClick( Sender : TObject );
1060                  //                  //
1061                  procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean);                  procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean);
1062                  // CoolBar の設定を変数に保存                  /// CoolBar の設定を変数に保存
1063                  procedure       SaveCoolBarSettings;                  procedure       SaveCoolBarSettings;
1064                  // CoolBar の設定を変数から復元                  /// CoolBar の設定を変数から復元
1065                  procedure       LoadCoolBarSettings;                  procedure       LoadCoolBarSettings;
1066                  // 最小化される                  /// 最小化される
1067                  procedure OnMinimize;                  procedure OnMinimize;
1068                  // 最小化された                  /// 最小化された
1069                  procedure OnMinimized;                  procedure OnMinimized;
1070                  // CoolBar がサイズ変更された                  /// CoolBar がサイズ変更された
1071                  procedure       CoolBarResized(Sender: TObject; CoolBar: TCoolBar);                  procedure       CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
1072                  // TreeView がクリックされた                  /// TreeView がクリックされた
1073                  procedure TreeClick( Node : TTreeNode );                  procedure TreeClick( Node : TTreeNode );
1074                  // TreeView がダブルクリックされた                  /// TreeView がダブルクリックされた
1075                  procedure TreeDoubleClick( Node : TTreeNode );                  procedure TreeDoubleClick( Node : TTreeNode );
1076                  // ギコナビのメッセージループを横取りします                  /// ギコナビのメッセージループを横取りします
1077                  procedure HandleAppMessage(var Msg: TMsg; var Handled: Boolean);                  procedure HandleAppMessage(var Msg: TMsg; var Handled: Boolean);
1078                  // ブラウザのキーダウンイベント                  /// ブラウザのキーダウンイベント
1079                  // イベントを取り扱った場合は True を返す                  /// イベントを取り扱った場合は True を返す
1080                  function BrowserKeydown(var Msg: TMsg; Key: Word; State:TShiftState) : Boolean;                  function BrowserKeydown(var Msg: TMsg; Key: Word; State:TShiftState) : Boolean;
1081                  // 各所にあるキャビネット・ BBS メニューをセット/更新                  /// 各所にあるキャビネット・ BBS メニューをセット/更新
1082                  procedure SetBBSMenu;                  procedure SetBBSMenu;
1083                  function WebBrowserClick(Sender: TObject): WordBool;                  function WebBrowserClick(Sender: TObject): WordBool;
1084                  procedure SkinorCSSFilesCopy(path: string);                  procedure SkinorCSSFilesCopy(path: string);
1085                  // タブ取得                  /// タブ取得
1086                  function GetTabURLs(AStringList: TStringList) : Boolean;                  function GetTabURLs(AStringList: TStringList) : Boolean;
1087                  // タブ保存                  /// タブ保存
1088                  function SaveTabURLs : Boolean;                  function SaveTabURLs : Boolean;
1089                  // タブ読み出し                  /// タブ読み出し
1090                  function LoadTabURLs : Boolean;                  function LoadTabURLs : Boolean;
1091                  // バンド幅を再計算・再設定する                  /// バンド幅を再計算・再設定する
1092                  procedure ResetBandInfo( bar : TGikoCoolBar; band : TToolBar );                  procedure ResetBandInfo( bar : TGikoCoolBar; band : TToolBar );
1093                    /// ListView の Column を真のカラムに変換
1094                    function        ActiveListTrueColumn( column : TListColumn ) : TListColumn;
1095                    /// ListColumnPopupMenu アイテムのクリックイベント
1096                    procedure       ListColumnPopupMenuOnClick( Sender : TObject );
1097          protected          protected
1098                  procedure CreateParams(var Params: TCreateParams); override;                  procedure CreateParams(var Params: TCreateParams); override;
1099                  procedure WndProc(var Message: TMessage); override;                  procedure WndProc(var Message: TMessage); override;
# Line 1093  type Line 1105  type
1105                  { Public 宣言 }                  { Public 宣言 }
1106  //              FDownload: TDownload;  //              FDownload: TDownload;
1107                  FControlThread: TThreadControl;                  FControlThread: TThreadControl;
1108                  procedure MoveToURL(URL: string);                  procedure MoveToURL(const inURL: string);
1109                  procedure InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True);                  function InsertBrowserTab(
1110                            ThreadItem      : TThreadItem;
1111                            ActiveTab               : Boolean = True
1112                    ) : TBrowserRecord;
1113                  procedure ReloadBBS;                  procedure ReloadBBS;
1114                  function GetHttpState: Boolean;                  function GetHttpState: Boolean;
1115                  procedure SetEnabledCloseButton(Enabled: Boolean);                  procedure SetEnabledCloseButton(Enabled: Boolean);
# Line 1114  type Line 1129  type
1129                  function GetActiveContent: TThreadItem;                  function GetActiveContent: TThreadItem;
1130                  function GetActiveList: TObject;                  function GetActiveList: TObject;
1131    
1132                  property ActiveList: TObject read GetActiveList write SetActiveList;  
1133  //              property LastRoundTime: TDateTime read FLastRoundTime write FLastRoundTime;  //              property LastRoundTime: TDateTime read FLastRoundTime write FLastRoundTime;
1134    
1135                  procedure SetListViewType(AViewType: TGikoViewType); overload;                  procedure SetListViewType(AViewType: TGikoViewType); overload;
# Line 1138  type Line 1153  type
1153  //              property Favorite: TFavorite read FFavorite write FFavorite;  //              property Favorite: TFavorite read FFavorite write FFavorite;
1154                  procedure SetToolBarPopup;                  procedure SetToolBarPopup;
1155                  procedure ShowFavoriteAddDialog( Item : TObject );                  procedure ShowFavoriteAddDialog( Item : TObject );
1156          procedure FavoritesURLReplace(oldURLs: TStringList; newURLs: TStringList);                  procedure FavoritesURLReplace(oldURLs: TStringList; newURLs: TStringList);
1157          procedure RoundListURLReplace(oldURLs: TStringList; newURLs: TStringList);                  procedure RoundListURLReplace(oldURLs: TStringList; newURLs: TStringList);
1158                  property ListViewBackGroundColor: TColor read FListViewBackGroundColor write SetListViewBackGroundColor;                  property ListViewBackGroundColor: TColor read FListViewBackGroundColor write SetListViewBackGroundColor;
1159                  property UseOddResOddColor : Boolean read FUseOddResOddColor write FUseOddResOddColor;                  property UseOddResOddColor : Boolean read FUseOddResOddColor write FUseOddResOddColor;
1160                  property OddColor : TColor read FOddColor write FOddColor;                  property OddColor : TColor read FOddColor write FOddColor;
1161    
1162                  function FindToolBarButton( bar : TToolBar; action : TAction ) : TToolButton;                  function FindToolBarButton( bar : TToolBar; action : TAction ) : TToolButton;
1163                  procedure OnPlugInMenuItem( Sender : TObject );                  procedure OnPlugInMenuItem( Sender : TObject );
1164                  procedure TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);                  procedure TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);
1165                    /// ListView のカラム幅および位置の保存 KuroutSettingからよびだしたいので
1166                    procedure ActiveListColumnSave;
1167                    procedure SetActiveList(Obj: TObject);
1168                    property ActiveList: TObject read GetActiveList write SetActiveList;
1169          published          published
1170                  property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;                  property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
1171          end;          end;
# Line 1176  type Line 1194  type
1194          TBrowserRecord = class( TObject )          TBrowserRecord = class( TObject )
1195          private          private
1196                  FBrowser        : TWebBrowser;                  FBrowser        : TWebBrowser;
1197                  FEvent: THTMLDocumentEventSink;//ブラウザドキュメントイベント                  FEvent: THTMLDocumentEventSink; //!< ブラウザドキュメントイベント
1198                  FThread         : TThreadItem;                  FThread         : TThreadItem;
1199                  FLastSize       : Integer;                  FLastSize       : Integer;
1200                  FRepaint        : Boolean;                  FRepaint        : Boolean;
1201   //             FOnlyHundred: Boolean;                  FMovement       : string;                                                       //!< スクロール先アンカー
1202          public          public
1203                  destructor      Destroy; override;                  destructor      Destroy; override;
1204                  property        Browser : TWebBrowser   read FBrowser   write FBrowser;                  property        Browser : TWebBrowser   read FBrowser   write FBrowser;
1205                  property        Thread  : TThreadItem   read FThread    write FThread;                  property        Thread  : TThreadItem   read FThread    write FThread;
1206                  property        LastSize        : Integer               read FLastSize  write FLastSize;                  property        LastSize        : Integer               read FLastSize  write FLastSize;
1207                  property        Repaint         : Boolean               read FRepaint   write FRepaint;                  property        Repaint         : Boolean               read FRepaint   write FRepaint;
1208  //              property        OnlyHundred : Boolean           read FOnlyHundred write FOnlyHundred;                  property        Movement        : string                read FMovement  write FMovement;
1209          end;          end;
1210    
1211  var  var
# Line 1248  const Line 1266  const
1266          USER_RESIZED            = WM_USER + 2001;          USER_RESIZED            = WM_USER + 2001;
1267          USER_MINIMIZED                                  = WM_USER + 2002;          USER_MINIMIZED                                  = WM_USER + 2002;
1268          USER_SETLINKBAR                                 = WM_USER + 2003;          USER_SETLINKBAR                                 = WM_USER + 2003;
1269            USER_DOCUMENTCOMPLETE           = WM_USER + 2004;       ///< wParam : TWebBrowser
1270          SELECTTIME_INTERBAL                             = 110;          SELECTTIME_INTERBAL                             = 110;
1271    
1272          BROWSER_COUNT           = 5;    //ブラウザの数          BROWSER_COUNT           = 5;    //ブラウザの数
# Line 1285  begin Line 1304  begin
1304          Writeln(' 終了時は、ギコナビウィンドウを閉じてください');          Writeln(' 終了時は、ギコナビウィンドウを閉じてください');
1305          Writeln('============================================================');          Writeln('============================================================');
1306  {$ENDIF}  {$ENDIF}
1307            FStartUp := false;
1308          Application.OnDeactivate := AppFormDeactivate;          Application.OnDeactivate := AppFormDeactivate;
1309          Self.OnDeactivate := AppFormDeactivate;          Self.OnDeactivate := AppFormDeactivate;
1310          Application.HookMainWindow(Hook);          Application.HookMainWindow(Hook);
1311          Application.OnMessage := HandleAppMessage; //なんか無くても大丈夫になった by もじゅ          Application.OnMessage := HandleAppMessage; //なんか無くても大丈夫になった by もじゅ
1312          Self.DoubleBuffered := true;  //      Self.DoubleBuffered := true;
1313          FTreeType := gttNone;          FTreeType := gttNone;
1314    
1315          FSearchDialog := nil;          FSearchDialog := nil;
# Line 1304  begin Line 1324  begin
1324                  newBrowser.Align := alNone;                  newBrowser.Align := alNone;
1325                  newBrowser.Left := 0;                  newBrowser.Left := 0;
1326                  newBrowser.Top  := 0;                  newBrowser.Top  := 0;
1327          //newBrowser.DoubleBuffered := true;                  newBrowser.StatusBar    := false;
1328                    newBrowser.MenuBar              := false;
1329                    newBrowser.AddressBar   := false;
1330                  newBrowser.OnDocumentComplete   := BrowserDocumentComplete;                  newBrowser.OnDocumentComplete   := BrowserDocumentComplete;
1331                  newBrowser.OnBeforeNavigate2    := BrowserBeforeNavigate2;                  newBrowser.OnBeforeNavigate2    := BrowserBeforeNavigate2;
1332                  newBrowser.OnEnter                              := BrowserEnter;                  newBrowser.OnEnter                              := BrowserEnter;
1333                  newBrowser.OnNewWindow2                 := BrowserNewWindow2;                  newBrowser.OnNewWindow2                 := BrowserNewWindow2;
1334                  newBrowser.OnStatusTextChange   := BrowserStatusTextChange;                  newBrowser.OnStatusTextChange   := BrowserStatusTextChange;
                 //newBrowser.OnTitleChange              := BrowserTitleChange;  
1335                  newBrowser.Navigate(BLANK_HTML);                  newBrowser.Navigate(BLANK_HTML);
1336                  ShowWindow(newBrowser.Handle, SW_HIDE);                  ShowWindow(newBrowser.Handle, SW_HIDE);
1337    
# Line 1319  begin Line 1340  begin
1340          ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);          ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);
1341    
1342          // 起動時に保存されてしまう対策          // 起動時に保存されてしまう対策
1343          FIsIgnoreResize := True;          FIsIgnoreResize := rtResizing;
1344    
1345          //手のカーソル          //手のカーソル
1346          Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');          Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
# Line 1328  begin Line 1349  begin
1349          //アドレス履歴読み込み          //アドレス履歴読み込み
1350          AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);          AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1351    
         // 外部板プラグインをロード(ReadBoardFile, LoadHistory より先に行うこと)  
         InitializeBoardPlugIns;  
   
1352          EnabledCloseButton := True;          EnabledCloseButton := True;
1353    
   
         //巡回データ読み込み  
         RoundList := TRoundList.Create;  
         RoundList.LoadRoundBoardFile;  
   
         // ボードファイル列挙(ReadFavorite より先に行うこと)  
         GikoSys.ListBoardFile;  
   
         RoundList.LoadRoundThreadFile;  
   
         if RoundList.OldFileRead or ( RoundList.Count[grtItem] > 0 ) then  
                 GikoSys.ListBoardFile;  
   
         // メニューに追加  
         SetBBSMenu;  
   
         // ヒストリリスト(LoadHistory よりも先に行うこと)  
         FHistoryList := TList.Create;  
   
         // 履歴読み込み  
         LoadHistory;  
   
         //お気に入り読み込み  
 //      FFavorite := TFavorite.Create(FavoriteTreeView);  
         FavoriteDM.SetFavTreeView(FavoriteTreeView);  
         FavoriteDM.ReadFavorite;  
   
1354          //リストスタイル          //リストスタイル
1355          ListView.ViewStyle := GikoSys.Setting.ListStyle;          ListView.ViewStyle := GikoSys.Setting.ListStyle;
1356    
# Line 1403  begin Line 1394  begin
1394                  ListView.Font.Name := GikoSys.Setting.ListFontName;                  ListView.Font.Name := GikoSys.Setting.ListFontName;
1395                  ListView.Font.Size := GikoSys.Setting.ListFontSize;                  ListView.Font.Size := GikoSys.Setting.ListFontSize;
1396                  ListView.Font.Color := GikoSys.Setting.ListFontColor;                  ListView.Font.Color := GikoSys.Setting.ListFontColor;
1397                  //ListView.Color := GikoSys.Setting.ListBackColor;                  ListViewBackGroundColor := clWhite;                                                                                             // デフォルトに設定したのち
1398                  ListViewBackGroundColor := GikoSys.Setting.ListBackColor;                  ListViewBackGroundColor := GikoSys.Setting.ListBackColor;       // ユーザ定義に変更
1399                  FUseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;                  FUseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
1400                  FOddColor := GikoSys.Setting.OddColor;                  FOddColor := GikoSys.Setting.OddColor;
1401    
# Line 1472  begin Line 1463  begin
1463          FBrowserSizeHeight := GikoSys.Setting.ListHeight;          FBrowserSizeHeight := GikoSys.Setting.ListHeight;
1464          FBrowserSizeWidth := GikoSys.Setting.ListWidth;          FBrowserSizeWidth := GikoSys.Setting.ListWidth;
1465    
1466            // 外部板プラグインをロード(ReadBoardFile, LoadHistory より先に行うこと)
1467            InitializeBoardPlugIns;
1468    
1469            //巡回データ読み込み
1470            RoundList := TRoundList.Create;
1471            RoundList.LoadRoundBoardFile;
1472    
1473            // ボードファイル列挙(ReadFavorite より先に行うこと)
1474            GikoSys.ListBoardFile;
1475    
1476            RoundList.LoadRoundThreadFile;
1477    
1478            if RoundList.OldFileRead or ( RoundList.Count[grtItem] > 0 ) then
1479                    GikoSys.ListBoardFile;
1480    
1481            // メニューに追加
1482            SetBBSMenu;
1483    
1484            // ヒストリリスト(LoadHistory よりも先に行うこと)
1485            FHistoryList := TList.Create;
1486    
1487            // 履歴読み込み
1488            LoadHistory;
1489    
1490            //お気に入り読み込み
1491    //      FFavorite := TFavorite.Create(FavoriteTreeView);
1492            FavoriteDM.SetFavTreeView(FavoriteTreeView);
1493            FavoriteDM.ReadFavorite;
1494    
1495          ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);          ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);
1496          ArrangeAction.Execute;          ArrangeAction.Execute;
1497    
# Line 1668  begin Line 1688  begin
1688                          if GikoSys.Setting.CabinetIndex < Length( BBSs ) then                          if GikoSys.Setting.CabinetIndex < Length( BBSs ) then
1689                                  ShowBBSTree( BBSs[ GikoSys.Setting.CabinetIndex ] );                                  ShowBBSTree( BBSs[ GikoSys.Setting.CabinetIndex ] );
1690                          // 起動時に保存されてしまう対策 2                          // 起動時に保存されてしまう対策 2
1691                          FIsIgnoreResize := True;                          FIsIgnoreResize := rtResizing;
1692                          CabinetBBSAction.Execute;                          CabinetBBSAction.Execute;
1693                  end;                  end;
1694          end else begin          end else begin
# Line 1677  begin Line 1697  begin
1697          end;          end;
1698    
1699          // 起動時に保存されてしまう対策 3          // 起動時に保存されてしまう対策 3
1700          FIsIgnoreResize := True;          FIsIgnoreResize := rtResizing;
1701    
1702          //オートログイン          //オートログイン
1703          if GikoSys.Setting.AutoLogin then          if GikoSys.Setting.AutoLogin then
# Line 1701  begin Line 1721  begin
1721          //Samba24のファイルチェック          //Samba24のファイルチェック
1722          GikoSys.SambaFileExists();          GikoSys.SambaFileExists();
1723    
1724          //タブ自動読み込み (AV発生のため一時封印)          //にちゃん語ファイル読み出し
1725  end;  end;
1726    
1727  // CoolBar の設定を変数に保存  // CoolBar の設定を変数に保存
# Line 1711  var Line 1731  var
1731          CoolSet : TCoolSet;          CoolSet : TCoolSet;
1732  begin  begin
1733    
1734          if IsIconic( Handle ) or FIsIgnoreResize then          if IsIconic( Handle ) or (FIsIgnoreResize <> rtNone) then
1735                  Exit;                  Exit;
1736    
1737          //クールバー保存(Main)          //クールバー保存(Main)
# Line 1752  begin Line 1772  begin
1772                  for i := MAIN_COOLBAND_COUNT - 1 downto 0 do begin                  for i := MAIN_COOLBAND_COUNT - 1 downto 0 do begin
1773                          CoolSet := GikoSys.Setting.MainCoolSet[i];                          CoolSet := GikoSys.Setting.MainCoolSet[i];
1774                          if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin                          if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1775                                  FIsIgnoreResize := False;                                  FIsIgnoreResize := rtNone;
1776                                  SaveCoolBarSettings;                                  SaveCoolBarSettings;
1777                                  Exit;                                  Exit;
1778                          end;                          end;
# Line 1771  begin Line 1791  begin
1791                  for i := LIST_COOLBAND_COUNT - 1 downto 0 do begin                  for i := LIST_COOLBAND_COUNT - 1 downto 0 do begin
1792                          CoolSet := GikoSys.Setting.ListCoolSet[i];                          CoolSet := GikoSys.Setting.ListCoolSet[i];
1793                          if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin                          if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1794                                  FIsIgnoreResize := False;                                  FIsIgnoreResize := rtNone;
1795                                  SaveCoolBarSettings;                                  SaveCoolBarSettings;
1796                                  Exit;                                  Exit;
1797                          end;                          end;
# Line 1790  begin Line 1810  begin
1810                  for i := BROWSER_COOLBAND_COUNT - 1 downto 0 do begin                  for i := BROWSER_COOLBAND_COUNT - 1 downto 0 do begin
1811                          CoolSet := GikoSys.Setting.BrowserCoolSet[i];                          CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1812                          if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin                          if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1813                                  FIsIgnoreResize := False;                                  FIsIgnoreResize := rtNone;
1814                                  SaveCoolBarSettings;                                  SaveCoolBarSettings;
1815                                  Exit;                                  Exit;
1816                          end;                          end;
# Line 1809  end; Line 1829  end;
1829  //  //
1830  procedure TGikoForm.FormShow(Sender: TObject);  procedure TGikoForm.FormShow(Sender: TObject);
1831  begin  begin
1832          ShowWindow(Application.Handle, SW_HIDE);          if not FStartUp then begin
1833                    ShowWindow(Application.Handle, SW_HIDE);
1834    
1835          //FormCreateでやると可視設定が反映されない場合があるのでFormShowでやることにした                  //FormCreateでやると可視設定が反映されない場合があるのでFormShowでやることにした
1836          //ツールバー表示                  //ツールバー表示
1837          StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;                  StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1838          StdToolBarVisibleActionExecute( nil );                  StdToolBarVisibleActionExecute( nil );
1839          AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;                  AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1840          AddressBarVisibleActionExecute( nil );                  AddressBarVisibleActionExecute( nil );
1841          LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;                  LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1842          LinkBarVisibleActionExecute( nil );                  LinkBarVisibleActionExecute( nil );
1843          ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;                  ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1844          ListToolBarVisibleActionExecute( nil );                  ListToolBarVisibleActionExecute( nil );
1845          ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;                  ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1846          ListNameBarVisibleActionExecute( nil );                  ListNameBarVisibleActionExecute( nil );
1847          BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;                  BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1848          BrowserToolBarVisibleActionExecute( nil );                  BrowserToolBarVisibleActionExecute( nil );
1849          BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;                  BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1850          BrowserNameBarVisibleActionExecute( nil );                  BrowserNameBarVisibleActionExecute( nil );
1851    
1852          //ブラウザタブ                  //ブラウザタブ
1853          BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;                  BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
1854          BrowserTabVisibleActionExecute(nil);                  BrowserTabVisibleActionExecute(nil);
1855    
1856          if GikoSys.Setting.BrowserTabPosition = gtpTop then begin                  if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
1857                  BrowserTabTopAction.Checked := True;                          BrowserTabTopAction.Checked := True;
1858                  BrowserTabTopActionExecute(nil);                          BrowserTabTopActionExecute(nil);
1859          end else begin                  end else begin
1860                  BrowserTabBottomAction.Checked := True;                          BrowserTabBottomAction.Checked := True;
1861                  BrowserTabBottomActionExecute(nil);                          BrowserTabBottomActionExecute(nil);
1862          end;                  end;
1863    
1864          if GikoSys.Setting.BrowserTabStyle = gtsTab then begin                  if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
1865                  BrowserTabTabStyleAction.Checked := True;                          BrowserTabTabStyleAction.Checked := True;
1866                  BrowserTabTabStyleActionExecute(nil);                          BrowserTabTabStyleActionExecute(nil);
1867          end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin                  end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
1868                  BrowserTabButtonStyleAction.Checked := True;                          BrowserTabButtonStyleAction.Checked := True;
1869                  BrowserTabButtonStyleActionExecute(nil);                          BrowserTabButtonStyleActionExecute(nil);
1870          end else begin                  end else begin
1871                  BrowserTabFlatStyleAction.Checked := True;                          BrowserTabFlatStyleAction.Checked := True;
1872                  BrowserTabFlatStyleActionExecute(nil);                          BrowserTabFlatStyleActionExecute(nil);
1873          end;                  end;
   
         // CoolBar 復元  
         LoadCoolBarSettings;  
   
         FIsIgnoreResize := False;  
   
         //TabAutoLoad  
         //FormCreteから移動。  
         if GikoSys.Setting.TabAutoLoadSave then begin  
                 TabAutoLoadAction.Execute;  
         end;  
1874    
1875                    // ListView のヘッダドラッグ
1876    //              ListView.FullDrag := True;
1877    
1878                    // CoolBar 復元
1879                    LoadCoolBarSettings;
1880    
1881                    FIsIgnoreResize := rtNone;
1882    
1883                    //TabAutoLoad
1884                    //FormCreteから移動。
1885                    if GikoSys.Setting.TabAutoLoadSave then begin
1886                            TabAutoLoadAction.Execute;
1887                    end;
1888                    //にちゃん語案内サポート機能
1889                    if GikoSys.Setting.GengoSupport then begin
1890                    //予定地
1891                    //Test向け
1892                    end;
1893    
1894                    FStartUp := true;
1895            end;
1896  end;  end;
1897    
1898  procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);  procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
# Line 1893  begin Line 1924  begin
1924  //      Application.OnDeactivate := nil;  //      Application.OnDeactivate := nil;
1925  //      Self.OnDeactivate := nil;  //      Self.OnDeactivate := nil;
1926          try          try
1927                  //column幅                  ActiveListColumnSave;
                 if GetActiveList is TBBS then begin  
                         for i := 0 to ListView.Columns.Count - 1 do  
                                 GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;  
                 end else if GetActiveList is TCategory then begin  
                         for i := 0 to ListView.Columns.Count - 1 do  
                                 GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;  
                 end else if GetActiveList is TBoard then begin  
                         for i := 0 to ListView.Columns.Count - 1 do  
                                 GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;  
                 end;  
1928          except          except
1929          end;          end;
1930          try          try
# Line 2080  begin Line 2101  begin
2101    
2102  end;  end;
2103    
 //フォームクローズ  
 procedure TGikoForm.FormClose(Sender: TObject; var Action: TCloseAction);  
 begin  
 end;  
2104  //キャビネット×ボタンクリック  //キャビネット×ボタンクリック
2105  procedure TGikoForm.CabinetPanelHide(Sender: TObject);  procedure TGikoForm.CabinetPanelHide(Sender: TObject);
2106  begin  begin
# Line 2221  begin Line 2238  begin
2238                  Root.ImageIndex                 := ITEM_ICON_2CH1;                  Root.ImageIndex                 := ITEM_ICON_2CH1;
2239                  Root.SelectedIndex      := ITEM_ICON_2CH2;                  Root.SelectedIndex      := ITEM_ICON_2CH2;
2240                  Root.Data                                               := inBBS;                  Root.Data                                               := inBBS;
2241                  for i := 0 to inBBS.Count - 1 do begin                  for i := inBBS.Count - 1 downto 0 do begin
2242                          Category := TCategory(inBBS.Items[i]);                          Category := TCategory(inBBS.Items[i]);
2243                          CategoryNode := TreeView.Items.AddChild(Root, Category.Title);                          CategoryNode := TreeView.Items.AddChildFirst(Root, Category.Title);
2244                          CategoryNode.Data := Category;                          CategoryNode.Data := Category;
2245                          CategoryNode.ImageIndex := ITEM_ICON_CATEGORY1;                          CategoryNode.ImageIndex := ITEM_ICON_CATEGORY1;
2246                          CategoryNode.SelectedIndex := ITEM_ICON_CATEGORY2;                          CategoryNode.SelectedIndex := ITEM_ICON_CATEGORY2;
# Line 2236  begin Line 2253  begin
2253                                  Category.CustomSort(BoardSortProc);                                  Category.CustomSort(BoardSortProc);
2254                          end;                          end;
2255    
2256                          for j := 0 to Category.Count - 1 do begin                          for j := Category.Count - 1 downto 0 do begin
2257                                  Board := TBoard(Category.Items[j]);                                  Board := TBoard(Category.Items[j]);
2258                                  Board.BeginUpdate;                                  Board.BeginUpdate;
2259                                  BoardNode := TreeView.Items.AddChild(CategoryNode, Board.Title);                                  BoardNode := TreeView.Items.AddChildFirst(CategoryNode, Board.Title);
2260                                  BoardNode.Data := Board;                                  BoardNode.Data := Board;
2261                                  //if (Board.LastGetTime = 0) or (Board.LastGetTime = ZERO_DATE) then begin                                  //if (Board.LastGetTime = 0) or (Board.LastGetTime = ZERO_DATE) then begin
2262                                  if not Board.IsLogFile then begin                                  if not Board.IsLogFile then begin
# Line 2273  begin Line 2290  begin
2290  end;  end;
2291    
2292  function TGikoForm.SetCategoryListItem(ABBS2ch: TBBS): Integer;  function TGikoForm.SetCategoryListItem(ABBS2ch: TBBS): Integer;
 const  
         COLUMN: array[0..0] of string = ('カテゴリ名');  
2293  var  var
2294          ListColumn: TListColumn;          TitleColumn     : TListColumn;
2295          i: Integer;          ListColumn      : TListColumn;
2296            i, id, idx      : Integer;
2297  begin  begin
2298          ListView.Items.BeginUpdate;          ListView.Items.BeginUpdate;
2299          try          try
2300                  Screen.Cursor := crHourGlass;                  Screen.Cursor := crHourGlass;
2301    
2302                  ListView.Columns.Clear;                  ListView.Columns.Clear;
2303                  for i := 0 to Length(COLUMN) - 1 do begin                  TitleColumn := ListView.Columns.Add;
2304                          ListColumn := ListView.Columns.Add;                  TitleColumn.Caption := GikoBBSColumnCaption[ Ord( gbbscTitle ) ];
2305                          ListColumn.Caption := COLUMN[i];                  TitleColumn.Width := GikoSys.Setting.BBSColumnWidth[ Ord( gbbscTitle ) ];
2306                          ListColumn.Width := GikoSys.Setting.BBSColumnWidth[i];                  idx := 0;
2307                    for i := 0 to GikoSys.Setting.BBSColumnOrder.Count - 1 do begin
2308                            if GikoSys.Setting.BBSColumnOrder[ i ] = gbbscTitle then begin
2309                                    TitleColumn.Tag := i;
2310                                    idx := i;
2311                            end else begin
2312                                    id := Ord( GikoSys.Setting.BBSColumnOrder[ i ] );
2313                                    if (Integer( Low( TGikoBBSColumnID ) ) <= id) and
2314                                            (id <= Integer( High( TGikoBBSColumnID ) )) then begin
2315                                            ListColumn := ListView.Columns.Add;
2316            //                                      ListColumn.Tag := id;
2317                                                    ListColumn.Tag := i;
2318                                            ListColumn.Caption := GikoBBSColumnCaption[ id ];
2319                                            ListColumn.Width := GikoSys.Setting.BBSColumnWidth[ id ];
2320                                    end;
2321                            end;
2322                  end;                  end;
2323                    TitleColumn.Index := idx;
2324    
2325                  ListView.Items.Count := 0;                  ListView.Items.Count := 0;
2326                  ListView.Items.Clear;                  ListView.Items.Clear;
# Line 2309  begin Line 2341  begin
2341    
2342                  FSortIndex := GikoSys.Setting.BBSSortIndex;                  FSortIndex := GikoSys.Setting.BBSSortIndex;
2343                  FSortOrder := GikoSys.Setting.BBSSortOrder;                  FSortOrder := GikoSys.Setting.BBSSortOrder;
2344                  if (FSortIndex >= 0) and (FSortIndex < Length(COLUMN)) then                  for i := ListView.Columns.Count - 1 downto 0 do begin
2345                          ListViewSort(nil, ListView.Column[FSortIndex]);                          idx := ListView.Column[ i ].Tag;
2346                            if FSortIndex = Ord( GikoSys.Setting.BBSColumnOrder[ idx ] ) then
2347                                    ListViewSort( nil, ListView.Column[ i ] );
2348                    end;
2349    
2350                  Result := ABBS2ch.Count;                  Result := ABBS2ch.Count;
2351          finally          finally
# Line 2320  begin Line 2355  begin
2355  end;  end;
2356    
2357  function TGikoForm.SetBoardListItem(Category: TCategory): Integer;  function TGikoForm.SetBoardListItem(Category: TCategory): Integer;
 const  
         COLUMN: array[0..2] of string = ('板名', '巡回予約', '取得日時');  
2358  var  var
2359          ListColumn: TListColumn;          TitleColumn     : TListColumn;
2360          i: Integer;          ListColumn      : TListColumn;
2361            i, id, idx      : Integer;
2362  begin  begin
2363          ListView.Items.BeginUpdate;          ListView.Items.BeginUpdate;
2364          try          try
2365                  Screen.Cursor := crHourGlass;                  Screen.Cursor := crHourGlass;
2366    
2367                  ListView.Columns.Clear;                  ListView.Columns.Clear;
2368                  for i := 0 to Length(COLUMN) - 1 do begin                  TitleColumn := ListView.Columns.Add;
2369                          ListColumn := ListView.Columns.Add;                  TitleColumn.Caption := GikoCategoryColumnCaption[ Ord( gccTitle ) ];
2370                          ListColumn.Caption := COLUMN[i];                  TitleColumn.Width := GikoSys.Setting.CategoryColumnWidth[ Ord( gccTitle ) ];
2371                          ListColumn.Width := GikoSys.Setting.CategoryColumnWidth[i];                  idx := 0;
2372                    for i := 0 to GikoSys.Setting.CategoryColumnOrder.Count - 1 do begin
2373                            if GikoSys.Setting.CategoryColumnOrder[ i ] = gccTitle then begin
2374                                    TitleColumn.Tag := i;
2375                                    idx := i;
2376                            end else begin
2377                                    id := Ord( GikoSys.Setting.CategoryColumnOrder[ i ] );
2378                                    if (Integer( Low( TGikoCategoryColumnID ) ) <= id) and
2379                                            (id <= Integer( High( TGikoCategoryColumnID ) )) then begin
2380                                            ListColumn := ListView.Columns.Add;
2381    //                                              ListColumn.Tag := id;
2382                                            ListColumn.Tag := i;
2383                                            ListColumn.Caption := GikoCategoryColumnCaption[ id ];
2384                                            ListColumn.Width := GikoSys.Setting.CategoryColumnWidth[ id ];
2385                                    end;
2386                            end;
2387                  end;                  end;
2388                    TitleColumn.Index := idx;
2389    
2390                  ListView.Items.Count := 0;                  ListView.Items.Count := 0;
2391                  ListView.Items.Clear;                  ListView.Items.Clear;
# Line 2356  begin Line 2406  begin
2406    
2407                  FSortIndex := GikoSys.Setting.CategorySortIndex;                  FSortIndex := GikoSys.Setting.CategorySortIndex;
2408                  FSortOrder := GikoSys.Setting.CategorySortOrder;                  FSortOrder := GikoSys.Setting.CategorySortOrder;
2409                  if (FSortIndex >= 0) and (FSortIndex < Length(COLUMN)) then                  for i := ListView.Columns.Count - 1 downto 0 do begin
2410                          ListViewSort(nil, ListView.Column[FSortIndex]);                          idx := ListView.Column[ i ].Tag;
2411                            if FSortIndex = Ord( GikoSys.Setting.CategoryColumnOrder[ idx ] ) then
2412                                    ListViewSort( nil, ListView.Column[ i ] );
2413                    end;
2414    
2415                  Result := Category.Count;                  Result := Category.Count;
2416          finally          finally
# Line 2367  begin Line 2420  begin
2420  end;  end;
2421    
2422  function TGikoForm.SetThreadListItem(Board: TBoard): Integer;  function TGikoForm.SetThreadListItem(Board: TBoard): Integer;
 const  
         COLUMN: array[0..7] of string = ('スレッド名', 'カウント', '取得', '新着',  
                                                                                                                                          '未読', '巡回予約', '取得日時', 'スレ作成日時');  
         COLUMN_NONACQUIREDCOUNT: string = '未取得';  
         COLUMN_ALIGNMENT: array[0..7] of TAlignment = (taLeftJustify, taRightJustify,  
                                                                                                                                                                                                  taRightJustify, taRightJustify,  
                                                                                                                                                                                                  taRightJustify, taLeftJustify,  
                                                                                                                                                                                                  taLeftJustify, taLeftJustify);  
         //No, スレッド名, カウント, 巡回予約, 取得日時  
2423  var  var
2424          ListColumn: TListColumn;          TitleColumn     : TListColumn;
2425          i: Integer;          ListColumn      : TListColumn;
2426            i, id, idx      : Integer;
2427  begin  begin
2428          ListView.Items.BeginUpdate;          ListView.Items.BeginUpdate;
2429          try          try
2430                  Screen.Cursor := crHourGlass;                  Screen.Cursor := crHourGlass;
2431    
2432    {*
2433                  // チラつき防止のため、変更されている場合のみ                  // チラつき防止のため、変更されている場合のみ
2434                  // ※名称は違うがカラム数が同じ、といった場合に対処できないので注意                  // ※名称は違うがカラム数が同じ、といった場合に対処できないので注意
2435                  if ListView.Columns.Count <> (High( COLUMN ) - Low( COLUMN ) + 1) then                  if ListView.Columns.Count <> GikoSys.Setting.BoardColumnOrder.Count then
2436    *}
2437                  begin                  begin
2438                          ListView.Columns.Clear;                          ListView.Columns.Clear;
2439                          for i := 0 to Length(COLUMN) - 1 do begin                          TitleColumn := ListView.Columns.Add;
2440                                  ListColumn := ListView.Columns.Add;                          TitleColumn.Caption := GikoBoardColumnCaption[ Ord( gbcTitle ) ];
2441                                  ListColumn.Caption := COLUMN[i];                          TitleColumn.Width := GikoSys.Setting.BoardColumnWidth[ Ord( gbcTitle ) ];
2442                                  ListColumn.Width := GikoSys.Setting.BoardColumnWidth[i];                          idx := 0;
2443                                  ListColumn.Alignment := COLUMN_ALIGNMENT[i];                          for i := 0 to GikoSys.Setting.BoardColumnOrder.Count - 1 do begin
2444                                    if GikoSys.Setting.BoardColumnOrder[ i ] = gbcTitle then begin
2445                                            TitleColumn.Tag := i;
2446                                            idx := i;
2447                                    end else begin
2448                                            id := Ord( GikoSys.Setting.BoardColumnOrder[ i ] );
2449                                            if (Integer( Low( TGikoBoardColumnID ) ) <= id) and
2450                                                    (id <= Integer( High( TGikoBoardColumnID ) )) then begin
2451                                                    ListColumn := ListView.Columns.Add;
2452                                                    ListColumn.Caption := GikoBoardColumnCaption[ id ];
2453            //                                      ListColumn.Tag := id;
2454                                                    ListColumn.Tag := i;
2455                                                    ListColumn.Width := GikoSys.Setting.BoardColumnWidth[ id ];
2456                                                    ListColumn.Alignment := GikoBoardColumnAlignment[ id ];
2457                                            end;
2458                                    end;
2459                          end;                          end;
2460                            TitleColumn.Index := idx;
2461                  end;                  end;
                 if GikoSys.Setting.NonAcquiredCount then  
                         ListView.Columns[2].Caption := COLUMN_NONACQUIREDCOUNT  
                 else  
                         ListView.Columns[2].Caption := COLUMN[2];  
2462    
2463                  ListView.Items.Count := 0;                  ListView.Items.Count := 0;
2464                  ListView.Items.Clear;                  ListView.Items.Clear;
# Line 2417  begin Line 2476  begin
2476    
2477                  FSortIndex := GikoSys.Setting.BoardSortIndex;                  FSortIndex := GikoSys.Setting.BoardSortIndex;
2478                  FSortOrder := GikoSys.Setting.BoardSortOrder;                  FSortOrder := GikoSys.Setting.BoardSortOrder;
2479                  if (FSortIndex >= 0) and (FSortIndex < Length(COLUMN)) then                  for i := ListView.Columns.Count - 1 downto 0 do begin
2480                          ListViewSort(nil, ListView.Column[FSortIndex]);                          idx := ListView.Column[ i ].Tag;
2481                            if FSortIndex = Ord( GikoSys.Setting.BoardColumnOrder[ idx ] ) then
2482                                    ListViewSort( nil, ListView.Column[ i ] );
2483                    end;
2484    
2485                  Result := Board.Count;                  Result := Board.Count;
2486          finally          finally
# Line 2438  var Line 2500  var
2500          ThreadItem: TThreadItem;          ThreadItem: TThreadItem;
2501          RepStr: string;          RepStr: string;
2502                  ActivListObj : TObject;                  ActivListObj : TObject;
2503            i, idx : Integer;
2504  begin  begin
2505          ActivListObj := ActiveList;          ActivListObj := ActiveList;
2506          if ActivListObj is TBBS then begin          if ActivListObj is TBBS then begin
2507                    //===== カテゴリリスト =====
2508                  BBS := TBBS(ActivListObj);                  BBS := TBBS(ActivListObj);
2509    
2510                  ListView.StateImages := nil;                  ListView.StateImages := nil;
# Line 2463  begin Line 2527  begin
2527    
2528                  Item.ImageIndex := ITEM_ICON_CATEGORY1;                  Item.ImageIndex := ITEM_ICON_CATEGORY1;
2529                  Item.Data := Category;                  Item.Data := Category;
2530    
2531          end else if ActivListObj is TCategory then begin          end else if ActivListObj is TCategory then begin
2532    
2533                    //===== 板リスト =====
2534                  Category := TCategory(ActivListObj);                  Category := TCategory(ActivListObj);
2535    
2536                  ListView.StateImages := nil;                  ListView.StateImages := nil;
# Line 2484  begin Line 2551  begin
2551                  else                  else
2552                          Item.Caption := Board.Title;                          Item.Caption := Board.Title;
2553    
2554                  if Item.SubItems.Count <> 2 then begin                  if Item.SubItems.Count <> ListView.Columns.Count then begin
2555                          Item.SubItems.Clear;                          Item.SubItems.Clear;
2556                          Item.SubItems.Add('');                          for i := GikoSys.Setting.CategoryColumnOrder.Count - 1 downto 1 do
2557                          Item.SubItems.Add('');                                  Item.SubItems.Add('');
2558                  end;                  end;
2559    
2560                  Item.ImageIndex := ITEM_ICON_BOARD1;                  Item.ImageIndex := ITEM_ICON_BOARD1;
2561    
2562                  if Board.Round then                  idx := 0;
2563                          Item.SubItems[0] := Board.RoundName     // '予約'                  for i := 0 to ListView.Columns.Count - 1 do begin
2564                  else                          if GikoSys.Setting.CategoryColumnOrder.Count <= i then
2565                          Item.SubItems[0] := '';                                  Break;
2566    //                              case TGikoCategoryColumnID( ListView.Column[ i ].Tag ) of
2567                            case GikoSys.Setting.CategoryColumnOrder[ i ] of
2568                            gccTitle:
2569                                    // Item.Caption は SubItems に含まれ無いので
2570                                    Dec( idx );
2571    
2572                            gccRoundName:
2573                                    if Board.Round then
2574                                            Item.SubItems[ idx ] := Board.RoundName // '予約'
2575                                    else
2576                                            Item.SubItems[ idx ] := '';
2577    
2578                            gccLastModified:
2579                                    if Board.RoundDate = ZERO_DATE then begin
2580                                            Item.SubItems[ idx ] := '';
2581                                    end else
2582                                            Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);
2583                            end;
2584                            Inc( idx );
2585                    end;
2586    
                 if Board.RoundDate = ZERO_DATE then begin  
                         Item.SubItems[1] := '';  
                 end else  
                         Item.SubItems[1] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);  
2587                  Item.Data := Board;                  Item.Data := Board;
2588    
2589          end else if ActivListObj is TBoard then begin          end else if ActivListObj is TBoard then begin
2590    
2591                    //===== スレリスト =====
2592                  Board := TBoard(ActivListObj);                  Board := TBoard(ActivListObj);
2593    
2594                  if GikoSys.Setting.ListIconVisible then                  if GikoSys.Setting.ListIconVisible then
# Line 2548  begin Line 2634  begin
2634                  RepStr := CustomStringReplace(RepStr, '&amp;', '&' );                  RepStr := CustomStringReplace(RepStr, '&amp;', '&' );
2635                  //RepStr := StringReplace(RepStr, '@`', ',', [rfReplaceAll]);                  //RepStr := StringReplace(RepStr, '@`', ',', [rfReplaceAll]);
2636    
2637                  if Item.SubItems.Count <> 7 then begin                  if Item.SubItems.Count <> ListView.Columns.Count then begin
2638                          Item.SubItems.Clear;                          Item.SubItems.Clear;
2639                          Item.SubItems.Add('');                          for i := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 1 do
2640                          Item.SubItems.Add('');                                  Item.SubItems.Add('');
                         Item.SubItems.Add('');  
                         Item.SubItems.Add('');  
                         Item.SubItems.Add('');  
                         Item.SubItems.Add('');  
             Item.SubItems.Add('');  
2641                  end;                  end;
2642    
2643                  if ListNumberVisibleAction.Checked then                  if ListNumberVisibleAction.Checked then
# Line 2572  begin Line 2653  begin
2653                  end;                  end;
2654    
2655                  if ThreadItem.IsLogFile then begin                  if ThreadItem.IsLogFile then begin
2656                          Item.ImageIndex := ITEM_ICON_THREADLOG1;                          idx := 0;
2657                          Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);                          for i := 0 to ListView.Columns.Count - 1 do begin
2658                          if GikoSys.Setting.NonAcquiredCount then                          if GikoSys.Setting.BoardColumnOrder.Count <= i then
2659                                  Item.SubItems[1] := IntToStr(ThreadItem.AllResCount - ThreadItem.Count)                                  Break;
2660                          else  //                              case TGikoBoardColumnID( ListView.Column[ i ].Tag ) of
2661                                  Item.SubItems[1] := IntToStr(ThreadItem.Count);                                  case GikoSys.Setting.BoardColumnOrder[ i ] of
2662                          if ThreadItem.NewResCount = 0 then                                  gbcTitle:
2663                                  Item.SubItems[2] := ''                                          // Item.Caption は SubItems に含まれ無いので
2664                          else                                          Dec( idx );
2665                                  Item.SubItems[2] := IntToStr(ThreadItem.NewResCount);  
2666                          Item.SubItems[3] := '';                                  gbcAllCount:
2667                          if ThreadItem.Round then                                          Item.SubItems[ idx ] := IntToStr(ThreadItem.AllResCount);
2668                                  Item.SubItems[4] := ThreadItem.RoundName  
2669                          else                                  gbcLocalCount:
2670                                  Item.SubItems[4] := '';                                          Item.SubItems[ idx ] := IntToStr(ThreadItem.Count);
2671                          if ThreadItem.RoundDate = ZERO_DATE then begin  
2672                                  Item.SubItems[5] := '';                                  gbcNonAcqCount:
2673                          end else                                          Item.SubItems[ idx ] := IntToStr(ThreadItem.AllResCount - ThreadItem.Count);
2674                                  Item.SubItems[5] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.RoundDate);  
2675                          if ThreadItem.NewArrival then                                  gbcNewCount:
2676                                  Item.ImageIndex := ITEM_ICON_THREADNEW1;                                          if ThreadItem.NewResCount = 0 then
2677              if ThreadItem.CreateDate = ZERO_DATE then begin                                                  Item.SubItems[ idx ] := ''
2678                                  Item.SubItems[6] := '';                                          else
2679                          end else                                                  Item.SubItems[ idx ] := IntToStr(ThreadItem.NewResCount);
2680                                  Item.SubItems[6] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.CreateDate);  
2681                                    gbcUnReadCount:
2682                                            Item.SubItems[ idx ] := '';
2683    
2684                                    gbcRoundName:
2685                                            if ThreadItem.Round then
2686                                                    Item.SubItems[ idx ] := ThreadItem.RoundName
2687                                            else
2688                                                    Item.SubItems[ idx ] := '';
2689    
2690                                    gbcRoundDate://gbcLastModified:
2691                                            if (ThreadItem.RoundDate = ZERO_DATE)  then begin
2692                                                    Item.SubItems[ idx ] := '';
2693                                            end else
2694                                                    Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.RoundDate);
2695    
2696                                    gbcCreated:
2697                                            if ThreadItem.CreateDate = ZERO_DATE then begin
2698                                                    Item.SubItems[ idx ] := '';
2699                                            end else
2700                                                    Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.CreateDate);
2701    
2702                                    gbcLastModified:
2703                                            if (ThreadItem.LastModified = ZERO_DATE)  then begin
2704                                                    Item.SubItems[ idx ] := '';
2705                                            end else
2706                                                    Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.LastModified);
2707    
2708    
2709                                    end;
2710                                    Inc( idx );
2711                            end;
2712    
2713                            if ThreadItem.NewArrival then
2714                                    Item.ImageIndex := ITEM_ICON_THREADNEW1
2715                            else
2716                                    Item.ImageIndex := ITEM_ICON_THREADLOG1;
2717                  end else begin                  end else begin
2718                          Item.ImageIndex := ITEM_ICON_THREAD1;                          idx := 0;
2719                          Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);                          for i := 0 to GikoSys.Setting.BoardColumnOrder.Count - 1 do begin
2720                          Item.SubItems[1] := '';  //                              case TGikoBoardColumnID( ListView.Column[ i ].Tag ) of
2721                          Item.SubItems[2] := '';                                  case GikoSys.Setting.BoardColumnOrder[ i ] of
2722                          Item.SubItems[3] := '';                                  gbcTitle:
2723                          Item.SubItems[4] := '';                                          // Item.Caption は SubItems に含まれ無いので
2724                          Item.SubItems[5] := '';                                          Dec( idx );
2725              if not GikoSys.Setting.CreationTimeLogs then  
2726                                  if ThreadItem.CreateDate = ZERO_DATE then                                  gbcAllCount:
2727                                          Item.SubItems[6] := ''                                          Item.SubItems[ idx ] := IntToStr(ThreadItem.AllResCount);
2728                                  else  
2729                                          Item.SubItems[6] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.CreateDate);                                  gbcRoundDate://gbcLastModified:
2730                                            Item.SubItems[ idx ] := '';
2731    
2732                                    gbcCreated:
2733                                            if ThreadItem.CreateDate = ZERO_DATE then begin
2734                                                    Item.SubItems[ idx ] := '';
2735                                            end else
2736                                                    Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.CreateDate);
2737    
2738                                    gbcLastModified:
2739                                            Item.SubItems[ idx ] := '';
2740    
2741                                    else
2742                                            Item.SubItems[ idx ] := '';
2743                                    end;
2744                                    Inc( idx );
2745                            end;
2746    
2747                            if ThreadItem.NewArrival then
2748                                    Item.ImageIndex := ITEM_ICON_THREADNEW1
2749                            else
2750                                    Item.ImageIndex := ITEM_ICON_THREAD1;
2751                  end;                  end;
2752    
2753                  Item.Data := ThreadItem;                  Item.Data := ThreadItem;
2754    
2755          end;          end;
2756  end;  end;
2757    
# Line 2657  var Line 2794  var
2794          ActiveFileName: string;          ActiveFileName: string;
2795          e: IHTMLElement;          e: IHTMLElement;
2796          Ext: string;          Ext: string;
2797          buf: string;  //      buf, buf2: string;
2798          PathRec: TPathRec;          PathRec: TPathRec;
2799  begin  begin
2800          if not( TObject(Sender) is TWebBrowser )then          if not( TObject(Sender) is TWebBrowser )then
# Line 2740  begin Line 2877  begin
2877                  end else begin                  end else begin
2878                          threadItem := GetActiveContent;                          threadItem := GetActiveContent;
2879                          if Pos('about:blank..', Text) = 1 then begin                          if Pos('about:blank..', Text) = 1 then begin
2880                                    if (AnsiPos('http://jbbs.livedoor.com/', threadItem.URL) <> 0) then begin                                  wkInt := LastDelimiter( '/', threadItem.URL );
2881                                          URL := Copy(threadItem.URL, 1,  LastDelimiter('/',threadItem.URL));                                  if Pos( '?', Copy( threadItem.URL, wkInt, MaxInt ) ) = 0 then begin
2882                                          Gikosys.GetPopupResNumber(Text,PathRec.FSt,PathRec.FTo);                                          // Thread.URL は PATH_INFO 渡し
2883                                          if ( PathRec.FSt <> 0 ) and ( PathRec.FTo <> 0 ) then                                          URL := Copy( threadItem.URL, 1,  LastDelimiter( '/', threadItem.URL ) );
2884                                                  buf := IntToStr(PathRec.FSt) + '-' + IntToStr(PathRec.FTo)                                          wkInt := LastDelimiter( '/', Text );
2885                                          else if( PathRec.FSt <> 0 ) then                                          if Pos( '?', Copy( Text, wkInt, MaxInt ) ) = 0 then
2886                                                  buf := IntToStr(PathRec.FSt);                                                  // Text も PATH_INFO 渡し
2887                                  end else if AnsiPos('machi.to/bbs/', threadItem.URL) <> 0 then begin                                                  URL := URL + Copy( Text, LastDelimiter( '/', Text ) + 1, MaxInt )
2888                                          URL := threaditem.URL;                                          else
2889                                          buf := Copy(Text,AnsiPos('&st=',Text),Length(Text)-AnsiPos('&st=',Text) + 1);                                                  // Text は QUERY_STRING 渡し
2890                                                    URL := URL + Copy( Text, LastDelimiter( '?', Text ) + 1, MaxInt );
2891                                  end else begin                                  end else begin
2892                                          URL := Copy(threadItem.URL, 1,  LastDelimiter('/',threadItem.URL));                                          // Thread.URL は QUERY_STRING 渡し
2893                                          buf := Copy(Text,LastDelimiter('/',Text)+1,Length(Text)-LastDelimiter('/',Text));                                          URL := Copy( threadItem.URL, 1,  LastDelimiter( '?', threadItem.URL ) );
2894                                            wkInt := LastDelimiter( '/', Text );
2895                                            if Pos( '?', Copy( Text, wkInt, MaxInt ) ) = 0 then begin
2896                                                    // Text は PATH_INFO 渡し
2897                                                    // URL に板とキーが足らないので Text から頂戴する
2898                                                    wkInt := LastDelimiter( '/', Copy( Text, 1, wkInt - 1 ) );
2899                                                    wkInt := LastDelimiter( '/', Copy( Text, 1, wkInt - 1 ) );
2900                                                    URL := Copy( URL, 1, Length( URL ) - 1 ) + Copy( Text, wkInt, MaxInt );
2901                                            end else begin
2902                                                    // Text も QUERY_STRING 渡し
2903                                                    URL := URL + Copy( Text, LastDelimiter( '?', Text ) + 1, MaxInt )
2904                                            end;
2905                                  end;                                  end;
                                 URL := URL + buf;  
2906                          end else begin                          end else begin
2907                                  URL := Text;                                  URL := Text;
2908                          end;                          end;
2909    
2910                          PathRec := Gikosys.Parse2chURL2(URL);                          PathRec := Gikosys.Parse2chURL2(URL);
2911                          if (PathRec.FNoParam) then begin                          if (PathRec.FNoParam) then begin
2912                                  PathRec.FSt := 1;                                  PathRec.FSt := 1;
2913                                  PathRec.FTo := 1;                                  PathRec.FTo := 1;
2914                          end else                          end else begin
2915                                  Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);                                  Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);
2916                            end;
2917                          GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );                          GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );
2918    
2919                          if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin                          if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin
# Line 2790  begin Line 2940  begin
2940                                  //      wkIntTo := 1;                                  //      wkIntTo := 1;
2941                                  //if PathRec.FFirst then                                  //if PathRec.FFirst then
2942                                  //      wkIntSt := 1;                                  //      wkIntSt := 1;
2943                                  if PathRec.FStBegin then                                  //if PathRec.FStBegin then //http://〜〜〜〜/-50というとき
2944                                          wkIntSt := 1;                                  //      wkIntSt := 1;          //
2945                                  if PathRec.FToEnd then                                  //if PathRec.FToEnd then   //http://〜〜〜〜/50-というとき
2946                                          wkIntTo := 9999;                                  //      wkIntTo := 9999;       // どちらの場合も、GetPopupResNumberでうまく番号を調整するのでふよう。
2947    
2948                                  //ATitle := ActiveFileName <> PathRec.FKey;                                  //ATitle := ActiveFileName <> PathRec.FKey;
2949                                  if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then                                  if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then
# Line 2863  end; Line 3013  end;
3013    
3014  procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;  procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
3015          Shift: TShiftState);          Shift: TShiftState);
3016    var
3017            pos     : TPoint;
3018  begin  begin
3019          if GetActiveList is TBoard then begin          if GetActiveList is TBoard then begin
3020                  if Key = VK_BACK then begin                  case Key of
3021  //              UpFolderButtonClick(Sender);                  VK_BACK:;       //      UpFolderButtonClick(Sender);
3022                  end else if Key = VK_SPACE then begin                  VK_SPACE:                       ListDoubleClick(Shift);
3023                          ListDoubleClick(Shift);                  VK_RETURN:              ListClick;
3024                  end else if Key = VK_RETURN then begin                  VK_APPS:
3025                          ListClick;                          begin
3026                                    if ListView.Selected <> nil then begin
3027                                            pos.X := ListView.Column[ 0 ].Width;
3028                                            pos.Y := ListView.Selected.Top;
3029                                    end else begin
3030                                            pos.X := ListView.Left;
3031                                            pos.Y := ListView.Top;
3032                                    end;
3033                                    Windows.ClientToScreen( ListView.Handle, pos );
3034                                    ListPopupMenu.Popup( pos.X, pos.Y );
3035                            end;
3036                  end;                  end;
3037          end else begin // TBBS, TCategory          end else begin // TBBS, TCategory
3038                  if Key = VK_BACK then begin                  case Key of
3039  //              UpFolderButtonClick(Sender);                  VK_BACK:;       //      UpFolderButtonClick(Sender);
3040                  end else if Key = VK_SPACE then begin                  VK_SPACE:                       ListClick;
3041                          ListClick;                  VK_RETURN:              ListDoubleClick(Shift);
3042                  end else if Key = VK_RETURN then begin                  VK_APPS:
3043                          ListDoubleClick(Shift);                          begin
3044                                    if ListView.Selected <> nil then begin
3045                                            pos.X := ListView.Column[ 0 ].Width;
3046                                            pos.Y := ListView.Selected.Top;
3047                                    end else begin
3048                                            pos.X := ListView.Left;
3049                                            pos.Y := ListView.Top;
3050                                    end;
3051                                    Windows.ClientToScreen( ListView.Handle, pos );
3052                                    ListPopupMenu.Popup( pos.X, pos.Y );
3053                            end;
3054                  end;                  end;
3055          end;          end;
3056  end;  end;
# Line 2888  begin Line 3060  begin
3060          Result := FHttpState;          Result := FHttpState;
3061  end;  end;
3062    
3063    {*!
3064    \brief          ListView の Column を真のカラムに変換
3065    
3066    Delphi 6 Personal での ListView では ListViewColumnClick イベントで
3067    正しいカラムが渡されないため、正しいカラムに変換します。
3068    *}
3069    function        TGikoForm.ActiveListTrueColumn( column : TListColumn ) : TListColumn;
3070    {*
3071    var
3072            i, idx          : Integer;
3073            orderList       : TList;
3074    *}
3075    begin
3076    
3077            // 正しく変換する方法が分からないので保留
3078            Result := column;
3079            Exit;
3080    {*
3081            Result := column;
3082    
3083            if TObject( FActiveList ) is TBBS then
3084                    orderList := GikoSys.Setting.BBSColumnOrder
3085            else if TObject( FActiveList ) is TCategory then
3086                    orderList := GikoSys.Setting.CategoryColumnOrder
3087            else if TObject( FActiveList ) is TBoard then
3088                    orderList := GikoSys.Setting.BoardColumnOrder
3089            else
3090                    Exit;
3091    
3092            idx := column.Tag;
3093    
3094            for i := 0 to ListView.Columns.Count - 1 do begin
3095                    if Integer( orderList[ ListView.Column[ i ].Tag ] ) = 0 then begin
3096                            if idx = 0 then
3097                                    Result := ListView.Column[ i ]
3098                            else if idx <= i then
3099                                    Result := ListView.Column[ idx - 1 ];
3100                            Exit;
3101                    end;
3102            end;
3103    *}
3104    
3105    end;
3106    
3107  procedure TGikoForm.ListViewColumnClick(Sender: TObject;  procedure TGikoForm.ListViewColumnClick(Sender: TObject;
3108          Column: TListColumn);          Column: TListColumn);
3109    var
3110            id, idx                 : Integer;
3111            orderList               : TList;
3112  begin  begin
3113          if FSortIndex = Column.Index then          idx := ActiveListTrueColumn( Column ).Tag;
3114    
3115            if TObject( FActiveList ) is TBBS then
3116                    orderList := GikoSys.Setting.BBSColumnOrder
3117            else if TObject( FActiveList ) is TCategory then
3118                    orderList := GikoSys.Setting.CategoryColumnOrder
3119            else if TObject( FActiveList ) is TBoard then
3120                    orderList := GikoSys.Setting.BoardColumnOrder
3121            else
3122                    Exit;
3123    
3124            id := Integer( orderList[ idx ] );
3125    
3126            if FSortIndex = id then
3127                  FSortOrder := not FSortOrder                  FSortOrder := not FSortOrder
3128          else          else
3129                  FSortOrder := False;                  FSortOrder := False;
3130    
3131          ListViewSort(Sender, Column);          ListViewSort(Sender, Column);
3132  end;  end;
3133    
3134  procedure TGikoForm.ListViewSort(Sender: TObject; Column: TListColumn);  procedure TGikoForm.ListViewSort(Sender: TObject; Column: TListColumn);
3135  var  var
3136          i: Integer;          i, id, idx      : Integer;
3137            orderList               : TList;
3138          wkBBS: TBBS;          wkBBS: TBBS;
3139          wkCategory: TCategory;          wkCategory: TCategory;
3140          wkBoard: TBoard;          wkBoard: TBoard;
3141  begin  begin
3142          for i := 0 to ListView.Columns.Count - 1 do          idx := ActiveListTrueColumn( Column ).Tag;
3143    
3144            for i := 0 to ListView.Columns.Count - 1 do begin
3145                  ListView.Column[i].ImageIndex := -1;                  ListView.Column[i].ImageIndex := -1;
3146            end;
3147    
3148          if FSortOrder then          if FSortOrder then
3149                  ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT1                  ListView.Column[ idx ].ImageIndex := ITEM_ICON_SORT1
3150          else          else
3151                  ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT2;                  ListView.Column[ idx ].ImageIndex := ITEM_ICON_SORT2;
3152    
3153          Sort.SortNoFlag := ListNumberVisibleAction.Checked;          Sort.SortNoFlag := ListNumberVisibleAction.Checked;
3154    
# Line 2918  begin Line 3156  begin
3156          if TObject( FActiveList ) is TBBS then begin          if TObject( FActiveList ) is TBBS then begin
3157                  //wkBBS := TBBS(TreeView.Selected.Data);                  //wkBBS := TBBS(TreeView.Selected.Data);
3158                  wkBBS := TBBS( FActiveList );                  wkBBS := TBBS( FActiveList );
3159                    orderList := GikoSys.Setting.BBSColumnOrder;
3160                    id := Integer( orderList[ idx ] );
3161                  Sort.SortOrder := FSortOrder;                  Sort.SortOrder := FSortOrder;
3162                  Sort.SortIndex := Column.Index;                  Sort.SortIndex := id;
3163                  GikoSys.Setting.BBSSortIndex := Column.Index;                  GikoSys.Setting.BBSSortIndex := id;
3164                  GikoSys.Setting.BBSSortOrder := FSortOrder;                  GikoSys.Setting.BBSSortOrder := FSortOrder;
3165                  wkBBS.Sort(CategorySortProc);                  wkBBS.Sort(CategorySortProc);
                 ListView.Refresh;  
3166          //end else if TObject(TreeView.Selected.Data) is TCategory then begin          //end else if TObject(TreeView.Selected.Data) is TCategory then begin
3167          end else if TObject( FActiveList ) is TCategory then begin          end else if TObject( FActiveList ) is TCategory then begin
3168                  //wkCategory := TCategory(TreeView.Selected.Data);                  //wkCategory := TCategory(TreeView.Selected.Data);
3169                  wkCategory := TCategory( FActiveList );                  wkCategory := TCategory( FActiveList );
3170                    orderList := GikoSys.Setting.CategoryColumnOrder;
3171                    id := Integer( orderList[ idx ] );
3172                  Sort.SortOrder := FSortOrder;                  Sort.SortOrder := FSortOrder;
3173                  Sort.SortIndex := Column.Index;                  Sort.SortIndex := id;
3174                  GikoSys.Setting.CategorySortIndex := Column.Index;                  GikoSys.Setting.CategorySortIndex := id;
3175                  GikoSys.Setting.CategorySortOrder := FSortOrder;                  GikoSys.Setting.CategorySortOrder := FSortOrder;
3176                  wkCategory.CustomSort(BoardSortProc);                  wkCategory.CustomSort(BoardSortProc);
                 ListView.Refresh;  
3177          //end else if TObject(TreeView.Selected.Data) is TBoard then begin          //end else if TObject(TreeView.Selected.Data) is TBoard then begin
3178          end else if TObject( FActiveList ) is TBoard then begin          end else if TObject( FActiveList ) is TBoard then begin
3179                  //wkBoard := TBoard(TreeView.Selected.Data);                  //wkBoard := TBoard(TreeView.Selected.Data);
3180                  wkBoard := TBoard( FActiveList );                  wkBoard := TBoard( FActiveList );
3181                    orderList := GikoSys.Setting.BoardColumnOrder;
3182                    id := Integer( orderList[ idx ] );
3183                  Sort.SortOrder := FSortOrder;                  Sort.SortOrder := FSortOrder;
3184                  Sort.SortIndex := Column.Index;                  Sort.SortIndex := id;
3185                  Sort.SortNonAcquiredCountFlag := GikoSys.Setting.NonAcquiredCount;                  GikoSys.Setting.BoardSortIndex := id;
                 GikoSys.Setting.BoardSortIndex := Column.Index;  
3186                  GikoSys.Setting.BoardSortOrder := FSortOrder;                  GikoSys.Setting.BoardSortOrder := FSortOrder;
3187                  wkBoard.CustomSort(ThreadItemSortProc);                  wkBoard.CustomSort(ThreadItemSortProc);
3188                  ListView.Refresh;          end else begin
3189                    id := 0;
3190          end;          end;
3191          FSortIndex := Column.Index;  
3192            ListView.Refresh;
3193            FSortIndex := id;
3194  end;  end;
3195    
3196  procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;  procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
# Line 3020  begin Line 3264  begin
3264          if TObject(Item.Data) is TThreadItem then begin          if TObject(Item.Data) is TThreadItem then begin
3265                  ThreadItem := TThreadItem(Item.Data);                  ThreadItem := TThreadItem(Item.Data);
3266                  if ( FUseOddResOddColor ) and ( ThreadItem.Count <> 0 ) and ( ThreadItem.AllResCount <> ThreadItem.Count) then begin                  if ( FUseOddResOddColor ) and ( ThreadItem.Count <> 0 ) and ( ThreadItem.AllResCount <> ThreadItem.Count) then begin
3267                                                  ListView.Canvas.Brush.Color := FOddColor;                          ListView.Canvas.Brush.Color := FOddColor;
3268                                  end else begin                  end else begin
3269                                          ListView.Canvas.Brush.Color := FListViewBackGroundColor;                          ListView.Canvas.Brush.Color := FListViewBackGroundColor;
3270                                  end;                  end;
3271  //              if (ThreadItem.Kokomade <> ThreadItem.Count) and (ThreadItem.IsLogFile) then  //              if (ThreadItem.Kokomade <> ThreadItem.Count) and (ThreadItem.IsLogFile) then
3272                  if ThreadItem.UnRead then                  if ThreadItem.UnRead then
3273                          TListView(Sender).Canvas.Font.Style := [fsBold];                          TListView(Sender).Canvas.Font.Style := [fsBold];
# Line 3215  var Line 3459  var
3459          s: string;          s: string;
3460          boardPlugIn : TBoardPlugIn;          boardPlugIn : TBoardPlugIn;
3461          i: Integer;          i: Integer;
3462            browserRec      : TBrowserRecord;
3463  begin  begin
3464          try          try
3465                  if Item.DownType = gdtBoard then                  if Item.DownType = gdtBoard then
# Line 3249  begin Line 3494  begin
3494                                          ATitle := GikoSys.DivideStrLine(GikoSys.ReadThreadFile(Item.ThreadItem.GetThreadFileName, 1)).FTitle;                                          ATitle := GikoSys.DivideStrLine(GikoSys.ReadThreadFile(Item.ThreadItem.GetThreadFileName, 1)).FTitle;
3495                                  end;                                  end;
3496                                  for i := BrowserTab.Tabs.Count - 1 downto 0 do begin                                  for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
3497                                          if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = Item.ThreadItem then                                          if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = Item.ThreadItem then begin
3498                                                  TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;                                                  TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
3499                                                    break;
3500                                            end;
3501                                  end;                                  end;
3502                                  if GikoSys.Setting.BrowserTabVisible then begin                                  if GikoSys.Setting.BrowserTabVisible then begin
3503                                          if GetActiveContent = Item.ThreadItem then                                          if GetActiveContent = Item.ThreadItem then
3504                                                  InsertBrowserTab(Item.ThreadItem)                                                  browserRec := InsertBrowserTab(Item.ThreadItem)
3505                                          else if (ListView.Selected <> nil ) and ( TObject(ListView.Selected.Data) is TThreadItem ) and ( Item.ThreadItem = TThreadItem(ListView.Selected.Data)) then                                          else if (ListView.Selected <> nil ) and ( TObject(ListView.Selected.Data) is TThreadItem ) and ( Item.ThreadItem = TThreadItem(ListView.Selected.Data)) then
3506                                                  InsertBrowserTab(Item.ThreadItem, True)                                                  browserRec := InsertBrowserTab(Item.ThreadItem, True)
3507                                          else                                          else
3508                                                  InsertBrowserTab(Item.ThreadItem, False);                                                  browserRec := InsertBrowserTab(Item.ThreadItem, False);
3509                                            if browserRec.Thread = BrowserNullTab.Thread then begin
3510                                                    browserRec.Movement := BrowserNullTab.Movement;
3511                                                    BrowserNullTab.Movement := '';
3512                                            end;
3513                                  end else begin                                  end else begin
3514                                          if (GetActiveContent = Item.ThreadItem) or (FActiveContent = nil) or(FActiveContent.Browser = BrowserNullTab.Browser) then                                          if (GetActiveContent = Item.ThreadItem) or (FActiveContent = nil) or(FActiveContent.Browser = BrowserNullTab.Browser) then
3515                          InsertBrowserTab(Item.ThreadItem);                          InsertBrowserTab(Item.ThreadItem);
3516                                  end;                                  end;
3517                    Application.ProcessMessages;
3518                                  if Item.State = gdsComplete then begin                                  if Item.State = gdsComplete then begin
3519                                          PlaySound('New');                                          PlaySound('New');
3520                                          AddMessageList(ATitle + ' [スレ取得完了]', nil, gmiOK);                                          AddMessageList(ATitle + ' [スレ取得完了]', nil, gmiOK);
# Line 3391  begin Line 3642  begin
3642          end;          end;
3643  end;}  end;}
3644    
3645  procedure TGikoForm.InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True);  function TGikoForm.InsertBrowserTab(
3646            ThreadItem      : TThreadItem;
3647            ActiveTab               : Boolean = True
3648    ) : TBrowserRecord;
3649  var  var
3650          i, j, idx: Integer;          i, j, idx               : Integer;
3651          favItem : TFavoriteThreadItem;          favItem                 : TFavoriteThreadItem;
3652          newBrowser      : TBrowserRecord;          newBrowser      : TBrowserRecord;
3653  begin  begin
3654    
3655            Result := nil;
3656          if Threaditem = nil then Exit;          if Threaditem = nil then Exit;
3657    
3658          if ThreadItem.IsLogFile then begin          if ThreadItem.IsLogFile then begin
# Line 3417  begin Line 3671  begin
3671                  for i := 0 to BrowserTab.Tabs.Count - 1 do begin                  for i := 0 to BrowserTab.Tabs.Count - 1 do begin
3672                          if TObject(BrowserTab.Tabs.Objects[i]) is TBrowserRecord then begin                          if TObject(BrowserTab.Tabs.Objects[i]) is TBrowserRecord then begin
3673                                  if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin                                  if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin
3674                                            Result := TBrowserRecord( BrowserTab.Tabs.Objects[i] );
3675                                          if TBrowserRecord(BrowserTab.Tabs.Objects[i]).FBrowser = nil then begin                                          if TBrowserRecord(BrowserTab.Tabs.Objects[i]).FBrowser = nil then begin
3676                                                  for j := BrowserTab.Tabs.Count - 1 downto 0 do begin                                                  for j := BrowserTab.Tabs.Count - 1 downto 0 do begin
3677                                                          if TBrowserRecord(BrowserTab.Tabs.Objects[j]).FBrowser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin                                                          if TBrowserRecord(BrowserTab.Tabs.Objects[j]).FBrowser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
# Line 3503  begin Line 3758  begin
3758                                          BrowserTab.TabIndex := i;                                          BrowserTab.TabIndex := i;
3759                          end;                          end;
3760                  end;                  end;
3761                    Result := newBrowser;
3762                  if(ActiveTab) or (idx = -1) then begin                  if(ActiveTab) or (idx = -1) then begin
3763                          BrowserTab.OnChange(nil);                          BrowserTab.OnChange(nil);
3764                  end;                  end;
# Line 3512  begin Line 3768  begin
3768                          BrowserNullTab.Browser := Browser;                          BrowserNullTab.Browser := Browser;
3769                  end;                  end;
3770                  BrowserNullTab.thread := ThreadItem;                  BrowserNullTab.thread := ThreadItem;
3771                    Result := BrowserNullTab;
3772                  BrowserTab.TabIndex := -1;                  BrowserTab.TabIndex := -1;
3773                  SetContent(BrowserNullTab);                  SetContent(BrowserNullTab);
3774          end;          end;
# Line 3531  var Line 3788  var
3788          s: string;          s: string;
3789  //      OldCursor: TCursor;  //      OldCursor: TCursor;
3790          i: Integer;          i: Integer;
         url: OleVariant;  
3791          idx: Integer;          idx: Integer;
3792          ThreadItem: TThreadItem;          ThreadItem: TThreadItem;
3793          Thread: TBrowserRecord;          Thread: TBrowserRecord;
# Line 3539  var Line 3795  var
3795          ThreadScrollTop: Integer;          ThreadScrollTop: Integer;
3796          ThreadIsLog, ThreadUnRead, ThreadNewArraical: boolean;          ThreadIsLog, ThreadUnRead, ThreadNewArraical: boolean;
3797  begin  begin
3798    //      AddMessageList('SetContent', nil, gmiWhat);
3799          Thread := inThread;          Thread := inThread;
3800          idx := BrowserTab.TabIndex;          idx := BrowserTab.TabIndex;
3801          if (FActiveContent <> nil) and          if (FActiveContent <> nil) and
# Line 3602  begin Line 3859  begin
3859    
3860    
3861          try          try
3862                    {
3863                  if ThreadItem.UnRead then begin                  if ThreadItem.UnRead then begin
3864                          ThreadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1;                          ThreadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1;
3865                          if ThreadItem.ParentBoard.UnRead < 0 then ThreadItem.ParentBoard.UnRead := 0;                          if ThreadItem.ParentBoard.UnRead < 0 then ThreadItem.ParentBoard.UnRead := 0;
3866                          TreeView.Refresh;                          TreeView.Refresh;
3867                  end;                  end;
3868             //   LockWindowUpdate(Self.Handle);          }
3869                  if(FActiveContent <> nil) and (FActiveContent <> Thread) then begin                  if(FActiveContent <> nil) and (FActiveContent <> Thread) then begin
3870                          if (FActiveContent.Browser <> BrowserNullTab.Browser) then                          if (FActiveContent.Browser <> BrowserNullTab.Browser) then
3871                                  ShowWindow(FActiveContent.Browser.Handle, SW_HIDE);                                  ShowWindow(FActiveContent.Browser.Handle, SW_HIDE);
3872                  end;                  end;
3873    
3874                  ShowWindow(Thread.FBrowser.Handle, SW_SHOW);                  ShowWindow(Thread.FBrowser.Handle, SW_SHOW);
                 //LockWindowUpdate(0);  
3875                  if (not Assigned(Thread.Browser.Document)) then begin                  if (not Assigned(Thread.Browser.Document)) then begin
3876                          Thread.Browser.Navigate('about:blank');                          Thread.Browser.Navigate('about:blank');
3877                  end;                  end;
# Line 3640  begin Line 3898  begin
3898                          Self.Caption := CAPTION_NAME + ' - [' + ThreadTitle + ']';                          Self.Caption := CAPTION_NAME + ' - [' + ThreadTitle + ']';
3899                          //Thread.Repaintは、スキン等の設定を変更したとき、Threadをダウンロードしたとき                          //Thread.Repaintは、スキン等の設定を変更したとき、Threadをダウンロードしたとき
3900                          //新規にThreadを開いたときに真になっている。                          //新規にThreadを開いたときに真になっている。
 //                      if(Thread.Repaint) or (Thread.OnlyHundred <> GikoSys.OnlyAHundredRes)then begin  
3901                          if Thread.Repaint then begin                          if Thread.Repaint then begin
3902                                  //Thread.LastSize := ThreadItem.Size;                                  //Thread.LastSize := ThreadItem.Size;
3903                                  Thread.Repaint := false;                                  Thread.Repaint := false;
3904                                  try  
3905                                          Thread.Browser.OnStatusTextChange := nil;                                  Thread.Browser.OnStatusTextChange := nil;
3906                                          doc := Idispatch( olevariant(Thread.Browser.ControlInterface).Document) as IHTMLDocument2;                                  doc := Idispatch( olevariant(Thread.Browser.ControlInterface).Document) as IHTMLDocument2;
3907                                          GikoSys.CreateHTML2(doc, ThreadItem, sTitle);                                  GikoSys.CreateHTML2(doc, ThreadItem, sTitle);
3908                                    Thread.Browser.OnStatusTextChange := BrowserStatusTextChange;
3909                          //              if (Assigned(Thread.Browser)) and (Thread.Browser <> nil) then                                  PostMessage( Handle, USER_DOCUMENTCOMPLETE, Integer( Thread.Browser ), 0 );
3910                                          Thread.Browser.OnStatusTextChange := BrowserStatusTextChange;                                  if ThreadItem = nil then begin
3911                                          //なぜかここで明示的にDocumentCompleteを呼ばないとうまくいかない                                          FActiveContent := nil;
3912                                          //追記 200406/19                                          BrowserTab.Repaint;
3913                                          //VisibleのときしかDocumentCompleteは呼ばれないらしい                                          Exit;
                                         Thread.FBrowser.OnDocumentComplete(Thread.FBrowser, Thread.FBrowser.Parent, url);  
 //                                      Thread.OnlyHundred := GikoSys.OnlyAHundredRes;  
                                         Application.ProcessMessages;  
                                         //ここでApplication.ProcessMessagesを呼ぶことによってWebBrowserを更新させる。  
                                         //相しないと一画面分しか描画できてないのでそれ以上のスクロール量を指定しても無効になる  
                                         // byもじゅ(2004/01/20)  
                                         try  
                                                 //if (Assigned(Thread)) and (Assigned(ThreadItem))then begin  
                                                         if(Thread <> nil) and (ThreadItem <>nil) then begin  
                                                                 if ThreadUnRead then  
                                                                         BrowserMovement('new', Thread)  
                                                                 else if ThreadScrollTop <> 0 then begin  
                                                                         try  
                                                                                 doc.Body.ScrollTop := ThreadScrollTop;  
                                                                         except  
                                                                                 on E: Exception do  
                                                                                         MsgBox(Handle, E.Message, 'SetContent[ScrollTop<-]', 0);  
                                                                         end;  
                                                                 end;  
                                                 //      end;  
                                                 end else begin  
                                                         FActiveContent := nil;  
                                                         BrowserTab.Repaint;  
                                                         Exit;  
                                                 end;  
                                         except  
                                                 FActiveContent := nil;  
                                                 BrowserTab.Repaint;  
                                                 Exit;  
                                         end;  
                                 finally  
                                          //     Application.ProcessMessages;  
3914                                  end;                                  end;
3915                          end;                          end;
                         ThreadItem.UnRead := False;  
3916                          ListView.Refresh;                          ListView.Refresh;
3917                  end;                  end;
3918                  if (Assigned(Thread)) and (Assigned(Thread.Thread)) and (Thread <> nil) and (ThreadItem <>nil) then begin                  if (Assigned(Thread)) and (Assigned(Thread.Thread)) and (Thread <> nil) and (ThreadItem <>nil) then begin
# Line 3734  end; Line 3958  end;
3958    
3959  procedure TGikoForm.SetActiveList(Obj: TObject);  procedure TGikoForm.SetActiveList(Obj: TObject);
3960  var  var
         i               : Integer;  
3961          idx     : Integer;          idx     : Integer;
3962  begin  begin
3963  //      if FActiveList <> Obj then begin  //      if FActiveList <> Obj then begin
# Line 3748  begin Line 3971  begin
3971                  ListView.Items.Clear;                  ListView.Items.Clear;
3972                  ListView.Selected := nil;                  ListView.Selected := nil;
3973  //      ListView.Columns.Clear;  //      ListView.Columns.Clear;
3974                    if (FActiveContent <> nil) and (FActiveContent.Thread <> nil)
3975                  Self.Caption := CAPTION_NAME;                          and (FActiveContent.Thread.IsLogFile) then
3976                            Self.Caption := CAPTION_NAME + ' - [' + FActiveContent.Thread.Title + ']'
3977                    else
3978                            Self.Caption := CAPTION_NAME;
3979                  //Application.Title := CAPTION_NAME;                  //Application.Title := CAPTION_NAME;
3980    
3981    //              ActiveListColumnSave;
3982    
3983                  if Obj is TBBS then begin                  if Obj is TBBS then begin
                         for i := 0 to ListView.Columns.Count - 1 do  
                                 ListView.Column[i].Width := GikoSys.Setting.BBSColumnWidth[i];  
3984                          SetCategoryListItem(TBBS(Obj));                          SetCategoryListItem(TBBS(Obj));
3985                  end else if Obj is TCategory then begin                  end else if Obj is TCategory then begin
                         for i := 0 to ListView.Columns.Count - 1 do  
                                 ListView.Column[i].Width := GikoSys.Setting.CategoryColumnWidth[i];  
3986                          SetBoardListItem(TCategory(Obj));                          SetBoardListItem(TCategory(Obj));
3987                  end else if Obj is TBoard then begin                  end else if Obj is TBoard then begin
3988                          SetThreadListItem(TBoard(Obj));                          SetThreadListItem(TBoard(Obj));
# Line 3787  end; Line 4011  end;
4011  procedure TGikoForm.SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean);  procedure TGikoForm.SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean);
4012  var  var
4013          Board: TBoard;          Board: TBoard;
4014            i: Integer;
4015  begin  begin
4016          if ActiveList is TBoard then begin          if ActiveList is TBoard then begin
4017                    for i := Length( BBSs ) - 1 downto 0 do begin
4018                            BBSs[i].SelectText := SelectText;
4019                            BBSs[i].KubetsuChk := KubetsuChk;
4020                    end;
4021                  Board := TBoard(ActiveList);                  Board := TBoard(ActiveList);
4022    //              Board.ParentCategory.ParenTBBS.SelectText := SelectText;
4023                  Board.ParentCategory.ParenTBBS.SelectText := SelectText;  //              Board.ParentCategory.ParenTBBS.KubetsuChk := KubetsuChk;
                 Board.ParentCategory.ParenTBBS.KubetsuChk := KubetsuChk;  
4024  //              Board.SelectText := SelectText;  //              Board.SelectText := SelectText;
4025  //              Board.KubetsuChk := KubetsuChk;  //              Board.KubetsuChk := KubetsuChk;
4026                  ViewType := AViewType;                  ViewType := AViewType;
# Line 4297  begin Line 4525  begin
4525                  bbs := nil;                  bbs := nil;
4526    
4527          if (FTreeType = gtt2ch) and (FActiveBBS = bbs) then begin          if (FTreeType = gtt2ch) and (FActiveBBS = bbs) then begin
4528                  ChangeEvent := nil;                  if Item <> FActiveList then begin
4529                  ChangingEvent := nil;                          ChangeEvent := nil;
4530                            ChangingEvent := nil;
4531    
                 if not CallEvent then begin  
                         ChangeEvent := TreeView.OnChange;  
                         ChangingEvent := TreeView.OnChanging;  
                 end;  
                 try  
4532                          if not CallEvent then begin                          if not CallEvent then begin
4533                                  TreeView.OnChange := nil;                                  ChangeEvent := TreeView.OnChange;
4534                                  TreeView.OnChanging := nil;                                  ChangingEvent := TreeView.OnChanging;
4535                          end;                          end;
4536                          //Application.ProcessMessages;                          try
4537                          for i := 0 to TreeView.Items.Count - 1 do begin                                  if not CallEvent then begin
4538                                  if TreeView.Items[i].Data = Item then begin                                          TreeView.OnChange := nil;
4539                                          TreeView.Items[i].Selected := True;                                          TreeView.OnChanging := nil;
4540                                          if CallEvent then                                  end;
4541                                                  TreeClick(TreeView.Items[i]);                                  //Application.ProcessMessages;
4542                                          Break;                                  for i := 0 to TreeView.Items.Count - 1 do begin
4543                                            if TreeView.Items[i].Data = Item then begin
4544                                                    TreeView.Items[i].Selected := True;
4545                                                    if CallEvent then
4546                                                            TreeClick(TreeView.Items[i]);
4547                                                    Break;
4548                                            end;
4549                                    end;
4550                                    //Application.ProcessMessages;
4551                            finally
4552                                    if not CallEvent then begin
4553                                            TreeView.OnChange := ChangeEvent;
4554                                            TreeView.OnChanging := ChangingEvent;
4555                                  end;                                  end;
                         end;  
                         //Application.ProcessMessages;  
                 finally  
                         if not CallEvent then begin  
                                 TreeView.OnChange := ChangeEvent;  
                                 TreeView.OnChanging := ChangingEvent;  
4556                          end;                          end;
4557                  end;                  end;
4558          end else begin          end else begin
4559                  if GetActiveList is TBBS then begin                  if Item <> FActiveList then begin
4560                          for i := 0 to ListView.Columns.Count - 1 do                          ActiveListColumnSave;
                                 GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;  
                 end else if GetActiveList is TCategory then begin  
                         for i := 0 to ListView.Columns.Count - 1 do  
                                 GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;  
                 end else if GetActiveList is TBoard then begin  
                         for i := 0 to ListView.Columns.Count - 1 do  
                                 GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;  
                 end;  
4561    
4562                  if (Item is TBBS) or (Item is TCategory) then begin                          if (Item is TBBS) or (Item is TCategory) then begin
4563                          ListView.Columns.Clear;                                  ListView.Columns.Clear;
4564                          SetActiveList( Item );                                  SetActiveList( Item );
4565                  end else if Item is TBoard then begin                          end else if Item is TBoard then begin
4566                          if not TBoard( Item ).IsThreadDatRead then begin                                  if not TBoard( Item ).IsThreadDatRead then begin
4567                                  Screen.Cursor := crHourGlass;                                          Screen.Cursor := crHourGlass;
4568                                  try                                          try
4569                                          if not TBoard( Item ).IsThreadDatRead then                                                  if not TBoard( Item ).IsThreadDatRead then
4570                                                  GikoSys.ReadSubjectFile(TBoard( Item ));                                                          GikoSys.ReadSubjectFile(TBoard( Item ));
4571                                  finally                                          finally
4572                                          Screen.Cursor := crDefault;                                                  Screen.Cursor := crDefault;
4573                                            end;
4574                                  end;                                  end;
4575                                    SetActiveList( Item );
4576                          end;                          end;
                         SetActiveList( Item );  
4577                  end;                  end;
4578            end;
4579    
4580                  if Item is TBoard then begin // not TCategory          if Item is TBoard then begin // not TCategory
4581                          if GikoSys.Setting.ListOrientation = gloHorizontal then begin                  if GikoSys.Setting.ListOrientation = gloHorizontal then begin
4582                                  if GikoSys.Setting.ListWidthState = glsMax then begin                          if GikoSys.Setting.ListWidthState = glsMax then begin
4583                                          BrowserMinAction.Execute;                                  BrowserMinAction.Execute;
4584                                          if GikoForm.Visible then                                  if GikoForm.Visible then
4585                                                  ListView.SetFocus;                                          ListView.SetFocus;
4586                                  end;                          end;
4587                          end else begin                  end else begin
4588                                  if GikoSys.Setting.ListHeightState = glsMax then begin                          if GikoSys.Setting.ListHeightState = glsMax then begin
4589                                          BrowserMinAction.Execute;                                  BrowserMinAction.Execute;
4590                                          if GikoForm.Visible then                                  if GikoForm.Visible then
4591                                                  ListView.SetFocus;                                          ListView.SetFocus;
                                 end;  
4592                          end;                          end;
4593                  end;                  end;
4594          end;          end;
# Line 4376  procedure TGikoForm.ListViewMouseDown(Se Line 4599  procedure TGikoForm.ListViewMouseDown(Se
4599  var  var
4600          listItem                : TListItem;          listItem                : TListItem;
4601          threadItem      : TThreadItem;          threadItem      : TThreadItem;
4602            pos                                     : TPoint;
4603  //      t: Cardinal;  //      t: Cardinal;
4604  begin  begin
4605          case Button of          case Button of
# Line 4399  begin Line 4623  begin
4623                          else                          else
4624                                  ListClick;                                  ListClick;
4625                  end;                  end;
4626            mbRight:
4627                    begin
4628                            pos.X := X;
4629                            pos.Y := Y;
4630                            Windows.ClientToScreen( ListView.Handle, pos );
4631                            ListPopupMenu.Popup( pos.X, pos.Y );
4632                    end;
4633          end;          end;
4634  {       if ssDouble in Shift then begin  {       if ssDouble in Shift then begin
4635                  DoubleClickOccurred[Button] := True;                  DoubleClickOccurred[Button] := True;
# Line 4525  begin Line 4756  begin
4756                          top := 0;                          top := 0;
4757                          nm := AName;                          nm := AName;
4758                          item := OleVariant( activeBrower.Document as IHTMLDocument2).anchors.item(nm);                          item := OleVariant( activeBrower.Document as IHTMLDocument2).anchors.item(nm);
4759                            item.focus();
4760                          repeat                          repeat
4761                                  top := top + item.offsetTop;                                  top := top + item.offsetTop;
4762                                  item := item.offsetParent;                                  item := item.offsetParent;
4763                          until AnsiCompareText(item.tagName, 'body' ) = 0;                          until AnsiCompareText(item.tagName, 'body' ) = 0;
   
4764                          OleVariant(activeBrower.Document as IHTMLDocument2).body.scrollTop := top;                          OleVariant(activeBrower.Document as IHTMLDocument2).body.scrollTop := top;
4765                  except                  except
4766                  end;                  end;
# Line 4557  begin Line 4788  begin
4788                          top := 0;                          top := 0;
4789                          nm := AName;                          nm := AName;
4790                          item := OleVariant( activeBrower.Document as IHTMLDocument2).anchors.item(nm);                          item := OleVariant( activeBrower.Document as IHTMLDocument2).anchors.item(nm);
4791                item.focus();
4792                          repeat                          repeat
4793                                  top := top + item.offsetTop;                                  top := top + item.offsetTop;
4794                                  item := item.offsetParent;                                  item := item.offsetParent;
# Line 5028  begin Line 5260  begin
5260                  case GikoSys.Setting.ListWidthState of                  case GikoSys.Setting.ListWidthState of
5261                          glsMax: begin                          glsMax: begin
5262                                  //通常表示にする                                  //通常表示にする
5263                                    if FActiveContent <> nil then
5264                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //描画停止
5265                                  ViewPanel.Width := FBrowserSizeWidth;                                  ViewPanel.Width := FBrowserSizeWidth;
5266                                  BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;                                  BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
5267                                  BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;                                  BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
5268                                  GikoSys.Setting.ListWidthState := glsNormal;                                  GikoSys.Setting.ListWidthState := glsNormal;
5269                                    if FActiveContent <> nil then
5270                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //描画
5271                          end;                          end;
5272                          glsMin, glsNormal: begin                          glsMin, glsNormal: begin
5273                                  //最大表示にする                                  //最大表示にする
5274                                    if FActiveContent <> nil then
5275                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //描画停止
5276                                  if GikoSys.Setting.ListWidthState = glsNormal then                                  if GikoSys.Setting.ListWidthState = glsNormal then
5277                                          FBrowserSizeWidth := ViewPanel.Width;                                          FBrowserSizeWidth := ViewPanel.Width;
5278                                    if FActiveContent <> nil then
5279                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //描画
5280                                  ViewPanel.Width := 1;                                  ViewPanel.Width := 1;
5281                                  BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;                                  BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
5282                                  BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;                                  BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
# Line 5047  begin Line 5287  begin
5287                  case GikoSys.Setting.ListHeightState of                  case GikoSys.Setting.ListHeightState of
5288                          glsMax: begin                          glsMax: begin
5289                                  //通常表示にする                                  //通常表示にする
5290                                    if FActiveContent <> nil then
5291                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //描画停止
5292                                  ViewPanel.Height := FBrowserSizeHeight;                                  ViewPanel.Height := FBrowserSizeHeight;
5293                                  BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;                                  BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
5294                                  BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;                                  BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
5295                                  GikoSys.Setting.ListHeightState := glsNormal;                                  GikoSys.Setting.ListHeightState := glsNormal;
5296                                    if FActiveContent <> nil then
5297                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //描画
5298                          end;                          end;
5299                          glsMin, glsNormal: begin                          glsMin, glsNormal: begin
5300                                  //最大表示にする                                  //最大表示にする
5301                                    if FActiveContent <> nil then
5302                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //描画停止
5303                                  if GikoSys.Setting.ListHeightState = glsNormal then                                  if GikoSys.Setting.ListHeightState = glsNormal then
5304                                          FBrowserSizeHeight := ViewPanel.Height;                                          FBrowserSizeHeight := ViewPanel.Height;
5305                                    if FActiveContent <> nil then
5306                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //描画
5307                                  ViewPanel.Height := 1;                                  ViewPanel.Height := 1;
5308                                  BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;                                  BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
5309                                  BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;                                  BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
# Line 5076  begin Line 5324  begin
5324                  case GikoSys.Setting.ListWidthState of                  case GikoSys.Setting.ListWidthState of
5325                          glsMax, glsNormal: begin                          glsMax, glsNormal: begin
5326                                  //最小表示にする                                  //最小表示にする
5327                                    if FActiveContent <> nil then
5328                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //描画停止
5329                                  if GikoSys.Setting.ListWidthState = glsNormal then                                  if GikoSys.Setting.ListWidthState = glsNormal then
5330                                          FBrowserSizeWidth := ViewPanel.Width;                                          FBrowserSizeWidth := ViewPanel.Width;
5331                                    if FActiveContent <> nil then
5332                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //描画
5333                                  ViewPanel.Width := ThreadMainPanel.Width - 80;                                  ViewPanel.Width := ThreadMainPanel.Width - 80;
5334                                  BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;                                  BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
5335                                  BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;                                  BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
# Line 5085  begin Line 5337  begin
5337                          end;                          end;
5338                          glsMin: begin                          glsMin: begin
5339                                  //通常表示にする                                  //通常表示にする
5340                                    if FActiveContent <> nil then
5341                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //描画停止
5342                                  ViewPanel.Width := FBrowserSizeWidth;                                  ViewPanel.Width := FBrowserSizeWidth;
5343                                  BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;                                  BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
5344                                  BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;                                  BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
5345                                  GikoSys.Setting.ListWidthState := glsNormal;                                  GikoSys.Setting.ListWidthState := glsNormal;
5346                                    if FActiveContent <> nil then
5347                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //描画
5348                          end;                          end;
5349                  end;                  end;
5350          end else begin          end else begin
5351                  case GikoSys.Setting.ListHeightState of                  case GikoSys.Setting.ListHeightState of
5352                          glsMax, glsNormal: begin                          glsMax, glsNormal: begin
5353                                  //最小表示にする                                  //最小表示にする
5354                                    if FActiveContent <> nil then
5355                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //描画停止
5356                                  if GikoSys.Setting.ListHeightState = glsNormal then                                  if GikoSys.Setting.ListHeightState = glsNormal then
5357                                          FBrowserSizeHeight := ViewPanel.Height;                                          FBrowserSizeHeight := ViewPanel.Height;
5358                                  ViewPanel.Height := ThreadMainPanel.Height - BrowserCoolBar.Height - 7;                                  ViewPanel.Height := ThreadMainPanel.Height - BrowserCoolBar.Height - 7;
5359                                  BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;                                  BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
5360                                  BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;                                  BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
5361                                  GikoSys.Setting.ListHeightState := glsMin;                                  GikoSys.Setting.ListHeightState := glsMin;
5362                                    if FActiveContent <> nil then
5363                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //描画
5364                          end;                          end;
5365                          glsMin: begin                          glsMin: begin
5366                                  //通常表示にする                                  //通常表示にする
5367                                    if FActiveContent <> nil then
5368                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 0, 0);  //描画停止
5369                                  ViewPanel.Height := FBrowserSizeHeight;                                  ViewPanel.Height := FBrowserSizeHeight;
5370                                  BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;                                  BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
5371                                  BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;                                  BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
5372                                  GikoSys.Setting.ListHeightState := glsNormal;                                  GikoSys.Setting.ListHeightState := glsNormal;
5373                                    if FActiveContent <> nil then
5374                                            SendMessage(FActiveContent.FBrowser.Handle, WM_SETREDRAW, 1, 0);  //描画
5375                          end;                          end;
5376                  end;                  end;
5377          end;          end;
# Line 5328  begin Line 5592  begin
5592  end;  end;
5593    
5594  procedure TGikoForm.FormResize(Sender: TObject);  procedure TGikoForm.FormResize(Sender: TObject);
 var  
         doc                                             : Variant;  
5595  begin  begin
5596    
5597          MessageListView.Column[0].Width := MessageListView.ClientWidth - 32;          MessageListView.Column[0].Width := MessageListView.ClientWidth - 32;
5598          MainCoolBar.Width := TopPanel.Width - TopRightPanel.Width;          MainCoolBar.Width := TopPanel.Width - TopRightPanel.Width;
5599    
# Line 5346  begin Line 5609  begin
5609                  end;                  end;
5610          end;          end;
5611    
5612          if FIsMinimize = mtMinimized then begin          FIsIgnoreResize := rtResizing;
                 if FActiveContent <> nil then begin  
                         //Application.ProcessMessages;  
                         doc := Idispatch( olevariant(FActiveContent.Browser.ControlInterface).Document) as IHTMLDocument2;  
                         doc.Body.ScrollTop := FActiveContent.Thread.ScrollTop;  
                         FIsMinimize := mtNone;  
                 end;  
         end;  
   
         FIsIgnoreResize := True;  
5613          PostMessage( Handle, USER_RESIZED, 0, 0 );          PostMessage( Handle, USER_RESIZED, 0, 0 );
5614    
5615    
5616  end;  end;
5617    
5618  procedure TGikoForm.ScrollTopActionUpdate(Sender: TObject);  procedure TGikoForm.ScrollTopActionUpdate(Sender: TObject);
# Line 5444  end; Line 5700  end;
5700    
5701  procedure TGikoForm.LogDeleteActionExecute(Sender: TObject);  procedure TGikoForm.LogDeleteActionExecute(Sender: TObject);
5702  const  const
5703          DEL_MSG = '“^0”のログをを削除します。よろしいですか?';          DEL_MSG = '“^0”のログを削除します。よろしいですか?';
5704          DEL_SAME_MSG = 'これら ^0 個のスレッドのログをを削除します。よろしいですか?';          DEL_SAME_MSG = 'これら ^0 個のスレッドのログを削除します。よろしいですか?';
5705          DEL_TITLE = '削除確認';          DEL_TITLE = '削除確認';
5706  var  var
5707          ThreadItem: TThreadItem;          ThreadItem: TThreadItem;
# Line 5482  begin Line 5738  begin
5738                          DeleteHistory(ThreadItem);                          DeleteHistory(ThreadItem);
5739                          DeleteTab(ThreadItem);                          DeleteTab(ThreadItem);
5740                          ThreadItem.DeleteLogFile;                          ThreadItem.DeleteLogFile;
5741                            
5742                            TreeView.Refresh;       // UnRead の表示を更新
5743                  end;                  end;
5744                  ListView.Refresh;                  ListView.Refresh;
5745          finally          finally
# Line 5667  begin Line 5925  begin
5925    
5926          Editor := TEditorForm.Create(Self);          Editor := TEditorForm.Create(Self);
5927          Editor.SetThreadItem(Item);          Editor.SetThreadItem(Item);
5928        GikoSys.LoadEditorKeySetting(Editor.ActionList);
5929          Editor.BodyEdit.Text := '>>' + IntToStr(Number) + #13#10;          Editor.BodyEdit.Text := '>>' + IntToStr(Number) + #13#10;
5930          Editor.Show;          Editor.Show;
5931          Editor.BodyEdit.SetFocus;          Editor.BodyEdit.SetFocus;
# Line 6402  var Line 6661  var
6661          FDispHtmlDocument: DispHTMLDocument;          FDispHtmlDocument: DispHTMLDocument;
6662          BrowserRecord :TBrowserRecord;          BrowserRecord :TBrowserRecord;
6663          i :Integer;          i :Integer;
6664            doc                                     : Variant;
6665            threadItem      : TThreadItem;
6666  begin  begin
6667  //      AddMessageList('DocumentComplete', nil);  //      AddMessageList('DocumentComplete', nil, gmiWhat);
6668          if TObject(Sender) is TWebBrowser then begin          if TObject(Sender) is TWebBrowser then begin
6669                    BrowserRecord := nil;
6670                  if TWebBrowser(Sender) <> Browser then begin                  if TWebBrowser(Sender) <> Browser then begin
                         BrowserRecord := nil;  
6671                          for i := BrowserTab.Tabs.Count - 1 downto 0 do begin                          for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
6672                                  if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = TWebBrowser(Sender) then begin                                  if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = TWebBrowser(Sender) then begin
6673                                                  BrowserRecord := TBrowserRecord(BrowserTab.Tabs.Objects[i]);                                                  BrowserRecord := TBrowserRecord(BrowserTab.Tabs.Objects[i]);
# Line 6422  begin Line 6683  begin
6683                                  BrowserRecord.FEvent.OnClick := WebBrowserClick;  //追加したOnClickイベント                                  BrowserRecord.FEvent.OnClick := WebBrowserClick;  //追加したOnClickイベント
6684                          end;                          end;
6685                  end else begin                  end else begin
6686                  if GetActiveContent <> nil then begin                          if GetActiveContent <> nil then begin
6687                                  FDispHtmlDocument := Idispatch(OleVariant(Browser.ControlInterface).Document) as DispHTMLDocument;                                  FDispHtmlDocument := Idispatch(OleVariant(Browser.ControlInterface).Document) as DispHTMLDocument;
6688                                  if FEvent <> nil then                                  if FEvent <> nil then
6689                                          FEvent.Free;                                          FEvent.Free;
# Line 6431  begin Line 6692  begin
6692                                  FEvent.OnClick := WebBrowserClick;  //追加したOnClickイベント                                  FEvent.OnClick := WebBrowserClick;  //追加したOnClickイベント
6693                          end;                          end;
6694                  end;                  end;
6695    
6696                    if (BrowserRecord <> nil) and
6697                             Assigned( BrowserRecord.Thread ) then begin
6698                            threadItem := BrowserRecord.Thread;
6699    
6700                            if (BrowserRecord <> nil) and (Length( BrowserRecord.Movement ) > 0) then begin
6701                                    if threadItem.UnRead then begin
6702                                            threadItem.UnRead := False;
6703                                            threadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1;
6704                                            if threadItem.ParentBoard.UnRead < 0 then threadItem.ParentBoard.UnRead := 0;
6705                                            TreeView.Refresh;
6706                                            ListView.Refresh;
6707                                    end;
6708                                    BrowserMovement( BrowserRecord.Movement, BrowserRecord );
6709                                    BrowserRecord.Movement := '';
6710                            end else if threadItem.UnRead then begin
6711                                    threadItem.UnRead := False;
6712                                    threadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1;
6713                                    if threadItem.ParentBoard.UnRead < 0 then threadItem.ParentBoard.UnRead := 0;
6714                                    TreeView.Refresh;
6715                                    BrowserMovement( 'new', BrowserRecord );
6716                                    ListView.Refresh;
6717                            end else if threadItem.ScrollTop <> 0 then begin
6718                                    try
6719                                            doc := Idispatch( OleVariant( BrowserRecord.Browser.ControlInterface ).Document ) as IHTMLDocument2;
6720                                            doc.Body.ScrollTop := threadItem.ScrollTop;
6721                                    except
6722                                            on E: Exception do
6723                                                    MsgBox(Handle, E.Message, 'SetContent[ScrollTop<-]', 0);
6724                                    end;
6725                            end;
6726                    end;
6727          end;          end;
6728  end;  end;
6729    
# Line 6786  end; Line 7079  end;
7079    
7080  procedure TGikoForm.ActiveLogDeleteActionExecute(Sender: TObject);  procedure TGikoForm.ActiveLogDeleteActionExecute(Sender: TObject);
7081  const  const
7082          DEL_MSG = '“^0”のログをを削除します。よろしいですか?';          DEL_MSG = '“^0”のログを削除します。よろしいですか?';
7083          DEL_TITLE = '削除確認';          DEL_TITLE = '削除確認';
7084  var  var
7085          idx: Integer;          idx: Integer;
# Line 7204  begin Line 7497  begin
7497          end;          end;
7498  end;  end;
7499    
7500  procedure TGikoForm.MoveToURL(URL: string);  procedure TGikoForm.MoveToURL(const inURL: string);
   
7501  var  var
7502          protocol, host, path, document, port, bookmark : string;          protocol, host, path, document, port, bookmark : string;
7503          URL2, protocol2, host2, path2, document2, port2, bookmark2 : string;          URL, protocol2, host2, path2, document2, port2, bookmark2 : string;
7504          tmp1, tmp2: string;          tmp1, tmp2: string;
7505          BBSID, BBSKey: string;          BBSID, BBSKey: string;
7506          Board: TBoard;          tmpBoard, Board: TBoard;
7507          ThreadItem: TThreadItem;          ThreadItem: TThreadItem;
7508          i, bi                                   : Integer;          i, bi                                   : Integer;
7509          boardURL                        : string;          boardURL                        : string;
# Line 7221  var Line 7513  var
7513  //      boardNode                       : TTreeNode;  //      boardNode                       : TTreeNode;
7514          shiftDown                       : Boolean;          shiftDown                       : Boolean;
7515          ctrlDown                        : Boolean;          ctrlDown                        : Boolean;
7516            stRes, edRes    : Int64;
7517            browserRec              : TBrowserRecord;
7518  begin  begin
7519    
7520          GikoSys.ParseURI( URL, protocol, host, path, document, port, bookmark );          GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
7521          GikoSys.Parse2chURL( URL, path, document, BBSID, BBSKey );          GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
7522    
7523    
7524          shiftDown       := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);          shiftDown       := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
7525      ctrlDown    := GetAsyncKeyState(VK_CONTROL) = Smallint($8001);          ctrlDown        := GetAsyncKeyState(VK_CONTROL) = Smallint($8001);
7526      if shiftDown then begin          if shiftDown then begin
7527          GikoSys.OpenBrowser(URL, gbtUserApp);                  GikoSys.OpenBrowser(inURL, gbtUserApp);
7528          Exit;                  Exit;
7529      end else if ctrlDown then begin          end else if ctrlDown then begin
7530          GikoSys.OpenBrowser(URL, gbtIE);                  GikoSys.OpenBrowser(inURL, gbtIE);
7531          Exit;                  Exit;
7532          end;          end;
7533    
7534          //===== プラグイン          //===== プラグイン
# Line 7243  begin Line 7537  begin
7537                  bi := High( BoardPlugIns );                  bi := High( BoardPlugIns );
7538                  for i := Low( BoardPlugIns ) to bi do begin                  for i := Low( BoardPlugIns ) to bi do begin
7539                          if Assigned( Pointer( BoardPlugIns[ i ].Module ) ) then begin                          if Assigned( Pointer( BoardPlugIns[ i ].Module ) ) then begin
7540                                  case BoardPlugIns[ i ].AcceptURL( URL ) of                                  case BoardPlugIns[ i ].AcceptURL( inURL ) of
7541                                  atThread:                                  atThread:
7542                                          begin                                          begin
7543                                                  tmpThread               := TThreadItem.Create( BoardPlugIns[ i ], URL );                                                  tmpThread               := TThreadItem.Create( BoardPlugIns[ i ], inURL );
7544                                                  boardURL                := tmpThread.BoardPlugIn.GetBoardURL( DWORD( tmpThread ) );                                                  boardURL                := tmpThread.BoardPlugIn.GetBoardURL( DWORD( tmpThread ) );
7545                                                  Board                           := BBSsFindBoardFromURL( boardURL );                                                  Board                           := BBSsFindBoardFromURL( boardURL );
7546                                                  if Board = nil then begin                                                  if Board = nil then begin
7547                                //break;
7548                                                          // ※作っても追加するところが無いので激しく保留                                                          // ※作っても追加するところが無いので激しく保留
7549                                                          //GikoSys.OpenBrowser(URL, gbtUserApp);                                                          //GikoSys.OpenBrowser(inURL, gbtUserApp);
7550                                                          //Exit;                                                          //Exit;
7551                                                          {                                                          {
7552                                                          Board := GikoSys.GetUnknownBoard( tmpThread.BoardPlugIn, boardURL );                                                          Board := GikoSys.GetUnknownBoard( tmpThread.BoardPlugIn, boardURL );
# Line 7263  begin Line 7558  begin
7558                                                                  GikoSys.ReadSubjectFile( Board );                                                                  GikoSys.ReadSubjectFile( Board );
7559                                                                  Exit;                                                                  Exit;
7560                                                          end;                                                          end;
7561                                                  end;                                                          ThreadItem := Board.FindThreadFromFileName( tmpThread.FileName );
7562                                                            if ThreadItem = nil then begin
7563                                                  ThreadItem := Board.FindThreadFromFileName( tmpThread.FileName );                                                                  ThreadItem := tmpThread;
7564                                                  if ThreadItem = nil then begin                                                                  Board.Insert( 0, ThreadItem );
7565                                                          ThreadItem := tmpThread;                                                                  if ActiveList is TBoard then begin
7566                                                          Board.Insert( 0, ThreadItem );                                                                          if TBoard(ActiveList) = Board then
7567                                                          if ActiveList is TBoard then begin                                                                                  ListView.Items.Count := ListView.Items.Count + 1;
7568                                                                  if TBoard(ActiveList) = Board then                                                                  end;
7569                                                                          ListView.Items.Count := ListView.Items.Count + 1;                                                                  GikoSys.GetPopupResNumber( inURL, stRes, edRes );
7570                                                          end;                                                                  browserRec := InsertBrowserTab( ThreadItem );
7571                                                          InsertBrowserTab( ThreadItem );                                                                  if (browserRec <> nil) and (stRes > 0) then
7572                                                          DownloadContent( ThreadItem );                                                                          browserRec.Movement := IntToStr( stRes );
                                                         Exit;  
                                                 end else begin  
                                                         tmpThread.Free;  
                                                         InsertBrowserTab( ThreadItem );  
                                                         if not ThreadItem.IsLogFile then begin  
7573                                                                  DownloadContent( ThreadItem );                                                                  DownloadContent( ThreadItem );
7574                                                                    Exit;
7575                                                            end else begin
7576                                                                    tmpThread.Free;
7577                                                                    GikoSys.GetPopupResNumber( inURL, stRes, edRes );
7578                                                                    browserRec := InsertBrowserTab( ThreadItem );
7579                                                                    if ThreadItem.IsLogFile then begin
7580                                                                            if (browserRec <> nil) and (stRes > 0) then
7581                                                                                    BrowserMovement( IntToStr( stRes ), browserRec );
7582                                                                    end else begin
7583                                                                            if (browserRec <> nil) and (stRes > 0) then
7584                                                                                    browserRec.Movement := IntToStr( stRes );
7585                                                                            DownloadContent( ThreadItem );
7586                                                                    end;
7587                                                                    Exit;
7588                                                          end;                                                          end;
                                                         Exit;  
7589                                                  end;                                                  end;
   
                                                 //Exit;  
7590                                          end;                                          end;
7591    
7592                                  atBoard:                                  atBoard:
7593                                          begin                                          begin
7594                                                  Board := BBSsFindBoardFromURL( URL );                                                  tmpBoard := TBoard.Create(BoardPlugIns[ i ], inURL);
7595                                                    Board := BBSsFindBoardFromURL( tmpBoard.URL );
7596                                                    tmpBoard.Free;
7597                                                  if Board <> nil then begin                                                  if Board <> nil then begin
7598                                                          if FActiveBBS <> Board.ParentCategory.ParenTBBS then                                                          if FActiveBBS <> Board.ParentCategory.ParenTBBS then
7599                                                                  ShowBBSTree( Board.ParentCategory.ParenTBBS );                                                                  ShowBBSTree( Board.ParentCategory.ParenTBBS );
# Line 7307  begin Line 7610  begin
7610    
7611    
7612          if (Length( Trim(BBSKey) ) > 0) and (Length( Trim(BBSID) ) > 0) then begin          if (Length( Trim(BBSKey) ) > 0) and (Length( Trim(BBSID) ) > 0) then begin
7613                  boardURL := GikoSys.Get2chThreadURL2BoardURL( URL );                  boardURL := GikoSys.Get2chThreadURL2BoardURL( inURL );
7614                  Board := BBSsFindBoardFromURL( boardURL );                  Board := BBSsFindBoardFromURL( boardURL );
7615                  if Board = nil then                  if Board = nil then
7616                          Board := BBSsFindBoardFromBBSID( BBSID );                          Board := BBSsFindBoardFromBBSID( BBSID );
# Line 7319  begin Line 7622  begin
7622                  end;                  end;
7623                  if Board = nil then begin                  if Board = nil then begin
7624                           // 入るべき板が見つからなかったので、普通のブラウザで開く                           // 入るべき板が見つからなかったので、普通のブラウザで開く
7625                           GikoSys.OpenBrowser(URL, gbtUserApp);                           GikoSys.OpenBrowser(inURL, gbtUserApp);
7626                           Exit;                           Exit;
7627                  end else begin                  end else begin
7628                          // 外部の板なのに2chのURLにされてしまった奴をここで確認する                          // 外部の板なのに2chのURLにされてしまった奴をここで確認する
7629                          URL2 :=  Board.URL;                          URL :=  Board.URL;
7630                          GikoSys.ParseURI(URL2 , protocol2, host2, path2, document2, port2, bookmark2 );                          GikoSys.ParseURI(URL , protocol2, host2, path2, document2, port2, bookmark2 );
7631                          tmp1 := Copy(host, AnsiPos('.', host) + 1, Length(host));                          tmp1 := Copy(host, AnsiPos('.', host) + 1, Length(host));
7632                          tmp2 := Copy(host2, AnsiPos('.', host2) + 1, Length(host2));                          tmp2 := Copy(host2, AnsiPos('.', host2) + 1, Length(host2));
7633                          if (tmp1 <> tmp2) then begin                          if ( not GikoSys.Is2chHost(tmp1)) and (tmp1 <> tmp2) then begin
7634                                  GikoSys.OpenBrowser(URL, gbtUserApp);                                  GikoSys.OpenBrowser(inURL, gbtUserApp);
7635                                  Exit;                                  Exit;
7636                          end;                          end;
7637                  end;                  end;
7638    
7639                  if not Board.IsThreadDatRead then                  if not Board.IsThreadDatRead then
7640                          GikoSys.ReadSubjectFile(Board);                          GikoSys.ReadSubjectFile(Board);
7641                  URL := GikoSys.Get2chBrowsableThreadURL( URL );                  URL := GikoSys.Get2chBrowsableThreadURL( inURL );
7642                  ThreadItem := Board.FindThreadFromURL( URL );                  ThreadItem := Board.FindThreadFromURL( URL );
7643                  // 過去ログ倉庫から、ダウソしたスレが発見できないのでここで探すようにする (2004/01/22)                  // 過去ログ倉庫から、ダウソしたスレが発見できないのでここで探すようにする (2004/01/22)
7644                  if ThreadItem = nil then begin                  if ThreadItem = nil then begin
# Line 7348  begin Line 7651  begin
7651                          {shiftDown      := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);                          {shiftDown      := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
7652                          ctrlDown        := GetAsyncKeyState(VK_CONTROL) = Smallint($8001);                          ctrlDown        := GetAsyncKeyState(VK_CONTROL) = Smallint($8001);
7653                          if shiftDown then                          if shiftDown then
7654                                  GikoSys.OpenBrowser(URL, gbtUserApp)                                  GikoSys.OpenBrowser(URL1, gbtUserApp)
7655                          else if ctrlDown then                          else if ctrlDown then
7656                                  GikoSys.OpenBrowser(URL, gbtIE)                                  GikoSys.OpenBrowser(URL1, gbtIE)
7657                          else begin                          else begin
7658                          }                          }
7659                          ThreadItem := TThreadItem.Create( nil, URL );                          ThreadItem := TThreadItem.Create( nil, URL );
# Line 7364  begin Line 7667  begin
7667                                  if TBoard(ActiveList) = Board then                                  if TBoard(ActiveList) = Board then
7668                                          ListView.Items.Count := ListView.Items.Count + 1;                                          ListView.Items.Count := ListView.Items.Count + 1;
7669                          end;                          end;
7670                          InsertBrowserTab(ThreadItem);                          GikoSys.GetPopupResNumber( inURL, stRes, edRes );
7671                            browserRec := InsertBrowserTab(ThreadItem);
7672                            if (browserRec <> nil) and (stRes > 0) then
7673                                    browserRec.Movement := IntToStr( stRes );
7674                          DownloadContent(ThreadItem);                          DownloadContent(ThreadItem);
7675                          {end;}                          {end;}
7676                  end else begin                  end else begin
7677                          if ThreadItem.IsLogFile then                          if ThreadItem.IsLogFile then begin
7678                                  InsertBrowserTab(ThreadItem)                                  GikoSys.GetPopupResNumber( inURL, stRes, edRes );
7679                          else begin                                  browserRec := InsertBrowserTab(ThreadItem);
7680                                    if (browserRec <> nil) and (stRes > 0) then
7681                                            browserRec.Movement := IntToStr( stRes );
7682                            end else begin
7683                                  if AnsiPos(Host, Board.URL) = 0 then                                  if AnsiPos(Host, Board.URL) = 0 then
7684                                          ThreadItem.DownloadHost := Host                                          ThreadItem.DownloadHost := Host
7685                                  else                                  else
7686                                          ThreadItem.DownloadHost := '';                                          ThreadItem.DownloadHost := '';
7687                                  InsertBrowserTab(ThreadItem);                                  GikoSys.GetPopupResNumber( inURL, stRes, edRes );
7688                                    browserRec := InsertBrowserTab(ThreadItem);
7689                                    if (browserRec <> nil) and (stRes > 0) then
7690                                            browserRec.Movement := IntToStr( stRes );
7691                                  DownloadContent(ThreadItem);                                  DownloadContent(ThreadItem);
7692                          end;                          end;
7693                  end;                  end;
7694          end else begin          end else begin
7695      Board := BBSsFindBoardFromURL( URL );                  Board := BBSsFindBoardFromURL( inURL );
7696      if Board = nil then begin      if Board = nil then begin
7697                          GikoSys.OpenBrowser(URL, gbtAuto);                          GikoSys.OpenBrowser(inURL, gbtAuto);
7698      end else begin      end else begin
7699            if FActiveBBS <> Board.ParentCategory.ParenTBBS then            if FActiveBBS <> Board.ParentCategory.ParenTBBS then
7700          ShowBBSTree( Board.ParentCategory.ParenTBBS );          ShowBBSTree( Board.ParentCategory.ParenTBBS );
# Line 7428  begin Line 7740  begin
7740  end;  end;
7741    
7742  procedure TGikoForm.WndProc(var Message: TMessage);  procedure TGikoForm.WndProc(var Message: TMessage);
7743    var
7744            senderBrowser   : TWebBrowser;
7745            url                                             : OleVariant;
7746  begin  begin
7747          try          try
7748                  case Message.Msg of                  case Message.Msg of
# Line 7445  begin Line 7760  begin
7760                          OnMinimized;                          OnMinimized;
7761                  USER_SETLINKBAR:                  USER_SETLINKBAR:
7762                          SetLinkBar;                          SetLinkBar;
7763                    USER_DOCUMENTCOMPLETE:
7764                            if (Message.WParam <> 0) and
7765                                     (TObject(Message.WParam) is TWebBrowser) then begin
7766                                    senderBrowser := TWebBrowser( Message.WParam );
7767                                    BrowserDocumentComplete( senderBrowser, senderBrowser.Parent, url );
7768                            end;
7769                  end;                  end;
7770    
7771                  inherited;                  inherited;
# Line 7899  var Line 8220  var
8220          j: Integer;          j: Integer;
8221          ToolButton: TLinkToolButton;          ToolButton: TLinkToolButton;
8222          MenuItem: TMenuItem;          MenuItem: TMenuItem;
8223          oldIgnoreResize : Boolean;          oldIgnoreResize : TResizeType;
8224  begin  begin
8225          oldIgnoreResize := FIsIgnoreResize;          oldIgnoreResize := FIsIgnoreResize;
8226          FIsIgnoreResize := True;          FIsIgnoreResize := rtResizing;
8227          MainCoolBar.Bands.BeginUpdate;          MainCoolBar.Bands.BeginUpdate;
8228          try          try
8229                  LinkBarPopupMenu.Items.Clear;                  LinkBarPopupMenu.Items.Clear;
# Line 7995  begin Line 8316  begin
8316                          if FDropSpaceNode <> nil then                          if FDropSpaceNode <> nil then
8317                                  FDropSpaceNode.Free;                                  FDropSpaceNode.Free;
8318    
8319                          FDropSpaceNode := FavoriteDM.TreeView.Items.AddChildObject(Node.Parent, '', nil );                          FDropSpaceNode := FavoriteDM.TreeView.Items.AddChildObjectFirst(Node.Parent, '', nil );
8320                          FDropSpaceNode.MoveTo( Node, naInsert );                          FDropSpaceNode.MoveTo( Node, naInsert );
8321                          FDropSpaceNode.ImageIndex := -1;                          FDropSpaceNode.ImageIndex := -1;
8322                          FDropSpaceNode.SelectedIndex := -1;                          FDropSpaceNode.SelectedIndex := -1;
# Line 8361  begin Line 8682  begin
8682                  end;                  end;
8683          end;          end;
8684          // 設定          // 設定
8685          lResult := SendMessage( bar.Handle, RB_SETBANDINFO, i, Integer( pBandInfo ) );          lResult := SendMessage( bar.Handle, RB_SETBANDINFO, idx, Integer( pBandInfo ) );
8686    
8687  end;  end;
8688    
# Line 8606  procedure TGikoForm.FormMouseWheel(Sende Line 8927  procedure TGikoForm.FormMouseWheel(Sende
8927  var  var
8928          Wnd: THandle;          Wnd: THandle;
8929          delta: Integer;          delta: Integer;
8930  //      msg: TMessage;  //      browserPos : TPoint;
8931  const  const
8932          ICON_SIZE = 16;          ICON_SIZE = 16;
8933  begin  begin
8934          Handled := False;          Wnd := WindowFromPoint(Mouse.CursorPos);
         Wnd := WindowFromPoint(MousePos);  
8935          Handled := True;          Handled := True;
8936          if WheelDelta > 0 then          if WheelDelta > 0 then
8937                  Delta := -1                  Delta := -1
# Line 8621  begin Line 8941  begin
8941          if (Wnd = BrowserTab.Handle) or          if (Wnd = BrowserTab.Handle) or
8942                   (Wnd = BrowserTab.Parent.Handle) then begin                   (Wnd = BrowserTab.Parent.Handle) then begin
8943                  BrowserTab.ScrollTabs(Delta);                  BrowserTab.ScrollTabs(Delta);
         end else if Wnd = ListView.Handle then begin  
                 if ListView.ViewStyle = vsList then  
                         ListView.Scroll( Delta * Mouse.WheelScrollLines * Abs( ListView.Font.Height ) + Delta * ICON_SIZE, 0 )  
                 else  
                         ListView.Scroll( 0, Delta * Mouse.WheelScrollLines * Abs( ListView.Font.Height ) + Delta * ICON_SIZE );  
8944          end else begin          end else begin
8945                  Handled := False;                  if FIsHandledWheel then begin
8946                            FIsHandledWheel := False;
8947                            Handled := False;
8948                    end else begin
8949                            FIsHandledWheel := True;
8950                            if (Wnd = TreeView.Handle) or  (Wnd = FavoriteTreeView.Handle)
8951                            or (Wnd = ListView.Handle) or (Wnd = MessageListView.Handle)
8952                            then
8953                                    SendMessage( Wnd, WM_MOUSEWHEEL, WheelDelta shl 16, (Mouse.CursorPos.X shl 16) or Mouse.CursorPos.Y )
8954                            else
8955                                    Handled := False;
8956    
8957    {
8958    //                      if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
8959                                    // TWebBrowser の Handle と比較しても一致しないので座標で TWebBrowser かどうか判定
8960                                    browserPos.X := 0;
8961                                    browserPos.Y := 0;
8962                                    Windows.ClientToScreen( Browser.Handle, browserPos );
8963                                    if (Longword(Mouse.CursorPos.X - browserPos.X) >= Browser.Width)
8964                                    or (Longword(Mouse.CursorPos.Y - browserPos.Y) >= Browser.Height)
8965                                    or (Longword(Mouse.CursorPos.Y - browserPos.Y) < 0)
8966                                    or (Longword(Mouse.CursorPos.Y - browserPos.Y) < 0) then begin
8967    //                              or not FActiveContent.Browser.Focused then
8968                                            // TWebBrowser は無限ループするのでそれ以外ならコントロールに送信
8969                                            if (Wnd <> BrowserToolBar.Handle) and (Wnd <> BrowserNameToolBar.Handle) then
8970                                                    SendMessage( Wnd, WM_MOUSEWHEEL, WheelDelta shl 16, (Mouse.CursorPos.X shl 16) or Mouse.CursorPos.Y )
8971                                            else
8972                                                    Handled := False;
8973                                    end else begin
8974                                            Handled := False;
8975                                    end;
8976    //                      end else begin
8977    //                              SendMessage( Wnd, WM_MOUSEWHEEL, WheelDelta shl 16, (MousePos.X shl 16) or MousePos.Y );
8978    //                      end;
8979    }               end;
8980          end;          end;
8981  end;  end;
8982    
# Line 8664  begin Line 9013  begin
9013                  ModifySelectList;                  ModifySelectList;
9014          end else if Length( SelectComboBox.Text ) = 0 then          end else if Length( SelectComboBox.Text ) = 0 then
9015          begin          begin
9016                  AllItemAction.Checked := True;                  {* SelectComboBox.Textが空でも、入力途中でEscしたとか
9017                  LogItemAction.Checked := False;                   * 空のときにDelキーを押したとかなので、スレの絞込みを維持する。
9018                  NewItemAction.Checked := False;                   * (ここでは何もしない)
9019                     *}
9020          end else begin          end else begin
9021                  // チラつくと嫌だから、一応押してあるときだけ処理する                  // チラつくと嫌だから、一応押してあるときだけ処理する
9022                  if AllItemAction.Checked then                  if AllItemAction.Checked then
# Line 8797  begin Line 9147  begin
9147          SelectResAction.Enabled := (GetActiveContent <> nil) and (GetActiveContent.IsLogFile);          SelectResAction.Enabled := (GetActiveContent <> nil) and (GetActiveContent.IsLogFile);
9148  end;  end;
9149    
 procedure TGikoForm.FormKeyUp(Sender: TObject; var Key: Word;  
         Shift: TShiftState);  
 begin  
 end;  
   
9150  // 全てのレスを表示  // 全てのレスを表示
9151  procedure TGikoForm.AllResActionExecute(Sender: TObject);  procedure TGikoForm.AllResActionExecute(Sender: TObject);
9152  var  var
# Line 9306  end; Line 9651  end;
9651  procedure TGikoForm.FavoriteTreeViewKeyDown(Sender: TObject; var Key: Word;  procedure TGikoForm.FavoriteTreeViewKeyDown(Sender: TObject; var Key: Word;
9652          Shift: TShiftState);          Shift: TShiftState);
9653  begin  begin
9654            if not TTreeView(Sender).IsEditing then begin
9655          Case Key of                  Case Key of
9656          VK_F2:                  VK_F2:
9657                  begin                          begin
9658                          FClickNode := FavoriteTreeView.Selected;                                  FClickNode := FavoriteTreeView.Selected;
9659                          FavoriteTreeViewRenameActionExecute( Sender );                                  FavoriteTreeViewRenameActionExecute( Sender );
9660                  end;                          end;
9661          VK_DELETE:                  VK_DELETE:
9662                  begin                          begin
9663                          FClickNode := FavoriteTreeView.Selected;                                  FClickNode := FavoriteTreeView.Selected;
9664                          FavoriteTreeViewDeleteActionExecute( Sender );                                  FavoriteTreeViewDeleteActionExecute( Sender );
9665                  end;                          end;
9666          VK_RETURN:                  VK_RETURN:
9667                  begin                          begin
9668                  FavoriteClick( FavoriteTreeView.Selected );                          FavoriteClick( FavoriteTreeView.Selected );
9669                  FavoriteTreeView.Selected.Expanded := not FavoriteTreeView.Selected.Expanded;                          FavoriteTreeView.Selected.Expanded := not FavoriteTreeView.Selected.Expanded;
9670                            end;
9671                    VK_SPACE:
9672                            FavoriteTreeViewDblClick( Sender );
9673                  end;                  end;
         VK_SPACE:  
                 FavoriteTreeViewDblClick( Sender );  
9674          end;          end;
9675    
9676  end;  end;
# Line 9576  end; Line 9922  end;
9922  procedure TGikoForm.FavoriteTreeViewLogDeleteActionExecute(  procedure TGikoForm.FavoriteTreeViewLogDeleteActionExecute(
9923          Sender: TObject);          Sender: TObject);
9924  const  const
9925          DEL_MSG = '“^0”のログをを削除します。よろしいですか?';          DEL_MSG = '“^0”のログを削除します。よろしいですか?';
9926          DEL_TITLE = '削除確認';          DEL_TITLE = '削除確認';
9927  var  var
9928          ThreadItem: TThreadItem;          ThreadItem: TThreadItem;
# Line 9719  begin Line 10065  begin
10065                  ThreadItem := FavThread.Item;                  ThreadItem := FavThread.Item;
10066    
10067                  try                  try
10068                          s := ThreadItem.URL + #13#10 + ThreadItem.Title + #13#10;                          s := ThreadItem.Title + #13#10 + ThreadItem.URL + #13#10;
10069                          if s <> '' then                          if s <> '' then
10070                                  Clipboard.AsText := s;                                  Clipboard.AsText := s;
10071                  finally                  finally
# Line 9734  begin Line 10080  begin
10080                                  GikoSys.ReadSubjectFile(Board);                                  GikoSys.ReadSubjectFile(Board);
10081    
10082                  try                  try
10083                          s := Board.URL + #13#10 + Board.Title + #13#10;                          s := Board.Title + #13#10 + Board.URL + #13#10;
10084                          if s <> '' then                          if s <> '' then
10085                                  Clipboard.AsText := s;                                  Clipboard.AsText := s;
10086                  finally                  finally
# Line 9791  procedure TGikoForm.BrowserTabMouseUp(Se Line 10137  procedure TGikoForm.BrowserTabMouseUp(Se
10137  begin  begin
10138          if FDragWFirst <> true then begin          if FDragWFirst <> true then begin
10139                  FDragWFirst := false;                  FDragWFirst := false;
10140          end else if (X = FMouseDownPos.X) and (Y = FMouseDownPos.Y) then begin  {
10141            end else if (abs( X - FMouseDownPos.X ) < Mouse.DragThreshold)
10142            and (abs( Y - FMouseDownPos.Y ) < Mouse.DragThreshold) then begin
10143    (*}
10144            end else begin
10145    //*)
10146                  if GikoSys.Setting.ListOrientation = gloHorizontal then begin                  if GikoSys.Setting.ListOrientation = gloHorizontal then begin
10147                          if GikoSys.Setting.ListWidthState = glsMin then begin                          if GikoSys.Setting.ListWidthState = glsMin then begin
10148                                  BrowserMaxAndFocusAction.Execute;                                  BrowserMaxAndFocusAction.Execute;
# Line 9875  end; Line 10226  end;
10226  procedure TGikoForm.SetListViewBackGroundColor(value: TColor);  procedure TGikoForm.SetListViewBackGroundColor(value: TColor);
10227  begin  begin
10228          if FListViewBackGroundColor <> value then begin          if FListViewBackGroundColor <> value then begin
10229                          FListViewBackGroundColor := value;                  FListViewBackGroundColor := value;
10230                                  ListView.Color := FListViewBackGroundColor;                  ListView.Color := FListViewBackGroundColor;
10231                  end;          end;
10232  end;  end;
10233  procedure TGikoForm.ExportFavoriteFileBeforeExecute(Sender: TObject);  procedure TGikoForm.ExportFavoriteFileBeforeExecute(Sender: TObject);
10234  begin  begin
# Line 10064  end; Line 10415  end;
10415  procedure TGikoForm.TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);  procedure TGikoForm.TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);
10416  var  var
10417          i: Integer;          i: Integer;
10418          j: Integer;                                  j: Integer;
10419          tempString: string;                                  tempString: string;
10420          tmpURL: string;                                  tmpURL: string;
10421          oldHost: string;                                  oldHost: string;
10422          oldBoardName: string;                                  oldBoardName: string;
10423          newHost: string;                                  newHost: string;
10424          newBoardName: string;                                  newBoardName: string;
10425          TabList: TStringList;                                  TabList: TStringList;
10426  begin  begin
10427      TabList := TStringList.Create;                  TabList := TStringList.Create;
10428      if oldURLs.Count <> newURLs.Count then                  if oldURLs.Count <> newURLs.Count then
10429          Exit;                          Exit;
10430      //ここから、BoardのURLの変更                  //ここから、BoardのURLの変更
10431      for j :=0 to oldURLs.Count - 1 do begin                  for j :=0 to oldURLs.Count - 1 do begin
10432                  for i :=0 to TabList.Count - 1 do begin                  for i :=0 to TabList.Count - 1 do begin
10433                          if TabList.Text = oldURLs[j] then                          if TabList.Text = oldURLs[j] then
10434                  TabList.Text := newURLs[j];                                                          TabList.Text := newURLs[j];
10435          end;                          end;
10436      end;                  end;
10437      //ここまで、BoardのURLの変更                  //ここまで、BoardのURLの変更
10438    
10439      //ここから、ThreadのURLの変更                  //ここから、ThreadのURLの変更
10440      //面倒だけどthreadはそれぞれURLをチャックしながらやってかなきゃいけない。                  //面倒だけどthreadはそれぞれURLをチャックしながらやってかなきゃいけない。
10441      for i := 0 to oldURLs.Count - 1 do begin                  for i := 0 to oldURLs.Count - 1 do begin
10442          tmpURL                  := Copy(oldURLs[i], 1, Length(oldURLs[i]) -1);                                  tmpURL                  := Copy(oldURLs[i], 1, Length(oldURLs[i]) -1);
10443          oldHost                 := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );                                  oldHost                 := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );
10444          oldBoardName    := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';                                  oldBoardName    := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';
10445          tmpURL                  := Copy(newURLs[i], 1, Length(newURLs[i]) -1);                                  tmpURL                  := Copy(newURLs[i], 1, Length(newURLs[i]) -1);
10446          newHost                 := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );                                  newHost                 := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );
10447          newBoardName    := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';                                  newBoardName    := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';
10448    
10449          for j := 0 to TabList.Count - 1 do begin                                  for j := 0 to TabList.Count - 1 do begin
10450              tempString := TabList.Text;                                                  tempString := TabList.Text;
10451              if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin                                                  if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin
10452                  tempString := StringReplace(tempString, oldHost, newHost,[]);                                                          tempString := StringReplace(tempString, oldHost, newHost,[]);
10453                  TabList.Text := tempString;                                                                  TabList.Text := tempString;
10454              end;                                                  end;
10455          end;                                  end;
10456  end;  end;
10457      //ここまで、ThreadのURLの変更                  //ここまで、ThreadのURLの変更
10458    
10459  end;  end;
10460    
10461  // 最小化される  /// 最小化される
10462  procedure TGikoForm.OnMinimize;  procedure TGikoForm.OnMinimize;
10463  begin  begin
10464          FIsMinimize := mtMinimizing;          if FActiveContent <> nil then begin
10465          if FActiveContent <> nil then                  FIsMinimize := mtMinimizing;
10466                  FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;                  FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop;
10467          PostMessage( Handle, USER_MINIMIZED, 0, 0 );          end;
10468  end;  end;
10469    
10470  // 最小化された  /// 最小化された (OnResized から呼ばれる)
10471  procedure TGikoForm.OnMinimized;  procedure TGikoForm.OnMinimized;
10472  begin  begin
10473          FIsMinimize := mtMinimized;          FIsMinimize := mtMinimized;
         FIsIgnoreResize := False;  
10474  end;  end;
10475    
10476  procedure TGikoForm.CoolBarResized(Sender: TObject; CoolBar: TCoolBar);  procedure TGikoForm.CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
# Line 10131  var Line 10481  var
10481          affectedBand    : TCoolBand;          affectedBand    : TCoolBand;
10482          i                                                       : Integer;          i                                                       : Integer;
10483  begin  begin
10484          if (FOldFormWidth = Width) and not IsIconic( Handle ) and not FIsIgnoreResize then begin          if (FOldFormWidth = Width) and not IsIconic( Handle ) and (FIsIgnoreResize = rtNone) then begin
10485                  FIsIgnoreResize := True;                  FIsIgnoreResize := rtResizing;
10486                  PostMessage( Handle, USER_RESIZED, 0, 0 );                  PostMessage( Handle, USER_RESIZED, 0, 0 );
10487                  if not (Sender is TToolBar) or (CoolBar = nil) then                  if not (Sender is TToolBar) or (CoolBar = nil) then
10488                          Exit;                          Exit;
# Line 10273  begin Line 10623  begin
10623  end;  end;
10624  // TreeView がクリックされた  // TreeView がクリックされた
10625  procedure TGikoForm.TreeClick( Node : TTreeNode );  procedure TGikoForm.TreeClick( Node : TTreeNode );
 var  
         i: Integer;  
10626  begin  begin
10627    
10628          if Node = nil then          if Node = nil then
# Line 10288  begin Line 10636  begin
10636                  Exit;                  Exit;
10637          end;          end;
10638    
10639          if GetActiveList is TBBS then begin          ActiveListColumnSave;
                 for i := 0 to ListView.Columns.Count - 1 do  
                         GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;  
         end else if GetActiveList is TCategory then begin  
                 for i := 0 to ListView.Columns.Count - 1 do  
                         GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;  
         end else if GetActiveList is TBoard then begin  
                 for i := 0 to ListView.Columns.Count - 1 do  
                         GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;  
         end;  
10640    
10641          if TObject(Node.Data) is TBBS then begin          if TObject(Node.Data) is TBBS then begin
10642                  SetActiveList(Node.data);                  SetActiveList(Node.data);
# Line 10412  end; Line 10751  end;
10751    
10752  // ギコナビのメッセージループを横取りします  // ギコナビのメッセージループを横取りします
10753  procedure TGikoForm.HandleAppMessage(var Msg: TMsg; var Handled: Boolean);  procedure TGikoForm.HandleAppMessage(var Msg: TMsg; var Handled: Boolean);
   
10754  //var  //var
10755  //      key                             : Word;  //      key                             : Word;
10756  begin  begin
# Line 10478  end; Line 10816  end;
10816  procedure TGikoForm.MessagePanelResize(Sender: TObject);  procedure TGikoForm.MessagePanelResize(Sender: TObject);
10817  begin  begin
10818    
10819          if FIsIgnoreResize then          if FIsIgnoreResize <> rtNone then
10820                  Exit;                  Exit;
10821    
10822          if GikoSys.Setting.ListOrientation = gloVertical then begin          if GikoSys.Setting.ListOrientation = gloVertical then begin
# Line 10491  begin Line 10829  begin
10829  end;  end;
10830    
10831  procedure TGikoForm.OnResized;  procedure TGikoForm.OnResized;
10832    var
10833            doc                                             : Variant;
10834  begin  begin
10835    
10836          FOldFormWidth := Width;          FOldFormWidth := Width;
10837          FIsIgnoreResize := False;          FIsIgnoreResize := rtNone;
10838    
10839            case FIsMinimize of
10840            mtMinimizing:
10841                    begin
10842                            // 最小化中である
10843                            PostMessage( Handle, USER_MINIMIZED, 0, 0 );
10844                    end;
10845    
10846            mtMinimized:
10847                    begin
10848                            // 最小化は既に完了している (つまりタスクバーからウィンドウを復元中)
10849                            if FActiveContent <> nil then begin
10850                                    doc := Idispatch( olevariant(FActiveContent.Browser.ControlInterface).Document) as IHTMLDocument2;
10851                                    doc.Body.ScrollTop := FActiveContent.Thread.ScrollTop;
10852                            end;
10853                            FIsMinimize := mtNone;
10854                    end;
10855            end;
10856    
10857  end;  end;
10858    
# Line 10810  begin Line 11168  begin
11168                  SelectListItem(List);                  SelectListItem(List);
11169                  for i := 0 to List.Count - 1 do begin                  for i := 0 to List.Count - 1 do begin
11170                          if TObject(List[i]) is TThreadItem then begin                          if TObject(List[i]) is TThreadItem then begin
11171                                  TThreadItem(List[i]).UnRead := false;                                  if (TThreadItem(List[i]).UnRead) then begin
11172                                  TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead - 1;                                          TThreadItem(List[i]).UnRead := false;
11173                                            TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead - 1;
11174                                    end;
11175                          end;                          end;
11176                  end;                  end;
11177                  if TreeView.Visible then                  if TreeView.Visible then
11178                          TreeView.Refresh;                          TreeView.Refresh;
11179                    if ListView.Visible then
11180                    ListView.Refresh;
11181          finally          finally
11182                  List.Free;                  List.Free;
11183          end;          end;
# Line 10831  begin Line 11193  begin
11193                  SelectListItem(List);                  SelectListItem(List);
11194                  for i := 0 to List.Count - 1 do begin                  for i := 0 to List.Count - 1 do begin
11195                          if TObject(List[i]) is TThreadItem then begin                          if TObject(List[i]) is TThreadItem then begin
11196                                  TThreadItem(List[i]).UnRead := true;                                  if (TThreadItem(List[i]).IsLogFile) and (not TThreadItem(List[i]).UnRead) then begin
11197                                  TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead + 1;                                          TThreadItem(List[i]).UnRead := true;
11198                                            TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead + 1;
11199                                    end;
11200                          end;                          end;
11201                  end;                  end;
11202                  if TreeView.Visible then                  if TreeView.Visible then
11203                          TreeView.Refresh;                          TreeView.Refresh;
11204                    if ListView.Visible then
11205                    ListView.Refresh;
11206          finally          finally
11207                  List.Free;                  List.Free;
11208          end;          end;
# Line 10847  procedure TGikoForm.BrowserPanelCanResiz Line 11213  procedure TGikoForm.BrowserPanelCanResiz
11213  var  var
11214          i: Integer;          i: Integer;
11215  begin  begin
11216          for i := 0 to BROWSER_COUNT - 1 do          for i := BROWSER_COUNT - 1 downto 0 do begin
11217                  SetWindowPos(TWebBrowser(FBrowsers[i]).Handle, HWND_NOTOPMOST, 0, 0, NewWidth, NewHeight, SWP_NOMOVE + SWP_NOZORDER);                  SetWindowPos(TWebBrowser(FBrowsers[i]).Handle, HWND_NOTOPMOST, 0, 0, NewWidth, NewHeight, SWP_NOMOVE + SWP_NOZORDER);
   
         if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin  
                 SetWindowPos(FActiveContent.Browser.Handle, HWND_NOTOPMOST, 0, 0, NewWidth, NewHeight, SWP_NOMOVE + SWP_NOZORDER);  
11218          end;          end;
11219  end;  end;
11220    
# Line 10918  end; Line 11281  end;
11281    
11282  function TGikoForm.SaveTabURLs : Boolean;  function TGikoForm.SaveTabURLs : Boolean;
11283  var  var
11284          SaveStringList: TStringList;          SaveStringList, BackStrList: TStringList;
11285  begin  begin
11286          SaveStringList := TStringList.Create;          SaveStringList := TStringList.Create;
11287            BackStrList := TStringList.Create;
11288    
11289            //バックアップ
11290            BackStrList.LoadFromFile(ExtractFilePath(Application.ExeName) + 'tab.sav');
11291            BackStrList.SaveToFile(ExtractFilePath(Application.ExeName) + '~tab.sav');
11292            BackStrList.Free;
11293            //バックアップを作る。
11294          try          try
11295                  Result := GetTabURLs(SaveStringList);                  Result := GetTabURLs(SaveStringList);
11296                    if not Result then begin
11297                     Exit; //逃げ
11298                    end;
11299                  SaveStringList.SaveToFile(ExtractFilePath(Application.ExeName) + 'tab.sav');                  SaveStringList.SaveToFile(ExtractFilePath(Application.ExeName) + 'tab.sav');
11300          finally          finally
11301                  SaveStringList.Free                  SaveStringList.Free;
11302          end;          end;
11303  end;  end;
11304    
# Line 10990  end; Line 11363  end;
11363  procedure TGikoForm.TabsSaveToFileActionExecute(Sender: TObject);  procedure TGikoForm.TabsSaveToFileActionExecute(Sender: TObject);
11364  var  var
11365          SaveTabList: TStringList;          SaveTabList: TStringList;
11366          Result: Boolean;          Result: Boolean;
11367  begin  begin
11368          SaveTabList := TStringList.Create;          SaveTabList := TStringList.Create;
11369          try          try
# Line 11211  begin Line 11584  begin
11584          LoadTabURLs;          LoadTabURLs;
11585  end;  end;
11586    
11587    /// ListView のカラム幅および位置の保存
11588    procedure TGikoForm.ActiveListColumnSave;
11589    var
11590            ActivListObj    : TObject;
11591            i, id, idx              : Integer;
11592            BBSOrder                        : TGikoBBSColumnList;
11593            CategoryOrder   : TGikoCategoryColumnList;
11594            BoardOrder              : TGikoBoardColumnList;
11595    begin
11596    
11597            ActivListObj := ActiveList;
11598            if ActivListObj is TBBS then begin
11599                    //===== カテゴリリスト =====
11600                    BBSOrder := TGikoBBSColumnList.Create;
11601                    try
11602                            for i := 0 to ListView.Columns.Count - 1 do begin
11603                                    // 順序の取得
11604                                    idx := ListView.Column[ i ].Tag;
11605                                    id := Ord( GikoSys.Setting.BBSColumnOrder[ idx ] );
11606                                    BBSOrder.Add( TGikoBBSColumnID( id ) );
11607                                    // 幅の保存
11608                                    GikoSys.Setting.BBSColumnWidth[ id ] := ListView.Column[ i ].Width;
11609                            end;
11610                            for i := 0 to ListView.Columns.Count - 1 do
11611                                    // 順序の保存
11612                                    GikoSys.Setting.BBSColumnOrder[ i ] := BBSOrder[ i ];
11613                    finally
11614                            BBSOrder.Free;
11615                    end;
11616            end else if ActivListObj is TCategory then begin
11617                    //===== 板リスト =====
11618                    CategoryOrder := TGikoCategoryColumnList.Create;
11619                    try
11620                            for i := 0 to ListView.Columns.Count - 1 do begin
11621                                    // 順序の取得
11622                                    idx := ListView.Column[ i ].Tag;
11623                                    id := Ord( GikoSys.Setting.CategoryColumnOrder[ idx ] );
11624                                    CategoryOrder.Add( TGikoCategoryColumnID( id ) );
11625                                    // 幅の保存
11626                                    GikoSys.Setting.CategoryColumnWidth[ id ] := ListView.Column[ i ].Width;
11627                            end;
11628                            for i := 0 to ListView.Columns.Count - 1 do
11629                                    // 順序の保存
11630                                    GikoSys.Setting.CategoryColumnOrder[ i ] := CategoryOrder[ i ];
11631                    finally
11632                            CategoryOrder.Free;
11633                    end;
11634            end else if ActivListObj is TBoard then begin
11635                    //===== スレリスト =====
11636                    BoardOrder := TGikoBoardColumnList.Create;
11637                    try
11638                            for i := 0 to ListView.Columns.Count - 1 do begin
11639                                    // 順序の取得
11640                                    idx := ListView.Column[ i ].Tag;
11641                                    id := Ord( GikoSys.Setting.BoardColumnOrder[ idx ] );
11642                                    BoardOrder.Add( TGikoBoardColumnID( id ) );
11643                                    // 幅の保存
11644                                    GikoSys.Setting.BoardColumnWidth[ id ] := ListView.Column[ i ].Width;
11645                            end;
11646                            for i := 0 to ListView.Columns.Count - 1 do
11647                                    // 順序の保存
11648                                    GikoSys.Setting.BoardColumnOrder[ i ] := BoardOrder[ i ];
11649                    finally
11650                            BoardOrder.Free;
11651                    end;
11652            end;
11653            
11654    end;
11655    
11656    procedure TGikoForm.ListViewColumnRightClick(Sender: TObject;
11657            Column: TListColumn; Point: TPoint);
11658    var
11659            i, j    : Integer;
11660            item    : TMenuItem;
11661    begin
11662    
11663            // ポップアップメニューをクリア
11664            for i := ListColumnPopupMenu.Items.Count - 1 downto 0 do
11665                    ListColumnPopupMenu.Items.Items[ i ].Free;
11666    
11667            // メニューの作成 (メインカラムは必須なのでメニューに含めない)
11668            if TObject( FActiveList ) is TBBS then begin
11669    
11670                    //===== カテゴリリスト =====
11671                    for i := 1 to Length( GikoBBSColumnCaption ) - 1 do begin
11672                            item := TMenuItem.Create( ListColumnPopupMenu );
11673                            item.Caption := GikoBBSColumnCaption[ i ];
11674                            item.Tag := i;
11675                            item.OnClick := ListColumnPopupMenuOnClick;
11676                            for j := GikoSys.Setting.BBSColumnOrder.Count - 1 downto 0 do begin
11677                                    if GikoSys.Setting.BBSColumnOrder[ j ] = TGikoBBSColumnID( i ) then begin
11678                                            item.Checked := True;
11679                                            Break;
11680                                    end;
11681                            end;
11682                            ListColumnPopupMenu.Items.Add( item );
11683                    end;
11684    
11685            end else if TObject( FActiveList ) is TCategory then begin
11686    
11687                    //===== 板リスト =====
11688                    for i := 1 to Length( GikoCategoryColumnCaption ) - 1 do begin
11689                            item := TMenuItem.Create( ListColumnPopupMenu );
11690                            item.Caption := GikoCategoryColumnCaption[ i ];
11691                            item.Tag := i;
11692                            item.OnClick := ListColumnPopupMenuOnClick;
11693                            for j := GikoSys.Setting.CategoryColumnOrder.Count - 1 downto 0 do begin
11694                                    if GikoSys.Setting.CategoryColumnOrder[ j ] = TGikoCategoryColumnID( i ) then begin
11695                                            item.Checked := True;
11696                                            Break;
11697                                    end;
11698                            end;
11699                            ListColumnPopupMenu.Items.Add( item );
11700                    end;
11701    
11702            end else if TObject( FActiveList ) is TBoard then begin
11703    
11704                    //===== スレリスト =====
11705                    for i := 1 to Length( GikoBoardColumnCaption ) - 1 do begin
11706                            item := TMenuItem.Create( ListColumnPopupMenu );
11707                            item.Caption := GikoBoardColumnCaption[ i ];
11708                            item.Tag := i;
11709                            item.OnClick := ListColumnPopupMenuOnClick;
11710                            for j := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 0 do begin
11711                                    if GikoSys.Setting.BoardColumnOrder[ j ] = TGikoBoardColumnID( i ) then begin
11712                                            item.Checked := True;
11713                                            Break;
11714                                    end;
11715                            end;
11716                            ListColumnPopupMenu.Items.Add( item );
11717                    end;
11718    
11719            end;
11720    
11721            // メニューの表示
11722            Point := ListView.ClientToScreen( Point );
11723            if ListColumnPopupMenu.Items.Count > 0 then
11724                    ListColumnPopupMenu.Popup( Point.X, Point.Y );
11725    
11726    end;
11727    
11728    /// ListColumnPopupMenu アイテムのクリックイベント
11729    procedure       TGikoForm.ListColumnPopupMenuOnClick( Sender : TObject );
11730    var
11731            i                                       : Integer;
11732            orderList       : TList;
11733            item                    : TMenuItem;
11734    begin
11735    
11736            if not (Sender is TMenuItem) then
11737                    Exit;
11738    
11739            ActiveListColumnSave;
11740            item := TMenuItem( Sender );
11741    
11742            if TObject( FActiveList ) is TBBS then
11743                    orderList := GikoSys.Setting.BBSColumnOrder
11744            else if TObject( FActiveList ) is TCategory then
11745                    orderList := GikoSys.Setting.CategoryColumnOrder
11746            else if TObject( FActiveList ) is TBoard then
11747                    orderList := GikoSys.Setting.BoardColumnOrder
11748            else
11749                    Exit;
11750    
11751            if item.Checked then begin
11752                    // カラムの削除
11753                    for i := orderList.Count - 1 downto 0 do begin
11754                            if Integer( orderList[ i ] ) = item.Tag then begin
11755                                    orderList.Delete( i );
11756                                    Break;
11757                            end;
11758                    end;
11759            end else begin
11760                    // カラムの追加
11761                    orderList.Add( Pointer( item.Tag ) );
11762            end;
11763    
11764            SetActiveList( FActiveList );
11765    
11766    end;
11767    //指定した番号のレスにjumpするAction
11768    procedure TGikoForm.JumpToNumOfResActionExecute(Sender: TObject);
11769    var
11770            str: string;
11771            res: integer;
11772    begin
11773            str := '1';
11774            if( InputQuery('指定した番号のレスに飛ぶ', '番号を入力してください', str) ) then begin
11775                    str := ZenToHan(str);
11776                    res := StrToIntDef(str, -1);
11777                    if (res > 0) and (res <= GetActiveContent.Count) then begin
11778                            BrowserMovement(IntToStr(res), FActiveContent);
11779                            SetFocusForBrowserAction.Execute;
11780                    end else if res > GetActiveContent.Count then begin
11781                            BrowserMovement(IntToStr(GetActiveContent.Count), FActiveContent);
11782                            SetFocusForBrowserAction.Execute;
11783                    end;
11784            end;
11785    end;
11786    
11787    procedure TGikoForm.JumpToNumOfResActionUpdate(Sender: TObject);
11788    begin
11789            JumpToNumOfResAction.Enabled := (GetActiveContent <> nil) and (GetActiveContent.IsLogFile);
11790    end;
11791    
11792    procedure TGikoForm.FavoriteTreeViewCollapseActionExecute(Sender: TObject);
11793    var
11794            node    : TTreeNode;
11795    begin
11796    
11797            node := FavoriteTreeView.Items.GetFirstNode;
11798            while node <> nil do begin
11799                    if node.HasChildren then
11800                            node.Expanded := False;
11801                    node := node.GetNext;
11802            end;
11803    
11804    end;
11805    
11806  initialization  initialization
11807                                  OleInitialize(nil);                                  OleInitialize(nil);
11808  finalization  finalization

Legend:
Removed from v.1.98.2.3  
changed lines
  Added in v.1.98.2.4

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