Is there some news for bug #11505 (https://developer.berlios.de/bugs/?func=detailbug&bug_id=11505&group_id=5358 (https://developer.berlios.de/bugs/?func=detailbug&bug_id=11505&group_id=5358))?That's not a bug, but a feature request :) Regarding news to this feature, there are no recent news.
Thanks
Is there some news for bug #11505 (https://developer.berlios.de/bugs/?func=detailbug&bug_id=11505&group_id=5358 (https://developer.berlios.de/bugs/?func=detailbug&bug_id=11505&group_id=5358))?
Thanks
...
CB with the plugin:
-copy text outside CB, paste inside CB -> doesn't work
-copy text inside CB, paste inside CB -> works (well as you stated, the pasted text is selected. In other apps the cursor is placed after the pasted text or the original text is selected. I don't know what is the best behavior.)
-copy text inside CB, paste outside CB -> doesn't work
...
#ifdef __WXGTK__
void ScintillaWX::DoMiddleButtonUp(Point pt) {
// Set the current position to the mouse click point and
// then paste in the PRIMARY selection, if any. wxGTK only.
int newPos = PositionFromLocation(pt);
MovePositionTo(newPos, noSel, true);
pdoc->BeginUndoAction();
wxTextDataObject data;
bool gotData = false;
if (wxTheClipboard->Open()) {
wxTheClipboard->UsePrimarySelection(true);
gotData = wxTheClipboard->GetData(data);
wxTheClipboard->UsePrimarySelection(false);
wxTheClipboard->Close();
}
if (gotData) {
wxString text = wxTextBuffer::Translate(data.GetText(),
wxConvertEOLMode(pdoc->eolMode));
wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
int len = strlen(buf);
pdoc->InsertString(currentPos, buf, len);
SetEmptySelection(currentPos + len);
}
pdoc->EndUndoAction();
NotifyChange();
Redraw();
ShowCaretAtCurrentPosition();
EnsureCaretVisible();
}
#else
void ScintillaWX::DoMiddleButtonUp(Point WXUNUSED(pt)) {
}
#endif
...
CB with the plugin:
-copy text outside CB, paste inside CB -> doesn't work
Now I'm just wondering how do the other apps and native controls achieve this.Well, a native control doesn't have to worry, it's coded into it, it just happens. Console programs don't have to worry either, as the shell window does that.
Do you know if you can do the opposite (from scintilla to outside world) with scintilla?Yes, that's trivial, you only need to get the current text range and copy it to the clipboard. The problem is that you must do it every time the application loses focus, just in case. Actually, if you want to be able to copy from a text editor to somewhere else inside the application (file selector or whatever), you must do it every time the editor loses focus, or every time the user has made a new selection.
There's still the problem for selecting inside CB to paste outside. I agree that it should only be implemented for linux as this is quite a linux specific feature.
As for the scintilla code you gave, it seems to be the code for pasting with middle click inside scintilla (from what I understand). Do you know if you can do the opposite (from scintilla to outside world) with scintilla?
...
I see a little problem remaining: copy/paste using middle click works ok now, but using keyboard (ctrl-c/ctrl-v) doesn't work correctly if you copy from inside CB to CB itself or any other app.
Do you think it can be solved?
...
I see a little problem remaining: copy/paste using middle click works ok now, but using keyboard (ctrl-c/ctrl-v) doesn't work correctly if you copy from inside CB to CB itself or any other app.
Do you think it can be solved?