Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2dd4d160
Commit
2dd4d160
authored
Nov 02, 2001
by
Just van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use 32bit APIs for control values, refactor slightly
parent
52a42e98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
42 deletions
+28
-42
Mac/Tools/IDE/Wcontrols.py
Mac/Tools/IDE/Wcontrols.py
+28
-42
No files found.
Mac/Tools/IDE/Wcontrols.py
View file @
2dd4d160
...
...
@@ -94,6 +94,19 @@ class ControlWidget(Wbase.ClickableWidget):
def
gettitle
(
self
):
return
self
.
_title
def
set
(
self
,
value
):
if
self
.
_control
:
self
.
_control
.
SetControl32BitValue
(
value
)
else
:
self
.
_value
=
value
def
get
(
self
):
if
self
.
_control
:
return
self
.
_control
.
GetControl32BitValue
()
else
:
return
self
.
_value
class
Button
(
ControlWidget
):
...
...
@@ -165,19 +178,7 @@ class CheckBox(ControlWidget):
def
toggle
(
self
):
self
.
set
(
not
self
.
get
())
def
set
(
self
,
value
):
if
self
.
_control
:
self
.
_control
.
SetControlValue
(
value
)
else
:
self
.
_value
=
value
def
get
(
self
):
if
self
.
_control
:
return
self
.
_control
.
GetControlValue
()
else
:
return
self
.
_value
class
RadioButton
(
ControlWidget
):
...
...
@@ -217,13 +218,7 @@ class RadioButton(ControlWidget):
button
.
_control
.
SetControlValue
(
button
==
self
)
else
:
button
.
_value
=
(
button
==
self
)
def
get
(
self
):
if
self
.
_control
:
return
self
.
_control
.
GetControlValue
()
else
:
return
self
.
_value
class
Scrollbar
(
ControlWidget
):
...
...
@@ -234,9 +229,9 @@ class Scrollbar(ControlWidget):
ControlWidget
.
__init__
(
self
,
possize
,
""
,
procID
,
callback
,
value
,
min
,
max
)
# interface
def
set
(
self
,
value
):
if
self
.
_callback
:
Wbase
.
CallbackCall
(
self
.
_callback
,
1
,
value
)
#
def set(self, value):
#
if self._callback:
#
Wbase.CallbackCall(self._callback, 1, value)
def
up
(
self
):
if
self
.
_callback
:
...
...
@@ -255,16 +250,19 @@ class Scrollbar(ControlWidget):
Wbase
.
CallbackCall
(
self
.
_callback
,
1
,
'--'
)
def
setmin
(
self
,
min
):
self
.
_control
.
SetControlMinimum
(
min
)
self
.
_control
.
SetControl32BitMinimum
(
min
)
def
setmax
(
self
,
max
):
self
.
_control
.
SetControl32BitMaximum
(
max
)
def
set
max
(
self
,
min
):
self
.
_control
.
SetControl
Minimum
(
max
)
def
set
viewsize
(
self
,
view
):
self
.
_control
.
SetControl
ViewSize
(
view
)
def
getmin
(
self
):
return
self
.
_control
.
GetControlMinimum
()
return
self
.
_control
.
GetControl
32Bit
Minimum
()
def
getmax
(
self
):
return
self
.
_control
.
GetControl
Min
imum
()
return
self
.
_control
.
GetControl
32BitMax
imum
()
# internals
def
click
(
self
,
point
,
modifiers
):
...
...
@@ -299,7 +297,7 @@ class Scrollbar(ControlWidget):
def
_hit
(
self
,
part
):
if
part
==
Controls
.
inThumb
:
value
=
self
.
_control
.
GetControlValue
()
value
=
self
.
_control
.
GetControl
32Bit
Value
()
elif
part
==
Controls
.
inUpButton
:
value
=
"+"
elif
part
==
Controls
.
inDownButton
:
...
...
@@ -329,19 +327,7 @@ class Scrollbar(ControlWidget):
else
:
Qd
.
FrameRect
(
self
.
_bounds
)
self
.
GetWindow
().
ValidWindowRect
(
self
.
_bounds
)
def
set
(
self
,
value
):
if
self
.
_control
:
self
.
_control
.
SetControlValue
(
value
)
else
:
self
.
_value
=
value
def
get
(
self
):
if
self
.
_control
:
return
self
.
_control
.
GetControlValue
()
else
:
return
self
.
_value
def
_scalebarvalue
(
absmin
,
absmax
,
curmin
,
curmax
):
if
curmin
<=
absmin
and
curmax
>=
absmax
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment