From: Kevin A. <al...@se...> - 2004-09-30 21:21:33
|
Okay, I went ahead and checked in a hack for Windows, which seems to work, at least for the default control size on my Win2K box. You can try the change out yourself if you want. Starting on line 472 of resourceEditor.py in cvs I extended the offset workarounds for Windows with the elif t == 'Spinner' block. elif ['Gauge', 'StaticLine'].count(t): self.startGlobalOffset = [self.startGlobalOffset[0] + wx.SystemSettings.GetMetric(wx.SYS_BORDER_X), self.startGlobalOffset[1] + wx.SystemSettings.GetMetric(wx.SYS_BORDER_Y)] elif t == 'Spinner': # compensate for width of TextCtrl portion of # compound control - width of arrow buttons self.startGlobalOffset[0] += target.size[0] - 16 ka On Sep 30, 2004, at 8:53 AM, Kevin Altis wrote: > On Sep 30, 2004, at 4:35 AM, XXXXXXXXXXX wrote: > >> I've noticed a very small bug when trying to drag the spinner control >> around in the resource editor with Pythoncard 0.8 - could somebody try >> and replicate this on their installation? It affects my Windows NT >> machine but not the Mac OSX version. >> >> It doesn't seem to be possible to click on the left-hand part of the >> spinner because that's the text field which grabs the focus, so you >> need >> to click on the right-hand side (around the up-down buttons). That's >> OK. >> The problem is that the outline that appears when you click on the >> right- >> hand side of the component 'jumps' so that you suddenly find yourself >> with the outline extending out to the right of the cursor, as if >> you've >> actually grabbed it on the left-hand side.... >> >> ...hmmm...I don't think I'm explaining this very well. Like showing >> pictures on the radio :-) >> >> Like I said, a very small issue. It does make moving the component >> small >> distances via dragging quite tricky though when the component jumps to >> the right and you then need to drag it back left again before letting >> go, >> though you can always use the position attribute for fine adjustments. >> >> Neil > > This is a known issue and there isn't much if anything I can do about > it. The problem is that AFAIK on Windows the underlying wxWidgets > control is a compound control made up a TextCtrl and SpinCtrl. In > general, wxWidgets does not mask or translate events so that the > compound controls behave as a single entity, except to set the event > object, but rather just pass the low-level events like keyDown, > mouseDown, and mouseDrag. That causes offsets to generally be wrong, > but also causes behavior problems like you're experiencing. Since > almost no projects except PythonCard are interested in the type of > direct manipulation dragging that PythonCard uses in the > resourceEditor, there isn't much incentive at the wxWidgets/wxPython > level to "fix" these issues. Pretty much everyone else is using > sizer-based layouts and even in the GUI layout tools you are never > allowed to select and drag controls but instead have to build layouts > by nesting sizers and controls... > > With release 0.8.1 there is a workaround since you can use the arrow > keys to move the component around. I may also be able to write some > workaround code to handle the offset myself for dragging under > Windows, but it will be a bit of a hack and might not work all the > time depending on default font sizes and such. > > ka |