gtk2 intf: fixed GetPreferredSize, codetools: added targets i386-darwin-*

git-svn-id: trunk@9504 -
This commit is contained in:
mattias 2006-06-27 20:28:37 +00:00
parent c5534be14d
commit b9bf6c4b20
8 changed files with 24 additions and 15 deletions

View File

@ -100,7 +100,7 @@ const
'i386', 'powerpc', 'm68k', 'x86_64', 'sparc', 'arm' 'i386', 'powerpc', 'm68k', 'x86_64', 'sparc', 'arm'
); );
Lazarus_CPU_OS_Widget_Combinations: array[1..27] of string = ( Lazarus_CPU_OS_Widget_Combinations: array[1..31] of string = (
'i386-linux-gtk', 'i386-linux-gtk',
'i386-linux-gnome', 'i386-linux-gnome',
'i386-linux-gtk2', 'i386-linux-gtk2',
@ -120,6 +120,10 @@ const
'i386-win32-win32', 'i386-win32-win32',
'i386-win32-wince', 'i386-win32-wince',
'i386-win32-gtk', 'i386-win32-gtk',
'i386-darwin-gtk',
'i386-darwin-gtk2',
'i386-darwin-carbon',
'i386-darwin-qt',
'powerpc-darwin-gtk', 'powerpc-darwin-gtk',
'powerpc-darwin-gtk2', 'powerpc-darwin-gtk2',
'powerpc-darwin-carbon', 'powerpc-darwin-carbon',

View File

@ -8,11 +8,11 @@
<SaveClosedFiles Value="False"/> <SaveClosedFiles Value="False"/>
<SaveOnlyProjectUnits Value="True"/> <SaveOnlyProjectUnits Value="True"/>
</Flags> </Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<IconPath Value="./"/> <IconPath Value="./"/>
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<Title Value="createmacapplication"/> <Title Value="createmacapplication"/>
<ActiveEditorIndexAtStart Value="0"/>
</General> </General>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
@ -36,11 +36,6 @@
<Filename Value="createmacapplication.lpr"/> <Filename Value="createmacapplication.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="CreateMacApplication"/> <UnitName Value="CreateMacApplication"/>
<CursorPos X="30" Y="21"/>
<TopLine Value="1"/>
<EditorIndex Value="0"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit0> </Unit0>
</Units> </Units>
</ProjectOptions> </ProjectOptions>

View File

@ -30,7 +30,7 @@ interface
{$IFNDEF DisableAsyncProcess} {$IFNDEF DisableAsyncProcess}
{$IFDEF Linux} {$IFDEF Linux}
{$IFDEF CPUI386} {$IFDEF CPUI386}
{$DEFINE UseAsyncProcess} {off $DEFINE UseAsyncProcess}
{$ENDIF} {$ENDIF}
{$ENDIF} {$ENDIF}
{$ENDIF} {$ENDIF}

View File

@ -1,2 +1,2 @@
// Created by Svn2RevisionInc // Created by Svn2RevisionInc
const RevisionStr = '9489M'; const RevisionStr = '9500M';

View File

@ -44,7 +44,7 @@ interface
{$IFNDEF DisableAsyncProcess} {$IFNDEF DisableAsyncProcess}
{$IFDEF Linux} {$IFDEF Linux}
{$IFDEF CPUI386} {$IFDEF CPUI386}
{$DEFINE UseAsyncProcess} {off $DEFINE UseAsyncProcess}
{$ENDIF} {$ENDIF}
{$ENDIF} {$ENDIF}
{$ENDIF} {$ENDIF}

View File

@ -54,7 +54,7 @@ begin
lEventHandler^.OnEvent := AEventHandler; lEventHandler^.OnEvent := AEventHandler;
lEventHandler^.GSourceID := g_io_add_watch(giochannel, lEventHandler^.GSourceID := g_io_add_watch(giochannel,
AFlags, @waithandle_iocallback, lEventHandler); AFlags, @waithandle_iocallback, lEventHandler);
//debugln('TGtkWidgetSet.AddEventHandler lEventHandler=',HexStr(Cardinal(lEventHandler),8)); //debugln('TGtkWidgetSet.AddEventHandler lEventHandler=',HexStr(Cardinal(lEventHandler),8),' AHandle=',dbgs(lEventHandler^.Handle));
lEventHandler^.PrevHandler := nil; lEventHandler^.PrevHandler := nil;
lEventHandler^.NextHandler := FWaitHandles; lEventHandler^.NextHandler := FWaitHandles;
if FWaitHandles <> nil then if FWaitHandles <> nil then
@ -69,13 +69,15 @@ var
begin begin
if AHandler = nil then exit; if AHandler = nil then exit;
g_source_remove(lEventHandler^.GSourceID); g_source_remove(lEventHandler^.GSourceID);
g_io_channel_unref(lEventHandler^.GIOChannel);
g_io_channel_close(lEventHandler^.GIOChannel);
if lEventHandler^.PrevHandler = nil then if lEventHandler^.PrevHandler = nil then
FWaitHandles := lEventHandler^.NextHandler FWaitHandles := lEventHandler^.NextHandler
else else
lEventHandler^.PrevHandler^.NextHandler := lEventHandler^.NextHandler; lEventHandler^.PrevHandler^.NextHandler := lEventHandler^.NextHandler;
if lEventHandler^.NextHandler <> nil then if lEventHandler^.NextHandler <> nil then
lEventHandler^.NextHandler^.PrevHandler := lEventHandler^.PrevHandler; lEventHandler^.NextHandler^.PrevHandler := lEventHandler^.PrevHandler;
//debugln('TGtkWidgetSet.RemoveEventHandler lEventHandler=',HexStr(Cardinal(lEventHandler),8)); //debugln('TGtkWidgetSet.RemoveEventHandler lEventHandler=',HexStr(Cardinal(lEventHandler),8),' AHandle=',dbgs(lEventHandler^.Handle));
Dispose(lEventHandler); Dispose(lEventHandler);
AHandler := nil; AHandler := nil;
end; end;
@ -88,7 +90,7 @@ begin
g_source_remove(lEventHandler^.GSourceID); g_source_remove(lEventHandler^.GSourceID);
lEventHandler^.GSourceID := g_io_add_watch(lEventHandler^.GIOChannel, lEventHandler^.GSourceID := g_io_add_watch(lEventHandler^.GIOChannel,
NewFlags, @waithandle_iocallback, lEventHandler); NewFlags, @waithandle_iocallback, lEventHandler);
//debugln('TGtkWidgetSet.SetEventHandlerFlags lEventHandler=',HexStr(Cardinal(lEventHandler),8)); //debugln('TGtkWidgetSet.SetEventHandlerFlags lEventHandler=',HexStr(Cardinal(lEventHandler),8),' AHandle=',dbgs(lEventHandler^.Handle));
end; end;
type type

View File

@ -6220,8 +6220,14 @@ begin
if not WithThemeSpace then begin if not WithThemeSpace then begin
//DebugLn('GetGTKDefaultWidgetSize ',DbgSName(AWinControl),' ',dbgs(gtk_widget_get_xthickness(Widget)),' ',dbgs(gtk_widget_get_ythickness(Widget))); //DebugLn('GetGTKDefaultWidgetSize ',DbgSName(AWinControl),' ',dbgs(gtk_widget_get_xthickness(Widget)),' ',dbgs(gtk_widget_get_ythickness(Widget)));
//dec(PreferredWidth,gtk_widget_get_xthickness(Widget)); //dec(PreferredWidth,gtk_widget_get_xthickness(Widget));
{$IFDEF Gtk1}
dec(PreferredHeight,2*gtk_widget_get_ythickness(Widget)); dec(PreferredHeight,2*gtk_widget_get_ythickness(Widget));
{$ENDIF}
end; end;
//DebugLn(['GetGTKDefaultWidgetSize Allocation=',Widget^.allocation.x,',',Widget^.allocation.y,',',Widget^.allocation.width,',',Widget^.allocation.height,
// ' requisition=',Widget^.requisition.width,',',Widget^.requisition.height,
// ' PreferredWidth=',PreferredWidth,' PreferredHeight=',PreferredHeight,
// ' WithThemeSpace=',WithThemeSpace]);
// set new size // set new size
gtk_widget_set_usize(Widget,AWinControl.Width,AWinControl.Height); gtk_widget_set_usize(Widget,AWinControl.Width,AWinControl.Height);
//debugln('GetGTKDefaultSize PreferredWidth=',dbgs(PreferredWidth),' PreferredHeight=',dbgs(PreferredHeight)); //debugln('GetGTKDefaultSize PreferredWidth=',dbgs(PreferredWidth),' PreferredHeight=',dbgs(PreferredHeight));

View File

@ -236,7 +236,8 @@ type
): TCheckBoxState; override; ): TCheckBoxState; override;
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox;
const OldShortCut, NewShortCut: TShortCut); override; const OldShortCut, NewShortCut: TShortCut); override;
class procedure SetState(const ACB: TCustomCheckBox; const ANewState: TCheckBoxState); override; class procedure SetState(const ACB: TCustomCheckBox;
const ANewState: TCheckBoxState); override;
class procedure GetPreferredSize(const AWinControl: TWinControl; class procedure GetPreferredSize(const AWinControl: TWinControl;
var PreferredWidth, PreferredHeight: integer; var PreferredWidth, PreferredHeight: integer;
WithThemeSpace: Boolean); override; WithThemeSpace: Boolean); override;
@ -903,7 +904,8 @@ begin
'activate_item'); 'activate_item');
end; end;
class procedure TGtkWSCustomCheckBox.SetState(const ACB: TCustomCheckBox; const ANewState: TCheckBoxState); class procedure TGtkWSCustomCheckBox.SetState(const ACB: TCustomCheckBox;
const ANewState: TCheckBoxState);
var var
GtkObject: PGtkObject; GtkObject: PGtkObject;
begin begin