473,699 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why does wx.Window.Captu reMouse() send EVT_PAINT

It seems that the CaptureMouse method sends an EVT_PAINT handler. The
documentation does not mention this...is it somewhere else? Could
someone explain why this handler is sent out?

Also, I've seen:

def OnMouseDown(sel f, evt):
self.CaptureMou se()
self.x, self.y = self.lastx, self.lasty = evt.GetPosition ()
self.Refresh(Fa lse)

Given that CaptureMouse initiates a repaint, isn't self.Refresh(Fa lse)
moot at the point.

Thanks. The doc for CaptureMouse are below.


CaptureMouse(se lf)

Directs all mouse input to this window. Call wx.Window.Relea seMouse to
release the capture.

Note that wxWindows maintains the stack of windows having captured the
mouse and when the mouse is released the capture returns to the window
which had had captured it previously and it is only really released if
there were no previous window. In particular, this means that you must
release the mouse as many times as you capture it, unless the window
receives the wx.MouseCapture LostEvent event.

Any application which captures the mouse in the beginning of some
operation must handle wx.MouseCapture LostEvent and cancel this operation
when it receives the event. The event handler must not recapture mouse.
Dec 7 '06 #1
2 2261
Bill Jackson <ja*****@hotmai l.comwrote:
It seems that the CaptureMouse method sends an EVT_PAINT handler. The
documentatio n does not mention this...is it somewhere else? Could
someone explain why this handler is sent out?
The source code could answer that question for sure, but I doubt that it is
CaptureMouse doing it, and I know the SetCapture API (which it eventually
calls) does not. Is it possible that your clicking caused some part of the
app to become unhidden, or caused some button to change state?
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Dec 10 '06 #2
Tim Roberts wrote the following on 12/09/2006 08:27 PM:
The source code could answer that question for sure, but I doubt that it is
CaptureMouse doing it, and I know the SetCapture API (which it eventually
calls) does not. Is it possible that your clicking caused some part of the
app to become unhidden, or caused some button to change state?
Indeed. The EVT_PAINT came from self.Refresh(Fa lse). I mistakenly
thought that False implied that it would not refresh, but the docs
clearly state (which I had not read) otherwise. To reiterate,
CaptureMouse does not send an EVT_PAINT.
Dec 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As InternetExplorer But then I cant see when a user exit my objIExplorer and than an error will show up when I try to open a link in the IE window that does not exist... What can I do about this and way does it not work in win 98?
by: zapazap | last post by:
Dear Snake Charming Gurus, (Was: http://mail.python.org/pipermail/python-list/2004-January/204454.html) First, a thank you to Tim Golden, Thomas Heller, and Mark Hammond for your earlier help with this problem. I am uncertain about what etiquette calls for, but more on that later. My Objective: I am trying to control the _VMWare Desktop_ application
by: Curzio Basso | last post by:
Hi all, I have a problem for which I wasn't able to find an answer anywhere else, maybe someone can give me a hint... I designed with XRCed a small GUI (the code is at the bottom of the message) made up of a menu and a frame in which there are two panels, placed by an horizontal sizer. Now, what I would like to do is to be able to load an image and display
by: Max | last post by:
I have the following code on a form that launches Microsoft Outlook and creates a new email message for the user: Outlook.Application oApp = new Outlook.Application(); Outlook.MailItem oMail = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem); oMail.HTMLBody = "SOME HTML TEXT HERE"; oMail.Display(oApp); oMail.Close(Outlook.OlInspectorClose.olDiscard);
by: harvie wang | last post by:
Hi, How to send a message to every window(include child window), I use SendMessage ,but It can't do that. class frmA { public const int WM_test = 0x400 + 1; protected override void WndProc(ref Message m) {
by: JTL | last post by:
I have learnt java before and now begin to learn c++ what puzzle me is that seem that different SDKs(c++builder, vs.net, gcc..) has its own class library we know that in java there are only one uniform class library so that the codes I written in JBuilder can just copy to JCreator or Eclipse and they all run well does c++ have such an uniform class library so that I could just learn
by: analfabete | last post by:
Hi everybody ! When I move my windows's program, this windows can leave the screen like all program. But me, I would like to know how I can do to always keep all part of my windows (when I move it) visible I do this: self.width = GetSystemMetrics(0) self.height = GetSystemMetrics(1) def OnLeftDown(self, evt):
by: ndoe | last post by:
what a funtion of EVT_PAINT if i not use that can it work normally for drawing or show a picture
by: knkk | last post by:
Instead of an id getting its innerHTML changed, the entire page is getting refreshed with this function of mine (you may want to look just at the end of the function where there's an alert): function morerating(ratingform, checkflag, loc) { var f = document.forms; var rating_done_flag = 0; var params = ""; if (checkflag == true) check = checkrating(ratingform); else
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.