Page 1 of 1
Will this work with stringGadget ?
Posted: Fri Mar 04, 2005 1:59 pm
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
Posted: Sun Mar 06, 2005 6:43 pm
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

Posted: Sun Mar 06, 2005 7:42 pm
by chippy73
Kale,
many thanks, that will do the job nicely.
Alan