Recent

Author Topic: WordStar emulation  (Read 14153 times)

VBDavie

  • New Member
  • *
  • Posts: 17
    • Fantastic Photo Viewer, RedEyeRemoval, Find Dups & Photo Mosaics and more.
WordStar emulation
« on: May 09, 2011, 04:39:08 am »
I've looked everywhere and I can't find an option to set the Delphi IDE Classic mode which uses the old standard Wordstar diamond patterns for Lazarus.  Some control keys work and others don't. LIke the ctrl-s works, but Ctrl-D does not. Ctrl-F doesn't either. It's like 50% work and the other 50% don't work ;(((

What can I do about this?
Davie :o
Fantastic Photo Viewer, RedEyeRemoval, Find Dups & Photo Mosaics and more
http://photojockey.com and more.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4652
  • I like bugs.
Re: WordStar emulation
« Reply #1 on: May 09, 2011, 09:20:29 am »
I've looked everywhere and I can't find an option to set the Delphi IDE Classic mode which uses the old standard Wordstar diamond patterns for Lazarus.  Some control keys work and others don't. LIke the ctrl-s works, but Ctrl-D does not. Ctrl-F doesn't either. It's like 50% work and the other 50% don't work ;(((

What can I do about this?

There is Options -> Editor -> Key Mappings. There "Choose Scheme" -> Classic.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

VBDavie

  • New Member
  • *
  • Posts: 17
    • Fantastic Photo Viewer, RedEyeRemoval, Find Dups & Photo Mosaics and more.
Re: WordStar emulation
« Reply #2 on: May 09, 2011, 09:50:33 pm »
That would be nice IF it worked. See, when I use that option to select the CLASSIC, it then moves the radiogroup selection to CLASSIC (as expected). Then I click "OK" to close the keymapping page and then I click "OK" to close the options page.

The the IDE OPERATES THE SAME. So, I go back into the keymappings and POOOOF, it's back to the TOP RADIOBUTTON, it's sitting on "LAZARUS" instead of the "CLASSIC" I had just THOUGHT I had selected. So, I tried various combinations of setting the option and closing the program and then reload the IDE, just to see if I could get it to stick. But to no avail.

I am running WinXP professional SP3 and all updates. The lazarus I'm using was from the downloaded install file:
lazarus-0.9.30-fpc-2.4.2-win32.exe

Thanks
Davie
Fantastic Photo Viewer, RedEyeRemoval, Find Dups & Photo Mosaics and more
http://photojockey.com and more.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4652
  • I like bugs.
Re: WordStar emulation
« Reply #3 on: May 10, 2011, 12:17:23 am »
Keymapping itself was changed. For example Ctrl-Z and Ctrl-W proved it.
However on Windows indeed the radiobutton stayed at the first (default) value.
I fixed it at r30648, and also copied it to fixes branch.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

VBDavie

  • New Member
  • *
  • Posts: 17
    • Fantastic Photo Viewer, RedEyeRemoval, Find Dups & Photo Mosaics and more.
Re: WordStar emulation
« Reply #4 on: May 10, 2011, 12:24:43 am »
THanks Huja, can you explain to me why it works on some but not WINDOWS? IE: Was there a fake message what was missed in windows? I know windows uses a different window message queue system. Just curious as to what the fix was.

Thansk, I will download now
DAvie
Fantastic Photo Viewer, RedEyeRemoval, Find Dups & Photo Mosaics and more
http://photojockey.com and more.

VBDavie

  • New Member
  • *
  • Posts: 17
    • Fantastic Photo Viewer, RedEyeRemoval, Find Dups & Photo Mosaics and more.
Re: WordStar emulation
« Reply #5 on: May 10, 2011, 12:52:31 am »
JuHa;

I looked at your change to the source code and I might be a little brain dead right now, but it looks like your fix is not really a fix at all. Not in the sense that it doesn't work, but in the sense that it HIDES another problem that is actually existing.... Let me explain. You have the following source....
function ShowChooseKeySchemeDialog(var NewScheme: string): TModalResult;
 
65 var
 
66   ChooseKeySchemeDlg: TChooseKeySchemeDlg;
 
67 begin
 
68   ChooseKeySchemeDlg:=TChooseKeySchemeDlg.Create(nil);
 
69   ChooseKeySchemeDlg.KeymapScheme:=NewScheme;
 
70   Result:=ChooseKeySchemeDlg.ShowModal;
 
71   if Result=mrOk then
 
72     NewScheme:=ChooseKeySchemeDlg.KeymapScheme;
 
73   ChooseKeySchemeDlg.Free;
 
74 end;
 
75 
76 { TChooseKeySchemeDlg }
 
77 
78 procedure TChooseKeySchemeDlg.ChooseKeySchemeDlgCREATE(Sender: TObject);
 
79 begin
 
80   Caption:=lisKMChooseKeymappingScheme;
 
81   NoteLabel.Caption:=lisKMNoteAllKeysWillBeSetToTheValuesOfTheChosenScheme;
 
82   SchemeRadiogroup.Caption:=lisKMKeymappingScheme;
 
83 
84   ButtonPanel.HelpButton.OnClick := @HelpButtonClick;
 
85 
86   with SchemeRadiogroup.Items do begin
 
87     Clear;
 
88     // keep order of TKeyMapScheme
 
89     Add(lisKMLazarusDefault);
 
90     Add(lisKMClassic);
 
91     Add(lisKMMacOSXApple);
 
92     Add(lisKMMacOSXLaz);
 
93     // do not add custom
 
94   end;
 
95 end;
 


And your logic is to basically ..
1. create the dlg form
2. Set the KeyMapScheme
3. Show the dlg as modal

Pretty simple! But in the dlgCreate event, that is where you clear the items from the radiogroup, and then re-add them to ensure they are in a particular order (not sure why they would ever change), but so be it. So you rebuild the list in the DLGCREATE event handler. This event handler is executed BEFORE you set the KeyMapScheme (CORRECT)?? And thus, this line...
69   ChooseKeySchemeDlg.KeymapScheme:=NewScheme;
Get's executed AFTER the code that rebuilds the radiogroup list. The code that you removed the beginupdate and endupdate from.
RIGHT?

So, reguardless of the beginupdate/endupdate interactions, the setting of the KeyMapScheme basically sets the ITEMINDEX to the appropriate index. RIGHT?  And so, it should not matter about the beginupdate or endupdate. ("should not") matter. So, if there IS a problem with beginupdate/endupdate in that it interferes with the setting of the ITEMINDEX, then I believe there is a much bigger problem going on here. 

In otherwords, "why in the world would removing the begin/endupdate methods FIX a problem with setting the ITEMINDEX for that same radiogroup later on in execution time?"

;)

DAvie
Fantastic Photo Viewer, RedEyeRemoval, Find Dups & Photo Mosaics and more
http://photojockey.com and more.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4652
  • I like bugs.
Re: WordStar emulation
« Reply #6 on: May 10, 2011, 12:10:11 pm »
It is clearly a bug in Windows LCL RadioGroup code.
When using BeginUpdate and EndUpdate, setting ItemIndex didn't work any more.
I will create a bug report later (now little busy).

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

VBDavie

  • New Member
  • *
  • Posts: 17
    • Fantastic Photo Viewer, RedEyeRemoval, Find Dups & Photo Mosaics and more.
Re: WordStar emulation
« Reply #7 on: June 13, 2011, 07:18:47 am »
Okay, see.. that makes sense that there was a bug in the ragiogroup code.

Have you or someone submitted a bug report on that? Seems to me that that could break a lot of standard delphi code that works with delphi.

Also, is there a page that lists all the known bugs?

Thanks
Davie
Fantastic Photo Viewer, RedEyeRemoval, Find Dups & Photo Mosaics and more
http://photojockey.com and more.

VBDavie

  • New Member
  • *
  • Posts: 17
    • Fantastic Photo Viewer, RedEyeRemoval, Find Dups & Photo Mosaics and more.
Re: WordStar emulation
« Reply #8 on: June 13, 2011, 07:21:00 am »
Woops, forgot to mention. Back in may when you suggested to get the latest fix, I COULD NOT FIND the latest fix (in EXE form). All I could find was the souce code updates. That's why I mentioned the beginupdate/endupdate problem.

Is there now a fix that is in EXE form that I can download and install on top of my current lazarus?

Thanks so much
Davie
Fantastic Photo Viewer, RedEyeRemoval, Find Dups & Photo Mosaics and more
http://photojockey.com and more.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4652
  • I like bugs.
Re: WordStar emulation
« Reply #9 on: June 13, 2011, 01:05:21 pm »
Have you or someone submitted a bug report on that? Seems to me that that could break a lot of standard delphi code that works with delphi.

I forgot to make a report. I got a new job recently and my time is still limited.
Could you maybe do it? A simple test project demonstrating the problem should be attached to the report.

Quote
Also, is there a page that lists all the known bugs?

It is the 3. link on the left, "Bugtracker".
 http://bugs.freepascal.org

Quote
Is there now a fix that is in EXE form that I can download and install on top of my current lazarus?

You can use the snapshots. I personally would recommend using the SVN server directly, either the fixes 0.9.30 branch or the trunk development branch.
They are easy to download, update and compile once you have FPC installed.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

chron

  • Newbie
  • Posts: 2
Re: WordStar emulation
« Reply #10 on: June 18, 2011, 12:47:24 pm »
I've looked everywhere and I can't find an option to set the Delphi IDE Classic mode which uses the old standard Wordstar diamond patterns for Lazarus.  Some control keys work and others don't. LIke the ctrl-s works, but Ctrl-D does not. Ctrl-F doesn't either. It's like 50% work and the other 50% don't work ;(((

What can I do about this?
Davie :o

Hello VBDavie, et Al!

Has there been a resolution to the IDE Classic keymapping function malfunction?  I too tried the WordStar keymappings, its not just malfunctioning, it only emulates a couple of keys. Here are the keymappings I expect to see of the original MicroPro's  'programming mode' of WordStar, which I consider essential for program editing.


Cursor Movement Commands
======================


Keystroke   Command
=========   =======
^A          Word Left
^S         Character Left
^D          Character Right
^F          Word Right

^E         Line Up
^X         Line Down
^QS         Move to Start of Line
^QD         Move to End of Line

^R         Page Up
^C          Page Down

^B          Para Down (copy formatting)

^W         Scroll Window Up
^Z              Scroll Window Down

^QW       Repeat Scroll Up
^QZ          Repeat Scroll Down

^QC         Move to End of Document
^QR         Go To Start of Document


^QE         Go to Top of Page (Top Left)
^QX         Go to End of Page (Bottom Right)

^QP         Previous Cursor Position (prior to jump scroll, go to, or find)


Delete Commands
===============

^G         Delete Char Right
^T         Delete Word Right
^Y         Delete Line
QY         Delete Right of Cursor to End of Line
^H         Backspace Delete
^QH          Delete Left of Cursor to Start of Line

^U         Edit Undo (multiple undos, in Delphi, Alt-Z performs same function)

Block Commands
==============

^KB         Mark Block Beginning (Persistent Blocks)
^KK         Marked Block End, (Highlights text area between ^KB & ^KK block markers)
^KC         Copy Marked Block to Cursor Position
^KY         Delete Block
^KV         Move Marked Block to Cursor Position
^KW       Write Block to File
^KR         Insert File into Marked Area

^QK         Go To Block End
^QB         Go To Block Beginning

^QV          Cursor to Last Find/Replace or Block Position

Find Commands
=============

^QF         Edit Find (auto-loads word as search key at cursor as default)
^QA         Edit Replace (auto-loads word as search key at cursor as default)
^L         Repeat Find/Change Default Drive/Directory (Folder) if no files open
^QV          Cursor to Last Find/Replace or Block Position

Misc Commands
=============

^K0~9      Drop Text-Anchor (Bookmarks)
^Q0~9      Move To Text-Anchor (Bookmarks)

^V         Overtype Mode/Insert Toggle (indication on status line)

===============

Thanks in advance,

xray
ps, I know these commands well, I've been using them since ~1978....B. Gates was still going, 'wah wah' & pooping his diapers.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4652
  • I like bugs.
Re: WordStar emulation
« Reply #11 on: November 03, 2011, 12:20:50 am »
Hi

I improved the classic key mapping. Please test.
I assigned ^B to jumping back in history (normally ^H) because the editor does not have "paragraph down" feature.
Char left / right does not work even I mapped it. I must figure out why.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018