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 and SplitterFrame
GridCtrl and SplitterFrame [message #36108] Sat, 28 April 2012 04:47 Go to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Hi,

When I add a SplitterFrame to a GridCtrl in a dialog, the GridCtrl still uses the entire original space for its scrollbar.

For example, I want to share the left hand side of my dialog between two GridCtrl objects so I add one to the layout in the layout designer and then I add the splitterFrame to that GridCtrl and add another GridCtrl to the SplitterFrame.

IMO the behaviour should be that the two GridCtrls share the space according to the SplitterFrame which they do but also their scrollbars should do the same too which they don't.

If you need me to I can upload an example but it is very quick and easy to recreate.

Cheers,

Nick
Re: GridCtrl and SplitterFrame [message #36348 is a reply to message #36108] Mon, 21 May 2012 16:31 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1354
Registered: November 2005
Location: Poland
Senior Contributor

nixnixnix wrote on Fri, 27 April 2012 22:47


If you need me to I can upload an example but it is very quick and easy to recreate.
Cheers,
Nick

If you could please do it Smile
Re: GridCtrl and SplitterFrame [message #36402 is a reply to message #36348] Thu, 24 May 2012 02:02 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Hi Daniel,

The following code in a CtrlLib application recreates the problem.


SplitGrid.h

#ifndef _SplitGrid_SplitGrid_h
#define _SplitGrid_SplitGrid_h

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

#define LAYOUTFILE <SplitGrid/SplitGrid.lay>
#include <CtrlCore/lay.h>

#include <GridCtrl/GridCtrl.h>


class SplitGrid : public WithSplitGridLayout<TopWindow> {
public:
	typedef SplitGrid CLASSNAME;
	SplitGrid();
	
	GridCtrl m_grid1,m_grid2;
	
	SplitterFrame sf1,sf2;
	
	
};

#endif




main.cpp

#include "SplitGrid.h"


SplitGrid::SplitGrid()
{
	CtrlLayout(*this, "Window title");
	
	Sizeable().Zoomable();
	
	label.AddFrame(sf1.Left(m_grid1,200));
	m_grid1.AddFrame(sf2.Bottom(m_grid2,200));
	
	m_grid1.Ready(false);
	m_grid1.AddColumn("health",100);
	m_grid1.AddColumn("wealth",100);
	m_grid1.SetRowCount(20);
	m_grid1.Ready(true);
	
	m_grid2.Ready(false);
	m_grid2.AddColumn("black",100);
	m_grid2.AddColumn("white",100);
	m_grid2.SetRowCount(20);
	m_grid2.Ready(true);
	
}

GUI_APP_MAIN
{
	SplitGrid().Run();
}




SplitGrid.lay
LAYOUT(SplitGridLayout, 532, 332)
	ITEM(EditString, label, HSizePosZ(0, 0).VSizePosZ(0, 0))
END_LAYOUT

Re: GridCtrl and SplitterFrame [message #36411 is a reply to message #36402] Thu, 24 May 2012 14:46 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1354
Registered: November 2005
Location: Poland
Senior Contributor

Thanks for the test case. Now I see what you mean Smile
It happens like that because grid has 3 frames:
0 - view frame
1 - scrollbar x frame
2 - scrollbar y frame

So now if you call grid.AddFrame(..) you are adding control inside y frame...
To fix this simply change:
m_grid1.AddFrame(sf2.Bottom(m_grid2,200));

to
m_grid1.InsertFrame(0, sf2.Bottom(m_grid2,200));


Re: GridCtrl and SplitterFrame [message #36412 is a reply to message #36411] Thu, 24 May 2012 19:47 Go to previous message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Perfect! Thanks!
Previous Topic: GridCtrl Clipboard just for copying
Next Topic: GridCtrl: Feature Requests
Goto Forum:
  


Current Time: Thu Nov 14 07:10:00 CET 2019

Total time taken to generate the page: 0.01338 seconds