mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-29 00:02:40 +02:00
fixed setting TListBox.Selected before createhandle
git-svn-id: trunk@2368 -
This commit is contained in:
parent
18feeaef49
commit
24d194c0cd
@ -2298,17 +2298,21 @@ begin
|
|||||||
csListBox:
|
csListBox:
|
||||||
begin
|
begin
|
||||||
if Handle<>0 then begin
|
if Handle<>0 then begin
|
||||||
|
Widget:=nil;
|
||||||
if TListBox(Sender).MultiSelect then
|
if TListBox(Sender).MultiSelect then
|
||||||
Widget:= PGtkList(GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget)^.last_focus_child
|
Widget:= PGtkList(GetWidgetInfo(Pointer(Handle), True)^.
|
||||||
else begin
|
ImplementationWidget)^.last_focus_child;
|
||||||
|
if Widget=nil then begin
|
||||||
GList:= PGtkList(GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget)^.selection;
|
GList:= PGtkList(GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget)^.selection;
|
||||||
if GList = nil then
|
if GList <> nil then
|
||||||
Widget:= nil
|
|
||||||
else
|
|
||||||
Widget:= PGtkWidget(GList^.data);
|
Widget:= PGtkWidget(GList^.data);
|
||||||
end;
|
end;
|
||||||
if Widget = nil then Result:= -1
|
if Widget = nil then
|
||||||
else Result:= gtk_list_child_position(PGtkList(GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget), Widget);
|
Result:= -1
|
||||||
|
else
|
||||||
|
Result:= gtk_list_child_position(PGtkList(
|
||||||
|
GetWidgetInfo(Pointer(Handle), True)^.
|
||||||
|
ImplementationWidget), Widget);
|
||||||
end else
|
end else
|
||||||
Result:=-1;
|
Result:=-1;
|
||||||
end;
|
end;
|
||||||
@ -2332,14 +2336,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
LM_SETITEMINDEX :
|
LM_SETITEMINDEX:
|
||||||
if Handle<>0 then begin
|
if Handle<>0 then begin
|
||||||
case TControl(Sender).fCompStyle of
|
case TControl(Sender).fCompStyle of
|
||||||
|
|
||||||
csComboBox:
|
csComboBox:
|
||||||
SetComboBoxItemIndex(TComboBox(Sender),Integer(Data));
|
SetComboBoxItemIndex(TComboBox(Sender),Integer(Data));
|
||||||
|
|
||||||
csListBox :
|
csListBox:
|
||||||
|
begin
|
||||||
if Integer(Data)>=0 then
|
if Integer(Data)>=0 then
|
||||||
gtk_list_select_item(
|
gtk_list_select_item(
|
||||||
PGtkList(GetWidgetInfo(Pointer(Handle),True)^.ImplementationWidget),
|
PGtkList(GetWidgetInfo(Pointer(Handle),True)^.ImplementationWidget),
|
||||||
@ -2347,6 +2352,7 @@ begin
|
|||||||
else
|
else
|
||||||
gtk_list_unselect_all(
|
gtk_list_unselect_all(
|
||||||
PGtkList(GetWidgetInfo(Pointer(Handle),True)^.ImplementationWidget));
|
PGtkList(GetWidgetInfo(Pointer(Handle),True)^.ImplementationWidget));
|
||||||
|
end;
|
||||||
|
|
||||||
csCListBox:
|
csCListBox:
|
||||||
gtk_clist_select_row(PGtkCList(GetWidgetInfo(Pointer(Handle),
|
gtk_clist_select_row(PGtkCList(GetWidgetInfo(Pointer(Handle),
|
||||||
@ -2518,7 +2524,7 @@ begin
|
|||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
LM_SETSEL :
|
LM_SETSEL:
|
||||||
begin
|
begin
|
||||||
if (Sender is TControl)
|
if (Sender is TControl)
|
||||||
and (TControl(Sender).fCompStyle in [csListBox, csCListBox])
|
and (TControl(Sender).fCompStyle in [csListBox, csCListBox])
|
||||||
@ -7259,6 +7265,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.362 2003/05/14 13:06:00 mattias
|
||||||
|
fixed setting TListBox.Selected before createhandle
|
||||||
|
|
||||||
Revision 1.361 2003/05/01 11:44:03 mattias
|
Revision 1.361 2003/05/01 11:44:03 mattias
|
||||||
fixed changing menuitem separator and normal
|
fixed changing menuitem separator and normal
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user