* mantis #25278 ascii table and #25239 (redundant help buttons) parts.

git-svn-id: trunk@26288 -
This commit is contained in:
marco 2013-12-26 17:14:50 +00:00
parent 62a5ba14a3
commit b2a4b4cfda
3 changed files with 31 additions and 12 deletions

View File

@ -4346,6 +4346,7 @@ end;
procedure TFPASCIIChart.HandleEvent(var Event: TEvent);
var W: PSourceWindow;
begin
writeln(stderr,'all what=',event.what,' cmd=', event.command);
case Event.What of
evKeyDown :
case Event.KeyCode of
@ -4356,6 +4357,16 @@ begin
end;
end;
evCommand :
begin
writeln(stderr,'fpascii what=',event.what, ' cmd=', event.command, ' ',cmtransfer,' ',cmsearchwindow);
if Event.Command=(AsciiTableCommandBase+1) then // variable
begin
W:=FirstEditorWindow;
if Assigned(W) and Assigned(Report) then
Message(W,evCommand,cmAddChar,Event.InfoPtr);
ClearEvent(Event);
end
else
case Event.Command of
cmTransfer :
begin
@ -4364,10 +4375,12 @@ begin
Message(W,evCommand,cmAddChar,pointer(ptrint(ord(Report^.AsciiChar))));
ClearEvent(Event);
end;
cmSearchWindow+1..cmSearchWindow+99 :
if (Event.Command-cmSearchWindow=Number) then
ClearEvent(Event);
end;
end;
end;
inherited HandleEvent(Event);
end;

View File

@ -171,7 +171,7 @@ var
CurrentPos : TPoint;
Handled : boolean;
procedure SetTo(xpos, ypos : sw_integer);
procedure SetTo(xpos, ypos : sw_integer;press:integer);
var
newchar : ptrint;
begin
@ -180,6 +180,10 @@ var
SetCursor(xpos,ypos);
Message(Owner,evCommand,AsciiTableCommandBase,
pointer(newchar));
if press>0 then
begin
Message(Owner,evCommand,AsciiTableCommandBase+press,pointer(newchar));
end;
DrawCurPos(true);
ClearEvent(Event);
end;
@ -191,7 +195,7 @@ begin
If MouseInView(Event.Where) then
begin
MakeLocal(Event.Where, CurrentPos);
SetTo(CurrentPos.X, CurrentPos.Y);
SetTo(CurrentPos.X, CurrentPos.Y,1);
exit;
end;
end;
@ -200,15 +204,16 @@ begin
Handled:=true;
case Event.Keycode of
kbUp : if Cursor.Y>0 then
SetTo(Cursor.X,Cursor.Y-1);
SetTo(Cursor.X,Cursor.Y-1,0);
kbDown : if Cursor.Y<Size.Y-1 then
SetTo(Cursor.X,Cursor.Y+1);
SetTo(Cursor.X,Cursor.Y+1,0);
kbLeft : if Cursor.X>0 then
SetTo(Cursor.X-1,Cursor.Y);
SetTo(Cursor.X-1,Cursor.Y,0);
kbRight: if Cursor.X<Size.X-1 then
SetTo(Cursor.X+1,Cursor.Y);
kbHome : SetTo(0,0);
kbEnd : SetTo(Size.X-1,Size.Y-1);
SetTo(Cursor.X+1,Cursor.Y,0);
kbHome : SetTo(0,0,0);
kbEnd : SetTo(Size.X-1,Size.Y-1,0);
kbEnter: SetTo(Cursor.X,Cursor.Y,1);
else
Handled:=false;
end;
@ -301,6 +306,7 @@ end;
procedure TASCIIChart.HandleEvent(var Event:TEvent);
begin
writeln(stderr,'ascii cmd',event.what, ' ', event.command);
if (Event.what=evCommand) and
(Event.Command = AsciiTableCommandBase) then
begin

View File

@ -1491,8 +1491,8 @@ begin
Inc(R.A.Y,3); Inc(R.B.Y,3);
if AOptions and fdHelpButton <> 0 then
begin
Insert(New(PButton, Init(R,slHelp,cmHelp, bfNormal)));
Inc(R.A.Y,3); Inc(R.B.Y,3);
//Insert(New(PButton, Init(R,slHelp,cmHelp, bfNormal)));
//Inc(R.A.Y,3); Inc(R.B.Y,3);
end;
R.Assign(1,16,48,18);
@ -2005,8 +2005,8 @@ begin
Insert(New(PButton, Init(R,slRevert, cmRevert, bfNormal)));
if AOptions and cdHelpButton <> 0 then
begin
Inc(R.A.Y,3); Inc(R.B.Y,3);
Insert(New(PButton, Init(R,slHelp, cmHelp, bfNormal)));
//Inc(R.A.Y,3); Inc(R.B.Y,3);
//Insert(New(PButton, Init(R,slHelp, cmHelp, bfNormal)));
end;
if AOptions and cdNoLoadDir = 0 then SetUpDialog;