List Info

Thread: copy & paste event




copy & paste event
country flaguser name
Germany
2008-03-07 00:28:30
hi. now I have problem about copy and paste text in my
application I
make copy and paste button in toolbar and I have fuction of
them but I
don't know how to make it can copy only selection text and
paste into
other textCtrl. see my picture for more info. thank you 

Attachments:
http://www.ruby-forum.com/attachment/1526/untitled.JPG


-- 
Posted via http://www.ruby-forum.com
/.
_______________________________________________
wxruby-users mailing list
wxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/wxruby-users

Re: copy & paste event
country flaguser name
United Kingdom
2008-03-07 02:51:35
Hi

Pat Kiatchaipipat wrote:
> hi. now I have problem about copy and paste text in my
application I
> make copy and paste button in toolbar and I have
fuction of them but I
> don't know how to make it can copy only selection text
and paste into
> other textCtrl. see my picture for more info. thank you

>   
If you just want ToolBar buttons that do the
"normal" thing for 
cut/copy/paste - i.e. do that action to the current
selection in the 
current active widget - just give the Tool the relevant
standard id when 
you create it. For example

toolbar.add_tool(Wx::ID_COPY, 'Cut', bitmap_1 ....)

Or Wx::ID_CUT, Wx::ID_PASTE. No additional programming
effort should be 
needed

alex

_______________________________________________
wxruby-users mailing list
wxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/wxruby-users

Re: copy & paste event
country flaguser name
Germany
2008-03-07 03:53:25
I use

tb.add_tool(ID_COPY, "Copy",
ArtProvider::get_bitmap(ART_COPY))

but when I click it can't copy some text
what's wrong :'(
-- 
Posted via http://www.ruby-forum.com
/.
_______________________________________________
wxruby-users mailing list
wxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/wxruby-users

Re: copy & paste event
country flaguser name
Germany
2008-03-07 05:19:32
:'(

    tb.add_tool(ID_COPY, "Copy",
ArtProvider::get_bitmap(ART_COPY))
    evt_tool(ID_COPY){|event| on_copy()}

    def on_copy()
      textbox2.copy
    end

then I copy it's ok but it can copy only textbox2
and and I have many 
textbox. how can I use it to copy only selected text not
dependent 
textbox? I have textbox1, textbox2 and textbox3
-- 
Posted via http://www.ruby-forum.com
/.
_______________________________________________
wxruby-users mailing list
wxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/wxruby-users

Re: copy & paste event
country flaguser name
Germany
2008-03-07 06:10:36
Thank you I use it now!!
 
-- 
Posted via http://www.ruby-forum.com
/.
_______________________________________________
wxruby-users mailing list
wxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/wxruby-users

Re: copy & paste event
country flaguser name
Germany
2008-03-07 08:08:26
now I have problem with paste :(
when I copy I use this

      a = textbox1.get_selection()
      b = textbox2.get_selection()
      c = textbox3.get_selection()
      if a[1] - a[0] != 0
        textbox1.copy
      elsif b[1] - b[0] != 0
        textbox2.copy
      elsif c[1] - c[0] != 0
        textbox3.copy
      end

to check where textbox was selected but when I want to
paste it can't 
use this I try to think but I don't know how can I fix it
please help me 
:'(
-- 
Posted via http://www.ruby-forum.com
/.
_______________________________________________
wxruby-users mailing list
wxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/wxruby-users

Re: copy & paste event
country flaguser name
Germany
2008-03-07 09:33:19
sorry, I will explain again 

I have three textbox like this picture, and I have copy,
paste, cut on 
toolbar and  I want to make when user click at copy it will
copy text 
that selected (I can do it now) and then I want to paste
text in other 
textbox

example
first I copy 'sssss' on left textbox, it's ok. then I want
to paste it 
in right textbox that I point into it (see picture)

if I use textbox2.paste in function on_paste. it's ok but it
can paste 
only right textbox when I point mouse at left textbox and
paste it, it 
will appear at riht textbox :'(

Attachments:
http://www.ruby-forum.com/attachment/1528/untitled.JPG


-- 
Posted via http://www.ruby-forum.com
/.
_______________________________________________
wxruby-users mailing list
wxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/wxruby-users

[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )