mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-25 15:44:20 +02:00
qt,gtk,gtk2: use TPanel.BorderStyle in widget initialization code
gtk, gtk2: use GtkFrame instead of GTkHBox to implement panel container (since Frame can handle our BorderStyle property) git-svn-id: trunk@16887 -
This commit is contained in:
parent
c17b1aa2d5
commit
586365803f
lcl
@ -1480,8 +1480,8 @@ type
|
||||
wcfReAlignNeeded,
|
||||
wcfAligningControls,
|
||||
wcfEraseBackground,
|
||||
wcfCreatingHandle, // Set while constructing the handle of this control
|
||||
wcfInitializing, // Set while initializing during handle creation
|
||||
wcfCreatingHandle, // Set while constructing the handle of this control
|
||||
wcfInitializing, // Set while initializing during handle creation
|
||||
wcfCreatingChildHandles, // Set while constructing the handles of the childs
|
||||
wcfHandleVisible
|
||||
);
|
||||
|
@ -6742,17 +6742,20 @@ begin
|
||||
AChild.FBaseParentClientSize:=LoadedClientSize;
|
||||
//DebugLn(['TWinControl.Loaded Self=',DbgSName(Self),' AChild=',AChild,' AChild.FBaseParentClientSize=',dbgs(AChild.FBaseParentClientSize)]);
|
||||
end;
|
||||
if HandleAllocated then begin
|
||||
if HandleAllocated then
|
||||
begin
|
||||
// Set cached caption
|
||||
if GetCachedText(CachedText) then
|
||||
WSSetText(CachedText);
|
||||
InvalidatePreferredSize;
|
||||
|
||||
if wcfColorChanged in FWinControlFlags then begin
|
||||
if wcfColorChanged in FWinControlFlags then
|
||||
begin
|
||||
TWSWinControlClass(WidgetSetClass).SetColor(Self);
|
||||
Exclude(FWinControlFlags,wcfColorChanged);
|
||||
end;
|
||||
if wcfFontChanged in FWinControlFlags then begin
|
||||
if wcfFontChanged in FWinControlFlags then
|
||||
begin
|
||||
TWSWinControlClass(WidgetSetClass).SetFont(Self,Font);
|
||||
NotifyControls(CM_PARENTCOLORCHANGED);
|
||||
for i := 0 to ControlCount - 1 do
|
||||
|
@ -634,10 +634,15 @@ var
|
||||
WidgetInfo: PWidgetInfo;
|
||||
TempWidget: PGtkWidget; // pointer to gtk-widget (local use when neccessary)
|
||||
begin
|
||||
// create a fixed widget in a horizontal box
|
||||
// a fixed on a fixed has no z-order
|
||||
Widget := gtk_hbox_new(False, 0);
|
||||
// TPanel control is a area with frame around. Area can have its own color
|
||||
|
||||
// To implement that in gtk we need:
|
||||
// 1. GtkFrame to draw frame around area
|
||||
// 2. GtkFixed to plaace controls and draw color area
|
||||
|
||||
Widget := gtk_frame_new(nil);
|
||||
WidgetInfo := CreateWidgetInfo(Widget, AWinControl, AParams);
|
||||
gtk_frame_set_shadow_type(PGtkFrame(Widget), BorderStyleShadowMap[TCustomPanel(AWinControl).BorderStyle]);
|
||||
TempWidget := CreateFixedClientWidget;
|
||||
gtk_container_add(GTK_CONTAINER(Widget), TempWidget);
|
||||
gtk_widget_show(TempWidget);
|
||||
|
@ -31,7 +31,7 @@ interface
|
||||
uses
|
||||
// Bindings
|
||||
qt4,
|
||||
qtwidgets, qtobjects, qtproc,
|
||||
qtwidgets, qtobjects, qtproc, QtWSControls,
|
||||
// LCL
|
||||
LMessages, LCLMessageGlue,
|
||||
SysUtils, Classes, Controls, Graphics, Forms, StdCtrls, ExtCtrls, LCLType,
|
||||
@ -256,11 +256,9 @@ begin
|
||||
QtFrame.AttachEvents;
|
||||
|
||||
// Set's initial properties
|
||||
|
||||
QtFrame.setFrameShape(QFrameNoFrame);
|
||||
QtFrame.setFrameShape(TBorderStyleToQtFrameShapeMap[TCustomPanel(AWinControl).BorderStyle]);
|
||||
|
||||
// Return the Handle
|
||||
|
||||
Result := TLCLIntfHandle(QtFrame);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user