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 » Community » Newbie corner » ArrayCtrl vs. GridCtrl (A noob's perspective)
ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25150] Fri, 12 February 2010 19:32 Go to next message
alendar is currently offline  alendar
Messages: 47
Registered: January 2010
Location: Idaho, USA
Member
I started out using ArrayCtrl because I didn't see GridCtrl right off. It works good, but since it stores Value objects I wondered if it might not be faster if it was just string objects.

I found GridCtrl and got it to work. I put both next to each other and just flipped the names between them in the layout and compared the behavior on a large set.

My notes:
- ArrayCtrl has the Accel function, which filters keystrokes and scans ahead to the first matching grid item. I'll steal the code, clone GridCtrl and add it Smile because its a nifty feature for me. I'll probably try to make it multi-character, too.
- ArrayCtrl works with dynamically created windows, but GridCtrl blows chunks in the destructor somewhere. I shouldn't have been using dynamic construction anyway, but it's nice to know for when I do.

- GridCtrl has:
Viewable row count
Interactive row resize (I think)
3-state sort marker, ArrayCtrl is 2 state
Loads faster
Lets user size header height, which is nice
Doesn't flicker when multithreaded (GREAT!)
"live" mouse hover highlight works great
Default context menu is prettier, better icons
Has clipboard built in
Has alternating row coloring with single setting
Sorts much faster than ArrayCtrl for smaller sets
No memory leaks on either with MT (except with dynamic window)

I'm going with GridCtrl because of the no flicker. I use threads to populate the grid and let the user interact with it on the main thread, so flicker is considerable.

Anyone else try both? I'm curious what other differences there are when stacked up against each other.


cd7651feeb698f6ac6cec1f6deda5e5b

[Updated on: Fri, 12 February 2010 19:34]

Report message to a moderator

Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25153 is a reply to message #25150] Fri, 12 February 2010 20:52 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

If you want to avoid flickering for arrayctrl just do:
ArrayCtrl arr;
arr.BackPaint();

You can use the same in GridCtrl but in most cases it's not necessary.
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25158 is a reply to message #25153] Fri, 12 February 2010 21:43 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Alendar

Quote:

Anyone else try both? I'm curious what other differences there are when stacked up against each other.


I agree with many of your experiences.

I would add two pros for ArrayCtrl that are that it handles Drag & Drop and it is very easy to set a full control inside a simple cell.


Best regards
Iñaki
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25163 is a reply to message #25158] Sat, 13 February 2010 07:00 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator

Quote:



I would add two pros for ArrayCtrl that are that it handles Drag & Drop and it is very easy to set a full control inside a simple cell.


What do you mean by "full control"?
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25169 is a reply to message #25150] Sat, 13 February 2010 11:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
alendar wrote on Fri, 12 February 2010 13:32

I started out using ArrayCtrl because I didn't see GridCtrl right off. It works good, but since it stores Value objects I wondered if it might not be faster if it was just string objects.



Performance difference would be negligible, but you would loose a lot of functionality. What about images in cells? Smile

Quote:


I found GridCtrl and got it to work. I put both next to each other and just flipped the names between them in the layout and compared the behavior on a large set.



As I see it, ArrayCtrl is headed more to be used as building block (in fact, it is used even for such things like DropList), whereas GridCtrl is geared towards a lot of prebuild functions.

Mirek

[Updated on: Sat, 13 February 2010 11:31]

Report message to a moderator

Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25170 is a reply to message #25169] Sat, 13 February 2010 11:36 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
As for flickering, it is very easy to make U++ app completely flicker-free. Use:

Ctrl::GlobalBackPaint();

or

Ctrl::GlobalBackPaintHint();

(second one makes U++ flicker free only if windows is >=XP and machine has more than 512MB - heurestic indication that the machine is OK).

The reason why this is not default is that on many machines in the past (2 years back), there was visible speed difference between modes.

Well, I guess, today we could make at least GlobalBackPaintHint default... Smile

Mirek
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25171 is a reply to message #25150] Sat, 13 February 2010 11:49 Go to previous messageGo to next message
Sc0rch is currently offline  Sc0rch
Messages: 99
Registered: February 2008
Location: Russia, Rubtsovsk
Member

alendar wrote on Sat, 13 February 2010 00:32

ArrayCtrl works with dynamically created windows, but GridCtrl blows chunks in the destructor somewhere.

Hello Alendar,

I'm using GridCtrl for dynamically created windows. I don't noticed such problem. Any details? Just need to know, I want to avoid the problems with GridCtrl in future.

Best regards,
Anton
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25176 is a reply to message #25150] Sat, 13 February 2010 12:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
alendar wrote on Fri, 12 February 2010 13:32

but GridCtrl blows chunks in the destructor somewhere



