Page 1 of 1

Non-breaking space

Posted: Wed Mar 09, 2011 12:39 am
by Koverhage
Hello Roger,

is there a way to insert a non-breaking-space with the dcget or dcmultiline command ?
I know the way with alt+255, but for the normal user is this intricate.

See
http://en.wikipedia.org/wiki/Non-breaking_space
Keyboard entry methods

Re: Non-breaking space

Posted: Wed Mar 09, 2011 7:37 am
by rdonnay
How are you wanting to do this? With the SPACE bar?

Re: Non-breaking space

Posted: Wed Mar 09, 2011 8:29 am
by Koverhage
with
Ctrl+Shift+Space
as Microsoft Word, Open Office

Re: Non-breaking space

Posted: Wed Mar 09, 2011 8:51 am
by rdonnay
Try this:

Code: Select all

#INCLUDE "dcdialog.CH"
#INCLUDE "appevent.CH"

#define xbeK_SH_CTRL_SPACE  720928

FUNCTION Main

LOCAL GetList[0], GetOptions, cMemo := '', oMemo

@ 0,0 DCMULTILINE cMemo SIZE 40,10 NOHSCROLL FONT '10.Lucida Console' OBJECT oMemo ;
      RESIZE DCGUI_RESIZE_RESIZEONLY

DCHOTKEY xbeK_SH_CTRL_SPACE ACTION {||PostAppEvent(xbeP_Keyboard,Asc(Chr(255)),,oMemo)}

DCGETOPTIONS RESIZE

DCREAD GUI FIT ADDBUTTONS TITLE 'Testing Chr(255)' OPTIONS GetOptions

WTF Chr(255) $ cMemo PAUSE

RETURN nil

PROC appsys ; RETURN

Re: Non-breaking space

Posted: Wed Mar 09, 2011 9:35 am
by Koverhage
Roger,

this work, thank you. Now i must find a way to make this global for all memo und character fields.

Re: Non-breaking space

Posted: Wed Mar 09, 2011 9:47 am
by rdonnay

Code: Select all

// Install global handler.  Put this in main program.
DC_ReadGuiHandler({|a,b,c,d,e,f|MyGlobalHandler(a,b,c,d,e,f)})



FUNCTION MyGlobalHandler( nEvent, mp1, mp2, oXbp, oDlg, Getlist )

IF nEvent == xbeP_Keyboard .AND. mp1 == xbeK_SH_CTRL_SPACE
  PostAppEvent( xbeP_Keyboard, Asc(Chr(255)),, oXbp )
ENDIF

RETURN DCGUI_NONE

Re: Non-breaking space

Posted: Thu Mar 10, 2011 1:47 am
by Koverhage
Roger,

thank you again.