|
Post by George on Jul 29, 2019 15:15:32 GMT -5
Hi, After adding all the latest macro stuff for FM, and Post_do etc. I had expected to receive a "That's nice, but we need a function for ...." request.
Hard to believe we just guessed at a function set that satisfies everyone's needs.
George
|
|
|
Post by mueh on Jul 30, 2019 1:12:41 GMT -5
Hi George and Robert! I'm impressed how perfect it works . But let's see some Pictures . First shows the full Path Name in FM after MI Macro executed as Primary command .
|
|
|
Post by mueh on Jul 30, 2019 1:23:26 GMT -5
Second shows result of mi x command from First Picture . Third shows the result after line cmd's from second are executed . mi n starts Notepad fr and to cmd starts Compare for the two files .
|
|
|
Post by mueh on Jul 30, 2019 1:54:35 GMT -5
Here the MI/FR/TO/QK Macro which are identical . Asks in macro for that names to function . For more functions see comment in macro like mi L = locate file names with that txt . Open files in edited filelist e.t.c Work is not finished yet on the macro . MI.macro (23.91 KB) George : Since i use RMB as (SaveCursor)(LineNo)(SetInsert)[MI ](RestoreCursor)(Enter) so i don't Need to enter the macro Name (only optional Parameters if needed and RMB will insert Macro Name in front) may i politly ask for a new Hybrid Keystroke Primitive like LINECMD for HOME/LineNO which positions Cursor to 1'st Carater of LineNo or Cmd Line depending where the key is pressed . Should work in FM and Edit . Instead of Beep in LINENO Code if issued on cmd line do the Home Action . didn't get happy with BackTab in FM Line cmd . Here the Keystroke Primitives of Home and LineNo . Me.InitPrim("(Home)", %False, %True, CODEPTR(krHome), CODEPTR(FMkbHome), 0) Me.InitPrim("(LineNo)", %False, %True, CODEPTR(krLineNo), CODEPTR(FMkbLineNo), 0)
METHOD FMkbLineNo() '---------- LineNo key IF ISFALSE IsCLLin AND ISFALSE IsCLCmd AND ISFALSE IsCLNote THEN sDoBeep: MExitMeth ' Exit if not in line area me.CsrCol = 1 ' Go back to LCmd area END METHOD
METHOD krLineNo() '---------- LineNo key LOCAL ix, i AS LONG CsrLinDX = 0 ' Reset possible hidden DX line location '----- Only if in an eligible line IF IsCData OR IsCLinN THEN ' ix = sGetIX(CRow) ' Get IX of line the cursor is on IF ix = 0 OR ix = -3 THEN sDoBeep: EXIT METHOD ' Below last line or Hex dash line? Bail out me.CsrCol = 1 ' Move cursor back to col 1 ELSE ' sDoBeep ' Beep END IF ' END METHOD
METHOD FMkbHome() '---------- FM Mode Home key MEntry me.CsrRow = 1: me.CsrCol = 11: COffset = 0 ' Reset things me.WindowCmd ' Re-do the command line in case we shifted me.MarkLineNumb ' Refresh the line number MExit END METHOD
METHOD krHome() '---------- Home the cursor SetCmd ' Cursor to the command line COffset = 0 ' Remove Offset sDoCursor ' me.WindowCmd ' Redisplay the line END METHOD
Thanks for this beautiful feature .
|
|
|
Post by George on Jul 30, 2019 12:06:51 GMT -5
mueh: So you want a single command to work in both the command line and in the text/line area of both Edit and FM.
The command is to position to he 1st actual character in the Command line or Line command area, not just position 1.
Have I got that right?
George
|
|
|
Post by mueh on Jul 30, 2019 12:27:31 GMT -5
George: I think positioning to 1'st actual character in the Command Line or Line Cmd Area is perfect . RMB mapping with (SaveCursor)(NewKeyStroke)(SetInsert)[MI ](RestoreCursor)(Enter) will insert MI Macro Name followed by blank before first character in Cmd line or Line Cmd . Thanks
|
|
|
Post by mueh on Jul 30, 2019 13:49:28 GMT -5
George: Positioning to 1'st actual Character might be no good idea . What are you doing if nothing is in cmd line ? Just the Macro Name should be executed with the Mouse button . So positioning like Home/LineNo does it for Cmd Line/Line Cmd is enough fo this new Keyboard Primitive. MI n gives the same Get_Arg$ or Get_Src_Op result as MI n Thanks
|
|
|
Post by George on Jul 30, 2019 15:52:51 GMT -5
mueh: Well, if nothing in the field, then cursor goes to the 1st position, there's not really any other option.
Does Robert's suggestion of just left justifying the data not do what you want? Or would it cause a problem? Just having (Home) and (LineNo) do that justify would be a lot simpler than creating some new 'flavor' of command.
Or is it that you want one single command to do a sort-of combined (Home) and (LineNo). A sort of universal 'get me to the command area' function.
George
|
|
|
Post by mueh on Jul 31, 2019 1:21:43 GMT -5
George: I exactöy want one single command to do a sort-of combined (Home) and (LineNo). A sort of universal 'get me to the command area' function. With this universal "Get me to the Command area" i will be able to insert a macro Name in Line cmd Area or Cmd line with one Mouse click . One key Definition is needed and i don't have to think what key (with LINENO or Home ) i have to press . The macro is checking with IS_FM and IS_Primary_Cmd IS_Line_Cmd how it get invoked . Thanks
P.S. Just for info: If you are displayin the files in an FLIST FMGet_Mode returns 0 . No Problem to check for Zero . In all other cases i use the FM_EQU_.... definitions .
|
|
|
Post by George on Jul 31, 2019 10:01:42 GMT -5
Robert: MUEH uses the RMB to do an insert of a macro name in front of whatever is in the command area. i.e. RMB inserts FRED (or something) in front of what's already there.
The FRED macro is smart enough to detect whether it's being invoked as a Primary command, and Edit line command or an FM line command.
But to get the FRED inserted, the routine to insert FRED has to use three different routines one for primary commands, one for edit line commands and a third for FM line commands. He wants a single function that simply places the cursor properly so that all he has to do is set RMB to (NewCommand)(Insert)[add some text](Enter) which would now work regardless of which of the three locations were chosen.
My bet is right now he has three 'flavours' of RMB settings - Normal for Primary, Alt for Edit Line and Ctrl for FM line (or somthing like this), meaing he has to 'think' before hitting RMB.
I think the request has merit - now - what to name it.
MUEH. Can you confirm that I have this correct. And what default should it do if the cursor is in a non-valid position. (Home? Ignore it? etc.(
George
[P.S.] MUEH, yes there's a missing equate, I'll be adding "FM_EQU_FLISTData" for the Zero case.
George
|
|
|
Post by mueh on Jul 31, 2019 10:58:44 GMT -5
George: You got it . Just to clarify . Have now only 2 'flavours' since LineNo works in both FM and Edit and Home for Primary cmd line . If Cursor is at a non-valid Position i suggest to put it at Home . Found it's better than doing Beep as i suggested before . As for the Name i suggest CmdLineCmd or Pos1Cmd . Maybe you have a better idea . Thanks
|
|
|
Post by George on Jul 31, 2019 12:33:12 GMT -5
Robert: I think the need is to get the cursor to the left-hand end regardless of where you click in the line. Your solution works only if you position the click carefully at the beginning.
George
|
|
|
Post by George on Jul 31, 2019 14:39:05 GMT -5
I'm not sure what you mean by bug. Remember, if Edit has tabs set then (Tab)(BackTab) is not going to work EVER if the line is clicked somewhere to the right of the tab positions.
Otherwise, yes, your solution works fine, for those.
George
[Update] I think this does indeed need a new primitive. I'll go whip one up. How about MUEH's suggested name CmdLineCmd?
G.
|
|
|
Post by mueh on Jul 31, 2019 14:44:45 GMT -5
Hi Robert! Before i made this Suggestion i tested long with BackTab . It is nearly Perfect but if you use it in EDIT in the line command area the insert results in previous line . No Problem if Button is hit in txt area .
|
|
|
Post by George on Aug 1, 2019 10:38:39 GMT -5
OK (CmdHome) has been added.
George
|
|