I've made a custom subclass of NSTextStorage, which processes text as I need it to be processed.
To use this on a text view I need to create a NSTextContainer and a NSLayoutManager, and then assign the container to the UITextView.
This works without any problems if done programatically.
Is there a way how to change the text container and layout manager after the text view was loaded from a Storyboard or XIB file?
Related
I am working on an application where I am using a third-party PDF viewer PDFtron. I can select the text over the canvas, but once I inspect it, I can't see the text overlay. Only the annotations are there. You can check the demo here.
If I can select the text on this, but it's not actually 'HTML' then how it's rendered on the canvas.
Simply, I am looking for the HTML overlay, which I can access through DOM APIs.
I am wondering if I can somehow enable it?
Texts are rendered on the canvas, so that's why when you inspect you can not see them.
If you want the texts added to the DOM, you can try turn on the Accessibility mode - https://www.pdftron.com/documentation/web/samples/advanced/#accessibility.
And you can also try extract the text - https://www.pdftron.com/documentation/web/guides/extraction/text-extract/. Or get the information on the selected text using events - https://www.pdftron.com/documentation/web/guides/extraction/selected-text/.
I'm sure I am missing something straightforward and simple, but in xpages, using a tabbed panel, who do I get all the tabs to print when the users prints the page?
You can use a Dojo tab container (part of the extension library) instead of the standard tabbed panel. With the Dojo tab container the content of all tabs is loaded at once (in opposite to the standard tabbed panel, as Tim said), so you could do some CSS magic to make all tabs visible when printing.
Tim recommends building a separate XPage for printing, and I second that. Organize the content of the tabs in custom controls, create a new XPage for example with the suffix "_print" and include the custom controls in it without the tabbed panel. Then create a button, link or whatever in the first XPage which simple opens an XPage with the same name plus "_print" in a new window.
In the "_print" Xpage you can use a "window.print" after the page loads to open the print dialog automatically.
This technique has the advantage that you can style the printing exactly as needed. You can even control which content to include when printing by using the visible/rendered property and compute to render controls only when the current page name does not include "_print".
I'm using InstallShield Professional 2013, and I'm having troubles including a scrollable text area in a custom dialog box (like the SdLincenseE RTF dialog box).
I have tried using a normal Text area but it only displays the raw text. Is there a way to add the scrollable text area so it will display the contents of an rtf file like the SdLicenseEx RTF?
I managed to work around this issue by copying and renaming the SdLicenseEx followed by writing a function to handle the scrollable text area.
If not sure if this is the best way to handle this in an installscript project, but it worked for me.
I am trying to add both image and string in Tabs in LWUIT-1.5. Anyway both are comes in UI but the text is coming at bottom of the image. So, I need to add both in same place like overlapping the image.
Tabs tabs = new Tabs();
tabs.addTab("Text", Image, Component);
can any one help us ?
You seem to want a background image for the tabs not an icon (which is what that API is for), you should modify the style's for the Tab UIID in the resource editor and set the image background you want.
That is not possible without using resource editor. You set either image or text. If you set both, it takes image as icon and text as title automatically.
Create theme in resource editor by setting the background image for Tabs and apply the theme in your app.
I'm using a CMFCLinkCtrl in my custom dialog that inherits from CDialog. The CMFCLinkCtrl is set dynamically using data that is set by the user in another part of the application, so I have to handle long urls.
Is there a way to have the link control truncate what is displayed in the dialog and add an ellipse to the end? Currently the control is wrapping to the next line when it is too long to fit in the dialog or sees the "//" in the http://.
Static controls have an SS_ENDELLIPSIS style that does exactly what you want, but unfortunately this won't work with CMFCLinkCtrl which is derived from CButton. So you have two choices:
Use a static control with the SS_ENDELLIPSIS style, but you'll have to set the text colour and font yourself, and handle click events and open the URL manually.
Subclass CMFCLinkCtrl and add custom drawing code to add the ellipsis.
I think you're out of luck. You'll have to do what casablanca said or without subclassing truncate the text yourself (calculate the font size and link control size) and set it using SetWindowText.
You can easily resize the control to contain the entire text using SizeToContent, but I don't think this works for you.