Search Results

Search found 143 results on 6 pages for 'caret'.

Page 1/6 | 1 2 3 4 5 6  | Next Page >

  • Clipping the caret in a C# program

    - by Bob Sammers
    I'm creating a WinForms control in C# (using VS2008, .net 3.5) which allows text input. I've imported the necessary Win32 API functions from User32.dll for displaying the normal Windows caret and these are all working fine, but it's not displaying exactly how I'd like it. Text is displayed on the control with a blank border and I use Graphics.SetClip() to leave this margin clear. I want the caret to be clipped to the same region, but since I don't paint it and there's no obvious API function to set a clipping region, I can't see any way of doing this. Have I missed anything obvious? The caret is clipped inside the control in which it is drawn. I'm therefore aware that one solution could be to place the text in a separate sub-control with no border. However, if there's a simpler way than redesigning this part of the control, I'd like to look for that first. Thanks in advance for any help!

    Read the article

  • RichTextBox doesn't update caret position correctly

    - by shadeMe
    I have a handler consuming the keyDown event of a WinForms RTB, that has the following code: GetTextAtLoc(RTB->SelectionStart); // selects some text at the caret's position RTB->SelectedText = "SomeOfMyOwn"; GetTextAtLoc(RTB->SelectionStart); // selects the replacement string RTB->SelectionStart += RTB->SelectionLength - 1; While this code seems to do its job (SelectionStart/Length properties are updated correctly), the caret doesn't move to the end of the new string - It says right where it was at the time of GetTextAtLoc's first call. Redrawing the textbox does seem to have any effect either.

    Read the article

  • TextField Caret Does Not Display in Actionscript 3

    - by Cinegod
    Hello all, I am trying to display a text field that has text inside it, and display the flashing Caret at the end of the text. I have tried the following: Code: // ti_title is my textField stage.focus = ti_title; ti_title.setSelection( ti_title.length, ti_title.length ); I have also tried: // ti_title is my textField ti_title.stage.focus = ti_title; ti_title.setSelection( ti_title.length, ti_title.length ); The field is focused because I can type into it, but I do not see a Caret until I have started typing. This is not very good for usability. I have even tried removing text then re-adding it and then setting the selection again, but still not working. Any ideas? all the best nG

    Read the article

  • contentEditable javascript caret placement in div

    - by Ben Mc
    I have a contentEditable div. Let's say the user clicks a button that inserts HTML into the editable area. So, they click a button and the following is added to the innerHTML of the contentEditable div: <div id="outside"><div id="inside"></div></div> How do I automatically place the cursor (ie caret) IN the "inside" div? Worse. How can this work in IE and FF?

    Read the article

  • Set caret position in contenteditable div layer in Chrome/webkit

    - by Alex
    Hello, I'm trying to set the caret position in a contenteditable div layer, and after a bit of searching the web and experimenting I got it to work in firefox using this: function set(element,position){ element.focus(); var range= window.getSelection().getRangeAt(0); range.setStart(element.firstChild,position); range.setEnd(element.firstChild,position); } [...] set(document.getElementById("test"),3); But in Chrome/webkit it selects all of the content in the div. Is this a bug with webkit or am I doing something wrong? Thank you in advance.

    Read the article

  • What does the caret operator in Python do?

    - by Fry
    I ran across the caret operator in python today and trying it out, I got the following output: >>> 8^3 11 >>> 8^4 12 >>> 8^1 9 >>> 8^0 8 >>> 7^1 6 >>> 7^2 5 >>> 7^7 0 >>> 7^8 15 >>> 9^1 8 >>> 16^1 17 >>> 15^1 14 >>> It seems to be based on 8, so I'm guessing some sort of byte operation? I can't seem to find much about this searching sites other than it behaves oddly for floats, does anybody have a link to what this operator does or can you explain it here?

    Read the article

  • IntelliJ IDEA non standard caret behaviour

    - by Vaat666
    I have an issue with IntelliJ IDEA when selecting a big amount of text, and I cannot find the parameter to set to change that. Here is an example of the situation: My caret is on line 3 I scroll with the mouse wheel towards line 300 I press ctrl + shift I press the left button of the mouse Such an action would result in the text from line 3 to 300 being selected in all common editors (even in MS-Word I think), but not in IntelliJ. Do you know how to set this right? Thanks!

    Read the article

  • Notepad++ Move Caret Outside Bracket

    - by marknadal
    I've searched everywhere and can't find an answer to something incredibly simple and useful for Notepad++. When using autoclose, the cursor gets stuck inside, which is good until I've finished typing the parameters. How do I get the caret to jump outside of the currently nested autoclosed element? Regardless of it being (), {}, [], "", '', ? CTRL+B does does something similar, but it goes to the inside of the left bracket first, and then to the outside of the right bracket, which is where I want to be. This only works for brackets though, not tags and qoutations Hitting CTRL+B twice is cumbersome and manually hitting "right arrow" requires too much hand motion while coding. And finally, is there anyway I can map this to "SHIFT+Space"?

    Read the article

  • Set the caret/cursor position to the end of the string value WPF textbox

    - by Zamboni
    I am try to set the caret/cursor position to the end of the string value in my WPF textbox when I open my window for the first time. I use the FocusManager to set the focus on my textbox when my window opens. Nothing seems to work. Any ideas? Note, I am using the MVVM pattern, and I included only a portion of the XAML from my code. <Window FocusManager.FocusedElement="{Binding ElementName=NumberOfDigits}" Height="400" Width="800"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <TextBox Grid.Column="0" Grid.Row="0" x:Name="NumberOfDigits" IsReadOnly="{Binding Path=IsRunning, Mode=TwoWay}" VerticalContentAlignment="Center" Text="{Binding Path=Digits, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> <Button Grid.Column="0" Grid.Row="1" Margin="10,0,10,0" IsDefault="True" Content="Start" Command="{Binding StartCommand}"/> </Grid> </Window>

    Read the article

  • Cannot type '^' (caret) in native KDE apps

    - by nebukadnezzar
    I cannot type the caret character '^' in native KDE apps, such as plasmoids, editors (Kate, KWrite), etc. It worked in previous (older) versions of KDE (3.5, I think). I believe it may be related to the fact that I'm using a keyboard with a german layout, however, it would seem farfetched - I can type the caret character just fine in non-KDE apps (such as chrome, firefox, etc). I tried switching keyboard layouts, but no cigar. What's going on? What do I have to change to get the caret character back?

    Read the article

  • Tag-like autocompletion and caret/cursor movement in contenteditable elements.

    - by jimeh
    I'm working on a jQuery plugin that will allow you to do @username style tags, like Facebook does in their status update input box. My problem is, that even after hours of researching and experimenting, it seems REALLY hard to simply move the caret. I've managed to inject the <a> tag with someone's name, but placing the caret after it seems like rocket science, specially if it's supposed work in all browsers. And I haven't even looked into replacing the typed @username text with the tag yet, rather than just injecting it as I'm doing right now... lol There's a ton of questions about working with contenteditable here on Stack Overflow, and I think I've read all of them, but they don't really cover properly what I need. So any more information anyone can provide would be great :)

    Read the article

  • How do you programmatically move the caret of a Flex TextArea to the end?

    - by Akinwale
    I'm trying to move the caret in a Flex TextArea to the end after appending some text from my code. I've looked through the reference documentation for TextArea and its underlying TextField but it appears there is no method provided to handle this. One approach I've tried is to set focus to the text area and dispatch a KeyUp KeyboardEvent with the event's key code set to the "End" key, but this doesn't work. Any ideas on how to do this? Thanks.

    Read the article

  • Setting the a caret in an JEditor Pane causes an exception.

    - by Elliott
    I have a JeditorPane which has some text in HTML format. When I execute the following command int len = editorPane.getText().length(); The value for len is 7473. But then I try to do the following: editorPane.setCaretPosition(4995); And I get the following exception: java.lang.IllegalArgumentException: bad position: 4995 My understanding is that I should only get this exception if the position at which I'm trying to set the caret is less than 0 or greater than the text length. It is neither. How can this be. Thank you, Elliott

    Read the article

  • Set focus and carret position in textarea according to mouse position, as if user had clicked

    - by JeanHuguesRobert
    Once a page with a textarea is loaded, I want some textarea to have the focus immediatly if the mouse cursor is inside that textarea. This is the easy part because a onmousehover handler can set the focus. Now, how to I also set the position of the caret? I would like the caret to be where it would be if the user had clicked using the mouse to set the focus/caret. The basic use case is : User clicks on a link and waits (mouse barely moves) A page is delivered, it contains a big textarea only, full of text User types using keyboard Characters are inserted right below the mouse cursor Today the user has to wait until the caret is visible (at the top left of the textarea) and then click to move the caret before typing. Thanks!

    Read the article

  • JavaScript 'contenteditable' -- Getting/Setting Caret Position

    - by OneNerd
    I have read a few posts on positioning the caret, but none seem to answer my particular issue. I have 2 divs (div1 and div2) div1 = noneditable div div2 = contenteditable div both divs contain exact same contents when user clicks on div1, it gets hidden, and div2 appears in exact location and user can edit The problem: I want the caret to appear in exact location on div2 as div1 So, I need some way to READ the location where the user clicks on div1, and then when div2 appears place the cursor/caret in that same location, so a getCaretLocation(in_div_id) and setCaretLocation(in_div_id) set of functions. Any way to do that? Thanks -

    Read the article

  • Get the caret position when losing focus in WPF

    - by DrLazer
    I have two textbox's. I have an event setup for the "onLostFocus" of the textbox's. If i finish typing a word into both boxes one after the other all is well. At the point where i click back on the first textbox i want to click halfway through the word (perfectly resonable thing for a user to do). When the onLostFocus event fires here is my code : void tbox_LostFocus(object sender, RoutedEventArgs e) { IInputElement focusedelement = FocusManager.GetFocusedElement(this); if (focusedelement is TextBox) { TextBox focusedTextBox = focusedelement as TextBox; int focusIndex = m_commandsStacker.Children.IndexOf(focusedTextBox); int caretIndex = focusedTextBox.CaretIndex; The caret index is 0. At that point I refresh the whole form and set parameters and all other kinds of whizzery, storing the texbox index and caret position to put everything back the same. Why does it return 0 and not the position where the caret should be halfway between the word?

    Read the article

  • Chrome Extension contenteditable get and set caret position

    - by jwize
    I am creating an extension where I need to insert a link into the gmail window. I am able to create a simple extension button in the top of the window and execute code that does replaces all the links. Now, I want to do add links in the contenteditable section as I type. It seems like there should be a simple way to replace text with a link in the document object model. If this is not true I need to do three things. Insert text from the current caret position Capture the caret position. Set the caret position by its offset. I have tried using window.getSelection within the gmail context(that is a body element that is set to contenteditable and embedded inside an iframe in the gmail tab) to get the current range and position. The selection is always empty and contains no ranges regardless of whether text is selected or not.

    Read the article

  • Set Caret position with JTextArea in JScrollPane

    - by Albinoswordfish
    Right now I have a JTextArea inside of a JScrollPane. For the current content it has both a vertical and horizontal scroll bar showing up. I'm trying to implement a search functionality where a user can search for a certain string and it will set the caret position to the first occurrence of that string. However it seems that JScrollPane only scrolls vertically when I set my caret position. So matching strings going off the JTextArea horizontally will completely get missed and the horizontal scroll bar won't scroll at all. I'm using the basic function setCaretPosition() for the JTextArea Does anybody have any idea why my JScrollPane isn't moving horizontally using setCaretPosition() Edit: It appears the horizontal scroll bar is scrolling but it moves so little that it's barely noticeable. I can only see the very first pixel of the character. Is there a way to have the scrollbar center (or as much as possible) to the caret position?

    Read the article

  • In vim, prevent caret moving back when I leave edit mode?

    - by romkyns
    In vim, if I enter and leave edit mode without doing anything, the caret ends up one character to the left. And if I enter and leave append mode, the caret moves forwards and then backwards. Any way to configure vim to leave the caret alone in these cases? Ideally I just want to always enter append mode, but without moving the caret when I enter or exit the mode. (Currently I usually use insert mode because it doesn't mess up my caret position upon entry. That is, except when I need to append to the end of the line, in which case I swear at vim for behaving in such an archaic fashion, press Esc and enter append mode.)

    Read the article

  • TextMate: Highlight matching tags of caret location.

    - by subkamran
    Is it possible for TextMate to syntax highlight the opening and closing tags of your current caret location? And I am talking about constantly, not by pressing a key combo. Furthermore, if it possible, how can I do it? There doesn't seem to be any way that I know of except by using selectors in the theme, but I don't know if selectors can be context-sensitive.

    Read the article

  • Return caret postion or range of a div in IE8

    - by Robin
    I am wanting to return the start and end range or the caret postion inside a div. The div will have the attribute contentEditable. typically I would use document.selection.createRange(); but the createRange function is broken in IE8 is there a way to get around this?

    Read the article

1 2 3 4 5 6  | Next Page >