Forum > General

Clipboard and RichMemo

(1/3) > >>

I use a button to automatically select all text from a RichMemo1 and transfer it, via the clipboard, to another RichMemo2.
As long as the application is open: no problem. Copy/Paste OK with all formatting attributes.

 But after closing the app (after the button procedure) the clipboard looks empty: no way to paste the text elsewhere.

By consulting the history of the clipboard, the text stored in memory appears there, but it has lost all its attributes of format, color ... and even that I cannot "paste" it anywhere (rtf compatible of course) . And it's annoying because if the user made a mistake, he could reopen the application and paste the lost text back into it...


(re) Bonjour,
J'utilise un bouton pour sélectionner automatiquement tout le texte d'un RichMemo et le transférer, via le presse papier, vers un autre RichMemo.
Tant que l'application est ouverte : pas de pb. Copier/Coller OK avec tous les attributs de formatage.

 Mais après la fermeture de l'appli (après la procedure du bouton) le presse papier à l'air vide : plus moyen de coller le texte ailleurs.

En consultant l'historique du presse papier, le texte mis en mémoire y figure bien, mais il perdu tous ses attributs de format, couleur ... et même ça je ne peux pas le "coller" nulle part (compatible rtf bien sûr). Et c'est gènant parce que si l'utilisateur a fait une erreur, il pourrait réouvrir l'application et y recoller le texte perdu ...


In the international part of the forum please use English as language or at least include an automatic translation (e.g. by Google Translate) in addition to your native language.

I don't know about recent Laz but the one I just looked at in the Destructor of the Clipboard class.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---   Clear;  inherited Destroy;              
just partial of the code of course.

 The CLEAR does what it states, it clears the clipboard.


  I forgot, if you are using the system's context menu then I'z not sure about that one. It should work,

Jurassic Pork:
depending what is your O.S, the clipboard is cleared when an application is terminated. On windows with Lazarus it is this case.
May be, before closing your application you can save the rtf content of the clipboard in a file and if you want, reload the clipboard with this content when reopening your application.

Ami calmant, J.P

Actually windows does maintain the clipboard when app exits if there is text on it.

I really don't thing the LCL should be clearing the text of the clipboard when it free's itself.

Or we could be using a BOOLEAN to indicate this before it gets cleared.

Property KeepTextOnClipboardAfterFree:Boolean;


[0] Message Index

[#] Next page

Go to full version