calling TComboBox.OnSelect when ItemIndex changes from luizamerico

git-svn-id: trunk@8961 -
This commit is contained in:
mattias 2006-03-18 15:47:57 +00:00
parent f7ceee21aa
commit decac5e3ee
4 changed files with 6 additions and 4 deletions

View File

@ -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;
{------------------------------------------------------------------------------

View File

@ -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;

View File

@ -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;

View File

@ -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 }