Silverfrost Forums

Welcome to our forums

Underscore character in %eb edit box !!

28 Sep 2014 1:26 #14730

Hi Paul,

I'm waiting since long time for a response to my question:

Independently from keyboard type (English, Spanish, German), in my %eb edit box

WINIO@ (%23.11?`^eb[no_border,undo,hscrollbar,vscrollbar,report_right_clicks]@ &', ....

I cannot type underscore characters '' The old DOS method with holding left Alt button down while typing '95' at the numerical keypad creates the '' character. However, it is too complicated for practical use, an not possible on many notebooks.

This is really disturbing, because my customers are using frequently this character to define e.g. photo or point names like 23_012 or C_4711 which have to be entered in this box.

Please help! Erwin

28 Sep 2014 2:28 #14733

Can you give more details. I am using a standard UK keyboard and the under-score character appears as expected - i.e. it appears in a %eb box when I press the shift and minus key thus _

29 Sep 2014 8:10 #14739

Hi Paul,

as well on my keyboard shift and minus key should result in underscore. This key is neighbor of the right shift key on my keyboard.

I tried to isolate a small example from my code and found, that under some (un-identified) circumstances this key combination was acting like ctrl+v (paste).

Then I found the source of the problem: The accelerator key Shift+Ins. Without that line everything works fine.

    WINAPP '..\\icons\\rc_bbman.rc'

    PROGRAM BgoPara                    ! Parameter settings for .....

    USE      GlobalData
    USE      BgoParaData
    IMPLICIT NONE
    INCLUDE    <win32api.ins>
    INCLUDE    <clearwin.ins>
       :
       :

    MA = WINIO@ ('%ac[Ctrl+z]&',   'EDIT_UNDO')
    MA = WINIO@ ('%ac[Ctrl+c]&',    CB_COPY)
    MA = WINIO@ ('%ac[Ctrl+v]&',    CB_INSERT)
    MA = WINIO@ ('%ac[Shift+Del]&', CB_CUT)
!>> MA = WINIO@ ('%ac[Shift+Ins]&', CB_PASTE)    <<<<
    MA = WINIO@ ('%sh', HD_IMAGE)




 MODULE BgoParaData

    IMPLICIT NONE
       :
       :

    TYPE EB_EDIT_INFO                  ! Edit boxes for points and photos
       INTEGER   EB_H_POSITION
       INTEGER   EB_V_POSITION
       INTEGER   EB_LAST_LINE
       INTEGER, POINTER ::   EB_BUFFER
       INTEGER   EB_BUFFER_SIZE
       INTEGER   EB_MAX_BUFFER_SIZE
       INTEGER   EB_CURRENT_POSITION
       INTEGER   EB_SELECTION
       INTEGER   EB_N_SELECTED
       INTEGER   EB_VK_KEY
       INTEGER   EB_VK_SHIFT
       INTEGER   EB_ACTIVE
       INTEGER   EB_MODIFIED
       INTEGER   EB_CLOSING
       INTEGER   EB_USER_COLOURS
       INTEGER   EB_UNDO
       INTEGER   EB_LIMITED_HSCROLLBAR
       INTEGER   EB_NO_FRAME
       INTEGER   EB_NO_CURSOR_SNAP
       INTEGER   EB_REPORT_DOUBLE_CLICK
       INTEGER   EB_REPORT_RIGHT_CLICK
       INTEGER   EB_RESERVED(3)
    END TYPE EB_EDIT_INFO

    INTEGER      IBOX1(24), IBOX2(24), NREBOX
    TYPE (EB_EDIT_INFO) :: BOX1, BOX2
    EQUIVALENCE  (BOX1, IBOX1)
    EQUIVALENCE  (BOX2, IBOX2)

 END MODULE BgoParaData


    INTEGER FUNCTION CB_PASTE ()
    USE      BgoParaData
    IMPLICIT NONE
    INCLUDE    <clearwin.ins>

    IF (NREBOX .EQ. 1) THEN                 ! Select box 1 or 2
       CALL EDIT_CLIPBOARD_PASTE@ (IBOX1)
       CALL NEXT_EDIT_OPERATION@  (IBOX1)
    ELSE IF (NREBOX .EQ. 2) THEN
       CALL EDIT_CLIPBOARD_PASTE@ (IBOX2)
       CALL NEXT_EDIT_OPERATION@  (IBOX2)
    ENDIF

    CB_PASTE = 1
    RETURN
    END

Can you reproduce this or identify a fault in my code?

Erwin

29 Sep 2014 1:17 #14744

If you were able to present a working program then I might be able to comment.

29 Sep 2014 1:44 #14745

Erwin,

If it is too long for a forum post, put it on Dropbox or similar.

Eddie

14 Oct 2014 9:15 #14825

Here my example:

    WINAPP
!-----------------------------------------------------------
    MODULE BgoParaData

    IMPLICIT NONE
    INTEGER        KONTROL

    TYPE EB_EDIT_INFO
       INTEGER   EB_H_POSITION
       INTEGER   EB_V_POSITION
       INTEGER   EB_LAST_LINE
       INTEGER, POINTER ::   EB_BUFFER
       INTEGER   EB_BUFFER_SIZE
       INTEGER   EB_MAX_BUFFER_SIZE
       INTEGER   EB_CURRENT_POSITION
       INTEGER   EB_SELECTION
       INTEGER   EB_N_SELECTED
       INTEGER   EB_VK_KEY
       INTEGER   EB_VK_SHIFT
       INTEGER   EB_ACTIVE
       INTEGER   EB_MODIFIED
       INTEGER   EB_CLOSING
       INTEGER   EB_USER_COLOURS
       INTEGER   EB_UNDO
       INTEGER   EB_LIMITED_HSCROLLBAR
       INTEGER   EB_NO_FRAME
       INTEGER   EB_NO_CURSOR_SNAP
       INTEGER   EB_REPORT_DOUBLE_CLICK
       INTEGER   EB_REPORT_RIGHT_CLICK
       INTEGER   EB_RESERVED(3)
    END TYPE EB_EDIT_INFO

    INTEGER      IBOX2(24), NREBOX
    TYPE (EB_EDIT_INFO) :: BOX1, BOX2
    EQUIVALENCE  (BOX2, IBOX2)

    END MODULE BgoParaData
!-----------------------------------------------------------
    PROGRAM BgoPara

    USE      BgoParaData
    IMPLICIT NONE
    INCLUDE    <win32api.ins>
    INCLUDE    <clearwin.ins>
    INTEGER    CB_EDIT2, CB_PASTE
    EXTERNAL   CB_EDIT2, CB_PASTE
    INTEGER    MA

    MA = WINIO@ ('%ca@&', 'EditorTest')
    MA = WINIO@ ('%bg&', RGB@(135,215,230))
    MA = WINIO@ (' %`bg[white]&')
    MA = WINIO@ ('%30.11?`^eb[no_border,undo,hscrollbar, &
         & vscrollbar,report_right_clicks]@ &', '*',     & 
         & 0, IBOX2, CB_EDIT2, 'Edit box.')

    MA = WINIO@ ('%ac[Shift+Ins]&', CB_PASTE)

    MA = WINIO@ ('%lw', KONTROL)

    BOX2%EB_H_POSITION = 1
    BOX2%EB_V_POSITION = 1
    BOX2%EB_MODIFIED   = 0
    END
