View Issue Details

IDProjectCategoryView StatusLast Update
0004190JEDI VCL00 JVCL Componentspublic2007-08-18 07:06
ReportercacofonyAssigned ToAHUser 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.30 
Target VersionFixed in Version3.34 
Summary0004190: TJvDBLookupCombo - Allow TAB key to select records
DescriptionCurrently pressing the TAB key while the Dropdown menu is active will close the drop down menu and cancel any record selection. We found many users where in the habit of pressing tab, these changes allow the option TabSelects to be enabled so when the TAB key is pressed it is the eqivilant as pressing ENTER, users can then press TAB again to move to next component.
TagsNo tags attached.

Activities

2007-07-31 02:35

 

TJvDBLookupCombo - Tab Selection.txt (1,906 bytes)
Changes to JvDBLookup to allow TAB key to select records.

private
    { Modified: Tristan Marlow - 31-07-2007 }
    FTabSelects : Boolean;
    { Modified: Tristan Marlow - 31-07-2007 }
published
    { Modified: Tristan Marlow - 31-07-2007 }
    property TabSelects : Boolean read FTabSelects write FTabSelects;
    { Modified: Tristan Marlow - 31-07-2007 }


procedure TJvDBLookupCombo.CNKeyDown(var Msg: TWMKeyDown);
begin
  { Modified: Tristan Marlow - 31-07-2007 }
  if (FTabSelects) and (Self.IsDropDown) then
    begin
      If Msg.Charcode = VK_TAB then
        begin
          Msg.Charcode := VK_RETURN;
        end;
    end;
  { Modified: Tristan Marlow - 31-07-2007 }
  if not (csDesigning in ComponentState) then
    if (Msg.CharCode in [VK_RETURN, VK_ESCAPE]) and FListVisible and
      FLookupMode and FDataLink.DataSourceFixed then
    begin
      CloseUp(Msg.CharCode = VK_RETURN);
      Msg.Result := 1;
      Exit;
    end;
  inherited;
end;


procedure TJvDBLookupCombo.KeyPress(var Key: Char);
begin
  if FListVisible then
  begin
    { Modified: Tristan Marlow - 31-07-2007 }
    if (FTabSelects) and (Self.IsDropDown) then If Key = Tab then Key := Cr;
    { Modified: Tristan Marlow - 31-07-2007 }
    if Key in [Cr, Esc] then
    begin
      CloseUp(Key = Cr);
      Key := #0;
    end
    else
      FDataList.KeyPress(Key)
  end
  else
  begin
    if Key in [#32..#255] then
    begin
      DropDown;
      if FListVisible then
        FDataList.KeyPress(Key);
    end
    else
    if (Key = Esc) and FEscapeClear and (not ValueIsEmpty(FValue)) and CanModify then
    begin
      ResetField;
      // Key := #0;
      if FValue = FEmptyValue then
        Key := #0; // Polaris
    end;
  end;
  inherited KeyPress(Key);
  if Key in [Cr, Esc] then
    GetParentForm(Self).Perform(CM_DIALOGKEY, Byte(Key), 0);
end;

AHUser

2007-08-18 07:05

developer   ~0013641

Added to SVN

Issue History

Date Modified Username Field Change
2007-07-31 02:35 cacofony New Issue
2007-07-31 02:35 cacofony File Added: TJvDBLookupCombo - Tab Selection.txt
2007-08-18 07:05 AHUser Status new => resolved
2007-08-18 07:05 AHUser Fixed in Version => Daily / SVN
2007-08-18 07:05 AHUser Resolution open => fixed
2007-08-18 07:05 AHUser Assigned To => AHUser
2007-08-18 07:05 AHUser Note Added: 0013641