Once again about multiline StringGadget...

Just starting out? Need help? Post your questions and find answers here.
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Re: Once again about multiline StringGadget...

Post 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.
User avatar
Melissa
User
User
Posts: 71
Joined: Tue Sep 22, 2009 3:13 pm

Re: Once again about multiline StringGadget...

Post 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).
User avatar
Crusiatus Black
Enthusiast
Enthusiast
Posts: 389
Joined: Mon May 12, 2008 1:25 pm
Location: The Netherlands
Contact:

Re: Once again about multiline StringGadget...

Post 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 ;)
Image
Bas Groothedde,
Imagine Programming

I live in a philosophical paradoxal randome filled with enigma's!
User avatar
Melissa
User
User
Posts: 71
Joined: Tue Sep 22, 2009 3:13 pm

Re: Once again about multiline StringGadget...

Post 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.
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: Once again about multiline StringGadget...

Post 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)
PyroStrex
User
User
Posts: 61
Joined: Mon Mar 22, 2010 3:08 pm

Re: Once again about multiline StringGadget...

Post 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).
User avatar
Melissa
User
User
Posts: 71
Joined: Tue Sep 22, 2009 3:13 pm

Re: Once again about multiline StringGadget...

Post 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).
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: Once again about multiline StringGadget...

Post 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.
%101010 = $2A = 42
User avatar
Melissa
User
User
Posts: 71
Joined: Tue Sep 22, 2009 3:13 pm

Re: Once again about multiline StringGadget...

Post by Melissa »

It's nearly is, except for one little problem - I need StringGadget, not:
EditorGadget(1, 10, 40, 300, 300, #PB_Editor_ReadOnly)
User avatar
KJ67
Enthusiast
Enthusiast
Posts: 218
Joined: Fri Jun 26, 2009 3:51 pm
Location: Westernmost tip of Norway

Re: Once again about multiline StringGadget...

Post by KJ67 »

If you just removed the "#PB_Editor_ReadOnly" then?
:wink:
The best preparation for tomorrow is doing your best today.
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: Once again about multiline StringGadget...

Post by Perkin »

Oops :oops:

Has it GOT to be a StringGadget then?
Or can you use the EditorGadget?
%101010 = $2A = 42
User avatar
Melissa
User
User
Posts: 71
Joined: Tue Sep 22, 2009 3:13 pm

Re: Once again about multiline StringGadget...

Post 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.
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: Once again about multiline StringGadget...

Post 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.
%101010 = $2A = 42
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4946
Joined: Sun Apr 12, 2009 6:27 am

Re: Once again about multiline StringGadget...

Post 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
Egypt my love
User avatar
Melissa
User
User
Posts: 71
Joined: Tue Sep 22, 2009 3:13 pm

Re: Once again about multiline StringGadget...

Post 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.
Last edited by Melissa on Mon Apr 05, 2010 12:12 pm, edited 1 time in total.
Post Reply