U++ framework
Do not panic. Ask here before giving up.

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 Go to previous messageGo to previous message
Oblivion is currently offline  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):

/forums/index.php?t=getfile&id=7177&private=0

Best regards,
Oblivion


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GridCtrl not following SetDateScan / Format
Next Topic: all ctrl's frame inset/outset inverted
Goto Forum:
  


Current Time: Thu Oct 01 14:18:49 GMT+2 2026

Total time taken to generate the page: 0.02467 seconds