stringgadget wordwrap problem!?

Just starting out? Need help? Post your questions and find answers here.
DEU.exe
User
User
Posts: 13
Joined: Sun Oct 19, 2003 11:21 am
Location: www

stringgadget wordwrap problem!?

Post 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.
pIII@1Ghz, wXP, 512MB, pb3.93full
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

The only workaround for this is create your own StringGadget (edit control), there are examples in the forum.
El_Choni
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post 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...)
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post 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
--Kale

Image
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2139
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post 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)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
DEU.exe
User
User
Posts: 13
Joined: Sun Oct 19, 2003 11:21 am
Location: www

Post 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?
pIII@1Ghz, wXP, 512MB, pb3.93full
TronDoc
Enthusiast
Enthusiast
Posts: 310
Joined: Wed Apr 30, 2003 3:50 am
Location: 3DoorsDown

Post 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
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post 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.
Post Reply