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 » [BUG] GridCtrl uses wrong sorting icon order.
[BUG] GridCtrl uses wrong sorting icon order. [message #40342] Mon, 22 July 2013 16:55 Go to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

I have noticed that GridCtrl uses wrong sorting icon order. Why we need to change this behavior? Beacuse, it seems most of GUI frameworks such as Qt or GTK use revert notation. Moreover this notation is more intuitive for casual user.

What we need to do is just replace images order (GridCtrl/GridDisplay.cpp - line 214):
                if(sortmode == 1)
			w.DrawImage(xf, yf, GridImg::SortDsc(), col);
		else
			w.DrawImage(xf, yf, GridImg::SortAsc(), col);


Insted of
		if(sortmode == 1)
			w.DrawImage(xf, yf, GridImg::SortAsc(), col);
		else
			w.DrawImage(xf, yf, GridImg::SortDsc(), col);


The other better solution is just replace icons names in GridCtrl.iml file. (SortDsc -> SortAsc, SortAsc -> SortDsc).

Sincerely,
Klugier


U++ - one framework to rule them all.
Re: [BUG] GridCtrl uses wrong sorting icon order. [message #40658 is a reply to message #40342] Mon, 26 August 2013 20:34 Go to previous message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Guys,

Now, GridCtrl has one more static method:
GridCtrl::ReverseSortIcon(bool b = true);

which is reversing sorting icons order gloablly.

How you can use it? Example:

static void initCtrls();

GUI_APP_MAIN
{
    initCtrls();
    // ...
}

void initCtrls()
{
   GridCtrl::ReverseSortIcon(true);
}



Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Mon, 26 August 2013 20:37]

Report message to a moderator

Previous Topic: GridCtrl: Key for Row
Next Topic: Retrieving column index like a row
Goto Forum:
  


Current Time: Thu Mar 28 18:56:05 CET 2024

Total time taken to generate the page: 0.01709 seconds