Does anybody need to implement character overwriting? 
Author Message
 Does anybody need to implement character overwriting?

I've just made a unit that lets you implement global character overwriting
among all the application forms and switching between Insert/Overwrite
mode when typing in edit controls. It handles all sorts of typing-aware
controls as long as they are descendants from TCustomComboBox,
TCustomGrid or TCustomEdit

The unit contains two functions:

 function ProcessKbdMessages(var Msg: TMsg): boolean;
 function IsInsMode: boolean;

Function ProcessKbdMessages lets you implement character overwriting
and switching between Insert/Overwrite state with <Ins> key by including
the call to it into Application.OnMessage event as follows:

{ <<< Sample >>> }

unit Unit1;

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
    Forms, Dialogs, OvrChars;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure AppMessage(var Msg: TMsg; var Handled: Boolean);
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.OnMessage := AppMessage;
end;

procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean);
begin
  Handled := ProcessKbdMessages(Msg);
  if Handled then
    if InsMode then
      Label1.Caption := 'Ins'
    else
      Label1.Caption := 'Or';
end;

end.

{ <<< End of sample >>> }

Second of them, IsInsMode is used to check insert/overwrite state
of keyboard. You can inform the user about current state on
status bar or wherever you want.

Is there anybody interested in this unit?



Sun, 17 May 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Overwriting Space with Write character.

2. Novice need help doing user interface

3. Need Hhheeeeellllllllppppppppppppp on doing Windows screen saver.

4. help I need to know whether this can be done

5. Need pascal code for doing matrix algebra

6. Need pascal code for doing matrix algebra

7. character set problem, need help!!

8. HELP NEEDED!! character setup

9. converting string characters to char characters

10. Help needed with reading and counting of characters and words

11. Help needed with reading and counting of characters and

12. Need help with Null Characters and Blob Fields

 

 
Powered by phpBB® Forum Software