From 36a656e6188f227956dbdf12bf5fda8be1ea7985 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 27 Nov 2025 19:28:03 +0100 Subject: Fix panel separator resizing --- libgtk_kylix/GTKForms.pas | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'libgtk_kylix/GTKForms.pas') diff --git a/libgtk_kylix/GTKForms.pas b/libgtk_kylix/GTKForms.pas index 0dc1691..3b159de 100644 --- a/libgtk_kylix/GTKForms.pas +++ b/libgtk_kylix/GTKForms.pas @@ -66,13 +66,11 @@ type // Some basic types private FOnClose: TCloseEvent; FOnCloseQuery: TCloseQueryEvent; - FOnResize: TNotifyEvent; FOnShow: TNotifyEvent; FCaption: string; FOnDestroy: TNotifyEvent; - FDeleteEventSignalHandlerID: gulong; - FSizeAllocateSignalHandlerID: gulong; - FShowSignalHandlerID: gulong; + FDeleteEventSignalHandler: gulong; + FShowSignalHandler: gulong; function GetWindowPosition: TWindowPosition; function GetResizeable: boolean; function GetWindowTypeHint: TGDKWindowTypeHint; @@ -97,7 +95,6 @@ type // Some basic types property Visible write SetVisible default False; property OnClose: TCloseEvent read FOnClose write FOnClose; property OnCloseQuery: TCloseQueryEvent read FOnCloseQuery write FOnCloseQuery; - property OnResize: TNotifyEvent read FOnResize write FOnResize; property OnShow: TNotifyEvent read FOnShow write FOnShow; property Caption: string read FCaption write SetCaption; property WindowPosition: TWindowPosition read GetWindowPosition write SetWindowPosition; @@ -277,20 +274,14 @@ begin if Assigned(TCustomGTKForm(user_data).FOnShow) then TCustomGTKForm(user_data).FOnShow(TCustomGTKForm(user_data)); end; -procedure TCustomGTKForm_size_allocate(widget : PGtkWidget; allocation : PGtkAllocation; user_data : gpointer); cdecl; -begin - if Assigned(TCustomGTKForm(user_data).FOnResize) then TCustomGTKForm(user_data).FOnResize(TCustomGTKForm(user_data)); -end; - constructor TCustomGTKForm.Create(AOwner: TComponent); begin inherited Create(AOwner); FOnClose := nil; FOnCloseQuery := nil; FOnDestroy := nil; - FDeleteEventSignalHandlerID := 0; - FSizeAllocateSignalHandlerID := 0; - FShowSignalHandlerID := 0; + FDeleteEventSignalHandler := 0; + FShowSignalHandler := 0; FCaption := ''; FAccelGroup := gtk_accel_group_new; Screen.AddForm(Self); @@ -300,18 +291,16 @@ destructor TCustomGTKForm.Destroy; begin Screen.RemoveForm(Self); if Assigned(FOnDestroy) then FOnDestroy(Self); -// if FDeleteEventSignalHandlerID > 0 then g_signal_handler_disconnect(PGObject(FWidget), FDeleteEventSignalHandlerID); -// if FSizeAllocateSignalHandlerID > 0 then g_signal_handler_disconnect(PGObject(FWidget), FSizeAllocateSignalHandlerID); -// if FShowSignalHandlerID > 0 then g_signal_handler_disconnect(PGObject(FWidget), FShowSignalHandlerID); +// if FDeleteEventSignalHandler > 0 then g_signal_handler_disconnect(PGObject(FWidget), FDeleteEventSignalHandler); +// if FShowSignalHandler > 0 then g_signal_handler_disconnect(PGObject(FWidget), FShowSignalHandler); if not Application.Terminated then gtk_widget_destroy(FWidget); inherited Destroy; end; procedure TCustomGTKForm.ConnectDefaultSignals; begin - FDeleteEventSignalHandlerID := g_signal_connect_data(PGObject(FWidget), 'delete-event', TGCallback(@TCustomGTKForm_delete_event), Self, nil, G_CONNECT_DEFAULT); - FSizeAllocateSignalHandlerID := g_signal_connect_data(PGObject(FWidget), 'size-allocate', TGCallback(@TCustomGTKForm_size_allocate), Self, nil, G_CONNECT_DEFAULT); - FShowSignalHandlerID := g_signal_connect_data(PGObject(FWidget), 'show', TGCallback(@TCustomGTKForm_show), Self, nil, G_CONNECT_DEFAULT); + FDeleteEventSignalHandler := g_signal_connect_data(PGObject(FWidget), 'delete-event', TGCallback(@TCustomGTKForm_delete_event), Self, nil, G_CONNECT_DEFAULT); + FShowSignalHandler := g_signal_connect_data(PGObject(FWidget), 'show', TGCallback(@TCustomGTKForm_show), Self, nil, G_CONNECT_DEFAULT); end; procedure TCustomGTKForm.SetVisible(Value: Boolean); -- cgit v1.2.3