This is a small procedure to Activate or Deactivate the EditorGadget() wordwrap behaviour. The code work on Windows and Linux.
Have Fun !!
Regards
Guimauve
P.S. Sorry for the French comments in this source.
Code: Select all
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; Nom du projet : EditorGadgetActivateWordWrap()
; Nom du fichier : EditorGadgetActivateWordWrap.pbi
; Version du fichier : 1.0.0
; Programmation : OK
; Programmé par : Guimauve
; Date : 17-01-2010
; Mise à jour : 17-01-2010
; Code PureBasic : 4.40 
; Plateforme : Windows, Linux
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Procedure EditorGadgetActivateWordWrap(EditorID.l, State.l)
  TextBuffer.s = GetGadgetText(EditorID)
  If State = 0
    CompilerSelect #PB_Compiler_OS
      CompilerCase #PB_OS_Windows 
        SendMessage_(GadgetID(EditorID), #EM_SETTARGETDEVICE, #Null, $FFFFFF)
      CompilerCase #PB_OS_Linux
        gtk_text_view_set_wrap_mode_(GadgetID(EditorID), #GTK_WRAP_NONE)
    CompilerEndSelect
  ElseIf State = 1
    CompilerSelect #PB_Compiler_OS
      CompilerCase #PB_OS_Windows 
        SendMessage_(GadgetID(EditorID), #EM_SETTARGETDEVICE, #Null, 0)
      CompilerCase #PB_OS_Linux
        gtk_text_view_set_wrap_mode_(GadgetID(EditorID), #GTK_WRAP_WORD)
    CompilerEndSelect
  EndIf 
  SetGadgetText(EditorID, TextBuffer)
EndProcedure 
; <<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< FIN DU FICHIER <<<<<
; <<<<<<<<<<<<<<<<<<<<<<<<<<












