mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 07:58:07 +02:00
fixed gtk2 key handle result
git-svn-id: trunk@6813 -
This commit is contained in:
parent
458fb0ea45
commit
6161468c16
@ -3063,7 +3063,8 @@ end;
|
||||
Applies a Message to the sender
|
||||
------------------------------------------------------------------------------}
|
||||
//TODO: remove ALCLObject when creation splitup is finished
|
||||
procedure TGtkWidgetSet.SetCallback(const AMsg: LongInt; const AGTKObject: PGTKObject; const ALCLObject: TObject);
|
||||
procedure TGtkWidgetSet.SetCallback(const AMsg: LongInt;
|
||||
const AGTKObject: PGTKObject; const ALCLObject: TObject);
|
||||
|
||||
procedure ConnectSenderSignal(const AnObject:PGTKObject; const ASignal: PChar;
|
||||
const ACallBackProc: Pointer);
|
||||
@ -3101,6 +3102,7 @@ procedure TGtkWidgetSet.SetCallback(const AMsg: LongInt; const AGTKObject: PGTKO
|
||||
|
||||
procedure ConnectKeyPressReleaseEvents(const AnObject: PGTKObject);
|
||||
begin
|
||||
//debugln('ConnectKeyPressReleaseEvents A ALCLObject=',DbgSName(ALCLObject));
|
||||
ConnectSenderSignal(AnObject,
|
||||
'key-press-event', @GTKKeyUpDown, GDK_KEY_PRESS_MASK);
|
||||
ConnectSenderSignalAfter(AnObject,
|
||||
@ -3114,6 +3116,7 @@ procedure TGtkWidgetSet.SetCallback(const AMsg: LongInt; const AGTKObject: PGTKO
|
||||
var
|
||||
gObject, gFixed, gCore, Scroll, Adjustment: PGTKObject;
|
||||
begin
|
||||
//debugln('TGtkWidgetSet.SetCallback A ALCLObject=',DbgSName(ALCLObject),' AMsg=',dbgs(AMsg));
|
||||
if AGTKObject = nil
|
||||
then gObject := ObjectToGTKObject(ALCLObject)
|
||||
else gObject := AGTKObject;
|
||||
@ -3231,6 +3234,7 @@ begin
|
||||
LM_SYSCHAR,
|
||||
LM_SYSKEYUP:
|
||||
begin
|
||||
//debugln('TGtkWidgetSet.SetCallback A KEY ALCLObject=',DbgSName(ALCLObject),' AMsg=',dbgs(AMsg));
|
||||
if (ALCLObject is TCustomComboBox) then begin
|
||||
ConnectKeyPressReleaseEvents(PgtkObject(PgtkCombo(gObject)^.entry));
|
||||
end
|
||||
@ -7010,6 +7014,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.630 2005/02/19 20:33:09 mattias
|
||||
fixed gtk2 key handle result
|
||||
|
||||
Revision 1.629 2005/02/19 16:30:46 mattias
|
||||
fixed 1.0.10 compilation
|
||||
|
||||
|
@ -2040,7 +2040,8 @@ var
|
||||
TargetData: gPointer;
|
||||
KeyPressesChar: char;
|
||||
begin
|
||||
Result := True;
|
||||
Result := CallBackDefaultReturn;
|
||||
|
||||
EventStopped := False;
|
||||
HandledByLCL:=KeyEventWasHandledByLCL(Event,BeforeEvent);
|
||||
|
||||
@ -4463,7 +4464,7 @@ begin
|
||||
end;
|
||||
{$ELSE}
|
||||
begin
|
||||
Result:= g_signal_handler_find(AnObject,
|
||||
Result:=g_signal_handler_find(AnObject,
|
||||
G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA,
|
||||
0,0,nil,ACallBackProc,ALCLObject)<>0;
|
||||
end;
|
||||
@ -4480,7 +4481,8 @@ var
|
||||
RealizeConnected: Boolean;
|
||||
HasRealizeSignal: Boolean;
|
||||
begin
|
||||
if ACallBackProc = nil then exit;
|
||||
if ACallBackProc = nil then
|
||||
RaiseGDBException('ConnectSignal');
|
||||
|
||||
// first loop through the handlers to:
|
||||
// - check if a handler already exists
|
||||
@ -8057,6 +8059,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.338 2005/02/19 20:33:09 mattias
|
||||
fixed gtk2 key handle result
|
||||
|
||||
Revision 1.337 2005/02/19 16:30:47 mattias
|
||||
fixed 1.0.10 compilation
|
||||
|
||||
|
@ -581,16 +581,18 @@ function GetDesignOnlySignalFlag(Widget: PGtkWidget;
|
||||
|
||||
// signals
|
||||
// new signal procs, these will obsolete the old ones
|
||||
// MG: Say who?
|
||||
procedure SignalConnect(const AWidget: PGTKWidget; const ASignal: PChar;
|
||||
const AProc: Pointer; const AInfo: PWidgetInfo);
|
||||
procedure SignalConnectAfter(const AWidget: PGTKWidget; const ASignal: PChar;
|
||||
const AProc: Pointer; const AInfo: PWidgetInfo);
|
||||
|
||||
// old signal procs
|
||||
procedure ConnectSignal(const AnObject:PGTKObject; const ASignal: PChar;
|
||||
// MG: why old?
|
||||
procedure ConnectSignal(const AnObject: PGTKObject; const ASignal: PChar;
|
||||
const ACallBackProc: Pointer; const ALCLObject: TObject;
|
||||
const AReqSignalMask: TGdkEventMask; const ASFlags: TConnectSignalFlags);
|
||||
procedure ConnectSignal(const AnObject:PGTKObject; const ASignal: PChar;
|
||||
procedure ConnectSignal(const AnObject: PGTKObject; const ASignal: PChar;
|
||||
const ACallBackProc: Pointer; const ALCLObject: TObject;
|
||||
const AReqSignalMask: TGdkEventMask);
|
||||
procedure ConnectSignalAfter(const AnObject:PGTKObject; const ASignal: PChar;
|
||||
|
@ -157,7 +157,8 @@ begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
procedure TGtkWSButton.SetCallbacks(const AGtkWidget: PGtkWidget; const AWidgetInfo: PWidgetInfo);
|
||||
procedure TGtkWSButton.SetCallbacks(const AGtkWidget: PGtkWidget;
|
||||
const AWidgetInfo: PWidgetInfo);
|
||||
begin
|
||||
TGtkWSWinControl.SetCallbacks(PGtkObject(AGtkWidget), TComponent(AWidgetInfo^.LCLObject));
|
||||
|
||||
|
@ -60,12 +60,32 @@ begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
function GTK2KeyUpDown(Widget: PGtkWidget; Event : pgdkeventkey;
|
||||
function GTK2KeyDown(Widget: PGtkWidget; Event : pgdkeventkey;
|
||||
Data: gPointer) : GBoolean; cdecl;
|
||||
begin
|
||||
Result := GtkWidgetIsA(Widget,GTK_APIWIDGETCLIENT_TYPE) and
|
||||
(HandleGtkKeyUpDown(Widget, Event, Data, True) or
|
||||
HandleGtkKeyUpDown(Widget, Event, Data, False));
|
||||
debugln('GTK2KeyDown ',DbgSName(TObject(Data)));
|
||||
Result := HandleGtkKeyUpDown(Widget, Event, Data, True);
|
||||
end;
|
||||
|
||||
function GTK2KeyDownAfter(Widget: PGtkWidget; Event : pgdkeventkey;
|
||||
Data: gPointer) : GBoolean; cdecl;
|
||||
begin
|
||||
debugln('GTK2KeyDownAfter ',DbgSName(TObject(Data)));
|
||||
Result := HandleGtkKeyUpDown(Widget, Event, Data, False);
|
||||
end;
|
||||
|
||||
function GTK2KeyUp(Widget: PGtkWidget; Event : pgdkeventkey;
|
||||
Data: gPointer) : GBoolean; cdecl;
|
||||
begin
|
||||
debugln('GTK2KeyUp ',DbgSName(TObject(Data)));
|
||||
Result := HandleGtkKeyUpDown(Widget, Event, Data, True);
|
||||
end;
|
||||
|
||||
function GTK2KeyUpAfter(Widget: PGtkWidget; Event : pgdkeventkey;
|
||||
Data: gPointer) : GBoolean; cdecl;
|
||||
begin
|
||||
debugln('GTK2KeyUpAfter ',DbgSName(TObject(Data)));
|
||||
Result := HandleGtkKeyUpDown(Widget, Event, Data, False);
|
||||
end;
|
||||
|
||||
function GTK2KillFocusCB(widget: PGtkWidget; event:PGdkEventFocus;
|
||||
@ -974,19 +994,21 @@ procedure TGTK2WidgetSet.SetCallback(const AMsg: LongInt; const AGTKObject: PGTK
|
||||
|
||||
procedure ConnectKeyPressReleaseEvents(const AnObject: PGTKObject);
|
||||
begin
|
||||
//debugln('gtk2object ConnectKeyPressReleaseEvents A ALCLObject=',DbgSName(ALCLObject));
|
||||
ConnectSenderSignal(AnObject,
|
||||
'key-press-event', @GTK2KeyUpDown, GDK_KEY_PRESS_MASK);
|
||||
'key-press-event', @GTK2KeyDown, GDK_KEY_PRESS_MASK);
|
||||
//ConnectSenderSignalAfter(AnObject,
|
||||
// 'key-press-event', @GTK2KeyUpDownAfter, GDK_KEY_PRESS_MASK);
|
||||
ConnectSenderSignal(AnObject,
|
||||
'key-release-event', @GTK2KeyUpDown, GDK_KEY_RELEASE_MASK);
|
||||
// 'key-press-event', @GTK2KeyDownAfter, GDK_KEY_PRESS_MASK);
|
||||
//ConnectSenderSignal(AnObject,
|
||||
// 'key-release-event', @GTK2KeyUp, GDK_KEY_RELEASE_MASK);
|
||||
//ConnectSenderSignalAfter(AnObject,
|
||||
// 'key-release-event', @GTK2KeyUpDownAfter, GDK_KEY_RELEASE_MASK);
|
||||
// 'key-release-event', @GTK2KeyUpAfter, GDK_KEY_RELEASE_MASK);
|
||||
end;
|
||||
|
||||
var
|
||||
gObject, gFixed, gCore: PGTKObject;
|
||||
begin
|
||||
//debugln('gtk2object.inc TGtkWidgetSet.SetCallback A ALCLObject=',DbgSName(ALCLObject),' AMsg=',dbgs(AMsg));
|
||||
gObject := AGTKObject;
|
||||
if gObject = nil then Exit;
|
||||
|
||||
@ -1011,7 +1033,7 @@ begin
|
||||
LM_CHAR,
|
||||
LM_KEYDOWN,
|
||||
LM_KEYUP,
|
||||
|
||||
|
||||
LM_SYSCHAR,
|
||||
LM_SYSKEYDOWN,
|
||||
LM_SYSKEYUP:
|
||||
@ -1499,6 +1521,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.25 2005/02/19 20:33:10 mattias
|
||||
fixed gtk2 key handle result
|
||||
|
||||
Revision 1.24 2005/02/16 23:56:51 mattias
|
||||
fixed some gtk2 intf mem leaks, clean ups
|
||||
|
||||
|
@ -9,21 +9,21 @@
|
||||
<SaveOnlyProjectUnits Value="True"/>
|
||||
</Flags>
|
||||
<MainUnit Value="0"/>
|
||||
<ActiveEditorIndexAtStart Value="0"/>
|
||||
<ActiveEditorIndexAtStart Value="6"/>
|
||||
<IconPath Value="./"/>
|
||||
<TargetFileExt Value=""/>
|
||||
<Title Value="test1_2button"/>
|
||||
</General>
|
||||
<Units Count="1">
|
||||
<Unit0>
|
||||
<CursorPos X="14" Y="210"/>
|
||||
<CursorPos X="14" Y="347"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<Filename Value="test1_2button.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<Loaded Value="True"/>
|
||||
<TopLine Value="193"/>
|
||||
<TopLine Value="321"/>
|
||||
<UnitName Value="test1_2button"/>
|
||||
<UsageCount Value="34"/>
|
||||
<UsageCount Value="38"/>
|
||||
</Unit0>
|
||||
</Units>
|
||||
<PublishOptions>
|
||||
|
Loading…
Reference in New Issue
Block a user