In Xamarin.UWP, I have created a custom renderer for label using richtextblock. Within the richtextblock, I have used hyperlink to enter text with the ability to click on it. Can I change the underline from straight to dotted?
Related
Is there a way to have a button with text and graphic, with the graphic on the right side of the text, without having to owner-draw the button?
I want to just sent BM_SETIMAGE and whatever else would be needed so the graphic is to the right of the text.
Also, I noticed the image is so tight against the text that it doesn't look good. Is there a way to adjust the margin without having to use a blank space in the text?
Is there a way to have a button with text and graphic, with the graphic on the right side of the text, without having to owner-draw the button?
There are BS_LEFTTEXT and BS_RIGHTBUTTON styles available, but the documentation says they only apply to CheckBoxes and RadioButtons:
Constant
Description
BS_LEFTTEXT
Places text on the left side of the radio button or check box when combined with a radio button or check box style. Same as the BS_RIGHTBUTTON style.
BS_RIGHTBUTTON
Positions a radio button's circle or a check box's square on the right side of the button rectangle. Same as the BS_LEFTTEXT style.
For a standard push button, there does not appear to be a way to control the position of the image other than through owner-drawing.
Is there a way to adjust the margin without having to use a blank space in the text?
Use BCM_SETTEXTMARGIN/Button_SetTextMargin():
Sets the margins for drawing text in a button control.
I use CkEditor BalloonEditor:
BalloonEditor.create(document.querySelector('#editor'), { ...options... });
By design the balloon toolbar of CkEditor 5 is only shown when I mark some text in the editor. That's totally okay for standard text operations as making a text bold, italic or changing its colors.
But if I want to insert something (image, table, media) I first must type something, mark it, so that the toolbar is shown before I can insert new content. That is not practical. So actually the balloon editor is great for changing existing content, not to insert new content.
My idea now is, that I want to open the toolbar by clicking with the right mouse button, showing the toolbar instead of the browser's context menu. Nice would be if the toolbar then only contains actions to insert new content (as inserting image, table, media) and the actions for formatting content (as bold, italic, font color) disappears or at least are disabled.
So basically I would implement something like:
<div id="editor" oncontextmenu="showContextMenu(event)">
...
function showContextMenu(event) {
event.preventDefault();
// --> Open here the balloon toolbar at the current caret position. How?
}
I tried finding a solution with a hack:
When clicking with the right mouse button, I inserted a space character at the clicked position and marked/selected it automatically so that the CkEditor balloon editor opened the toolbar. That worked so far, but then I had this undesired space character in the document and I struggled to remove it gracefully afterwards. Furthermore the context menu also contained the text formatting actions (as bold, italic and so on, since there was text - the inserted space selected).
Another idea would be to develop an own toolbar completely detached from CkEditor and then using Commands to insert the appropriate commands as #denov has suggested in his solution. But I think this should actually be possible to achieve with the CkEditor API by using the class ContextualBalloon. But how?
Does anyone have any idea how to achieve this or can guide me with some directions?
Thx!
For images you can just drag the image into the editor.
Commands are the way to interact with the editor. The Images plugin uses the ImageInsertCommand
assuming you have the editor assigned to the global window object you could do
function showContextMenu(event) {
event.preventDefault();
window.editor.execute('imageInsert', { source: 'https://upload.wikimedia.org/wikipedia/commons/8/8d/Frog_on_palm_frond.jpg'} )
}
Unfortunately, it's not possible to show the balloon toolbar if the selection is collapsed. This behaviour is defined here.
I would like to know wether we can change the Text Alignment of a label using the App Inventor 2's Code Block. I would like to make a button to select the text alignment position of a label or button.
You can't change the text alignment of a label programmatically in App Inventor
As workaround for example define 2 Labels, one having an alignment left and another having an alighment right and hide the second label. Then after button click copy the text of the label and display the other label instead, see screenshot.
I want to make custom view or textview, which supports text selection and can also underline part of text string on long press and move-after-long-press events(drag to next line to underline) with different colors of underline. Undelined text can be clickable and get underlined text. I had tried to draw string in canvas and use SpannableString, UnderlineSpan and Clickable Span to draw underline and selection, But failed to get result as required.
Please help! Thank you in advance.
I want to click a text on the panel with a underline and the text color is blue, and then show a web , I know how to show a web , but how to define the text , in nib when I put a label on the window , I found the label didn't respond for the action , when I put a button with no border I found that I didn't edit the text attribute of the button , which module should I put on that and how to edit that text attribute?Thanks a lot.
The impact I want to show is : http://stackoverflow.com
You could use an NSTextField with attributed text marked with NSLinkAttributeName.
Check out this Apple example http://developer.apple.com/qa/qa2006/qa1487.html
Why don't you add a WebView and then you can put html directly in there?