Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get copy and paste working #2

Closed
blippy opened this issue Nov 29, 2016 · 2 comments
Closed

Get copy and paste working #2

blippy opened this issue Nov 29, 2016 · 2 comments

Comments

@blippy
Copy link
Owner

blippy commented Nov 29, 2016

  1. The copy accelerator key should be Ctrl-c, the paste accelerator key should be Ctrl-v, and both menu items should be enabled.
  2. Get copying working.
  3. Get pasting working.
@blippy
Copy link
Owner Author

blippy commented Nov 30, 2016

ITEM 1 - MENU KEYS

fallback.c should now be changed to read:

//      "*copy.sensitive:               no",
//      "*paste.sensitive:              no",
        "*copy.accelerator:            Ctrl<Key>c",
        "*paste.accelerator:            Ctrl<Key>v",
        "*copy.acceleratorText:         Ctrl-c",
        "*paste.acceleratorText:         Ctrl-v",

ITEM 2 - COPYING

Changes needed to be made in CopyCB(). Use the function decomp() to obtain a pointer to the formula expressed as a string. The functions XmClipboardStartCopy(), XmClipboardCopy(), XmClipboardEndCopy() and a number of other Motif functions are used to affect the copy to clipboard.

In the line long private_id = 0x01E0;, 01E0 is a "magic number" identifying oleo. It looks like the word "OLEO".

Most of the code was cribbed from http://www.oreilly.com/openbook/motif/vol6a/Vol6a_html/ch17.html. In a call to XmClipboardStartCopy(), the parameter CurrentTime was passed in, as per the afrorementioned webpage. However man XmClipboardStartCopy says:

A valid timestamp must be supplied; it is not sufficient to use CurrentTime.

There does not appear to be an issue with its use, however.

ITEM 3 - PASTING

XmClipboardRetrieve() was called to retrieve the contents of the clipboard into a buffer of size 80. Motif has an ability to read in the clipboard in chunks, but I think the simple solution I have adopted is sufficient.

Setting this string - which may actually be a formula - into the cell is straigtforward:

                new_value(curow, cucol, buf);

blippy pushed a commit that referenced this issue Nov 30, 2016
For more details, see:
#2
@blippy
Copy link
Owner Author

blippy commented Nov 30, 2016

Closing, as issue has been implemented.

@blippy blippy closed this as completed Nov 30, 2016
blippy pushed a commit that referenced this issue Dec 5, 2016
* Support for vanilla X11 dropped.

* Conditional compilation for Motif+Xbae.

* issue2: Added Copy (Ctrl-c) and Paste (Ctrl-v)
  #2

* issue3: Removed splash screen
  #3

* Added support for Tcl scripting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant