Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
15ab0ad7
Commit
15ab0ad7
authored
May 07, 2008
by
Hisham Muhammad
Browse files
Let mouseclicks tick/untick checkboxes
parent
23615d63
Changes
4
Show whitespace changes
Inline
Side-by-side
AffinityPanel.c
View file @
15ab0ad7
...
...
@@ -11,6 +11,7 @@ static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) {
HandlerResult
result
=
IGNORED
;
CheckItem
*
selected
=
(
CheckItem
*
)
Panel_getSelected
(
this
);
switch
(
ch
)
{
case
KEY_MOUSE
:
case
' '
:
CheckItem_set
(
selected
,
!
(
CheckItem_get
(
selected
))
);
result
=
HANDLED
;
...
...
ColorsPanel.c
View file @
15ab0ad7
...
...
@@ -54,6 +54,7 @@ static HandlerResult ColorsPanel_EventHandler(Panel* super, int ch) {
case
0x0a
:
case
0x0d
:
case
KEY_ENTER
:
case
KEY_MOUSE
:
case
' '
:
for
(
int
i
=
0
;
ColorSchemes
[
i
]
!=
NULL
;
i
++
)
CheckItem_set
((
CheckItem
*
)
Panel_get
(
super
,
i
),
false
);
...
...
DisplayOptionsPanel.c
View file @
15ab0ad7
...
...
@@ -37,6 +37,7 @@ static HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) {
case
0x0a
:
case
0x0d
:
case
KEY_ENTER
:
case
KEY_MOUSE
:
case
' '
:
CheckItem_set
(
selected
,
!
(
CheckItem_get
(
selected
))
);
result
=
HANDLED
;
...
...
ScreenManager.c
View file @
15ab0ad7
...
...
@@ -144,7 +144,6 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
ch
=
getch
();
bool
loop
=
false
;
if
(
ch
==
KEY_MOUSE
)
{
MEVENT
mevent
;
int
ok
=
getmouse
(
&
mevent
);
...
...
@@ -159,14 +158,12 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
focus
=
i
;
panelFocus
=
panel
;
Panel_setSelected
(
panel
,
mevent
.
y
-
panel
->
y
+
panel
->
scrollV
-
1
);
loop
=
true
;
break
;
}
}
}
}
}
if
(
loop
)
continue
;
if
(
panelFocus
->
eventHandler
)
{
HandlerResult
result
=
panelFocus
->
eventHandler
(
panelFocus
,
ch
);
...
...
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