Page 1 of 1

stringgadget wordwrap problem!?

Posted: Fri Feb 06, 2004 6:07 pm
by DEU.exe
Hi,
following question about a program from purearea.net:

Code: Select all

If OpenWindow(0,0,0,340,480,#PB_Window_SystemMenu,"") And CreateGadgetList(WindowID(0))
StringGadget(0,8,8,326,466,"Does anybody know how to set this stringgadget to auto-word wrap? When the text is too long, it is cut out and this is my problem. Do you know understand what I mean? I want the gadget to automatically add a line return when the text is too long and continued in the next line. Can anybody help me? Please! Thank you!",#ES_MULTILINE | #ESB_DISABLE_LEFT | #ESB_DISABLE_RIGHT | #ES_AUTOVSCROLL | #WS_VSCROLL)
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
This works perfect under winXP, but...
on win98 the text is right aligned????? :evil:

Any ideas?

F.

Posted: Fri Feb 06, 2004 7:16 pm
by El_Choni
The only workaround for this is create your own StringGadget (edit control), there are examples in the forum.

Posted: Fri Feb 06, 2004 7:22 pm
by GPI
Use a Editor-Gadget:

Code: Select all

Procedure EditGadgetEnableTextWarp(Id); - Activate the automatic word-warp for a EditorGadget
  GID=GadgetID(11)
  dc=GetWindowDC_(GID)
  SendMessage_(GID, #EM_SETTARGETDEVICE ,dc ,-1)
  ReleaseDC_(GID,dc)
EndProcedure

EditorGadget(1,blablabla)
EditGadgetEnableTextWarp(1)
@Andre:
Can you remove the example above? Because it only work on XP (and i found no information, that it is allowed to use this constants to a string-gadget in the SDK...)

Posted: Fri Feb 06, 2004 7:25 pm
by Kale

Code: Select all

If OpenWindow(0,0,0,340,480,#PB_Window_SystemMenu,"") And CreateGadgetList(WindowID(0)) 
EditorGadget(0, 8, 8, 326, 466)
SendMessage_(GadgetID(0), #EM_SETTARGETDEVICE, #NULL, 0)
SetGadgetText(0, "Does anybody know how to set this stringgadget to auto-word wrap? When the text is too long, it is cut out and this is my problem. Do you know understand what I mean? I want the gadget to automatically add a line return when the text is too long and continued in the next line. Can anybody help me? Please! Thank you!")
Repeat 
    Until WaitWindowEvent()=#PB_Event_CloseWindow 
EndIf

Posted: Fri Feb 06, 2004 8:24 pm
by Andre
@GPI / Kale: Can anyone test Kale's new code on Win98, please ? On WinXP it works fine, if its the same for other Windows versions I will change the code the CodeArchive to the new one... 8)

Posted: Fri Feb 06, 2004 11:00 pm
by DEU.exe
@ GPI / Kale / Andre:
Kale's prog works fine, but in purearea the first prog is described with 'stringgadget with wordwrap' and kale's doesn't have the rightclick kontext-menu like in the stringgadget.

@ El_Choni: I know, we talked about this, but my question was WHY?

Posted: Sat Feb 07, 2004 1:12 pm
by TronDoc
on my w98fe...
DEU.exe's code does wrap and has right-click options, but it is right justified
and Kale's wraps correctly but lacks the right-click options as mentioned.
Joe

Posted: Sat Feb 07, 2004 4:43 pm
by GPI
DEU.exe wrote:@ GPI / Kale / Andre:
Kale's prog works fine, but in purearea the first prog is described with 'stringgadget with wordwrap'
Thats why I said, that the Example should be removed. It work only on XP and it must not work under other Windows-Version
and kale's doesn't have the rightclick kontext-menu like in the stringgadget.
The program it by your self.
@ El_Choni: I know, we talked about this, but my question was WHY?
Why it not work under Win98? You use constants, which are not designed to use it here.