From: Robert M. <mar...@us...> - 2004-07-26 12:58:15
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32412/JVCL3/run Modified Files: JvDBControls.pas JvDBDateTimePicker.pas JvDBGrid.pas Log Message: tighten Shift handling Index: JvDBGrid.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvDBGrid.pas,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** JvDBGrid.pas 22 Jul 2004 17:13:22 -0000 1.62 --- JvDBGrid.pas 26 Jul 2004 12:58:04 -0000 1.63 *************** *** 623,627 **** function Ctrl: Boolean; begin ! Result := ssCtrl in Shift; end; --- 623,627 ---- function Ctrl: Boolean; begin ! Result := (Shift * KeyboardShiftStates = [ssCtrl]); end; *************** *** 675,679 **** // Ideally we would transmit the action to the DatalList but // DoMouseWheel is protected ! // Result := FDataList.DoMouseWheel(Shift, WheelDelta, MousePos); Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); end; --- 675,679 ---- // Ideally we would transmit the action to the DatalList but // DoMouseWheel is protected ! // Result := FDataList.DoMouseWheel(Shift, WheelDelta, MousePos); Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos); end; *************** *** 1026,1030 **** try if MultiSelect and DataLink.Active then ! if Select and (ssShift in Shift) then begin if not FSelecting then --- 1026,1030 ---- try if MultiSelect and DataLink.Active then ! if Select and (Shift * KeyboardShiftStates = [ssShift]) then begin if not FSelecting then *************** *** 1120,1124 **** Exit; with DataLink.DataSet do ! if ssCtrl in Shift then begin if Key in [VK_UP, VK_PRIOR, VK_DOWN, VK_NEXT, VK_HOME, VK_END] then --- 1120,1124 ---- Exit; with DataLink.DataSet do ! if (Shift * KeyboardShiftStates = [ssCtrl]) then begin if Key in [VK_UP, VK_PRIOR, VK_DOWN, VK_NEXT, VK_HOME, VK_END] then *************** *** 1148,1168 **** else begin ! case Key of ! VK_LEFT: ! if (FixedCols > 0) and not (dgRowSelect in Options) then ! begin ! if SelectedIndex <= CalcLeftColumn - IndicatorOffset then Exit; ! end; ! VK_HOME: ! if (FixedCols > 0) and (ColCount <> IndicatorOffset + 1) and ! not (dgRowSelect in Options) then ! begin ! SelectedIndex := CalcLeftColumn - IndicatorOffset; ! Exit; ! end; ! end; ! if DataLink.DataSet.State = dsBrowse then ! begin case Key of VK_UP: --- 1148,1166 ---- else begin ! if Shift * KeyboardShiftStates = [] then ! case Key of ! VK_LEFT: ! if (FixedCols > 0) and not (dgRowSelect in Options) then ! if SelectedIndex <= CalcLeftColumn - IndicatorOffset then ! Exit; ! VK_HOME: ! if (FixedCols > 0) and (ColCount <> IndicatorOffset + 1) and ! not (dgRowSelect in Options) then ! begin ! SelectedIndex := CalcLeftColumn - IndicatorOffset; Exit; ! end; ! end; ! if (DataLink.DataSet.State = dsBrowse) and (Shift * KeyboardShiftStates = []) then case Key of VK_UP: *************** *** 1177,1186 **** end; end; - end; if ((Key in [VK_LEFT, VK_RIGHT]) and (dgRowSelect in Options)) or ((Key in [VK_HOME, VK_END]) and ((ColCount = IndicatorOffset + 1) or ! (dgRowSelect in Options))) or (Key in [VK_ESCAPE, VK_NEXT, ! VK_PRIOR]) or ((Key = VK_INSERT) and (CanModify and ! (not ReadOnly) and (dgEditing in Options))) then ClearSelections else --- 1175,1182 ---- end; end; if ((Key in [VK_LEFT, VK_RIGHT]) and (dgRowSelect in Options)) or ((Key in [VK_HOME, VK_END]) and ((ColCount = IndicatorOffset + 1) or ! (dgRowSelect in Options))) or (Key in [VK_ESCAPE, VK_NEXT, VK_PRIOR]) or ! ((Key = VK_INSERT) and (CanModify and (not ReadOnly) and (dgEditing in Options))) then ClearSelections else *************** *** 1638,1642 **** if not AcquireFocus then Exit; ! if ssCtrl in Shift then Distance := VisibleRowCount - 1 else --- 1634,1638 ---- if not AcquireFocus then Exit; ! if Shift * KeyboardShiftStates = [ssCtrl] then Distance := VisibleRowCount - 1 else *************** *** 1795,1803 **** begin FSelecting := False; ! if ssCtrl in Shift then CurrentRowSelected := not CurrentRowSelected else begin ! if (ssShift in Shift) and (Count > 0) then begin lLastSelected := Items[Count - 1]; --- 1791,1799 ---- begin FSelecting := False; ! if Shift * KeyboardShiftStates = [ssCtrl] then CurrentRowSelected := not CurrentRowSelected else begin ! if (Shift * KeyboardShiftStates = [ssShift]) and (Count > 0) then begin lLastSelected := Items[Count - 1]; Index: JvDBControls.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvDBControls.pas,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** JvDBControls.pas 20 Jul 2004 14:31:04 -0000 1.69 --- JvDBControls.pas 26 Jul 2004 12:58:04 -0000 1.70 *************** *** 742,746 **** begin inherited KeyDown(Key, Shift); ! if (Key = VK_DELETE) or ((Key = VK_INSERT) and (ssShift in Shift)) then FDataLink.Edit; end; --- 742,747 ---- begin inherited KeyDown(Key, Shift); ! if ((Key = VK_DELETE) and (Shift * KeyboardShiftStates = [])) or ! ((Key = VK_INSERT) and (Shift * KeyboardShiftStates = [ssShift])) then FDataLink.Edit; end; *************** *** 1177,1181 **** begin inherited KeyDown(Key, Shift); ! if (Key = VK_DELETE) or ((Key = VK_INSERT) and (ssShift in Shift)) then FDataLink.Edit; end; --- 1178,1183 ---- begin inherited KeyDown(Key, Shift); ! if ((Key = VK_DELETE) and (Shift * KeyboardShiftStates = [])) or ! ((Key = VK_INSERT) and (Shift * KeyboardShiftStates = [ssShift])) then FDataLink.Edit; end; *************** *** 1451,1456 **** begin inherited KeyDown(Key, Shift); ! if not ReadOnly and ((Key = VK_DELETE) or ((Key = VK_INSERT) ! and (ssShift in Shift))) then FDataLink.Edit; end; --- 1453,1459 ---- begin inherited KeyDown(Key, Shift); ! if not ReadOnly and ! ((Key = VK_DELETE) and (Shift * KeyboardShiftStates = [])) or ! ((Key = VK_INSERT) and (Shift * KeyboardShiftStates = [ssShift])) then FDataLink.Edit; end; *************** *** 1803,1808 **** begin inherited KeyDown(Key, Shift); ! if not ReadOnly and ((Key = VK_DELETE) or ((Key = VK_INSERT) and ! (ssShift in Shift))) then FDataLink.Edit; end; --- 1806,1812 ---- begin inherited KeyDown(Key, Shift); ! if not ReadOnly and ! ((Key = VK_DELETE) and (Shift * KeyboardShiftStates = [])) or ! ((Key = VK_INSERT) and (Shift * KeyboardShiftStates = [ssShift])) then FDataLink.Edit; end; Index: JvDBDateTimePicker.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvDBDateTimePicker.pas,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** JvDBDateTimePicker.pas 20 Jul 2004 14:31:04 -0000 1.15 --- JvDBDateTimePicker.pas 26 Jul 2004 12:58:04 -0000 1.16 *************** *** 243,246 **** --- 243,247 ---- case Key of VK_DELETE: + if Shift * KeyboardShiftStates = [] then begin FDataLink.Edit; *************** *** 263,267 **** end; VK_INSERT: ! if ssShift in Shift then FDataLink.Edit; else --- 264,268 ---- end; VK_INSERT: ! if (Shift * KeyboardShiftStates = [ssShift]) then FDataLink.Edit; else |