Page 2 of 3

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 7:52 am
by UserOfPure
:shock: :roll: The sheer arrogance and rudeness just keeps coming. Can't you understand why nobody is helping you? Especially after you just linked to www.youfail.org ? Good luck with your programming endeavours. You're going to need it. You would've had your answer on the first day if you had asked nicely, or even if you had done the search that I told you. Amazing.

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 8:17 am
by Melissa
The sheer arrogance and rudeness just keeps coming. Can't you understand why nobody is helping you? Especially after you just linked to www.youfail.org ? Good luck with your programming endeavours. You're going to need it. You would've had your answer on the first day if you had asked nicely, or even if you had done the search that I told you. Amazing.
Oh, mine... There just was no room for 'pretty-pretty-pretty please' in my first post. Well, not a big deal, since people aren't reading it anyways. Yes, I actually done that search. There was no single word about auto-hiding scrollbars, yet plenty of questions about word-wrap. So ? Just link me page where you found solution, if it's really there (which I doubt a lot).

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 8:21 am
by Crusiatus Black
Looks like that most of posters didn't actually even bothered to read my request.
You've got that right, I'm posting, but I've read the unfriendly throwing of the word 'fail' and that's
when I decide not to even look any further into the original subject.

I now might fail in your eyes, but hey, ethics fail in your eyes aswell.
Oh, mine... There just was no room for 'pretty-pretty-pretty please' in my first post. Well, not a big deal, since people aren't reading it anyways. Yes, I actually done that search. There was no single word about auto-hiding scrollbars, yet plenty of questions about word-wrap. So ? Just link me page where you found solution, if it's really there (which I doubt a lot).
And you're still asking for help...
I would advice you to read some MSDN articles on the subject, you can probably search the MSDN networks
right? Well, search there and you might find something. This is constructive advice, I don't expect a 'fail' back
from you now ;)

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 8:28 am
by Melissa
Now I would be very, very rude, quoting my first post:
It’s first time when MSDN completely fails for me.
...So funny: whole thread about good manners and nobody even tried to observe one of main etiquette rules on forums: "read BEFORE posting".
No, I got one more request: please, people, tell me what I asked about in this thread ? Really interested to hear your guesses.

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 8:50 am
by Vera
This is what I wanted to post some minutes ago:
Hello,
to me it never sounded 'rude', as I understood it as 'This is in vain, as the advice fails to deliver the result I'm wishing for'.

As Melissa searches via russian-google I think it's only an unhappy useing of the word. Still I stuck to join in as well, because the answers are much to short of information and don't allow any reasonings.
~~~~~~~~~~~~~~~

But I'm sorry to realize now that it had been meant to be rude. :(

@Melissa
why can't your request be that comprehensive as your flames are now ?
Here again - a bit of sourcecode would have been easier to understand and handle for anybody.

@All
HHEM - Image - (Happy Holy Easter Monday)

cheers ~ Vera

~~~~~~~~~~~~~~~
Melissa wrote:"read BEFORE posting"
I did this several times and I investigated several hours to find out what you really meant and if there are any hints or solutions to find - (and the forum is quite filled with stringgadget - concerns)

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 8:58 am
by PyroStrex
Well, i've tried to read again your request and found out that you want to enable the scrollbar only when you need it. This can be done if there's a way to measure the string height and compare it with the window of the stringGadget. But, i've search through google and can't find anything about it. I Hope you'll find something useful. (This is only a tips for you).

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 9:04 am
by Melissa
But I'm sorry to realize now that it had been meant to be rude.
Not really - just got used to it since AIB experience).
why can't your request be that comprehensive as your flames are now ?
Here again - a bit of sourcecode would have been easier to understand and handle for anybody.
OK, let me state it's more clear:
1) I know how to make multiline StringGadget.
2) I know how to add scrollbars to it.
3) I know how to add word-wrapping to StringGadget.
4) I want to know how to do this, but for more 'stationary' (^^) Windows and writeable StringGadget.
...Is it really so much ?
Well, i've tried to read again your request and found out that you want to enable the scrollbar only when you need it. This can be done if there's a way to measure the string height and compare it with the window of the stringGadget. But, i've search through google and can't find anything about it. I Hope you'll find something useful. (This is only a tips for you).
Thanks, you first who got my question).

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 9:58 am
by Perkin
I think this does what you want, and it's quite simple.
If it doesn't then I may have mis-understood what you want.

Code: Select all

If OpenWindow(1, 40, 40, 400, 400, "Scrollbar Test", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_SizeGadget)
	EditorGadget(1, 10, 40, 300, 300, #PB_Editor_ReadOnly)
	SendMessage_(GadgetID(1), #EM_SETTARGETDEVICE, #Null, 0)
	ButtonGadget(2,10,10, 80, 24, "MORE")
	Repeat
	  Event=WaitWindowEvent(10)
	  Select Event
			Case #PB_Event_Gadget
				Select EventGadget()
				  Case 2
				    SetGadgetText(1, GetGadgetText(1)+"This is another long line of text to see if scrollbars come up automatically."+#CRLF$)
				EndSelect
		EndSelect
	Until Event=#PB_Event_CloseWindow
	
EndIf
EDIT:
If you want an editable StringGadget, just remove the ', #PB_Editor_ReadOnly' from the Gadget creation line.

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 10:24 am
by Melissa
It's nearly is, except for one little problem - I need StringGadget, not:
EditorGadget(1, 10, 40, 300, 300, #PB_Editor_ReadOnly)

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 10:31 am
by KJ67
If you just removed the "#PB_Editor_ReadOnly" then?
:wink:

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 10:38 am
by Perkin
Oops :oops:

Has it GOT to be a StringGadget then?
Or can you use the EditorGadget?

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 10:51 am
by Melissa
Has it GOT to be a StringGadget then?
Yes - i need plain text I/O (no RTF at all) and #PB_EventType_Change.

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 11:46 am
by Perkin
For the #PB_EventType_Change check out this thread http://www.purebasic.fr/english/viewtop ... ype_Change

I'm sure you can do an EditorGadget that display just unformatted text.
check out this thread http://www.purebasic.fr/english/viewtop ... t+raw+text

Hope these solve your probs.

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 11:53 am
by RASHAD

Code: Select all

OpenWindow(0,0,0,320,330,"",#PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StringGadget(0,10,10,300,65,"",#ES_MULTILINE|#WS_DLGFRAME|#WS_VSCROLL)
ShowScrollBar_(GadgetID(0),#SB_VERT,0)

Repeat  
  Select WaitWindowEvent()
    Case #PB_Event_Menu
      
    Case #PB_Event_Gadget    
     Select EventGadget()      
      Case 0
        If SendMessage_(GadgetID(0),#EM_GETLINECOUNT,0,0) > 4
            ShowScrollBar_(GadgetID(0),#SB_VERT,1)
        ElseIf SendMessage_(GadgetID(0),#EM_GETLINECOUNT,0,0) < 5
            ShowScrollBar_(GadgetID(0),#SB_VERT,0)
        EndIf

     EndSelect
    
    Case #PB_Event_CloseWindow
      Break
  EndSelect
  
ForEver

Re: Once again about multiline StringGadget...

Posted: Mon Apr 05, 2010 12:01 pm
by Melissa
2Perkin: Well, looks like that it's only way. However, I'm kinda worried about maximal capacity of EditorGadget... Also it lacks context menu.
2RASHAD: I need sizeable gadget here.