ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/ibcontrols/IBLookupComboEditBox.pas
(Generate patch)

Comparing ibx/trunk/ibcontrols/IBLookupComboEditBox.pas (file contents):
Revision 263 by tony, Thu Dec 6 15:55:01 2018 UTC vs.
Revision 268 by tony, Fri Dec 28 11:36:35 2018 UTC

# Line 117 | Line 117 | type
117      procedure CheckAndInsert;
118      procedure DoEnter; override;
119      procedure DoExit; override;
120 <    {$if lcl_fullversion >= 2000000}
120 >    {$if lcl_fullversion >= 2000003}
121      {Deferred update changes in Lazarus 2.0 stop the combo box working when
122       the datasource is nil. We thus have to reverse out the changes :(}
123      function DoEdit: boolean; override;
124      procedure Change; override;
125      procedure CloseUp; override;
126      procedure Select; override;
127    procedure UTF8KeyPress(var UTF8Key: TUTF8Char); override;
127      {$ifend}
128      procedure KeyUp(var Key: Word; Shift: TShiftState); override;
129      procedure Loaded; override;
# Line 587 | Line 586 | begin
586    FModified := false;
587   end;
588  
589 < {$if lcl_fullversion >= 2000000}
589 > {$if lcl_fullversion >= 2000003}
590   type
591  
592    { THackedCustomComboBox }
593  
594    THackedCustomComboBox = class(TCustomComboBox)
595    private
597    procedure CallUTF8KeyPress(var UTF8Key: TUTF8Char);
596      procedure CallChange;
597    end;
598  
599   { THackedCustomComboBox }
600  
603 procedure THackedCustomComboBox.CallUTF8KeyPress(var UTF8Key: TUTF8Char);
604 begin
605  inherited UTF8KeyPress(UTF8Key);
606 end;
607
601   procedure THackedCustomComboBox.CallChange;
602   begin
603    inherited Change;
604   end;
605  
613 procedure TIBLookupComboEditBox.UTF8KeyPress(var UTF8Key: TUTF8Char);
614 begin
615  {TDBLookupComboBox.UTF8KeyPress will swallow the character if
616  the datalink is not editable. hence to enable writing we must override it}
617  if ((DataSource = nil) or (Field = nil)) and not ReadOnly then
618    THackedCustomComboBox(self).CallUTF8KeyPress(UTF8Key)
619  else
620    inherited;
621 end;
622
606   procedure TIBLookupComboEditBox.Change;
607   begin
608    THackedCustomComboBox(self).CallChange;
# Line 641 | Line 624 | function TIBLookupComboEditBox.DoEdit: b
624   begin
625    {DoEdit will swallow characters if no editable Field. Hence, to enabled
626     writing we must avoid calling the inherited method.}
627 <  if ((DataSource = nil) or (Field = nil)) and not ReadOnly then
627 >  if IsUnbound then
628      Result := true
629    else
630      Result := inherited DoEdit;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines