mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 04:29:25 +02:00
fixed grids SetBorderStyle
git-svn-id: trunk@5499 -
This commit is contained in:
parent
c9f9f10d1a
commit
e79a9e2cb3
@ -55,7 +55,8 @@ type
|
||||
TGetIDEFileStateEvent = procedure(Sender: TObject; const Filename: string;
|
||||
NeededFlags: TIDEFileStateFlags; var ResultFlags: TIDEFileStateFlags)
|
||||
of object;
|
||||
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
@ -1179,6 +1179,8 @@ var
|
||||
HsbVisible, VsbVisible: boolean;
|
||||
HsbRange, VsbRange: Integer;
|
||||
begin
|
||||
if FCols=nil then exit; // not yet initialized or already destroyed
|
||||
|
||||
// Calculate New Cached Values
|
||||
FGCache.GridWidth:=0;
|
||||
FGCache.FixedWidth:=0;
|
||||
@ -2304,10 +2306,12 @@ begin
|
||||
if BorderStyle<>NewStyle then
|
||||
begin
|
||||
inherited;
|
||||
|
||||
VisualChange;
|
||||
if CheckTopLeft(Col, Row, True, True) then
|
||||
if HandleAllocated and ([csDestroying,csLoading]*ComponentState=[]) then
|
||||
begin
|
||||
VisualChange;
|
||||
if CheckTopLeft(Col, Row, True, True) then
|
||||
VisualChange;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -2320,7 +2324,8 @@ begin
|
||||
VisibleGrid:=GetVisibleGrid;
|
||||
with VisibleGrid do
|
||||
ValidGrid:=(Left>=0)and(Top>=0)and(Right>=Left)and(Bottom>=Top);
|
||||
if not ValidGrid then MaxClientXY:=Point(0,0)
|
||||
if not ValidGrid then
|
||||
MaxClientXY:=Point(0,0)
|
||||
else begin
|
||||
R:=CellRect(VisibleGrid.Right, VisibleGrid.Bottom);
|
||||
MaxClientXY:=R.BottomRight;
|
||||
@ -2524,7 +2529,8 @@ end;
|
||||
// ex: IsCol=true, Index:=100, TopLeft.x:=98, FixedCols:=1, all ColWidths:=20
|
||||
// Fisical = Relative => Ini := WidthfixedCols+WidthCol98+WidthCol99
|
||||
// Not Fisical = Absolute => Ini := WidthCols(0..99)
|
||||
function TCustomGrid.ColRowToOffset(IsCol,Fisical:Boolean; index:Integer; var Ini,Fin:Integer): Boolean;
|
||||
function TCustomGrid.ColRowToOffset(IsCol,Fisical:Boolean; index:Integer;
|
||||
var Ini,Fin:Integer): Boolean;
|
||||
var
|
||||
Dim: Integer;
|
||||
begin
|
||||
|
@ -983,7 +983,8 @@ begin
|
||||
// ToDo: implement it.
|
||||
// We can not use inherited SetBorderStyle(NewStyle),
|
||||
// because TBorderSTyle <> TFormBorderSTyle;
|
||||
TWSCustomFormClass(WidgetSetClass).SetFormBorderStyle(Self, NewStyle);
|
||||
if HandleAllocated then
|
||||
TWSCustomFormClass(WidgetSetClass).SetFormBorderStyle(Self, NewStyle);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
@ -1606,6 +1607,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.140 2004/05/22 11:06:27 mattias
|
||||
fixed grids SetBorderStyle
|
||||
|
||||
Revision 1.139 2004/05/21 18:34:44 mattias
|
||||
readded protected TWinControl.BorderStyle
|
||||
|
||||
|
@ -49,6 +49,7 @@ type
|
||||
TGTKAPIWidget = record
|
||||
// ! the ScrolledWindow must be the first attribute of this record !
|
||||
ScrolledWindow: TGTKScrolledWindow;
|
||||
Frame: PGtkFrame;
|
||||
Client: PGtkWidget;
|
||||
end;
|
||||
|
||||
@ -1014,7 +1015,7 @@ const
|
||||
begin
|
||||
{$IFDEF gtk2}
|
||||
// MWE: IMO the arguments can't work since we supply the adjustments as nil
|
||||
// for gtk2 newv doesn't exist so the desision is easy
|
||||
// for gtk2 newv doesn't exist so the decision is easy
|
||||
// TODO: check if we still need to pass the args in gtk1
|
||||
Result := gtk_widget_new(GTKAPIWidget_GetType, nil);
|
||||
{$ELSE}
|
||||
@ -1024,14 +1025,15 @@ begin
|
||||
Result := gtk_widget_newv(GTKAPIWidget_GetType, 2, @ARGS[0]);
|
||||
{$ENDIF}
|
||||
|
||||
// create client widget
|
||||
APIWidget := PGTKAPIWidget(Result);
|
||||
gtk_container_set_border_width(PGTKContainer(APIWidget),0);
|
||||
|
||||
// create client widget
|
||||
APIWidget^.Client := GTKAPIWidgetClient_New;
|
||||
gtk_object_set_data(PGTKObject(Result), 'Fixed', APIWidget^.Client);
|
||||
gtk_object_set_data(PGTKObject(APIWidget^.Client), 'Main', Result);
|
||||
gtk_widget_show(APIWidget^.Client);
|
||||
|
||||
gtk_container_add(PGTKContainer(Result), APIWidget^.Client);
|
||||
gtk_container_add(PGTKContainer(APIWidget), APIWidget^.Client);
|
||||
end;
|
||||
|
||||
procedure GTKAPIWidget_CreateCaret(APIWidget: PGTKAPIWidget;
|
||||
@ -1141,6 +1143,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.58 2004/05/22 11:06:27 mattias
|
||||
fixed grids SetBorderStyle
|
||||
|
||||
Revision 1.57 2004/05/11 12:16:48 mattias
|
||||
replaced writeln by debugln
|
||||
|
||||
|
@ -66,6 +66,7 @@ type
|
||||
// Internal public
|
||||
class procedure SetCallbacks(const AGTKObject: PGTKObject; const AComponent: TComponent);
|
||||
public
|
||||
class procedure SetBorderStyle(const AWinControl: TWinControl; const ABorderStyle: TBorderStyle); override;
|
||||
class procedure SetBounds(const AWinControl: TWinControl; const ALeft, ATop, AWidth, AHeight: Integer); override;
|
||||
class procedure SetSize(const AWinControl: TWinControl; const AWidth, AHeight: Integer); override;
|
||||
class procedure SetPos(const AWinControl: TWinControl; const ALeft, ATop: Integer); override;
|
||||
@ -100,7 +101,7 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
GtkProc, GtkDef, GtkInt;
|
||||
GtkProc, GtkDef, GtkInt, GTKWinapiWindow;
|
||||
|
||||
{ TGtkWSWinControl }
|
||||
|
||||
@ -138,6 +139,25 @@ begin
|
||||
GtkWidgetSet.SetCallback(LM_MOUSEWHEEL, AGTKObject, AComponent);
|
||||
end;
|
||||
|
||||
procedure TGtkWSWinControl.SetBorderStyle(const AWinControl: TWinControl;
|
||||
const ABorderStyle: TBorderStyle);
|
||||
var
|
||||
Widget: PGtkWidget;
|
||||
APIWidget: PGTKAPIWidget;
|
||||
begin
|
||||
Widget := PGtkWidget(AWinControl.Handle);
|
||||
if GtkWidgetIsA(Widget,GTKAPIWidget_GetType) then begin
|
||||
//writeln('TGtkWSWinControl.SetBorderStyle ',AWinControl.Name,':',AWinControl.ClassName,' ',ord(ABorderStyle));
|
||||
APIWidget := PGTKAPIWidget(Widget);
|
||||
if (APIWidget^.Frame<>nil) then begin
|
||||
case ABorderStyle of
|
||||
bsNone: gtk_frame_set_shadow_type(APIWidget^.Frame,GTK_SHADOW_NONE);
|
||||
bsSingle: gtk_frame_set_shadow_type(APIWidget^.Frame,GTK_SHADOW_ETCHED_IN);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGtkWSWinControl.SetCursor(const AControl: TControl; const ACursor: TCursor);
|
||||
begin
|
||||
GtkProc.SetCursor(AControl as TWinControl, ACursor);
|
||||
|
Loading…
Reference in New Issue
Block a user