2 ProcessController © 2000, Georges-Edouard Berenger, All Rights Reserved.
3 Copyright (C) 2004 beunited.org
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "NoiseBarMenuItem.h"
24 #include "ProcessController.h"
26 #undef B_TRANSLATION_CONTEXT
27 #define B_TRANSLATION_CONTEXT "ProcessController"
29 NoiseBarMenuItem::NoiseBarMenuItem()
30 : BMenuItem(B_TRANSLATE("Gone teams" B_UTF8_ELLIPSIS
), NULL
)
40 NoiseBarMenuItem::DrawContent()
43 Menu()->MovePenTo(ContentLocation());
44 BMenuItem::DrawContent();
49 NoiseBarMenuItem::DrawBar(bool force
)
51 bool selected
= IsSelected();
52 BRect frame
= Frame();
54 rgb_color highColor
= menu
->HighColor();
56 frame
.left
= frame
.right
- kBarWidth
;
58 frame
.bottom
= frame
.top
+ 8;
67 menu
->SetHighColor(gFrameColorSelected
);
69 menu
->SetHighColor(gFrameColor
);
70 menu
->StrokeRect(frame
);
75 float grenze1
= frame
.left
+(frame
.right
-frame
.left
)*fBusyWaiting
;
76 float grenze2
= frame
.left
+(frame
.right
-frame
.left
)*(fBusyWaiting
+fLost
);
77 if (grenze1
> frame
.right
)
78 grenze1
= frame
.right
;
79 if (grenze2
> frame
.right
)
80 grenze2
= frame
.right
;
84 if (r
.left
< r
.right
) {
86 menu
->SetHighColor(tint_color (kGreen
, B_HIGHLIGHT_BACKGROUND_TINT
));
88 menu
->SetHighColor(kGreen
);
89 // menu->SetHighColor(gKernelColor);
95 if (fGrenze2
> r
.left
&& r
.left
>= fGrenze1
)
97 if (fGrenze1
< r
.right
&& r
.right
<= fGrenze2
)
100 if (r
.left
< r
.right
) {
101 menu
->SetHighColor(highColor
);
102 // menu->SetHighColor(gUserColor);
106 r
.right
= frame
.right
;
109 if (r
.left
< r
.right
) {
111 menu
->SetHighColor(gWhiteSelected
);
113 menu
->SetHighColor(kWhite
);
116 menu
->SetHighColor(highColor
);
123 NoiseBarMenuItem::GetContentSize(float* width
, float* height
)
125 BMenuItem::GetContentSize(width
, height
);
128 *width
+= 20 + kBarWidth
;