Is there any reason that SB prevents the copying of label (and hyperlink) text? Is this a Dojo feature/limitation? Can this limitation be please be removed if possible (or disabled in code)?
I use labels to display some read-only data, such as record IDs, generated UIDs, fixed status text etc. When users want to send me feature requests / bug reports, they are unable to copy the text and have to copy by sight, which is difficult for some of the longer entries
Thanks
OS X, SB 1.40
Make label text copyable
- SparrowhawkMMU
- Posts: 281
- Joined: Wed Aug 19, 2015 3:02 pm
- Location: United Kingdom
Re: Make label text copyable
You can try this:
On a side note, we decided to disbale all selction to make the feel like a desktop app. Having a GUI where you can select all text within can be very messy at time
Code: Select all
Procedure RemoveNoSelectClassFromWindow(Window)
Protected WindowObject = WindowID(Window)
; Remove the specific class which disable all mouse selection
!$(v_windowobject.element).removeClass("sbNoSelect");
EndProcedure
OpenWindow(0, #PB_Ignore, #PB_Ignore, 300, 200, "", #PB_Window_ScreenCentered)
TextGadget(0, 10, 10, 200, 80, "Some test to select", #PB_Text_Border)
RemoveNoSelectClassFromWindow(0)
-
- Posts: 14
- Joined: Mon Oct 31, 2016 1:50 pm
- Location: Somewhere in this world...
- Contact:
Re: Make label text copyable
Another method is to set the window as background with #PB_Window_Background. It works fine ...
Yes, TextGadget also supports Html
Code: Select all
OpenWindow(#PB_Any,0,0,200,60,"Example of selectable text", #PB_Window_Background)
TextGadget(#PB_Any,0,0,200,50,~"<font face = \"segoe ui\">You can Select this text And this <a href \"http://www.google.com\">hyperlink</a></font>")
"It's only by continuously trying that you can finally succeed."-The Shadoks
Note : This Sherman is 100% made in France, so his default language is French... Please ̶p̶a̶r̶d̶o̶n̶a̶t̶e̶ forgive him his English ̶m̶i̶s̶t̶a̶ï̶q̶u̶e̶s̶ mistakes
Note : This Sherman is 100% made in France, so his default language is French... Please ̶p̶a̶r̶d̶o̶n̶a̶t̶e̶ forgive him his English ̶m̶i̶s̶t̶a̶ï̶q̶u̶e̶s̶ mistakes
Re: Make label text copyable
The fact it worked was a bug . Changed for next version
- SparrowhawkMMU
- Posts: 281
- Joined: Wed Aug 19, 2015 3:02 pm
- Location: United Kingdom
Re: Make label text copyable
Thanks for the info everyone.
- SparrowhawkMMU
- Posts: 281
- Joined: Wed Aug 19, 2015 3:02 pm
- Location: United Kingdom
Re: Make label text copyable
One suggestion perhaps: a new #PB_Gadget_TextSelectable (or whatever you want to call it) constant for Label gadgets so that this can be done at the gadget level without any JS code.
-
- Posts: 14
- Joined: Mon Oct 31, 2016 1:50 pm
- Location: Somewhere in this world...
- Contact:
Re: Make label text copyable
+1 for the option... And everyone will be happy
"It's only by continuously trying that you can finally succeed."-The Shadoks
Note : This Sherman is 100% made in France, so his default language is French... Please ̶p̶a̶r̶d̶o̶n̶a̶t̶e̶ forgive him his English ̶m̶i̶s̶t̶a̶ï̶q̶u̶e̶s̶ mistakes
Note : This Sherman is 100% made in France, so his default language is French... Please ̶p̶a̶r̶d̶o̶n̶a̶t̶e̶ forgive him his English ̶m̶i̶s̶t̶a̶ï̶q̶u̶e̶s̶ mistakes