Just fixes variable initialization and improves identation.

git-svn-id: trunk@14852 -
This commit is contained in:
sekelsenmat 2008-04-17 00:58:24 +00:00
parent 35f5fb0d47
commit 95ed4902e7
2 changed files with 33 additions and 21 deletions

View File

@ -2983,15 +2983,20 @@ var
gMouse: PGtkObject;
begin
//debugln('TGtkWidgetSet.SetCallback A ALCLObject=',DbgSName(ALCLObject),' AMsg=',dbgs(AMsg));
if Direct then begin
gMain:=AGTKObject;
gCore:=AGTKObject;
gFixed:=AGTKObject;
gMouse:=AGTKObject;
end else begin
if AGTKObject = nil
then gObject := ObjectToGTKObject(ALCLObject)
if Direct then
begin
gMain := AGTKObject;
gCore := AGTKObject;
gFixed := AGTKObject;
gMouse := AGTKObject;
gObject := AGTKObject;
end
else
begin
// gObject
if AGTKObject = nil then gObject := ObjectToGTKObject(ALCLObject)
else gObject := AGTKObject;
if gObject = nil then Exit;
// gFixed is the widget with the client area (e.g. TGroupBox, TCustomForm have this)
@ -3122,14 +3127,13 @@ begin
ConnectSenderSignal(gFixed,'style-set', @GTKStyleChanged);
end;
{$IFDEF GTK1}
LM_FOCUS :
begin
{$IFDEF GTK1}
if (ALCLObject is TCustomComboBox) then begin
ConnectFocusEvents(PgtkObject(PgtkCombo(gObject)^.entry));
ConnectFocusEvents(PgtkObject(PgtkCombo(gObject)^.list));
end else
{$ENDIF}
begin
ConnectFocusEvents(gCore);
end;
@ -3148,17 +3152,16 @@ begin
LM_SYSKEYUP:
begin
//debugln('TGtkWidgetSet.SetCallback A KEY ALCLObject=',DbgSName(ALCLObject),' AMsg=',dbgs(AMsg));
{$IFDEF GTK1}
if (ALCLObject is TCustomComboBox) then begin
ConnectKeyPressReleaseEvents(PgtkObject(PgtkCombo(gObject)^.entry));
end
else
{$ENDIF}
if (ALCLObject is TCustomForm) then begin
ConnectKeyPressReleaseEvents(gObject);
end;
ConnectKeyPressReleaseEvents(gCore);
end;
{$ENDIF}
LM_MONTHCHANGED: //calendar
Begin

View File

@ -327,12 +327,18 @@ var
gObject, gFixed, gCore: PGTKObject;
begin
//debugln('gtk2object.inc TGtkWidgetSet.SetCallback A ALCLObject=',DbgSName(ALCLObject),' AMsg=',dbgs(AMsg));
if Direct then begin
if Direct then
begin
gObject := AGTKObject;
gFixed := AGTKObject;
gCore := AGTKObject;
end else begin
gObject := AGTKObject;
end
else
begin
// gObject
if AGTKObject = nil then gObject := ObjectToGTKObject(ALCLObject)
else gObject := AGTKObject;
if gObject = nil then Exit;
// gFixed is the widget with the client area (e.g. TGroupBox, TForm have this)
@ -349,20 +355,23 @@ begin
ConnectFocusEvents(gCore);
end;
LM_GRABFOCUS:
begin
ConnectSenderSignal(gObject, 'grab_focus', @gtkActivateCB);
end;
LM_CHAR,
LM_KEYDOWN,
LM_KEYUP,
LM_SYSCHAR,
LM_SYSKEYDOWN,
LM_SYSKEYUP:
begin
if (ALCLObject is TCustomComboBox) then begin
ConnectKeyPressReleaseEvents(PgtkObject(PgtkCombo(gObject)^.entry));
end
else if (ALCLObject is TCustomForm) then begin
if (ALCLObject is TCustomComboBox) then
ConnectKeyPressReleaseEvents(PgtkObject(PgtkCombo(gObject)^.entry))
else if (ALCLObject is TCustomForm) then
ConnectKeyPressReleaseEvents(gObject);
end;
ConnectKeyPressReleaseEvents(gCore);
end;