Changes for TComboBox events KeyPress Focus.

Shane

git-svn-id: trunk@143 -
This commit is contained in:
lazarus 2001-01-28 21:06:07 +00:00
parent b45677ffb5
commit 5db12a2d5c
3 changed files with 33 additions and 2 deletions

View File

@ -747,6 +747,7 @@ end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
Procedure TWinControl.KeyPress(var Key: Char); Procedure TWinControl.KeyPress(var Key: Char);
begin begin
Writeln('[KeyPress] KeyPress');
if Assigned(FOnKeyPress) then FOnKeyPress(Self, Key); if Assigned(FOnKeyPress) then FOnKeyPress(Self, Key);
end; end;
@ -759,6 +760,7 @@ var
ShiftState: TShiftState; ShiftState: TShiftState;
begin begin
Result := True; Result := True;
Writeln('Getting focus...');
F := GetParentForm(Self); F := GetParentForm(Self);
if (F <> nil) if (F <> nil)
and (F <> Self) and (F <> Self)
@ -1266,6 +1268,8 @@ end;
Procedure TWinControl.WMSetFocus(var Message : TLMSetFocus); Procedure TWinControl.WMSetFocus(var Message : TLMSetFocus);
Begin Begin
Assert(False, Format('Trace:TODO: [TWinControl.LMSetFocus] %s', [ClassName])); Assert(False, Format('Trace:TODO: [TWinControl.LMSetFocus] %s', [ClassName]));
Writeln('Getting focus...');
DoEnter;
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -1388,6 +1392,9 @@ end;
procedure TWinControl.WMKillFocus(var Message: TLMKillFocus); procedure TWinControl.WMKillFocus(var Message: TLMKillFocus);
begin begin
Assert(False, Format('Trace: TODO: [TWinControl.LMKillFocus] %s', [ClassName])); Assert(False, Format('Trace: TODO: [TWinControl.LMKillFocus] %s', [ClassName]));
Writeln('Losing focus...');
DoExit;
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -1884,6 +1891,10 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.12 2001/01/28 21:06:07 lazarus
Changes for TComboBox events KeyPress Focus.
Shane
Revision 1.11 2001/01/23 23:33:54 lazarus Revision 1.11 2001/01/23 23:33:54 lazarus
MWE: MWE:
- Removed old LM_InvalidateRect - Removed old LM_InvalidateRect

View File

@ -457,7 +457,10 @@ activate_time : the time at which the activation event occurred.
StrDispose(pStr); StrDispose(pStr);
end; end;
LM_SETFOCUS:gtk_widget_grab_focus(PgtkWidget(handle)); LM_SETFOCUS: if GTK_WIDGET_CAN_FOCUS(PgtkWidget(Handle)) then
gtk_widget_grab_focus(PgtkWidget(handle))
else
Writeln('This control '+TControl(Sender).name+' can not get focus');
LM_SetSize : LM_SetSize :
begin begin
@ -1253,6 +1256,12 @@ begin
begin begin
if (sender is TMemo) then if (sender is TMemo) then
Writeln('KEY-PRESS-EVENT for TMEmo'); Writeln('KEY-PRESS-EVENT for TMEmo');
if (sender is TComboBox) then
Begin
ConnectSignal(PgtkObject(PgtkCombo(TComboBox(sender).handle)^.entry), 'key-press-event', @GTKKeyUpDown, GDK_KEY_PRESS_MASK);
ConnectSignal(PgtkObject(PgtkCombo(TComboBox(sender).handle)^.entry), 'key-release-event', @GTKKeyUpDown, GDK_KEY_RELEASE_MASK);
end;
ConnectSignal(gFixed, 'key-press-event', @GTKKeyUpDown, GDK_KEY_PRESS_MASK); ConnectSignal(gFixed, 'key-press-event', @GTKKeyUpDown, GDK_KEY_PRESS_MASK);
ConnectSignal(gFixed, 'key-release-event', @GTKKeyUpDown, GDK_KEY_RELEASE_MASK); ConnectSignal(gFixed, 'key-release-event', @GTKKeyUpDown, GDK_KEY_RELEASE_MASK);
end; end;
@ -2587,6 +2596,10 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.23 2001/01/28 21:06:07 lazarus
Changes for TComboBox events KeyPress Focus.
Shane
Revision 1.22 2001/01/28 03:51:42 lazarus Revision 1.22 2001/01/28 03:51:42 lazarus
Fixed the problem with Changed for ComboBoxs Fixed the problem with Changed for ComboBoxs
Shane Shane

View File

@ -110,6 +110,9 @@ type
property Visible; property Visible;
property OnChange; property OnChange;
property OnClick; property OnClick;
property OnEnter;
property OnExit;
property OnKeyPress;
end; end;
TListBoxStyle = (lbStandard, lbOwnerDrawFixed, lbOwnerDrawVariable); TListBoxStyle = (lbStandard, lbOwnerDrawFixed, lbOwnerDrawVariable);
@ -492,6 +495,10 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.11 2001/01/28 21:06:07 lazarus
Changes for TComboBox events KeyPress Focus.
Shane
Revision 1.10 2001/01/11 20:16:47 lazarus Revision 1.10 2001/01/11 20:16:47 lazarus
Added some TImageList code. Added some TImageList code.
Added a bookmark resource with 10 resource images. Added a bookmark resource with 10 resource images.