LCL, added metrics to fix grid's auto scrollbar issue #14799

git-svn-id: trunk@22535 -
This commit is contained in:
jesus 2009-11-11 20:59:23 +00:00
parent 812b84fe1f
commit 1ab6860b98
5 changed files with 28 additions and 2 deletions

View File

@ -3981,10 +3981,12 @@ begin
// get client bounds free of bars
ClientW := ClientWidth;
ClientH := ClientHeight;
BarW := GetSystemMetrics(SM_CXVSCROLL);
BarW := GetSystemMetrics(SM_CXVSCROLL) +
GetSystemMetrics(SM_SWSCROLLBARSPACING);
if ScrollBarIsVisible(SB_VERT) then
ClientW := ClientW + BarW;
BarH := GetSystemMetrics(SM_CYHSCROLL);
BarH := GetSystemMetrics(SM_CYHSCROLL) +
GetSystemMetrics(SM_SWSCROLLBARSPACING);
if ScrollBarIsVisible(SB_HORZ) then
ClientH := ClientH + BarH;

View File

@ -78,6 +78,7 @@ type
lgsToolBar, // toolbar
lgsToolButton, // button placed on toolbar
lgsCalendar, // button placed on toolbar
lgsScrolledWindow,
// user defined
lgsUserDefined
);
@ -109,6 +110,7 @@ const
'toolbar',
'toolbutton',
'calendar',
'scrolled window',
''
);

View File

@ -8038,6 +8038,11 @@ begin
lgs:=lgsToolButton;
StyleObject^.Widget := gtk_toolbar_append_item(PGtkToolBar(GetStyleWidget(lgsToolBar)), 'B', nil, nil, nil, nil, nil);
end
else
if CompareText(WName,LazGtkStyleNames[lgsScrolledWindow])=0 then begin
lgs:=lgsScrolledWindow;
StyleObject^.Widget := gtk_scrolled_window_new(nil, nil);
end
else
If CompareText(WName,LazGtkStyleNames[lgsGTK_Default])=0 then begin
lgs:=lgsGTK_Default;

View File

@ -6165,6 +6165,21 @@ begin
begin
Assert(False, 'Trace:TODO: [TGtkWidgetSet.GetSystemMetrics] --> SM_SWAPBUTTON ');
end;
SM_SWSCROLLBARSPACING:
begin
P := GetStyleWidget(lgsScrolledWindow);
if P <> nil then begin
{$IFDEF GTK2}
result := GTK_SCROLLED_WINDOW_CLASS(gtk_widget_get_class(P))^.scrollbar_spacing;
if result<0 then
gtk_widget_style_get(P, 'scrollbar-spacing', @result, nil);
{$ELSE}
result := PGtkScrolledWindowClass(PGtkTypeObject(P)^.klass)^.scrollbar_spacing;
if result<0 then
result := 3;
{$ENDIF}
end;
end;
end;
Assert(False, Format('Trace:< [TGtkWidgetSet.GetSystemMetrics] %d --> 0x%x (%d)', [nIndex, Result, Result]));
end;

View File

@ -1704,6 +1704,8 @@ const
SM_CMONITORS = 80;
SM_SAMEDISPLAYFORMAT = 81;
SM_SWSCROLLBARSPACING = 120;
//==============================================
// SystemParametersInfo constants
//==============================================