!-----------------------------------------------------------
    INTEGER FUNCTION CB_EDIT2 ()

    USE      BgoParaData
    IMPLICIT NONE

    NREBOX = 2
    CB_EDIT2 = 0
    RETURN
    END FUNCTION CB_EDIT2
!-----------------------------------------------------------

    INTEGER FUNCTION CB_PASTE ()

    USE      BgoParaData
    IMPLICIT NONE
    INCLUDE    <clearwin.ins>

    CALL EDIT_CLIPBOARD_PASTE@ (IBOX2)
    CALL NEXT_EDIT_OPERATION@  (IBOX2)

    CB_PASTE = 1
    RETURN
    END FUNCTION CB_PASTE
!-----------------------------------------------------------

Take some text into the paste buffer and then try to enter the '_' underscore character into the edit box.

Erwin

14 Oct 2014 10:01 #14826

ClearWin+ is translating the underscore to the accelerator [Shft+Ins]. I think that I can probably fix this but for now you could use something else like [Ctrl+V].

I notice that the paste is at the beginning of the text but I am hoping that the fix for this will be in your code.

14 Oct 2014 10:14 #14827

Oddly enough, if you delete the line associated with the paste callback you can insert the underscore character - but then you can't paste (UK keyboard).

I've been using Windows since version 1.0, and I still use the copy, cut and paste chords of Ctrl+Ins, Ctrl+Del and Shift+Ins. However, some versions of Windows ago the standard chords became Ctrl+C, Ctrl+X and Ctrl+V (for examples see the edit menu shortcuts in apps like Word etc in recent versions of Windows). It makes me think that Shift+Ins may not be reassignable with Clearwin+ %ac because of something in Windows rather than a bug in Clearwin+. On the other hand, Shift+Ins still works in other Windows apps.

Ctrl+V certainly works in place of Shift+Ins and allows creating an underscore when I modify your code.

I couldn't find where the standard key sequences changed, but there seem to be a lot of them! (See for example: http://www.howtogeek.com/115664/42-text-editing-keyboard-shortcuts-that-work-almost-everywhere/ )

Eddie

22 Jan 2015 9:11 #15388

This bug has now been fixed for the next release. I plan to upload a beta DLL soon for users to test.

Please login to reply.