Home » U++ Library support » U++ Widgets - General questions or Mixed problems » DropList Items Text highlight area height (How to increase the DropList Items Text highlight area height )
| Re: DropList Items Text highlight area height [message #62059 is a reply to message #62058] |
Thu, 17 September 2026 19:31   |
Oblivion
Messages: 1284 Registered: August 2007
|
Senior Contributor |
|
|
Since droplist expects a display object, it passed "style" variable, which is an enum part of Display
class Display : public Pte<Display> {
public:
enum {
CURSOR = 0x01,
FOCUS = 0x02,
SELECT = 0x04,
READONLY = 0x08,
};
So,
struct MyDisplay : Display {
void Paint(Draw &w, const Rect &r, const Value &q, Color ink, Color paper, dword style) const override
{
w.DrawRect(r, style & CURSOR ? SColorHighlight : SRed());
w.DrawText(r.left, r.top, q.ToString(), StdFont(), Black());
}
};
struct MyApp : TopWindow {
DropList list;
MyApp()
{
Sizeable().Zoomable().CenterScreen().SetRect(0, 0, 400, 400);
Add(list.HCenterPos(300).VCenterPos());
list.SetDisplay(Single<MyDisplay>());
for(int i = 0; i < 5; i++)
list.Add(i).SetLineCy(i, GetStdFontCy() * max(i, 1));
list.GoBegin();
}
};
GUI_APP_MAIN
{
MyApp().Run();
}
Should work (if this is what you meant):

Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
TerminalCtrl package https://github.com/ismail-yilmaz/Terminal
|
|
|
|
Goto Forum:
Current Time: Thu Oct 01 14:18:49 GMT+2 2026
Total time taken to generate the page: 0.02467 seconds
|