paste

NSTextField: exposing its Copy and Paste methods

折月煮酒 提交于 2019-11-28 14:16:20
I am trying to access the copy, cut, and paste methods of a NSTextField instance in its window delegate so I can customize these methods. I find that unlike tableViews and textViews, the textfield's copy, paste and cut actions are not responsive in the delegate. My understanding is that all text controls share the window's field editor yet this does not seem to be the case. I thought perhaps the TextField's field editor was not being shared with the window delegate, however I did some testing I see that as I am typing in control, those field editors are identical--very strange. My current work

VIM Replace word with contents of paste buffer?

蹲街弑〆低调 提交于 2019-11-28 13:20:56
问题 I need to do a bunch of word replacements in a file and want to do it with a vi command, not an EX command such as :%s///g . I know that this is the typical way one replaces the word at the current cursor position: cw<text><esc> but is there a way to do this with the contents of the unnamed register as the replacement text and without overwriting the register? 回答1: I'm thinking by "paste" you mean the unnamed (yank/put/change/delete/substitute) register, right? (Since that's the one that'd

jquery how to get the pasted content

亡梦爱人 提交于 2019-11-28 07:17:19
I have a little trouble catching a pasted text into my input: <input type="text" id="myid" val="default"> $('#myid').on('paste',function(){ console.log($('#myid').val()); }); console.log shows: default How I catch the pasted text and get ready to use? Because the paste event is triggered before the inputs value is updated, the solution is to either: Capture the data from the clipboard instead, as the clipboards data will surely be the same as the data being pasted into the input at that exact moment. Wait until the value has updated using a timer Luckily, years after the original answer was

Apply CKEditor Advanced Content Filter to a string

我与影子孤独终老i 提交于 2019-11-28 06:33:15
问题 How can I apply CKEditor's Advanced Content Filter to a string? I'm trying to intercept pasted content using editor.on('paste', ...), get its ACF-filtered value, and then apply my own transformations to the filtered value. After this point, it's okay if it runs through the ACF again. 回答1: I reported recently a ticket which I think you'll find interesting: http://dev.ckeditor.com/ticket/11621. There's a pretty high chance that this feature will be introduced in CKEditor 4.5. ( Edit : This

Jquery / JS bind “paste” event handler to input textbox

删除回忆录丶 提交于 2019-11-28 06:32:14
Allright, SO i have an input box and I need to do things everytime it changes, I am having trouble doing it for mouse paste. Here is the code I have $("#attack-navy"+unit.ID+"-number").bind('paste', function(){ alert("paste detected"); $("#attack-max-capacity").text(getMaxCapacity()); }); the getMaxCapacity() function return number entered * 30 for now; Here is the scenario when 1: I paste 3, it will not change (i still see the alert) 2: Then when i paste 5, it will be 90(3 * 30) 3: Then if i paste 10 it will be 150(5 * 30), and so on. I think its doing the handler before the paste actually

PIL crop and paste problem: Cropping doesn't create a cropped image

本秂侑毒 提交于 2019-11-28 06:03:52
问题 I'm trying to crop an image and then paste the cropped image into the centre of another image. Ideally I'd like the cropped image to be smaller than the image its being pasted on so that there is a border around the pasted image but I don't know if that's possible. Here's what I've tried (along with the resulting error message): >>> import Image >>> grey = Image.new('RGB', (200, 200), "grey") >>> House = Image.open("House01.jpg") >>> print grey.size, grey.mode, grey.format >>>(200, 200) RGB

VBA-excel paste chart as a picture

北城以北 提交于 2019-11-28 04:33:38
问题 I am creating various charts from the same source. I would like to be able to cut paste with vba each chart as a picture. Does anyone know the right code? I tried with this but it does not work: Range("B21:C22").Select ActiveSheet.Shapes.AddChart.Select ActiveChart.SetSourceData Source:=Range("'Graphs'!$B$21:$C$22") ActiveChart.ChartType = xl3DPie ActiveChart.ChartArea.Select ActiveChart.ChartArea.Copy ActiveSheet.Pictures.Paste.Select 回答1: I always find copying charts confusing, but this

Paste side by side multiple files by numerical order

柔情痞子 提交于 2019-11-28 04:26:13
问题 I have many files in a directory with similar file names like file1, file2, file3, file4, file5, ..... , file1000. They are of the same dimension, and each one of them has 5 columns and 2000 lines. I want to paste them all together side by side in a numerical order into one large file, so the final large file should have 5000 columns and 2000 lines. I tried for x in $(seq 1 1000); do paste `echo -n "file$x "` > largefile done Instead of writing all file names in the command line, is there a

Clean Microsoft Word Pasted Text using JavaScript

自作多情 提交于 2019-11-28 03:42:50
I am using a 'contenteditable' <div/> and enabling PASTE. It is amazing the amount of markup code that gets pasted in from a clipboard copy from Microsoft Word. I am battling this, and have gotten about 1/2 way there using Prototypes' stripTags() function ( which unfortunately does not seem to enable me to keep some tags ). However, even after that, I wind up with a mind-blowing amount of unneeded markup code. So my question is, is there some function (using JavaScript), or approach I can use that will clean up the majority of this unneeded markup? OneNerd Here is the function I wound up

Eclipse copy/paste entire line keyboard shortcut

自作多情 提交于 2019-11-28 02:39:10
Anyone know the keyboard shortcut to copy/paste a line into a new line in Eclipse , without having to highlight the entire line? ctrl - alt - down turns my whole screen upside down (I'm on windows). Interestingly, that's what's specified in the windows->preferences. Pierre-Antoine LaFayette Ctrl - Alt - Down : copies current line or selected lines to below Ctrl - Alt - Up :: copies current line or selected lines to above Ctrl - Shift - L : brings up a List of shortcut keys See Windows/Preference->General->Keys. KrishPrabakar (Tested in Windows) In Eclipse, press Ctrl + Shift + L two times in