gtk2 intf: TToolBar is now a simnple hbox instead of a gtk_toolbar

git-svn-id: trunk@9476 -
This commit is contained in:
mattias 2006-06-22 10:35:34 +00:00
parent 22e3d017fb
commit 080df83b4c
5 changed files with 15 additions and 27 deletions

View File

@ -98,28 +98,8 @@ begin
end;
procedure TToolBar.CreateParams(var Params: TCreateParams);
{const
TBSTYLE_TRANSPARENT = $8000; // IE4 style -this is not valid but still needed as a holder
DefaultStyles =
CCS_NOPARENTALIGN or CCS_NOMOVEY or CCS_NORESIZE or CCS_NODIVIDER;
ListStyles: array[Boolean] of DWORD = (0, TBSTYLE_LIST);
FlatStyles: array[Boolean] of DWORD = (0, TBSTYLE_FLAT);
TransparentStyles: array[Boolean] of DWORD = (0, TBSTYLE_TRANSPARENT);}
begin
//FNewStyle := InitCommonControl(ICC_BAR_CLASSES);
inherited CreateParams(Params);
{CreateSubClass(Params, TOOLBARCLASSNAME);
with Params do
begin
Style := Style or DefaultStyles or FlatStyles[FFlat] or ListStyles[FList]
or TransparentStyles[FTransparent];
if ShowCaptions then
Style := Style or TBSTYLE_TRANSPARENT;
WindowClass.style := WindowClass.style and
not Cardinal(CS_HREDRAW or CS_VREDRAW);
end;}
end;
procedure TToolBar.CreateWnd;

View File

@ -5196,16 +5196,20 @@ function TGtkWidgetSet.CreateToolBar(ToolBarObject: TObject): PGtkWidget;
var
ClientWidget: PGtkWidget;
begin
{$IFDEF GTK1}
Result := gtk_toolbar_new();
gtk_toolbar_set_space_size(PGTKToolbar(Result),0);
gtk_toolbar_set_space_style(PGTKToolbar(Result),GTK_TOOLBAR_SPACE_EMPTY);
ClientWidget := gtk_fixed_new();
gtk_toolbar_insert_widget(PGTKToolbar(Result),ClientWidget,nil,nil,0);
{$ELSE}
Result := gtk_hbox_new(false,0);
ClientWidget := gtk_fixed_new();
gtk_container_add(GTK_CONTAINER(Result), ClientWidget);
{$ENDIF}
gtk_widget_show(ClientWidget);
SetFixedWidget(Result,ClientWidget);
SetMainWidget(Result,ClientWidget);
{$IFDEF GTK1}
gtk_toolbar_set_space_size(PGTKToolbar(Result),0);
gtk_toolbar_set_space_style(PGTKToolbar(Result),GTK_TOOLBAR_SPACE_EMPTY);
{$ENDIF GTK1}
gtk_widget_show(Result);
end;

View File

@ -455,7 +455,9 @@ initialization
// RegisterWSComponent(TCustomUpDown, TGtkWSCustomUpDown);
// RegisterWSComponent(TCustomUpDown, TGtkWSUpDown);
// RegisterWSComponent(TCustomToolButton, TGtkWSToolButton);
{$ifdef OldToolbar}
RegisterWSComponent(TToolBar, TGtkWSToolBar);
{$ENDIF}
RegisterWSComponent(TCustomTrackBar, TGtkWSTrackBar);
// RegisterWSComponent(TCustomTreeView, TGtkWSCustomTreeView);
// RegisterWSComponent(TCustomTreeView, TGtkWSTreeView);

View File

@ -222,7 +222,8 @@ type
implementation
// Will be used commonly for ListViews and TreeViews
procedure GetCommonTreeViewWidgets(ATreeViewHandle: PGtkWidget; var TVWidgets: PTVWidgets);
procedure GetCommonTreeViewWidgets(ATreeViewHandle: PGtkWidget;
var TVWidgets: PTVWidgets);
var
WidgetInfo: PWidgetInfo;
begin
@ -265,4 +266,4 @@ initialization
// RegisterWSComponent(TCustomTreeView, TGtk2WSCustomTreeView);
// RegisterWSComponent(TCustomTreeView, TGtk2WSTreeView);
////////////////////////////////////////////////////
end.
end.

View File

@ -41,7 +41,8 @@ interface
{$endif}
uses
Classes, Controls, SysUtils, GraphType, Graphics, LCLType, LCLIntf, StdCtrls;
Classes, LCLProc, Controls, SysUtils, GraphType, Graphics, LCLType, LCLIntf,
StdCtrls;
type