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 » ArrayCtrl: Difference between xx.Ctrls<EditString>() and xx.Edit(ef1)
ArrayCtrl: Difference between xx.Ctrls<EditString>() and xx.Edit(ef1) [message #2403] Tue, 11 April 2006 22:20 Go to next message
kevinle10@gmail.com is currently offline  kevinle10@gmail.com
Messages: 25
Registered: April 2006
Promising Member
In my header file, I define

private:
   ArrayCtrl arrayCtrl;
   EditField ef1;


Then in the source file, what's the difference between making this call:

arrayCtrl.AddColumn("Value", 20).Ctrls<EditString>()


and

arrayCtrl.AddColumn("User variable", 10).Edit(ef1);


I did try both. Besides the difference on the appearance, it seems like the second approach gives me on the context menu (right click) a menu item call "Edit Row" for free. But when I select "Edit Row", the row that gets highlighted jumped to an incorrect one.

Long questions short, but
1. What's the prefered method or the use case for each ?
2. In the second approach, how do I make selecting the "Edit row" menu item from the context menu jump to to the right one ?
3. In the first approach, how do I make the edit area occupying the entire cell, leaving no gray area (don't really know how to describe this appearance).

Thanks


Re: ArrayCtrl: Difference between xx.Ctrls<EditString>() and xx.Edit(ef1) [message #2406 is a reply to message #2403] Tue, 11 April 2006 23:20 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
1. Depends on what you need. "Edit" has two potential advantages - can be "accepted" (e.g. stored into database) and also sometimes having editors everywhere is frustrating. "Edit" can be also faster for very long ArrayCtrls....

2. I am not sure what is the problem. Could be a bug. Post the code please!

3. By setting HeaderCtrl::Column:: margins.

arr.AddColumn(....).HeaderTab().SetMargin(0);

Mirek
Re: ArrayCtrl: Difference between xx.Ctrls<EditString>() and xx.Edit(ef1) [message #2457 is a reply to message #2406] Thu, 13 April 2006 14:13 Go to previous message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

luzr wrote on Tue, 11 April 2006 17:20


"Edit" can be also faster for very long ArrayCtrls....



It is.. Smile If I press Alt+T in my current project array ctrl has about 500 rows. Scrolling it dosn't look good.. it's simply too slow (and controls don't scroll with the rows in a sychronized way (because they are simply repainted at new positions after main view is scrolled))

PS: I hope Mirek that you remeber about implementing scrolling of child controls Wink
Previous Topic: How to create sizable header columns in ArrayCtrl
Next Topic: ArrayCtrl: ghost Image after "delete row" [602 BUG?] -Maybe... - Update required
Goto Forum:
  


Current Time: Mon Apr 29 16:05:31 CEST 2024

Total time taken to generate the page: 0.02909 seconds