mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 14:56:00 +02:00
MG: if completion form visible it will now get all synedit keys
git-svn-id: trunk@1737 -
This commit is contained in:
parent
e09134034f
commit
16aae9b974
@ -624,7 +624,8 @@ begin
|
|||||||
Result:=Form.OnSearchPosition;
|
Result:=Form.OnSearchPosition;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynBaseCompletion.SetOnSearchPosition(NewValue :TSynBaseCompletionSearchPosition);
|
procedure TSynBaseCompletion.SetOnSearchPosition(
|
||||||
|
NewValue :TSynBaseCompletionSearchPosition);
|
||||||
begin
|
begin
|
||||||
Form.OnSearchPosition:=NewValue;
|
Form.OnSearchPosition:=NewValue;
|
||||||
end;
|
end;
|
||||||
@ -642,8 +643,6 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// ToDo: redirect the Editor input to the form
|
|
||||||
|
|
||||||
Form.SetBounds(x,y,Form.Width,Form.Height);
|
Form.SetBounds(x,y,Form.Width,Form.Height);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Form.Left:=x;
|
Form.Left:=x;
|
||||||
@ -925,9 +924,6 @@ begin
|
|||||||
if F.CurrentEditor <> nil then begin
|
if F.CurrentEditor <> nil then begin
|
||||||
with F.CurrentEditor as TCustomSynEdit do begin
|
with F.CurrentEditor as TCustomSynEdit do begin
|
||||||
CommandProcessor(ecChar, Key, nil);
|
CommandProcessor(ecChar, Key, nil);
|
||||||
{$IFDEF SYN_LAZARUS}
|
|
||||||
|
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -974,6 +970,15 @@ var
|
|||||||
ShortCutShift: TShiftState;
|
ShortCutShift: TShiftState;
|
||||||
begin
|
begin
|
||||||
if Key=VK_UNKNOWN then exit;
|
if Key=VK_UNKNOWN then exit;
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
if (Form<>nil) and (Form.Visible) then begin
|
||||||
|
// completion form is visible, but the synedit got a key
|
||||||
|
// -> redirect to form
|
||||||
|
Form.KeyDown(Key,Shift);
|
||||||
|
// eat it
|
||||||
|
Key:=VK_UNKNOWN;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
ShortCutToKey(FShortCut, ShortCutKey, ShortCutShift);
|
ShortCutToKey(FShortCut, ShortCutKey, ShortCutShift);
|
||||||
if (Shift <> ShortCutShift) or (Key <> ShortCutKey) then exit;
|
if (Shift <> ShortCutShift) or (Key <> ShortCutKey) then exit;
|
||||||
|
|
||||||
@ -984,6 +989,9 @@ begin
|
|||||||
p := ClientToScreen(Point(CaretXPix, CaretYPix + LineHeight));
|
p := ClientToScreen(Point(CaretXPix, CaretYPix + LineHeight));
|
||||||
Form.CurrentEditor := Sender as TCustomSynEdit;
|
Form.CurrentEditor := Sender as TCustomSynEdit;
|
||||||
Execute(GetPreviousToken(Sender as TCustomSynEdit), p.x, p.y);
|
Execute(GetPreviousToken(Sender as TCustomSynEdit), p.x, p.y);
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
// eat it
|
||||||
|
{$ENDIF}
|
||||||
Key := VK_UNKNOWN;
|
Key := VK_UNKNOWN;
|
||||||
TRecordUsedToStoreEachEditorVars(fEditstuffs[i]^).NoNextKey := true;
|
TRecordUsedToStoreEachEditorVars(fEditstuffs[i]^).NoNextKey := true;
|
||||||
end;
|
end;
|
||||||
|
@ -3602,11 +3602,16 @@ end;
|
|||||||
procedure TCustomSynEdit.ShowCaret;
|
procedure TCustomSynEdit.ShowCaret;
|
||||||
begin
|
begin
|
||||||
if not (eoNoCaret in Options) and not (sfCaretVisible in fStateFlags) then
|
if not (eoNoCaret in Options) and not (sfCaretVisible in fStateFlags) then
|
||||||
|
begin
|
||||||
if {$IFDEF SYN_LAZARUS}LCLLinux{$ELSE}Windows{$ENDIF}.ShowCaret(Handle) then
|
if {$IFDEF SYN_LAZARUS}LCLLinux{$ELSE}Windows{$ENDIF}.ShowCaret(Handle) then
|
||||||
begin
|
begin
|
||||||
//writeln('[TCustomSynEdit.ShowCaret] A ',Name);
|
//writeln('[TCustomSynEdit.ShowCaret] A ',Name);
|
||||||
Include(fStateFlags, sfCaretVisible)
|
Include(fStateFlags, sfCaretVisible)
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
SetCaretRespondToFocus(Handle,not (eoPersistentCaret in fOptions));
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomSynEdit.UpdateCaret;
|
procedure TCustomSynEdit.UpdateCaret;
|
||||||
|
@ -55,11 +55,20 @@ end;
|
|||||||
{ callback routines }
|
{ callback routines }
|
||||||
{*************************************************************}
|
{*************************************************************}
|
||||||
|
|
||||||
// GTKRealizeCB is used to set extra signal masks after the widget window is created
|
{-------------------------------------------------------------------------------
|
||||||
// define extra events we're interrested in
|
function GTKRealizeCB
|
||||||
|
Params: Widget: PGtkWidget; Data: Pointer
|
||||||
|
Result: GBoolean
|
||||||
|
|
||||||
|
GTKRealizeCB is called by the gtk, whenever a widget is realized (ie mapped).
|
||||||
|
That means that the gdk window on the xserver has been created. This function
|
||||||
|
is used for the second part of the initialization of a widget.
|
||||||
|
-------------------------------------------------------------------------------}
|
||||||
function GTKRealizeCB(Widget: PGtkWidget; Data: Pointer): GBoolean; cdecl;
|
function GTKRealizeCB(Widget: PGtkWidget; Data: Pointer): GBoolean; cdecl;
|
||||||
begin
|
begin
|
||||||
EventTrace('realize', nil);
|
EventTrace('realize', nil);
|
||||||
|
// set extra signal masks after the widget window is created
|
||||||
|
// define extra events we're interrested in
|
||||||
gdk_window_set_events(Widget^.Window,
|
gdk_window_set_events(Widget^.Window,
|
||||||
gdk_window_get_events(Widget^.Window) or TGdkEventMask(Data));
|
gdk_window_get_events(Widget^.Window) or TGdkEventMask(Data));
|
||||||
|
|
||||||
@ -2029,6 +2038,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.80 2002/06/06 14:41:29 lazarus
|
||||||
|
MG: if completion form visible it will now get all synedit keys
|
||||||
|
|
||||||
Revision 1.79 2002/06/05 12:33:57 lazarus
|
Revision 1.79 2002/06/05 12:33:57 lazarus
|
||||||
MG: fixed fonts in XLFD format and styles
|
MG: fixed fonts in XLFD format and styles
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user