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  |
 |
Klugier
Messages: 1099 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 #39706 is a reply to message #39705] |
Thu, 18 April 2013 21:56   |
 |
Klugier
Messages: 1099 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
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:00:38 CEST 2025
Total time taken to generate the page: 0.00923 seconds
|