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 » [Minor bug & patch] ArrayCtrl and HeaderCtrl should use native resizing icons on X11.
[Minor bug & patch] ArrayCtrl and HeaderCtrl should use native resizing icons on X11. [message #39538] Tue, 26 March 2013 17:29 Go to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

It is very similar topic as my previous one (GridCtrl should use native resizing icons). In this case we have problem with ArrayCtrl and HeaderCtrl.

First of all, we need to modify CtrlLib/HeaderCtrl.cpp (line 515):

Image HeaderCtrl::CursorImage(Point p, dword) {
	#ifdef PLATFORM_X11
		Image horzPosImg = Image::SizeHorz();
	#else
		Image horzPosImg = CtrlsImg::HorzPos();
	#endif
	
	if(mode == FIXED)
		return Image::Arrow();
	if(HasCapture())
		return split >= 0 ? horzPosImg : Image::Arrow();
	int q = GetSplit(p.x);
	return q < 0 ? Image::Arrow()
	             : GetTabWidth(q) < 4 ? CtrlsImg::HorzSplit()
	                                  : horzPosImg;
}


Next, let's modify CtrlLib/ArrayCtrl (line 1643):

Image ArrayCtrl::CursorImage(Point p, dword)
{
	#ifdef PLATFORM_X11
		Image horzPosImg = Image::SizeHorz();
	#else
		Image horzPosImg = CtrlsImg::HorzPos();
	#endif

	if(!IsNull(cursor_override))
		return cursor_override;
	return header.GetSplit(p.x) < 0 || header.GetMode() == HeaderCtrl::FIXED ? Image::Arrow()
	                                                                         : horzPosImg;
}


Added 04.04.2013:
I have rewritten this patch to make it more multiplatform. Now, ArrayCtrl should work great on all X11 operating system.

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Thu, 04 April 2013 16:53]

Report message to a moderator

Re: [Minor bug & patch] ArrayCtrl and HeaderCtrl should use native resizing icons on X11. [message #39705 is a reply to message #39538] Thu, 18 April 2013 20:15 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I am not so sure about this. Problem is that CtrlsImg::HorzSplit() is designed to visualy match CtrlsImg::HorzPos() and nothing like that seems to be available in stock cursors (?).

Mirek
Re: [Minor bug & patch] ArrayCtrl and HeaderCtrl should use native resizing icons on X11. [message #39706 is a reply to message #39705] Thu, 18 April 2013 21:56 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Mirek,

I understand that most of Linux desktops enviroment don't offer real native CtrlImg::HorzPos () (*Only KDE4 has own images provided by QT). On the other hand, libraries such as: GTK (Upp trying to emulate it!), Lazurus, FLTK, Steam Api or wxWidgets are "using" Upp Image::SizeHorz() in ArrayCtrl (or GridCtrl) like widgets on X11 operating systems. In this way my solution is more native than this using custom cursor images.

I wrote multiplatform code, because CtrlImg::HorzPos() looks very good on newer Windows.

P.S.
Actually GridCtrl is using this solution on X11.

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Sun, 21 April 2013 00:19]

Report message to a moderator

Re: [Minor bug & patch] ArrayCtrl and HeaderCtrl should use native resizing icons on X11. [message #39722 is a reply to message #39706] Sun, 21 April 2013 08:24 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
klugier wrote on Thu, 18 April 2013 15:56

Hello Mirek,

I understand that most of Linux desktops enviroment don't offer real native CtrlImg::HorzPos () (*Only KDE4 has own images



That is not the problem. Problem is they do not have CtrlsImg::HorzSplit() (which is displayed when cursor is over column collapsed to zero), so in that situation, it would look quite unmatched...

Mirek
Re: [Minor bug & patch] ArrayCtrl and HeaderCtrl should use native resizing icons on X11. [message #39726 is a reply to message #39722] Sun, 21 April 2013 14:26 Go to previous message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Mirek,

It looks like we don't have alternatives for CtrlsImg::HorzSplit() in X11/cursorfont.h header file.

Thank you for answer.

Sincerely,
Klugier


U++ - one framework to rule them all.
Previous Topic: Grid cursor and its color
Next Topic: GridCtrl performance
Goto Forum:
  


Current Time: Thu Mar 28 16:23:38 CET 2024

Total time taken to generate the page: 0.01890 seconds