Will this work with stringGadget ?

Windows specific forum
chippy73
User
User
Posts: 59
Joined: Wed Feb 16, 2005 6:11 pm
Location: S.W.Wales

Will this work with stringGadget ?

Post by chippy73 »

I am trying to use this with a string gadget but it returns zero.

Code: Select all

result = SendMessage_(GadgetID(#Gadget_Form1_Editortx),#EM_FINDWORDBREAK, #WB_RIGHT,70)
I am trying to do a word wrap on this string gadget.

Any comments welcomed.

Alan
PB v3.94 PVXP v2.13 JaPBe v2.5.4.22
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Maybe something like this:

Code: Select all

;===========================================================================
;-CONSTANTS
;===========================================================================

#APP_NAME = "String Gadget Test"

Enumeration
    #WINDOW_ROOT
EndEnumeration

;===========================================================================
;-PROCEDURES
;===========================================================================

;Handle an error
Procedure HandleError(Result, Text.s)
    If Result = 0 : MessageRequester("Error", Text, #PB_MessageRequester_Ok) : End : EndIf
EndProcedure

;===========================================================================
;-GEOMETRY
;===========================================================================

HandleError(OpenWindow(#WINDOW_ROOT, 0, 0, 400, 300, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, #APP_NAME), "Main window could not be created.")
HandleError(CreateGadgetList(WindowID(#WINDOW_ROOT)), "Gadget list for the main window could not be created.")
StringGadget(1, 10, 10, 380, 280, "", #ES_MULTILINE | #ESB_DISABLE_LEFT | #ESB_DISABLE_RIGHT | #ES_AUTOVSCROLL | #WS_VSCROLL)

;===========================================================================
;-MAIN LOOP
;===========================================================================

Repeat
    EventID.l = WaitWindowEvent()
Until EventID = #PB_Event_CloseWindow
End
Try a search m8 :)
--Kale

Image
chippy73
User
User
Posts: 59
Joined: Wed Feb 16, 2005 6:11 pm
Location: S.W.Wales

Post by chippy73 »

Kale,

many thanks, that will do the job nicely.

Alan
PB v3.94 PVXP v2.13 JaPBe v2.5.4.22
Post Reply