Python

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Drag and Drop files and text into wxTextCtrl

    1 answers - 2735 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Thanks Grant - sounds promising - I'll get hold of that book and see if it
    helps.
    cheers,
    Ant
    Tue, 22 Aug 2006 22:02:42 +1200, Grant Paton-Simpson wrote:
    Hi Anthony,
    I'm a wxPython beginner but it just so happens I was recently
    reading the section in "wxPython in Action" on dragging and
    dropping text objects.
    In the example (p.529) a new class DragController(wx.Control) was
    defined.
    The comment was """Just a little control to handle dragging the
    text from a text control. We use a separate control so as not to
    interfere with the native drag-select functionality of the native
    text control."""
    Is this likely to be relevant to your problem?
    The example is quite involved and I haven't had time to get my head
    right around it but I can certainly recommend the book. If I have
    more time later I will try to be more useful.
    --
    All the best, Grant
    --
    Anthony Wiese wrote:
    >Hi everyone!
    >>

    >I want to drag and drop both text and files into a wxTextCtrl.
    >>

    >I've looked at the drag-and-drop examples, and seen how to set up
    >a wxTextCtrl as either a wxTextD or a wxFileD
    >>

    >To allow both, I've set up a wxDComposite as shown here:
    >
    >users/1101989
    >>

    >My problem is that it only works when I set my wxTextCtrl to read-
    >only. The examples I found all use a read-only text control. As
    >soon as I set my control to editable, all my drag and drop
    >behaviour stops working.
    >>

    >Instead, an editable wxTextCtrl seems to implement its own drag
    >and drop behaviour, which only accepts text, but not files. Can I
    >override this? I also see there is a method called
    >wxTextCtrl::DropFiles(), but it's listed as windows-only.
    >>

    >I tested my Composite data object by attaching it to a
    >wxHtmlWindow, instead of a wxTextCtrl, and it worked fine. Ditto
    >the read-only wxTextCtrl. It only stops working when I make it
    >editable.
    >>

    >Has anyone else found a solution to this?
    >>

    >cheers,
    >Ant
    >>

    >
    >To unsubscribe, e-mail: wxPython-users-
    >unsubscribe (AT) lists (DOT) wxwidgets.org For additional commands, e-mail:
    >wxPython-users-help (AT) lists (DOT) wxwidgets.org
    >>
    >>
  • No.1 | | 677 bytes | |

    Anthony Wiese <ant (AT) dogmelon (DOT) com.auwrote:
    Just to report the conclusion on this:
    I got rid of the wxTE_RICH2 from my wxTextCtrl, and it all started working.
    This is on the win32 platform.

    course now you can't have more than 64k of text in your text control,
    but that may or may not matter.

    Could you possibly post the code here, or on the wiki (wiki.wxpython.org),
    for the text+file drag and drop functionality?

    Thank you,
    - Josiah

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org

Re: Drag and Drop files and text into wxTextCtrl


max 4000 letters.
Your nickname that display:
In order to stop the spam: 3 + 2 =
QUESTION ON "Python"

EMSDN.COM