Alaska Software Inc. - Direction of INSERT in XbpSLE
Username: Password:
AuthorTopic: Direction of INSERT in XbpSLE
Itai Ben-ArtziDirection of INSERT in XbpSLE
on Mon, 03 Aug 2020 00:20:33 -0700
I am using a modified [Alaska sample] "CLASS XbpGet FROM XbpSLE" for
all of the data-entry fields.  If INSERT is on, characters are pushed
to the right as should be.  I'd like to change the direction of the
INSERT in numeric fields (oXbp:align := XBPSLE_RIGHT).  Is there a
method to change the direction of the INSERT so characters are pushed
to the left?  If yes, how?

In more general word:  Is there a way to change the direction of the
INSERT (e.g. where align:= XBPSLE_RIGHT)?

Many thanks,

-Itai
Andreas Gehrs-Pahl
Re: Direction of INSERT in XbpSLE
on Mon, 03 Aug 2020 19:54:16 -0400
Itai,

>I am using a modified [Alaska sample] "CLASS XbpGet FROM XbpSLE" for
>all of the data-entry fields.  If INSERT is on, characters are pushed
>to the right as should be.  I'd like to change the direction of the
>INSERT in numeric fields (oXbp:align := XBPSLE_RIGHT).  Is there a
>method to change the direction of the INSERT so characters are pushed
>to the left?  If yes, how?

You do have the source code of the XpbGet class available here:

	..\Source\Samples\Solution\xbpget\xbpget.prg

And you can change that code anyway you like.

>In more general word:  Is there a way to change the direction of the
>INSERT (e.g. where align:= XBPSLE_RIGHT)?

I don't think that the text alignment should be controlling the insert 
behavior, as those two things aren't logical related. Instead, you might 
want to create a sub-class for numerical entry fields with that specific 
behavior.

To do that, just create a new class like this:

Class XbpNumGet from XbpGet
   Exported:
   Method Init
   Method Keyboard
EndClass

Also, keep in mind that the keyboard input and picture handling for the 
XbpGet class are delegated to the Get class. So you could sub-class the 
InvisibleGet class to do the keyboard handling differently than the normal 
Get class, by overloading the :Insert() and :OverStrike() methods.

Then you would assign an object of that modified InvisibleGet class to your 
XbpNumGet:Get iVar.

You could also copy the code from the original XbpGet:Keyboard() method and 
modify it to add characters to the left of the cursor, instead of the right 
of the cursor, depending on the Set_Insert status. Keep in mind that this 
also affects other keyboard behavior, like TypeOut, and possibly backspace, 
delete, paste, etc.

You might get away with using the standard InvisibleGet class and simply 
using ::Get:Left() ; ::Get:OverStrike(cChar) ; ::Get:Left() in your new 
XbpNumGet:Keyboard() method, instead of just ::Get:Insert(cChar). But to 
eliminate unexpected side effects, the exact behavior needs to be tested and 
verified, according to your exact specifications.

You could even add an iVar to switch between LTR and RTL input, and switch 
between them using a keyboard shortcut, like CTRL + Right-Shift and CTRL + 
Left-Shift, as in MS Office applications, when languages with RTL scripts, 
like Hebrew or Arabic, are enabled.

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[L]:   https://www.LinkedIn.com/in/AndreasGehrsPahl
[F]:   https://www.FaceBook.com/AbsoluteSoftwareLLC
Jim LeeRe: Direction of INSERT in XbpSLE
on Tue, 04 Aug 2020 19:56:32 +0200
hi,

try SLEpic "Calculater" Mode
Itai Ben-ArtziRe: Direction of INSERT in XbpSLE
on Wed, 05 Aug 2020 21:50:15 -0700
Jim,
What is "Calculater" Mode?
I could not find any documentation about it.
How it should be used?

Many thanks,
-Itai
Jim LeeRe: Direction of INSERT in XbpSLE
on Thu, 06 Aug 2020 17:35:42 +0200
hi,

> What is "Calculater" Mode?
> I could not find any documentation about it.
> How it should be used?

* Note NEW 1.82
*              @M         N          SLE will be placed in Math/Calculator 
mode.
*                                    Data entry is like a calculator.
*                                    Note: - (minus) will toggal sign on non 
zero values!
*                                    Note: No other picture mask allowed
James LoughnerRe: Direction of INSERT in XbpSLE
on Thu, 06 Aug 2020 20:04:40 -0400
On 8/3/20 3:20 AM, Itai Ben-Artzi wrote:
> I am using a modified [Alaska sample] "CLASS XbpGet FROM XbpSLE" for
> all of the data-entry fields.  If INSERT is on, characters are pushed
> to the right as should be.  I'd like to change the direction of the
> INSERT in numeric fields (oXbp:align := XBPSLE_RIGHT).  Is there a
> method to change the direction of the INSERT so characters are pushed
> to the left?  If yes, how?
> 
> In more general word:  Is there a way to change the direction of the
> INSERT (e.g. where align:= XBPSLE_RIGHT)?
> 
> Many thanks,
> 
> -Itai
> 
Maybe try mu SLEPic class

http://gogalthorp.com/splash/SLEPIC.ZIP

Jim
Itai Ben-ArtziRe: Direction of INSERT in XbpSLE
on Thu, 13 Aug 2020 15:09:48 -0700
Thanks!
The SLEPic does not reverse the direction of the insert (e.g. if the
cursor is placed on 3, in the field [1234.56], inserting a digit 8
does not yield 12384.56).
-Itai
James LoughnerRe: Direction of INSERT in XbpSLE
on Sun, 23 Aug 2020 10:33:26 -0400
On 8/13/20 6:09 PM, Itai Ben-Artzi wrote:
> Thanks!
> The SLEPic does not reverse the direction of the insert (e.g. if the
> cursor is placed on 3, in the field [1234.56], inserting a digit 8
> does not yield 12384.56).
> -Itai
> 
You have the code fell free to adjust it to your liking

Jim