If it does, it is not a designed feature Smile It is a bug - you shold try to create a "testcase" and post it to the GridCtrl forum.

No bugs are to be tolerated...

Mirek
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25187 is a reply to message #25176] Sat, 13 February 2010 16:46 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello fudadmin

Quote:

What do you mean by "full control"?


I mean you can design a full StaticCtrl with other controls inside and put it easily into an ArrayCtrl cell.


Best regards
Iñaki
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25191 is a reply to message #25187] Sat, 13 February 2010 19:01 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
koldo wrote on Sat, 13 February 2010 15:46

Hello fudadmin

Quote:

What do you mean by "full control"?


I mean you can design a full StaticCtrl with other controls inside and put it easily into an ArrayCtrl cell.


Smile, yeh, I 50% guessed so. But I had just started worrying where could it be a possibility to lose "full control" in GridCtrl... Laughing
Anyway, if you or anyone else wants this feature (Set external Ctrl) (and some other features, eg. column selection...) you can freely borrow some or all of the tweaks from the files below.

In fact, I'm so in love with GridCtrl (fantastic job uno!) that I started to "gridizice" my version of theide.
index.php?t=getfile&id=2257&private=0
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25192 is a reply to message #25191] Sat, 13 February 2010 19:05 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
my experimental GridCtrl tweaks:
  • Attachment: GridCtrl.zip
    (Size: 58.59KB, Downloaded 243 times)
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25197 is a reply to message #25191] Sat, 13 February 2010 19:46 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Wow! That should be me first with "gridiziced" ide Smile. I see you know GridCtrl quite deep. Sorry for getting the knowledge without documentation.. I must finally finish it (to avoid this repeated question about difference to arrayctrl and to reveal all grid features)
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25211 is a reply to message #25197] Sun, 14 February 2010 13:29 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
unodgs wrote on Sat, 13 February 2010 18:46

Wow! That should be me first with "gridiziced" ide Smile. I see you know GridCtrl quite deep. Sorry for getting the knowledge without documentation.. I must finally finish it (to avoid this repeated question about difference to arrayctrl and to reveal all grid features)


Thank you for your appreciation!

Documentation is not a big problem if one can have the sources in nicely programmed u++ Smile.

Also, please have in mind that if, one wants to use the files from the zip above, he/she must merge/copy the relevant changes. This is because I use GridCtrl intgrated into CtrlLib due to (my?) inability to use it for CtrlLib (AKeys esp).
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25258 is a reply to message #25170] Mon, 15 February 2010 22:11 Go to previous messageGo to next message
alendar is currently offline  alendar
Messages: 47
Registered: January 2010
Location: Idaho, USA
Member
Thanks! I'll try both. I hate to not support things before XP. I have a soft heart for NT.

cd7651feeb698f6ac6cec1f6deda5e5b
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25259 is a reply to message #25176] Mon, 15 February 2010 22:17 Go to previous messageGo to next message
alendar is currently offline  alendar
Messages: 47
Registered: January 2010
Location: Idaho, USA
Member
luzr wrote on Sat, 13 February 2010 06:45

alendar wrote on Fri, 12 February 2010 13:32

but GridCtrl blows chunks in the destructor somewhere



If it does, it is not a designed feature Smile It is a bug - you shold try to create a "testcase" and post it to the GridCtrl forum.

No bugs are to be tolerated...

Mirek


I'll try to do a test case, but since I use Windows 7 with VC 10.0 (2010) it might not be a very relevant test to most people's envs. I tried various MinGW versions and had other problems with my code. I'll try VC 9.0 (2008) which is probably fairly standard.


cd7651feeb698f6ac6cec1f6deda5e5b
Re: ArrayCtrl vs. GridCtrl (A noob's perspective) [message #25262 is a reply to message #25259] Mon, 15 February 2010 22:42 Go to previous message
alendar is currently offline  alendar
Messages: 47
Registered: January 2010
Location: Idaho, USA
Member
[quote title=alendar wrote on Mon, 15 February 2010 16:17]
luzr wrote on Sat, 13 February 2010 06:45

alendar wrote on Fri, 12 February 2010 13:32

but GridCtrl blows chunks in the destructor somewhere



If it does, it is not a designed feature Smile It is a bug - you shold try to create a "testcase" and post it to the GridCtrl forum.

No bugs are to be tolerated...

Mirek


Well, I can't duplicate it now. Boy is my face red!


cd7651feeb698f6ac6cec1f6deda5e5b
Previous Topic: is there any way to embed a browser window in a U++ window or view the html direclty?
Next Topic: General comments
Goto Forum:
  


Current Time: Thu Mar 28 20:40:56 CET 2024

Total time taken to generate the page: 0.01370 seconds