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 » GridCtrl::Clear() doesn't take into account SetFixedRows(2)
GridCtrl::Clear() doesn't take into account SetFixedRows(2) [message #28039] Fri, 13 August 2010 15:18 Go to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
I can have a real nice header w/FixedRows(2), JoinFixedCells, etc... then call grid.Clear(); and it removes the 2nd header row.

An example:

	qsos.AddIndex(ID);                                                         //  1
	qsos.AddColumn(CALLSIGN, "Basics", 7).HeaderAlignCenter();                 //  2
	qsos.AddColumn(QSO_DATE, "", 8).HeaderAlignCenter();                       //  3
	qsos.AddColumn(MODE_ID, "", 5).Edit(mode).SetConvert(mode).HeaderAlignCenter();             //  4
	qsos.AddColumn(FREQ_TX, "Freq", 5).Edit(freqTx).HeaderAlignCenter();       //  5
	qsos.AddColumn(FREQ_RX, "", 5).Edit(freqRx).HeaderAlignCenter();           //  6
	qsos.AddColumn(RST_RCVD, "RST", 3).Edit(rstSent).HeaderAlignCenter();      //  7
	qsos.AddColumn(RST_SENT, "", 3).Edit(rstRcvd).HeaderAlignCenter();         //  8
	qsos.AddColumn(QSL_SENT, "QSL", 2).Edit(sent).HeaderAlignCenter();         //  9
	qsos.AddColumn(QSL_SENT_VIA, "", 3).Edit(sentVia).HeaderAlignCenter();     // 10
	qsos.AddColumn(QSL_RCVD, "", 2).Edit(rcvd).HeaderAlignCenter();            // 11
	qsos.AddColumn(QSL_RCVD_VIA, "", 2).Edit(rcvdVia).HeaderAlignCenter();     // 12
	qsos.AddRow("", "Callsign", "Date", "Mode", "TX", "RX", "S", "R", "S", "V", "R", "V");
	qsos.SetFixedRows(2);
	qsos.JoinFixedCells(2, 0,  4, 0);
	qsos.JoinFixedCells(5, 0,  6, 0);
	qsos.JoinFixedCells(7, 0,  8, 0);
	qsos.JoinFixedCells(9, 0, 12, 0);
	qsos.Editing().Navigating().Searching().ColorCols();
	qsos.SetToolBar();


On that setup, perform a Clear(). I've gotten around this for now by:

	if (qsos.GetRowCount() > 0)
		qsos.Remove(0, qsos.GetRowCount());


but looking at the code I believe my work-around is quite a bit more code executing to perform the same task.

Jeremy
Re: GridCtrl::Clear() doesn't take into account SetFixedRows(2) [message #28103 is a reply to message #28039] Mon, 16 August 2010 20:58 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1354
Registered: November 2005
Location: Poland
Senior Contributor

Should be fixed now. Please test Smile
Re: GridCtrl::Clear() doesn't take into account SetFixedRows(2) [message #28104 is a reply to message #28039] Mon, 16 August 2010 21:37 Go to previous messageGo to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Just to make sure my code didn't change, I recompiled my program and ran the code that exposed the problem. It removed the 2nd "Fixed" row as reported. I then did a svn up on uppsrc and rebuilt my program. Now when testing I get:

Assertion failed in C:\Development....\UppSrc/Core/Vcont.hpp, line 192 q >= 0 && q <= items - count && count > 0


Now, if I put .Clear() in a condition then it works.

if (qsos.GetRowCount() > 0)
  qsos.Clear();


however you do not need to place it in a condition when you only have 1 header row. .Clear() works on an empty grid or a grid with 10,000 items. It seems that .Clear() no longer works on an empty grid.

Jeremy
Re: GridCtrl::Clear() doesn't take into account SetFixedRows(2) [message #28105 is a reply to message #28104] Tue, 17 August 2010 00:32 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1354
Registered: November 2005
Location: Poland
Senior Contributor

Please try again. Now I did some test to be sure Smile Sorry for troubles.
Re: GridCtrl::Clear() doesn't take into account SetFixedRows(2) [message #28107 is a reply to message #28039] Tue, 17 August 2010 02:06 Go to previous message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Yup, that works no and no worries about a few test iterations!

Jeremy
Previous Topic: Sorting problem. Please Help!
Next Topic: PopUpTable:does this ctrl exist?
Goto Forum:
  


Current Time: Mon Sep 23 01:12:37 CEST 2019

Total time taken to generate the page: 0.04226 seconds