Changeset 8 for os/trunk/System


Ignore:
Timestamp:
Jun 2, 2013, 10:46:40 PM (12 years ago)
Author:
chronos
Message:
  • Added: Implemented simple TEdit control which react to key press messages.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • os/trunk/System/LDOS.Kernel.pas

    r7 r8  
    7373    function ReadKey: Char;
    7474    function KeyPressed: Boolean;
     75    procedure HandleKeyPress(Key: Word);
    7576  end;
    7677
     
    303304{ TKeyboard }
    304305
     306procedure TKeyboard.HandleKeyPress(Key: Word);
     307var
     308  Form: TForm;
     309  NewMessage: TMessageKeyPress;
     310begin
     311  NewMessage := TMessageKeyPress.Create;
     312  NewMessage.KeyCode := Key;
     313  try
     314    for Form in Kernel.Screen.Forms do
     315    if Form.HandleMessage(NewMessage) then begin
     316      Break;
     317    end;
     318  finally
     319    NewMessage.Destroy;
     320  end;
     321end;
     322
    305323function TKeyboard.KeyPressed: Boolean;
    306324begin
Note: See TracChangeset for help on using the changeset viewer.