Changeset 1679 for cprs/trunk/CPRS-Chart/Orders/fOMSet.pas
- Timestamp:
- May 7, 2015, 12:34:29 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/Orders/fOMSet.pas
r829 r1679 109 109 SetItem: TSetItem; 110 110 theOwner: TComponent; 111 ok: boolean; 111 112 112 113 procedure SkipToNext; 113 114 begin 115 if FClosing then Exit; 114 116 lstSet.Checked[lstSet.ItemIndex] := True; 115 117 DoNextItem; … … 117 119 118 120 begin 119 DoingNextItem := true;121 DoingNextItem := true; 120 122 //frmFrame.UpdatePtInfoOnRefresh; 121 123 if FClosing then Exit; … … 144 146 'A': if not ActivateAction(IntToStr(SetItem.DialogIEN), Self, ItemIndex) then 145 147 begin 146 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then 147 lstSet.Checked[lstSet.ItemIndex] := True 148 else SkipToNext; 148 if Not FClosing then 149 begin 150 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then 151 lstSet.Checked[lstSet.ItemIndex] := True 152 else SkipToNext; 153 end; 149 154 end; 150 155 'D', 'Q': if not ActivateOrderDialog(IntToStr(SetItem.DialogIEN), FDelayEvent, Self, ItemIndex) then 156 begin 157 if Not FClosing then 158 begin 159 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then 160 lstSet.Checked[lstSet.ItemIndex] := True 161 else SkipToNext; 162 end; 163 end; 164 'M': begin 165 ok := ActivateOrderMenu(IntToStr(SetItem.DialogIEN), FDelayEvent, Self, ItemIndex); 166 if not FClosing then 167 begin 168 if ok then 169 Inc(FActiveMenus) 170 else 171 begin 172 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then 173 lstSet.Checked[lstSet.ItemIndex] := True 174 else 175 SkipToNext; 176 end; 177 end; 178 end; 179 'O': begin 180 if (Self.Owner.Name = 'frmOMNavA') then theOwner := Self.Owner else theOwner := self; 181 if not ActivateOrderSet( IntToStr(SetItem.DialogIEN), FDelayEvent, theOwner, ItemIndex) then 151 182 begin 152 183 if Not FClosing then … … 157 188 end; 158 189 end; 159 'M': if ActivateOrderMenu( IntToStr(SetItem.DialogIEN), FDelayEvent, Self, ItemIndex)160 then Inc(FActiveMenus)161 else162 begin163 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then164 lstSet.Checked[lstSet.ItemIndex] := True165 else166 SkipToNext;167 end;168 'O': begin169 if (Self.Owner.Name = 'frmOMNavA') then theOwner := Self.Owner else theOwner := self;170 if not ActivateOrderSet( IntToStr(SetItem.DialogIEN), FDelayEvent, theOwner, ItemIndex) then171 begin172 if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then173 lstSet.Checked[lstSet.ItemIndex] := True174 else SkipToNext;175 end;176 190 end; 177 191 else begin … … 186 200 procedure TfrmOMSet.UMDelayEvent(var Message: TMessage); 187 201 begin 202 if CloseRequested then 203 begin 204 Close; 205 if Not FClosing then 206 begin 207 CloseRequested := False; 208 FClosing := False; 209 DoNextItem; 210 end 211 else Exit; 212 end; 188 213 // ignore if delay from other than current itemindex 189 214 // (prevents completion of an order set from calling DoNextItem) 190 215 if Message.WParam = lstSet.ItemIndex then 191 216 if lstSet.ItemIndex < lstSet.Items.Count - 1 then DoNextItem else Close; 192 if CloseRequested then193 Close;194 217 end; 195 218 … … 252 275 else if lstSet.ItemIndex < (lstSet.Items.Count - 1) 253 276 then CanClose := InfoBox(TX_STOP, TC_STOP, MB_YESNO) = IDYES; 277 FClosing := CanClose; 254 278 end; 255 279 … … 281 305 begin 282 306 if DoingNextItem then 283 CloseRequested := true //Fix for CQ: 8297 307 begin 308 CloseRequested := true; //Fix for CQ: 8297 309 FClosing := true; 310 end 284 311 else 285 312 Close;
Note:
See TracChangeset
for help on using the changeset viewer.