119 |
|
procedure CheckAndInsert; |
120 |
|
procedure DoEnter; override; |
121 |
|
procedure DoExit; override; |
122 |
< |
{$if lcl_fullversion >= 2000003} |
122 |
> |
{$if lcl_fullversion >= 2000002} |
123 |
|
{Deferred update changes in Lazarus 2.0 stop the combo box working when |
124 |
|
the datasource is nil. We thus have to reverse out the changes :(} |
125 |
|
function DoEdit: boolean; override; |
127 |
|
procedure CloseUp; override; |
128 |
|
procedure Select; override; |
129 |
|
{$ifend} |
130 |
+ |
{$if lcl_fullversion = 2000002} |
131 |
+ |
procedure UTF8KeyPress(var UTF8Key: TUTF8Char); override; |
132 |
+ |
{$ifend} |
133 |
|
procedure KeyUp(var Key: Word; Shift: TShiftState); override; |
134 |
|
procedure Loaded; override; |
135 |
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
581 |
|
FModified := false; |
582 |
|
end; |
583 |
|
|
584 |
< |
{$if lcl_fullversion >= 2000003} |
584 |
> |
|
585 |
> |
{Workarounds due to bugs in various Lazarus 2.0 release candidates} |
586 |
> |
{$if lcl_fullversion >= 2000002} |
587 |
|
type |
588 |
|
|
589 |
|
{ THackedCustomComboBox } |
591 |
|
THackedCustomComboBox = class(TCustomComboBox) |
592 |
|
private |
593 |
|
procedure CallChange; |
594 |
+ |
procedure CallUTF8KeyPress(var UTF8Key: TUTF8Char); |
595 |
|
end; |
596 |
|
|
597 |
|
{ THackedCustomComboBox } |
601 |
|
inherited Change; |
602 |
|
end; |
603 |
|
|
604 |
+ |
procedure THackedCustomComboBox.CallUTF8KeyPress(var UTF8Key: TUTF8Char); |
605 |
+ |
begin |
606 |
+ |
inherited UTF8KeyPress(UTF8Key); |
607 |
+ |
end; |
608 |
+ |
|
609 |
|
procedure TIBLookupComboEditBox.Change; |
610 |
|
begin |
611 |
< |
if IsUnbound then |
611 |
> |
if DataSource = nil then |
612 |
|
THackedCustomComboBox(self).CallChange |
613 |
|
else |
614 |
|
inherited Change; |
624 |
|
procedure TIBLookupComboEditBox.Select; |
625 |
|
begin |
626 |
|
inherited Select; |
627 |
< |
if IsUnbound then |
627 |
> |
if DataSource = nil then |
628 |
|
inherited DoEdit; |
629 |
|
end; |
630 |
|
|
632 |
|
begin |
633 |
|
{DoEdit will swallow characters if no editable Field. Hence, to enabled |
634 |
|
writing we must avoid calling the inherited method.} |
635 |
< |
if IsUnbound then |
635 |
> |
if DataSource = nil then |
636 |
|
Result := true |
637 |
|
else |
638 |
|
Result := inherited DoEdit; |
639 |
|
end; |
640 |
|
{$ifend} |
641 |
|
|
642 |
+ |
{$if lcl_fullversion = 2000002} |
643 |
+ |
procedure TIBLookupComboEditBox.UTF8KeyPress(var UTF8Key: TUTF8Char); |
644 |
+ |
begin |
645 |
+ |
if DataSource = nil then |
646 |
+ |
THackedCustomComboBox(self).CallUTF8KeyPress(UTF8Key) |
647 |
+ |
else |
648 |
+ |
inherited; |
649 |
+ |
end; |
650 |
+ |
{$ifend} |
651 |
+ |
|
652 |
+ |
|
653 |
|
constructor TIBLookupComboEditBox.Create(TheComponent: TComponent); |
654 |
|
begin |
655 |
|
inherited Create(TheComponent); |