Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 684235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:47:39+00:00 2026-05-14T01:47:39+00:00

I have 3 panels and I want to make drags on them. The problem

  • 0

I have 3 panels and I want to make drags on them.
The problem is that when I do a drag on one this happens:
http://img41.yfrog.com/img41/9043/soundlog.png http://img41.yfrog.com/img41/9043/soundlog.png

How can I refresh the frame to happear its color when the panel is no longer there?

This is the code that I have to make the drag:

def onMouseMove(self, event):
    (self.pointWidth, self.pointHeight) = event.GetPosition()
    (self.width, self.height) = self.GetSizeTuple()
    if (self.pointWidth>100 and self.pointWidth<(self.width-100) and self.pointHeight < 15) or self.parent.dragging:
        self.SetCursor(wx.StockCursor(wx.CURSOR_SIZING))

        """implement dragging"""
        if not event.Dragging():
            self.w = 0
            self.h = 0
            return
        self.CaptureMouse()
        if self.w == 0 and self.h == 0:
            (self.w, self.h) = event.GetPosition()
        else:
            (posw, posh) = event.GetPosition()
            displacement = self.h - posh
            self.SetPosition( self.GetPosition() - (0, displacement))
    else:
        self.SetCursor(wx.StockCursor(wx.CURSOR_ARROW))

def onDraggingDown(self, event):
    if self.pointWidth>100 and self.pointWidth<(self.width-100) and self.pointHeight < 15:
        self.parent.dragging = 1
        self.SetCursor(wx.StockCursor(wx.CURSOR_ARROW))
        self.SetBackgroundColour('BLUE')
        self.parent.SetTransparent(220)
        self.Refresh()

def onDraggingUp(self, event):
    self.parent.dragging = 0
    self.parent.SetTransparent(255)
    self.SetCursor(wx.StockCursor(wx.CURSOR_ARROW))

and this are the binds for this events:

self.Bind(wx.EVT_MOTION, self.onMouseMove)
self.Bind(wx.EVT_LEFT_DOWN, self.onDraggingDown)
self.Bind(wx.EVT_LEFT_UP, self.onDraggingUp)

With this, if I click on the top of the panel, and move down or up, the panel position changes (I drag the panel) to the position of the mouse.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:47:39+00:00Added an answer on May 14, 2026 at 1:47 am

    To refresh the parent on every repositioning of self, you could add

    self.parent.Refresh()
    

    right after your existing call to self.SetPosition in your def onMouseMove method. Right now you’re refreshing the frame only in the def onDraggingDown method, i.e., the first time the mouse left button is clicked and held down, not every time the mouse is moved while said button is held down (i.e., the “dragging” action itself).

    I was unable to download your code for testing purposes, due to the rather “spammy peculiar” site you chose to upload it to — the site keeps bombarding me with ads, no clear way for me to just do the download, occasionally complaining that it doesn’t support my machine (I use a Mac and Google Chrome, the site at some spots insists on Windows with IE or Firefox…), etc etc. I’m sure you can find other sites, more usable than that one, for people who are trying to help you out!-)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two update panels on a page. And I want to update both
I have panel that is using group layout to organize some label. I want
I have a page that above it I want to have a panel that
i have a simple JPanel bean in my projects, now i want to drag
I want make the control height as double when the mouse is over that
I have a jQuery tab section - and I want to animate the panels
I'm new to drag-and-drop in Swing. I have a JPanel that draws an image
I have a setup with two side panels, one as float:left and one as
I have a popup panel opened in sencha touch and I want to make
I'm trying to make a program that allows users to drag files onto a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.