Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » SOLVED: Array and Grid on high definition monitor
Re: Array and Grid on high definition monitor [message #49598 is a reply to message #49595] Fri, 09 March 2018 19:24 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1213
Registered: March 2006
Location: Italy
Senior Contributor
mirek wrote on Thu, 08 March 2018 14:30

Well, those numbers with SetLineCy etc... are absolute number of pixels. They should always be scaled. You can scale with Zx / Zy (for zoom X or zoom Y) - this scales based on size of standard font and should therefore take care about HDPI displays.


Hi Mirek,

I am sorry but I have not understood how to scale.
In the ArrayCtrl I am using 3 different display that affect 5 columns. Here are 2 Display:

struct FontDisplay3 : Display {
	virtual void Paint(Draw& w, const Rect& r, const Value& q,
		               Color ink, Color paper, dword style) const
	{		
		Font fnt = Courier(15).Bold(); 
	        ink = Blue();
		String txt = AsString(q);
	 	w.DrawRect(r, paper);
		w.DrawText(r.left + 2, r.top + (r.Height() - GetTextSize(txt, fnt).cy) / 2, txt, fnt, ink); 
	}
};

struct PaperResult : Display {
	virtual void Paint(Draw& w, const Rect& r, const Value& q,
		               Color ink, Color paper, dword style) const
	{				
		Font fnt = Roman(16).Bold();
		String txt = AsString(q);
		if (txt.Find("F")>=0) paper=Color(250,150,150);
		else if (txt.Find("U")>=0) paper=Color(124,252,0);
		else if (txt.Find("   ")>=0) paper=Color(255,255,204);
	 	w.DrawRect(r, paper);
	 	int a=(r.Width()-GetTextSize(txt, fnt).cx)/2;
		w.DrawText(r.left + a, r.top + (r.Height() - GetTextSize(txt, fnt).cy) / 2, txt, fnt, ink); 
	}
};


Can you please show me how to scale one of these?
Thanks!
Luigi
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GridControl release memory
Next Topic: [BUG #1739, + PATCH]ArrayCtrl: in Multiselect mode, WhenSel is called 5 time each cursor change
Goto Forum:
  


Current Time: Thu Aug 21 19:38:16 CEST 2025

Total time taken to generate the page: 0.05569 seconds