mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 23:26:32 +02:00
fixed changing unitname during update
git-svn-id: trunk@2659 -
This commit is contained in:
parent
c9a3bc987c
commit
d2ef70e4c2
@ -1325,6 +1325,54 @@ begin
|
|||||||
RaiseInvalidFixedWidget;
|
RaiseInvalidFixedWidget;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function GetParentWidget(Child: PGtkWidget): PGtkWidget;
|
||||||
|
var
|
||||||
|
LCLParent: TObject;
|
||||||
|
begin
|
||||||
|
Result:=nil;
|
||||||
|
LCLParent:=GetParentLCLObject(Child);
|
||||||
|
if (LCLParent=nil) or (not (LCLParent is TWinControl))
|
||||||
|
or (not TWinControl(LCLParent).HandleAllocated)
|
||||||
|
then exit;
|
||||||
|
Result:=PGtkWidget(TWinControl(LCLParent).Handle);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetParentFixedWidget(Child: PGtkWidget): PGtkWidget;
|
||||||
|
begin
|
||||||
|
Result:=GetParentWidget(Child);
|
||||||
|
if Result=nil then exit;
|
||||||
|
Result:=GetFixedWidget(Result);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function FindFixedChild(ParentFixed: PGtkFixed; Child: PGtkWidget): PGList;
|
||||||
|
begin
|
||||||
|
Result:=ParentFixed^.children;
|
||||||
|
while (Result<>nil) do begin
|
||||||
|
if (Result^.Data<>nil) and (PGtkFixedChild(Result^.Data)^.Widget=Child) then
|
||||||
|
exit;
|
||||||
|
Result:=Result^.Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure MoveGListLinkBehind(First, Item, After: PGList);
|
||||||
|
var
|
||||||
|
Data: Pointer;
|
||||||
|
NewPos: Integer;
|
||||||
|
begin
|
||||||
|
if (g_list_position(First,Item)<0) then
|
||||||
|
RaiseException('MoveGListLinkBehind Item not found');
|
||||||
|
if (After<>nil) and (g_list_position(First,After)<0) then
|
||||||
|
RaiseException('MoveGListLinkBehind After not found');
|
||||||
|
Data:=Item^.Data;
|
||||||
|
g_list_remove_link(First,Item);
|
||||||
|
if After<>nil then begin
|
||||||
|
NewPos:=g_list_position(First,After)+1;
|
||||||
|
end else begin
|
||||||
|
NewPos:=0;
|
||||||
|
end;
|
||||||
|
g_list_insert(First,Data,NewPos);
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function GetControlWindow(Widget: Pointer) : PGDKWindow;
|
Function GetControlWindow(Widget: Pointer) : PGDKWindow;
|
||||||
|
|
||||||
@ -4151,6 +4199,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.184 2003/06/19 09:26:58 mattias
|
||||||
|
fixed changing unitname during update
|
||||||
|
|
||||||
Revision 1.183 2003/06/18 00:10:38 marc
|
Revision 1.183 2003/06/18 00:10:38 marc
|
||||||
+ Added exceptionhandler while delivering messages
|
+ Added exceptionhandler while delivering messages
|
||||||
|
|
||||||
|
@ -256,6 +256,10 @@ procedure SetHiddenLCLObject(const Widget: Pointer; const AnObject: TObject);
|
|||||||
function GetHiddenLCLObject(const Widget: Pointer): TObject;
|
function GetHiddenLCLObject(const Widget: Pointer): TObject;
|
||||||
Procedure FixedMoveControl(Parent, Child : PGTKWIdget; Left, Top : Longint);
|
Procedure FixedMoveControl(Parent, Child : PGTKWIdget; Left, Top : Longint);
|
||||||
Procedure FixedPutControl(Parent, Child : PGTKWidget; Left, Top : Longint);
|
Procedure FixedPutControl(Parent, Child : PGTKWidget; Left, Top : Longint);
|
||||||
|
function GetParentWidget(Child: PGtkWidget): PGtkWidget;
|
||||||
|
function GetParentFixedWidget(Child: PGtkWidget): PGtkWidget;
|
||||||
|
function FindFixedChild(ParentFixed: PGtkFixed; Child: PGtkWidget): PGList;
|
||||||
|
procedure MoveGListLinkBehind(First, Item, After: PGList);
|
||||||
|
|
||||||
procedure SetComboBoxText(ComboWidget: PGtkCombo; NewText: PChar);
|
procedure SetComboBoxText(ComboWidget: PGtkCombo; NewText: PChar);
|
||||||
function GetComboBoxItemIndex(ComboBox: TComboBox): integer;
|
function GetComboBoxItemIndex(ComboBox: TComboBox): integer;
|
||||||
|
@ -7305,17 +7305,38 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TgtkObject.SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
|
function TgtkObject.SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
|
||||||
X, Y, cx, cy: Integer; uFlags: UINT): Boolean;
|
X, Y, cx, cy: Integer; uFlags: UINT): Boolean;
|
||||||
//var Widget: PGTKWidget;
|
var Widget: PGTKWidget;
|
||||||
|
{ FixedWidget: PGtkWidget;
|
||||||
|
OldListItem: PGList;
|
||||||
|
AfterWidget: PGtkWidget;
|
||||||
|
AfterListItem: PGList;}
|
||||||
begin
|
begin
|
||||||
//writeln('[TgtkObject.SetWindowPos] Top=',hWndInsertAfter=HWND_TOP);
|
writeln('[TgtkObject.SetWindowPos] Top=',hWndInsertAfter=HWND_TOP);
|
||||||
{ Widget := GetFixedWidget(pgtkwidget(hWnd));
|
Widget:=PGtkWidget(hWnd);
|
||||||
if Widget = nil then Widget := pgtkwidget(hWnd);
|
if GtkWidgetIsA(Widget,GTK_WINDOW_TYPE) then begin
|
||||||
case hWndInsertAfter of
|
{ case hWndInsertAfter of
|
||||||
HWND_BOTTOM: ; //gdk_window_lower(Widget^.Window);
|
HWND_BOTTOM: ; //gdk_window_lower(Widget^.Window);
|
||||||
HWND_TOP: gtk_window_set_position(PGtkWindow(hWnd),GTK_WIN_POS_CENTER);
|
HWND_TOP: gtk_window_set_position(PGtkWindow(hWnd),GTK_WIN_POS_CENTER);
|
||||||
//gdk_window_raise(Widget^.Window);
|
//gdk_window_raise(Widget^.Window);
|
||||||
|
end;
|
||||||
|
}
|
||||||
|
end else begin
|
||||||
|
{AfterWidget:=PGtkWidget(hWndInsertAfter);
|
||||||
|
FixedWidget:=GetParentFixedWidget(Widget);
|
||||||
|
if FixedWidget=nil then exit;
|
||||||
|
OldListItem:=FindFixedChild(FixedWidget,Widget);
|
||||||
|
if OldListItem=nil then begin
|
||||||
|
writeln('TgtkObject.SetWindowPos WARNING: Widget not on parents fixed widget');
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
AfterListItem:=FindFixedChild(FixedWidget,AfterWidget);
|
||||||
|
if (AfterListItem=nil) and (AfterWidget<>nil) then begin
|
||||||
|
writeln('TgtkObject.SetWindowPos WARNING: AfterWidget not on parents fixed widget');
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
MoveGListLinkBehind(PGtkFixed(FixedWidget)^.children,
|
||||||
|
OldListItem,AfterListItem);}
|
||||||
end;
|
end;
|
||||||
}
|
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -8270,6 +8291,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.245 2003/06/19 09:26:58 mattias
|
||||||
|
fixed changing unitname during update
|
||||||
|
|
||||||
Revision 1.244 2003/06/18 11:21:07 mattias
|
Revision 1.244 2003/06/18 11:21:07 mattias
|
||||||
fixed taborder=0, implemented TabOrder Editor
|
fixed taborder=0, implemented TabOrder Editor
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user