ギコナビ
Revision | dd0fe2f92749f1eb134c02c486782bd2b080557a (tree) |
---|---|
Time | 2005-07-09 23:48:11 |
Author | h677 <h677> |
Commiter | h677 |
巡回予約削除と新しい名前での巡回がショートカットorツールバーのボタンから
呼ばれると正常に動作しない不具合の修正
@@ -6714,25 +6714,40 @@ procedure TGikoForm.SelectNewRoundNameExecute(Sender: TObject); | ||
6714 | 6714 | var |
6715 | 6715 | s: string; |
6716 | 6716 | Dlg: TRoundNameDialog; |
6717 | - cnt: Integer; | |
6717 | + cnt: Integer; | |
6718 | 6718 | |
6719 | 6719 | begin |
6720 | - //o^ãÀ`FbN | |
6721 | - cnt := RoundList.Count[grtBoard]; | |
6722 | - cnt := cnt + RoundList.Count[grtItem]; | |
6723 | - if cnt > 500 then begin | |
6724 | - MsgBox(Handle, 'ñÍ500Èão^ūܹñ', 'G[', MB_OK or MB_ICONSTOP); | |
6725 | - Exit; | |
6726 | - end; | |
6720 | + //ÄÑoµ³ªATActionÅListViewÉIðª¢È¯êÎAEXIT·é | |
6721 | + if (Sender is TAction) and (ListView.Selected = nil) then | |
6722 | + Exit; | |
6723 | + | |
6724 | + //o^ãÀ`FbN | |
6725 | + cnt := RoundList.Count[grtBoard]; | |
6726 | + cnt := cnt + RoundList.Count[grtItem]; | |
6727 | + if cnt > 500 then begin | |
6728 | + MsgBox(Handle, 'ñÍ500Èão^ūܹñ', 'G[', MB_OK or MB_ICONSTOP); | |
6729 | + Exit; | |
6730 | + end; | |
6727 | 6731 | |
6728 | 6732 | Dlg := TRoundNameDialog.Create(Self); |
6729 | 6733 | try |
6730 | 6734 | Dlg.ShowModal; |
6731 | 6735 | if Dlg.ModalResult <> mrCancel then begin |
6732 | 6736 | s := Trim(Dlg.RoundNameEdit.Text); |
6733 | - //RoundList.RoundNameList.Add(s); | |
6734 | - SetSelectItemRound(True, s, TMenuItem(Sender).Parent.Name); | |
6735 | - ListView.Refresh; | |
6737 | + if (Sender is TMenuItem) then begin | |
6738 | + SetSelectItemRound(True, s, TMenuItem(Sender).Parent.Name); | |
6739 | + end else if (Sender is TAction) then begin | |
6740 | + if (ListView.Selected <> nil) then begin | |
6741 | + if (TObject(ListView.Selected.Data) is TThreadItem) then begin | |
6742 | + SetSelectItemRound(True, s, | |
6743 | + TThreadItem(ListView.Selected.Data).Title); | |
6744 | + end else if (TObject(ListView.Selected.Data) is TBoard) then begin | |
6745 | + SetSelectItemRound(True, s, | |
6746 | + TBoard(ListView.Selected.Data).Title); | |
6747 | + end; | |
6748 | + end; | |
6749 | + end; | |
6750 | + ListView.Refresh; | |
6736 | 6751 | end; |
6737 | 6752 | finally |
6738 | 6753 | Dlg.Free; |
@@ -6788,8 +6803,28 @@ begin | ||
6788 | 6803 | end; |
6789 | 6804 | |
6790 | 6805 | procedure TGikoForm.SelectDeleteRoundExecute(Sender: TObject); |
6806 | +var | |
6807 | + s : String; | |
6791 | 6808 | begin |
6792 | - SetSelectItemRound(False, '', TMenuItem(Sender).Parent.Name); | |
6809 | + if (Sender is TMenuItem) then begin | |
6810 | + try | |
6811 | + SetSelectItemRound(False, '', TMenuItem(Sender).Parent.Name); | |
6812 | + except | |
6813 | + end; | |
6814 | + end else if (Sender is TAction) then begin | |
6815 | + try | |
6816 | + if ListView.Selected <> nil then begin | |
6817 | + if (TObject(ListView.Selected.Data) is TThreadItem) then begin | |
6818 | + s := TThreadItem(ListView.Selected.Data).Title; | |
6819 | + end else if (TObject(ListView.Selected.Data) is TBoard) then begin | |
6820 | + s := TBoard(ListView.Selected.Data).Title; | |
6821 | + end; | |
6822 | + SetSelectItemRound(False, '', s); | |
6823 | + | |
6824 | + end; | |
6825 | + except | |
6826 | + end; | |
6827 | + end; | |
6793 | 6828 | ListView.Refresh; |
6794 | 6829 | end; |
6795 | 6830 |