Copy & Paste support

Hello everyone,

I have, as many of you, a custom GUI built on top of SDL. I have
edit boxes, among other things.

Now, I want to implement copy-paste, at least in the Win32 build.
Not only within my app but copying somewhere and pasting in my
edit box.

I can think of an easy way of doing it, and that’s listening to
CTRL-V or SHIFT-INS and doing the appropriate actions then. However,
this is somewhat fragile and somewhat ugly from a design standpoint,
because I want to intercept Paste events, not CTRL-V events.

Is there any other way of implementing this?

Thanks,
–Gabriel

Ing. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

I think Paste events are always a key combination event. You can have Paste
events from a CTRL-V or even from a custom combination.
CTRL-V is somewhat of a pattern but u can use any other. So for this reason
u can’t have a PASTE event. Ppl, is that allright or I said bullshit ?

thnxs
Bruce> ----- Original Message -----

From: sdl-admin@libsdl.org [mailto:sdl-admin at libsdl.org]On Behalf Of
Gabriel Gambetta
Sent: segunda-feira, 26 de janeiro de 2004 15:34
To: sdl at libsdl.org
Subject: [SDL] Copy & Paste support

Hello everyone,

I have, as many of you, a custom GUI built on top of SDL. I have
edit boxes, among other things.

Now, I want to implement copy-paste, at least in the Win32 build.
Not only within my app but copying somewhere and pasting in my
edit box.

I can think of an easy way of doing it, and that’s listening to
CTRL-V or SHIFT-INS and doing the appropriate actions then. However,
this is somewhat fragile and somewhat ugly from a design standpoint,
because I want to intercept Paste events, not CTRL-V events.

Is there any other way of implementing this?

Thanks,
–Gabriel

Ing. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

http://www.libsdl.org/projects/scrap/

Is an example of how to do what you are asking. SDL lets you get all the
window manager events, even the ones you don’t want. By using
SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE); to enable them. After that,
you just handle the normal Windows events to do what you want. Take a
look at scrap for a working example.

	Bob PendletonOn Mon, 2004-01-26 at 11:34, Gabriel Gambetta wrote:

Hello everyone,

I have, as many of you, a custom GUI built on top of SDL. I have
edit boxes, among other things.

Now, I want to implement copy-paste, at least in the Win32 build.
Not only within my app but copying somewhere and pasting in my
edit box.

I can think of an easy way of doing it, and that’s listening to
CTRL-V or SHIFT-INS and doing the appropriate actions then. However,
this is somewhat fragile and somewhat ugly from a design standpoint,
because I want to intercept Paste events, not CTRL-V events.

Is there any other way of implementing this?

Thanks,
–Gabriel

Ing. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±--------------------------------------+