mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-14 12:19:35 +02:00
calling TComboBox.OnSelect when ItemIndex changes from luizamerico
git-svn-id: trunk@8961 -
This commit is contained in:
parent
f7ceee21aa
commit
decac5e3ee
@ -798,6 +798,7 @@ begin
|
||||
// Text:=FItems[FItemIndex];
|
||||
if HandleAllocated then begin
|
||||
TWSCustomComboBoxClass(WidgetSetClass).SetItemIndex(Self, FItemIndex);
|
||||
Select;
|
||||
end else begin
|
||||
// remember text, in case one reads text without creating handle
|
||||
Text := FItems.Strings[FItemIndex];
|
||||
@ -851,8 +852,7 @@ end;
|
||||
procedure TCustomComboBox.LMSelChange(var TheMessage);
|
||||
begin
|
||||
if [csLoading,csDestroying,csDesigning]*ComponentState<>[] then exit;
|
||||
if Assigned(OnSelect) then
|
||||
OnSelect(Self);
|
||||
Select;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -225,7 +225,7 @@ begin
|
||||
// get itemindex and area
|
||||
//ItemIndex:=g_list_index(GtkList^.children,Data);
|
||||
|
||||
if LockOnChange(PgtkObject(Widget),0) > 0 then Exit;
|
||||
if LockOnChange(PGtkObject(LCLList.Owner.Handle),0) > 0 then Exit;
|
||||
|
||||
Mess.Msg := LM_SELCHANGE;
|
||||
Mess.Result := 0;
|
||||
|
@ -1009,6 +1009,7 @@ var
|
||||
ComboStrings: TStrings;
|
||||
begin
|
||||
ComboWidget:=PGtkCombo(ComboBox.Handle);
|
||||
LockOnChange(PGtkObject(ComboWidget),+1);
|
||||
gtk_list_select_item(PGtkList(ComboWidget^.list),Index);
|
||||
if Index>=0 then begin
|
||||
ComboStrings:=TStrings(gtk_object_get_data(PGtkObject(ComboWidget),'LCLList'));
|
||||
@ -1016,6 +1017,7 @@ begin
|
||||
then SetComboBoxText(ComboWidget, PChar(ComboStrings[Index]))
|
||||
else SetComboBoxText(ComboWidget, '#error#');
|
||||
end;
|
||||
LockOnChange(PGtkObject(ComboWidget),-1);
|
||||
end;
|
||||
|
||||
procedure SetLabelAlignment(LabelWidget: PGtkLabel;
|
||||
|
@ -950,7 +950,7 @@ Begin
|
||||
itemindex is updated, so set text manually }
|
||||
CBN_SELCHANGE: begin
|
||||
UpdateComboBoxText(TCustomComboBox(lWinControl));
|
||||
LMessage.Msg := LM_CHANGED;
|
||||
LMessage.Msg := LM_SELCHANGE;
|
||||
end;
|
||||
{ closeup message is sent before text is actually changed... *sigh*
|
||||
itemindex is updated, so set text manually }
|
||||
|
Loading…
Reference in New Issue
Block a user