type
TRoundDialog = class(TForm)
- RoundPopupMenu: TPopupMenu;
- C1: TMenuItem;
- P1: TMenuItem;
+ RoundPopupMenu: TPopupMenu;
+ C1: TMenuItem;
+ P1: TMenuItem;
N1: TMenuItem;
- D1: TMenuItem;
+ D1: TMenuItem;
ItemIcon16: TImageList;
- Panel1: TPanel;
- Label1: TLabel;
- Label2: TLabel;
- RoundNameComboBox: TComboBox;
- Panel2: TPanel;
- Panel3: TPanel;
- AllSelectButton: TButton;
- AllCancelButton: TButton;
- RoundDeleteButton: TButton;
- Panel4: TPanel;
- Button1: TButton;
- RoundButton: TButton;
- StatusBar1: TStatusBar;
- RoundListView: TListView;
+ Panel1: TPanel;
+ Label1: TLabel;
+ Label2: TLabel;
+ RoundNameComboBox: TComboBox;
+ Panel2: TPanel;
+ Panel3: TPanel;
+ AllSelectButton: TButton;
+ AllCancelButton: TButton;
+ RoundDeleteButton: TButton;
+ Panel4: TPanel;
+ Button1: TButton;
+ RoundButton: TButton;
+ StatusBar1: TStatusBar;
+ RoundListView: TListView;
procedure RoundButtonClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure RoundListViewChange(Sender: TObject; Item: TListItem;
procedure AllCancelButtonClick(Sender: TObject);
procedure RoundNameComboBoxChange(Sender: TObject);
procedure RoundDeleteButtonClick(Sender: TObject);
+ procedure RoundListViewColumnClick(Sender: TObject;
+ Column: TListColumn);
+ procedure RoundListViewCompare(Sender: TObject; Item1,
+ Item2: TListItem; Data: Integer; var Compare: Integer);
+ procedure RoundListViewColumnRightClick(Sender: TObject;
+ Column: TListColumn; Point: TPoint);
private
{ Private \90é\8c¾ }
+ FColumnToSort: Integer;
+ FSortOrder: Boolean;
function GetRoundCount: Integer;
procedure SetRoundItem(RoundName: string);
function CompareTime(Time1: TDateTime; Time2: TDateTime; MarginMin: Integer): Boolean;
{ Public \90é\8c¾ }
end;
-//var
-// RoundDialog: TRoundDialog;
implementation
uses
- Giko, BoardGroup, RoundData;
+ Giko, BoardGroup, RoundData, Math, GikoDataModule;
{$R *.DFM}
ThreadItem: TThreadItem;
RoundItem: TRoundItem;
begin
-// if CompareTime(GikoForm.LastRoundTime, Now, 5) then begin
-// msg := '\88ê\93x\8f\84\89ñ\82·\82é\82Æ\82T\95ª\8aÔ\8f\84\89ñ\82Í\8fo\97\88\82Ü\82¹\82ñ';
-// GikoSys.MsgBox(msg, '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
-// Exit;
-// end;
- if not Giko.GikoForm.LoginAction.Checked then begin
- msg := '\83\8d\83O\83C\83\93\82µ\82È\82¢\82Æ\8f\84\89ñ\82Í\8fo\97\88\82Ü\82¹\82ñ' + #13#10
- + '\95ª\82©\82ç\82È\82¢\90l\82Í\83M\83R\83i\83r\83X\83\8c\83b\83h\82Å\95·\82¢\82Ä\82\82¾\82³\82¢';
- MsgBox(Handle, msg, '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
- Exit;
+{$IF Defined(FRCRND) }
+ GikoDM.LoginAction.Checked := true; // \93®\8dì\8e\8e\8c±\97p\93r
+{$IFEND}
+
+{$IFNDEF LOOSENUP} //\8f\84\89ñ\90§\8cÀ\82ð\8aÉ\82ß\82é\82±\82Æ\82É\82µ\82Ä\82½\82ç{$ELSE}\82Ì\95û\82ð\8eg\82¤
+ if not GikoDM.LoginAction.Checked then begin
+ if GikoSys.Setting.UserID <> '' then begin
+ msg := '\83\8d\83O\83C\83\93\82µ\82È\82¢\82Æ\8f\84\89ñ\82Í\8fo\97\88\82Ü\82¹\82ñ' + #13#10
+ + '\8d¡\83\8d\83O\83C\83\93\82µ\82Ü\82·\82©';
+ if MsgBox(Handle, msg, '\8am\94F', MB_YESNO or MB_ICONQUESTION or MB_DEFBUTTON2) <> IDYES then begin
+ Exit;
+ end;
+ GikoDM.LoginAction.Execute;
+ end;
+ if not GikoDM.LoginAction.Checked then begin
+ msg := '\83\8d\83O\83C\83\93\82µ\82È\82¢\82Æ\8f\84\89ñ\82Í\8fo\97\88\82Ü\82¹\82ñ';
+ MsgBox(Handle, msg, '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
+ Exit;
+ end;
+ end;
+{$ELSE}
+ //\8bK\90§\82ð\8aÉ\82ß\82½\82Ù\82¤\82Í\81A\83X\83\8c\88ê\97\97\82Ì\82Ý\8f\84\89ñ\89Â\94\
+ if not GikoDM.LoginAction.Checked then begin
+ if GikoSys.Setting.UserID <> '' then begin
+ msg := '\83\8d\83O\83C\83\93\82µ\82È\82¢\82Æ\83X\83\8c\83b\83h\82Ì\8f\84\89ñ\82Í\8fo\97\88\82Ü\82¹\82ñ' + #13#10
+ + '\8d¡\83\8d\83O\83C\83\93\82µ\82Ü\82·\82©';
+ if MsgBox(Handle, msg, '\8am\94F', MB_YESNO or MB_ICONQUESTION or MB_DEFBUTTON2) <> IDYES then begin
+ Exit;
+ end;
+ GikoDM.LoginAction.Execute;
+ end;
end;
+ //\81\9c\82È\82µ\8f\84\89ñ\82Í15\95ª\88È\8fã\82Ì\8aÔ\8au\82ð\95K\97v\82Æ\82·\82é
+ if not GikoDM.LoginAction.Checked then begin
+ if CompareTime(GikoForm.LastRoundTime, Now, 30) then begin
+ msg := '\88ê\93x\8f\84\89ñ\82·\82é\82Æ\82R\82O\95ª\8aÔ\8f\84\89ñ\82Í\8fo\97\88\82Ü\82¹\82ñ';
+ MsgBox(Handle, msg, '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
+ Exit;
+ end;
+ end;
+{$ENDIF}
+ //\88ê\82Â\82à\8f\84\89ñ\82É\90Ý\92è\82µ\82Ä\82¢\82È\82©\82Á\82½\82ç\83G\83\89\81[\82É\82·\82é
cnt := GetRoundCount;
if cnt = 0 then begin
msg := '\8f\84\89ñ\82µ\82½\82¢\8d\80\96Ú\82É\82P\82Â\88È\8fã\83`\83F\83b\83N\82ð\93ü\82ê\82Ä\82\82¾\82³\82¢';
Exit;
end;
+{$IFNDEF LOOSENUP}
+ //\81\9c\82È\82µ\8f\84\89ñ\82Í\82P\93x\82É100\8cÂ\82Ü\82Å\82É\82·\82é
+ if not GikoDM.LoginAction.Checked then begin
+ if cnt > 100 then begin
+ msg := '\82P\82O\82O\8cÂ\88È\8fã\82Í\88ê\93x\82É\8f\84\89ñ\82Å\82«\82Ü\82¹\82ñ';
+ MsgBox(Handle, msg, '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
+ Exit;
+ end;
+ end;
+{$ENDIF}
+
+ //\8f\84\89ñ\82É\93o\98^\82³\82ê\82Ä\82¢\82é\94Â\82Ì\90\94\82¾\82¯\82Ü\82í\82·
for i := 0 to RoundList.Count[grtBoard] - 1 do begin
RoundItem := RoundList.Items[i, grtBoard];
+ //\8f\84\89ñ\82Ì\83`\83F\83b\83N\82ª\82Â\82¢\82Ä\82¢\82È\82¯\82ê\82Î\83X\83\8b\81[
if not RoundItem.BoolData then Continue;
- if not Giko.GikoForm.LoginAction.Checked then Exit;
+ //\8am\8eÀ\82É\94Â\82Ì\82Í\82¸\82¾\82¯\82Ç\83`\83F\83b\83N
if RoundItem.RoundType = grtBoard then begin
- //Board := TBoard( RoundItem.Item );
- Board := BBSsFindBoardFromURL(RoundItem.URL);
+ Board := TBoard( RoundItem.Item );
+ //Board\82Ì\83I\83u\83W\83F\83N\83g\82ª\91¶\8dÝ\82·\82ê\82Î\81ADL\82·\82é
if Board <> nil then begin
if not Board.IsThreadDatRead then
GikoSys.ReadSubjectFile(Board);
end;
for i := 0 to RoundList.Count[grtItem] - 1 do begin
RoundItem := RoundList.Items[i, grtItem];
+ //\8f\84\89ñ\82Ì\83`\83F\83b\83N\82ª\82Â\82¢\82Ä\82¢\82È\82¯\82ê\82Î\83X\83\8b\81[
if not RoundItem.BoolData then Continue;
- if not Giko.GikoForm.LoginAction.Checked then Exit;
- if RoundItem.RoundType = grtItem then begin
- //ThreadItem := TThreadItem( RoundItem.Item );
- ThreadItem := BBSsFindThreadFromURL(RoundItem.URL);
+{$IFDEF LOOSENUP}
+ //\81\9c\82È\82µ\8f\84\89ñ\82Í\83X\83\8c\83b\83h\82Í\82Å\82«\82È\82¢\82±\82Æ\82É\82·\82é
+ if not GikoDM.LoginAction.Checked then begin
+ msg := '\83\8d\83O\83C\83\93\82µ\82È\82¢\82Æ\83X\83\8c\83b\83h\82Ì\8f\84\89ñ\82Í\82Å\82«\82Ü\82¹\82ñ\81B';
+ MsgBox(Handle, msg, '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
+ break;
+ end;
+{$ENDIF}
+ if RoundItem.RoundType = grtItem then begin
+ ThreadItem := TThreadItem( RoundItem.Item );
if ThreadItem <> nil then begin
-// GikoForm.AddMessageList('debug2:' + IntToStr(i), nil);
GikoForm.DownloadContent(ThreadItem);
end;
end;
end;
-// GikoForm.LastRoundTime := Now;
+ GikoForm.LastRoundTime := Now;
Close;
end;
var
i: Integer;
begin
+ //\8c»\8dÝ\82Ì\8f\84\89ñ\83f\81[\83^\82ð\83t\83@\83C\83\8b\83A\83E\83g\82·\82é
+ RoundList.SaveRoundFile;
RoundNameComboBox.Items.Add('\81i\82·\82×\82Ä\81j');
for i := 0 to RoundList.RoundNameList.Count - 1 do
RoundNameComboBox.Items.Add(RoundList.RoundNameList[i]);
procedure TRoundDialog.RoundNameComboBoxChange(Sender: TObject);
begin
+ //\83J\83\89\83\80\82Ì\83\\81[\83g\8bL\8d\86\83C\83\81\81[\83W\82ð\89ð\8f\9c\82·\82é
+ if FColumnToSort > -1 then
+ RoundListView.Column[FColumnToSort].ImageIndex := -1;
+ FColumnToSort := -1;
if RoundNameComboBox.ItemIndex = 0 then
SetRoundItem('')
else
SetRoundItem(RoundNameComboBox.Items[RoundNameComboBox.itemIndex]);
+
end;
procedure TRoundDialog.SetRoundItem(RoundName: string);
procedure TRoundDialog.RoundDeleteButtonClick(Sender: TObject);
var
- Board: TBoard;
- ThreadItem: TThreadItem;
+// Board: TBoard;
+// ThreadItem: TThreadItem;
RoundItem: TRoundItem;
ListChangeEvent: TLVChangeEvent;
begin
Exit;
if TObject(RoundListView.Selected.Data) is TRoundItem then begin
RoundItem := TRoundItem(RoundListView.Selected.Data);
- RoundList.Delete(RoundItem.URL,RoundItem.RoundType);
- {
+ if( RoundItem.Item is TBoard ) then begin
+ TBoard(RoundItem.Item).Round := false;
+ end else if( RoundItem.Item is TThreadItem ) then begin
+ TThreadItem(RoundItem.Item).Round := false;
+ end;
+ //RoundList.Delete(RoundItem.URL,RoundItem.RoundType);
+ {
if RoundItem.RoundType = grtBoard then begin
//Board := TBoard( RoundItem.Item );
RoundList.Delete(RoundItem.URL,RoundItem.RoundType);
ThreadItem.Round := False;
ThreadItem.RoundName := '';
end;
- }
+ }
GikoForm.ListView.Refresh;
end;
RoundListView.Selected.Delete;
end;
end;
+procedure TRoundDialog.RoundListViewColumnClick(Sender: TObject;
+ Column: TListColumn);
+begin
+ if (Sender is TCustomListView) then begin
+
+ if FColumnToSort > -1 then
+ (Sender as TCustomListView).Column[FColumnToSort].ImageIndex := -1;
+
+ if FColumnToSort = Column.Index then
+ FSortOrder := not FSortOrder
+ else
+ FSortOrder := false;
+
+ if FSortOrder then
+ Column.ImageIndex := 3
+ else
+ Column.ImageIndex := 2;
+
+ FColumnToSort := Column.Index;
+ (Sender as TCustomListView).AlphaSort;
+ end;
+end;
+
+procedure TRoundDialog.RoundListViewCompare(Sender: TObject; Item1,
+ Item2: TListItem; Data: Integer; var Compare: Integer);
+var
+ ix: Integer;
+begin
+ if FColumnToSort = 0 then begin
+ if not FSortOrder then begin
+ Compare := CompareText(Item1.Caption,Item2.Caption);
+ if Compare = 0 then
+ Compare := CompareValue(Item1.ImageIndex, item2.ImageIndex);
+ end else begin
+ Compare := -CompareText(Item1.Caption,Item2.Caption);
+ if Compare = 0 then
+ Compare := -CompareValue(Item1.ImageIndex,item2.ImageIndex);
+ end;
+ end else begin
+ ix := FColumnToSort - 1;
+ if not FSortOrder then begin
+ Compare := CompareText(Item1.SubItems[ix],Item2.SubItems[ix]);
+ if Compare = 0 then
+ Compare := CompareValue(Item1.ImageIndex, item2.ImageIndex);
+ end else begin
+ Compare := -CompareText(Item1.SubItems[ix],Item2.SubItems[ix]);
+ if Compare = 0 then
+ Compare := -CompareValue(Item1.ImageIndex, item2.ImageIndex);
+ end;
+ end;
+end;
+(*
+* \83J\83\89\83\80\8fã\82Å\89E\83N\83\8a\83b\83N\82µ\82½\82ç\83\\81[\83g\82ð\89ð\8f\9c\82µ\82Ä\8f\89\8aú\8fó\91Ô\82É\96ß\82·
+*)
+procedure TRoundDialog.RoundListViewColumnRightClick(Sender: TObject;
+ Column: TListColumn; Point: TPoint);
+begin
+ RoundNameComboBox.OnChange(Sender);
+end;
+
end.