It is currently Sun Sep 15, 2019 11:30 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [Done] StringGadget allows multiple lines
PostPosted: Tue Mar 19, 2019 4:16 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 447
The StringGadget allows multiple lines when setting the text programatically or pasting it in.
Code:
If OpenWindow(0, 0, 0, 322, 205, "StringGadget Flags", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  StringGadget(0, 8,  10, 306, 25, "Line 1" + Chr(10) + "Line 2" + Chr(10) + "Line 3")
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

Using the following fixes the issue, but it doesn't update until the StringGadget is clicked.
Code:
cell = CocoaMessage(0, GadgetID(0), "cell")
CocoaMessage(0, cell, "setUsesSingleLineMode:", #YES)


Top
 Profile  
Reply with quote  
 Post subject: Re: StringGadget allows multiple lines
PostPosted: Fri Apr 12, 2019 1:50 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13612
Location: France
I added the flag, but the gadget doesn't behave very well if you try to delete text (spawn again on multiple lines). You shouldn't use multiline in a string gadget IMHO.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] StringGadget allows multiple lines
PostPosted: Fri Apr 12, 2019 5:53 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 447
I agree about not using multiline text in a StringGadget. Without the flag, the user can paste multiline text in, so I believe that will solve the problem. Thanks.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye