Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
d949b5cd
Kaydet (Commit)
d949b5cd
authored
Nis 09, 2000
tarafından
Just van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
added popup control (jvr)
üst
7051e526
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
4 deletions
+60
-4
Wmenus.py
Mac/Tools/IDE/Wmenus.py
+60
-4
No files found.
Mac/Tools/IDE/Wmenus.py
Dosyayı görüntüle @
d949b5cd
import
FrameWork
import
Qd
import
Wbase
import
Wbase
,
Wcontrols
,
Ctl
,
Controls
from
types
import
*
import
Wapplication
...
...
@@ -8,21 +8,77 @@ _arrowright = Qd.GetPicture(472)
_arrowdown
=
Qd
.
GetPicture
(
473
)
class
PopupControl
(
Wcontrols
.
ControlWidget
):
def
__init__
(
self
,
possize
,
items
=
None
,
callback
=
None
):
if
items
is
None
:
items
=
[]
procID
=
Controls
.
popupMenuProc
|
Controls
.
popupFixedWidth
|
Controls
.
useWFont
Wcontrols
.
ControlWidget
.
__init__
(
self
,
possize
,
""
,
procID
,
callback
,
0
,
0
,
0
)
self
.
_items
=
items
[:]
def
set
(
self
,
value
):
self
.
_control
.
SetControlValue
(
value
+
1
)
def
get
(
self
):
return
self
.
_control
.
GetControlValue
()
-
1
def
open
(
self
):
self
.
menu
=
menu
=
FrameWork
.
Menu
(
self
.
_parentwindow
.
parent
.
menubar
,
'Foo'
,
-
1
)
for
i
in
range
(
len
(
self
.
_items
)):
item
=
self
.
_items
[
i
]
if
type
(
item
)
==
StringType
:
menuitemtext
=
object
=
item
elif
type
(
item
)
==
TupleType
and
len
(
item
)
==
2
:
menuitemtext
,
object
=
item
self
.
_items
[
i
]
=
object
else
:
raise
Wbase
.
WidgetsError
,
"illegal itemlist for popup menu"
menuitem
=
FrameWork
.
MenuItem
(
menu
,
menuitemtext
,
None
,
None
)
self
.
_calcbounds
()
self
.
_control
=
Ctl
.
NewControl
(
self
.
_parentwindow
.
wid
,
self
.
_bounds
,
self
.
_title
,
1
,
self
.
_value
,
self
.
menu
.
id
,
self
.
_max
,
self
.
_procID
,
0
)
self
.
SetPort
()
self
.
enable
(
self
.
_enabled
)
def
close
(
self
):
self
.
menu
.
delete
()
return
Wcontrols
.
ControlWidget
.
close
(
self
)
def
click
(
self
,
point
,
modifiers
):
if
not
self
.
_enabled
:
return
part
=
self
.
_control
.
TrackControl
(
point
,
-
1
)
if
part
:
if
self
.
_callback
:
Wbase
.
CallbackCall
(
self
.
_callback
,
0
,
self
.
_items
[
self
.
get
()])
class
PopupWidget
(
Wbase
.
ClickableWidget
):
"""Simple title-less popup widget. Should be 16x16 pixels.
Builds the menu items on the fly, good for dynamic popup menus."""
def
__init__
(
self
,
possize
,
items
=
[],
callback
=
None
):
Wbase
.
Widget
.
__init__
(
self
,
possize
)
def
__init__
(
self
,
possize
,
items
=
None
,
callback
=
None
):
Wbase
.
ClickableWidget
.
__init__
(
self
,
possize
)
if
items
is
None
:
items
=
[]
self
.
_items
=
items
self
.
_itemsdict
=
{}
self
.
_callback
=
callback
self
.
_enabled
=
1
def
close
(
self
):
Wbase
.
Widget
.
close
(
self
)
Wbase
.
Clickable
Widget
.
close
(
self
)
self
.
_items
=
None
self
.
_itemsdict
=
{}
...
...
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