mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-05 08:56:18 +02:00
implemented TSplitter.Beveled for gtk intf
git-svn-id: trunk@8031 -
This commit is contained in:
parent
713c417a73
commit
da78e6e7a4
@ -7721,7 +7721,7 @@ begin
|
|||||||
// MWE: ???
|
// MWE: ???
|
||||||
// TODO: why are only the lower bytes of a handle checked ???
|
// TODO: why are only the lower bytes of a handle checked ???
|
||||||
// In the LCL a Handle has the size of a PtrUInt
|
// In the LCL a Handle has the size of a PtrUInt
|
||||||
if (TheMessage.WParam and $FFFF) = Handle then begin
|
if (cardinal(TheMessage.WParam) and $FFFF) = cardinal(Handle) then begin
|
||||||
// what a weird thing, we are losing the focus
|
// what a weird thing, we are losing the focus
|
||||||
// and giving it to ourselves
|
// and giving it to ourselves
|
||||||
TheMessage.Result := 0; // doesn't allow such thing
|
TheMessage.Result := 0; // doesn't allow such thing
|
||||||
|
@ -674,8 +674,9 @@ end;
|
|||||||
|
|
||||||
procedure TCustomSplitter.Paint;
|
procedure TCustomSplitter.Paint;
|
||||||
begin
|
begin
|
||||||
DrawSplitter(Canvas.Handle,Rect(0,0,Width,Height),
|
TWSCustomSplitterClass(WidgetSetClass).DrawSplitter(Self);
|
||||||
FResizeAnchor in [akTop,akBottom]);
|
//DrawSplitter(Canvas.Handle,Rect(0,0,Width,Height),
|
||||||
|
// FResizeAnchor in [akTop,akBottom]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TCustomSplitter.Create(TheOwner: TComponent);
|
constructor TCustomSplitter.Create(TheOwner: TComponent);
|
||||||
|
@ -2726,7 +2726,7 @@ begin
|
|||||||
SelectedColors := dcscCustom;
|
SelectedColors := dcscCustom;
|
||||||
|
|
||||||
// Draw outer rect
|
// Draw outer rect
|
||||||
if Bouter then
|
if BOuter then
|
||||||
DrawEdges(R,GC,Drawable,OuterTL,OuterBR);
|
DrawEdges(R,GC,Drawable,OuterTL,OuterBR);
|
||||||
|
|
||||||
// Draw inner rect
|
// Draw inner rect
|
||||||
|
@ -27,13 +27,13 @@ unit GtkWSExtCtrls;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
LCLProc, Controls,
|
LCLProc, LCLType, LCLIntf, Controls,
|
||||||
{$IFDEF GTK2}
|
{$IFDEF GTK2}
|
||||||
gtk2, gdk2, gdk2PixBuf, glib2,
|
gtk2, gdk2, gdk2PixBuf, glib2,
|
||||||
{$ELSE GTK2}
|
{$ELSE GTK2}
|
||||||
gtk, gdk, glib,
|
gtk, gdk, glib,
|
||||||
{$ENDIF GTK2}
|
{$ENDIF GTK2}
|
||||||
GtkGlobals, GtkProc, ExtCtrls, Classes,
|
GtkGlobals, GtkProc, GtkDef, ExtCtrls, Classes,
|
||||||
WSExtCtrls, WSLCLClasses, gtkint, interfacebase;
|
WSExtCtrls, WSLCLClasses, gtkint, interfacebase;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -98,6 +98,7 @@ type
|
|||||||
private
|
private
|
||||||
protected
|
protected
|
||||||
public
|
public
|
||||||
|
class procedure DrawSplitter(const ASplitter: TCustomSplitter); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TGtkWSSplitter }
|
{ TGtkWSSplitter }
|
||||||
@ -437,6 +438,57 @@ begin
|
|||||||
gtk_notebook_set_show_tabs(PGtkNotebook(ANotebook.Handle), AShowTabs);
|
gtk_notebook_set_show_tabs(PGtkNotebook(ANotebook.Handle), AShowTabs);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TGtkWSCustomSplitter }
|
||||||
|
|
||||||
|
procedure TGtkWSCustomSplitter.DrawSplitter(const ASplitter: TCustomSplitter);
|
||||||
|
var
|
||||||
|
Widget: PGtkWidget;
|
||||||
|
ClientWidget: Pointer;
|
||||||
|
DCOrigin: TPoint;
|
||||||
|
Detail: PChar;
|
||||||
|
Area: TGdkRectangle;
|
||||||
|
Style: PGtkStyle;
|
||||||
|
AWindow: PGdkWindow;
|
||||||
|
DevContext: TDeviceContext;
|
||||||
|
ARect: TRect;
|
||||||
|
begin
|
||||||
|
if not ASplitter.HandleAllocated then exit;
|
||||||
|
DevContext:=TDeviceContext(ASplitter.Canvas.Handle);
|
||||||
|
Widget:=PGtkWidget(ASplitter.Handle);
|
||||||
|
ClientWidget:=GetFixedWidget(Widget);
|
||||||
|
if ClientWidget<>nil then
|
||||||
|
Widget:=ClientWidget;
|
||||||
|
AWindow:=DevContext.Drawable;
|
||||||
|
|
||||||
|
Style:=GetStyle(lgsButton);
|
||||||
|
if ASplitter.ResizeAnchor in [akTop,akBottom] then begin
|
||||||
|
Detail:='hpaned';
|
||||||
|
end else begin
|
||||||
|
Detail:='vpaned';
|
||||||
|
end;
|
||||||
|
|
||||||
|
DCOrigin:=GetDCOffset(DevContext);
|
||||||
|
Area.X:=DCOrigin.X;
|
||||||
|
Area.Y:=DCOrigin.Y;
|
||||||
|
Area.Width:=ASplitter.Width;
|
||||||
|
Area.Height:=ASplitter.Height;
|
||||||
|
|
||||||
|
if ASplitter.Beveled then begin
|
||||||
|
ARect:=Bounds(Area.x,Area.y,Area.Width,Area.Height);
|
||||||
|
DrawEdge(HDC(DevContext),ARect,BDR_RAISEDOUTER,BF_ADJUST+BF_RECT);
|
||||||
|
Area.X:=ARect.Left;
|
||||||
|
Area.Y:=ARect.Top;
|
||||||
|
Area.Width:=ARect.Right-ARect.Left;
|
||||||
|
Area.Height:=ARect.Bottom-ARect.Top;
|
||||||
|
end;
|
||||||
|
|
||||||
|
gtk_paint_box(Style, AWindow,
|
||||||
|
GTK_WIDGET_STATE(Widget),
|
||||||
|
GTK_SHADOW_NONE,
|
||||||
|
@Area, Widget, Detail,
|
||||||
|
Area.X,Area.Y,Area.Width,Area.Height);
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
@ -450,7 +502,7 @@ initialization
|
|||||||
// RegisterWSComponent(TPage, TGtkWSPage);
|
// RegisterWSComponent(TPage, TGtkWSPage);
|
||||||
// RegisterWSComponent(TNotebook, TGtkWSNotebook);
|
// RegisterWSComponent(TNotebook, TGtkWSNotebook);
|
||||||
// RegisterWSComponent(TShape, TGtkWSShape);
|
// RegisterWSComponent(TShape, TGtkWSShape);
|
||||||
// RegisterWSComponent(TCustomSplitter, TGtkWSCustomSplitter);
|
RegisterWSComponent(TCustomSplitter, TGtkWSCustomSplitter);
|
||||||
// RegisterWSComponent(TSplitter, TGtkWSSplitter);
|
// RegisterWSComponent(TSplitter, TGtkWSSplitter);
|
||||||
// RegisterWSComponent(TPaintBox, TGtkWSPaintBox);
|
// RegisterWSComponent(TPaintBox, TGtkWSPaintBox);
|
||||||
// RegisterWSComponent(TCustomImage, TGtkWSCustomImage);
|
// RegisterWSComponent(TCustomImage, TGtkWSCustomImage);
|
||||||
|
@ -32,7 +32,7 @@ uses
|
|||||||
// To get as little as posible circles,
|
// To get as little as posible circles,
|
||||||
// uncomment only when needed for registration
|
// uncomment only when needed for registration
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
Windows, ExtCtrls, Classes, Controls, LCLType, SysUtils,
|
SysUtils, Windows, ExtCtrls, Classes, Controls, LCLType, LCLIntf,
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
WSExtCtrls, WSLCLClasses, WinExt, Win32Int, Win32Proc, InterfaceBase,
|
WSExtCtrls, WSLCLClasses, WinExt, Win32Int, Win32Proc, InterfaceBase,
|
||||||
Win32WSControls;
|
Win32WSControls;
|
||||||
@ -104,6 +104,7 @@ type
|
|||||||
private
|
private
|
||||||
protected
|
protected
|
||||||
public
|
public
|
||||||
|
class procedure DrawSplitter(const ASplitter: TCustomSplitter); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TWin32WSSplitter }
|
{ TWin32WSSplitter }
|
||||||
@ -534,6 +535,17 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{ TWin32WSCustomSplitter }
|
||||||
|
|
||||||
|
procedure TWin32WSCustomSplitter.DrawSplitter(const ASplitter: TCustomSplitter
|
||||||
|
);
|
||||||
|
begin
|
||||||
|
// TODO: beveled
|
||||||
|
LCLIntf.DrawSplitter(ASplitter.Canvas.Handle,
|
||||||
|
Rect(0,0,ASplitter.Width,ASplitter.Height),
|
||||||
|
ASplitter.ResizeAnchor in [akTop,akBottom]);
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
@ -547,7 +559,7 @@ initialization
|
|||||||
// RegisterWSComponent(TPage, TWin32WSPage);
|
// RegisterWSComponent(TPage, TWin32WSPage);
|
||||||
// RegisterWSComponent(TNotebook, TWin32WSNotebook);
|
// RegisterWSComponent(TNotebook, TWin32WSNotebook);
|
||||||
// RegisterWSComponent(TShape, TWin32WSShape);
|
// RegisterWSComponent(TShape, TWin32WSShape);
|
||||||
// RegisterWSComponent(TCustomSplitter, TWin32WSCustomSplitter);
|
RegisterWSComponent(TCustomSplitter, TWin32WSCustomSplitter);
|
||||||
// RegisterWSComponent(TSplitter, TWin32WSSplitter);
|
// RegisterWSComponent(TSplitter, TWin32WSSplitter);
|
||||||
// RegisterWSComponent(TPaintBox, TWin32WSPaintBox);
|
// RegisterWSComponent(TPaintBox, TWin32WSPaintBox);
|
||||||
// RegisterWSComponent(TCustomImage, TWin32WSCustomImage);
|
// RegisterWSComponent(TCustomImage, TWin32WSCustomImage);
|
||||||
|
@ -44,7 +44,7 @@ uses
|
|||||||
// To get as little as posible circles,
|
// To get as little as posible circles,
|
||||||
// uncomment only when needed for registration
|
// uncomment only when needed for registration
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
Controls, ExtCtrls, Classes,
|
LCLProc, Controls, ExtCtrls, Classes,
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
WSLCLClasses, WSControls, WSStdCtrls;
|
WSLCLClasses, WSControls, WSStdCtrls;
|
||||||
|
|
||||||
@ -92,7 +92,10 @@ type
|
|||||||
{ TWSCustomSplitter }
|
{ TWSCustomSplitter }
|
||||||
|
|
||||||
TWSCustomSplitter = class(TWSCustomControl)
|
TWSCustomSplitter = class(TWSCustomControl)
|
||||||
|
public
|
||||||
|
class procedure DrawSplitter(const ASplitter: TCustomSplitter); virtual;
|
||||||
end;
|
end;
|
||||||
|
TWSCustomSplitterClass = class of TWSCustomSplitter;
|
||||||
|
|
||||||
{ TWSSplitter }
|
{ TWSSplitter }
|
||||||
|
|
||||||
@ -235,7 +238,8 @@ begin
|
|||||||
Result:=60;
|
Result:=60;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TWSCustomNotebook.GetPageRealIndex(const ANotebook: TCustomNotebook; AIndex: Integer): Integer;
|
function TWSCustomNotebook.GetPageRealIndex(const ANotebook: TCustomNotebook;
|
||||||
|
AIndex: Integer): Integer;
|
||||||
begin
|
begin
|
||||||
Result := AIndex;
|
Result := AIndex;
|
||||||
end;
|
end;
|
||||||
@ -246,7 +250,8 @@ begin
|
|||||||
Result := -1;
|
Result := -1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWSCustomNotebook.SetPageIndex(const ANotebook: TCustomNotebook; const AIndex: integer);
|
procedure TWSCustomNotebook.SetPageIndex(const ANotebook: TCustomNotebook;
|
||||||
|
const AIndex: integer);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -255,14 +260,24 @@ procedure TWSCustomNotebook.SetTabCaption(const ANotebook: TCustomNotebook;
|
|||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWSCustomNotebook.SetTabPosition(const ANotebook: TCustomNotebook; const ATabPosition: TTabPosition);
|
procedure TWSCustomNotebook.SetTabPosition(const ANotebook: TCustomNotebook;
|
||||||
|
const ATabPosition: TTabPosition);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWSCustomNotebook.ShowTabs(const ANotebook: TCustomNotebook; AShowTabs: boolean);
|
procedure TWSCustomNotebook.ShowTabs(const ANotebook: TCustomNotebook;
|
||||||
|
AShowTabs: boolean);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TWSCustomSplitter }
|
||||||
|
|
||||||
|
class procedure TWSCustomSplitter.DrawSplitter(const ASplitter: TCustomSplitter
|
||||||
|
);
|
||||||
|
begin
|
||||||
|
debugln('TWSCustomSplitter.DrawSplitter TODO');
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
@ -275,7 +290,7 @@ initialization
|
|||||||
// RegisterWSComponent(TNotebook, TWSNotebook);
|
// RegisterWSComponent(TNotebook, TWSNotebook);
|
||||||
// RegisterWSComponent(TShape, TWSShape);
|
// RegisterWSComponent(TShape, TWSShape);
|
||||||
// RegisterWSComponent(TCustomSplitter, TWSCustomSplitter);
|
// RegisterWSComponent(TCustomSplitter, TWSCustomSplitter);
|
||||||
// RegisterWSComponent(TSplitter, TWSSplitter);
|
// RegisterWSComponent(TCustomSplitter, TWSCustomSplitter);
|
||||||
// RegisterWSComponent(TPaintBox, TWSPaintBox);
|
// RegisterWSComponent(TPaintBox, TWSPaintBox);
|
||||||
// RegisterWSComponent(TCustomImage, TWSCustomImage);
|
// RegisterWSComponent(TCustomImage, TWSCustomImage);
|
||||||
// RegisterWSComponent(TImage, TWSImage);
|
// RegisterWSComponent(TImage, TWSImage);
|
||||||
|
Loading…
Reference in New Issue
Block a user