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 and FileSel.ExecuteOK
ArrayCtrl and FileSel.ExecuteOK [message #33469] Wed, 10 August 2011 18:10 Go to next message
deep is currently offline  deep
Messages: 196
Registered: July 2011
Location: Bangalore
Experienced Member
Hi,

I am using Ubuntu 10.10 and UPP build 3211.

I am having a strange problem, FileSel.ExecuteOK dialog works ok when there is one ArrayCtrl element is declared.
File select works when only 'ArrayCtrl a' is declared. File select not working when 'ArrayCtrl a,c;' declared.

If I use FileSel.ExecuteOpen function then file select works OK as expected.

Also when I set ActiveDir files panel will not show files. It will show files when any other selection is done ( sort type changed ) will refresh the panel and show files.

Deepak.

With FileSel.ExecuteOK()
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

GUI_APP_MAIN
{
	ArrayCtrl a , c ;
	Splitter h1 ;
	FileSel fs1;
	FileIn fin1 ;
	
	fs1.Type("Text file", "*.txt;*.log");
	
//	if(!fs1.ExecuteOpen("Choose the file"))
//	return;
	
	if(!fs1.ExecuteOK())
	return;

	fin1.Open(~fs1);
	
	a.AddColumn("Text").Ctrls<EditString>();

	while (!fin1.IsEof() && fin1.IsOK())
	{
	 a.Add(fin1.GetLine());	
	}
	a.SetLineCy(Draw::GetStdFontCy() + 8);

	fin1.Close();
	
/*
	c.AddColumn("Text").Ctrls<EditString>();
	for(int i = 0; i < 300; i++)
		c.Add(FormatIntRoman(i));
	c.SetLineCy(Draw::GetStdFontCy() + 8);
	
	h1 << a  << c ;
	
	h1.Horz();
	h1.SizePos();
	
*/
	TopWindow app;
//	app.Add(h1.SizePos());
	app.Add(a.SizePos());
	app.Sizeable();
	app.Run();
}



Code with FileSel.ExecuteOpen

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

GUI_APP_MAIN
{
	ArrayCtrl a , c ;
	Splitter h1 ;
	FileSel fs1;
	FileIn fin1 ;
	
	fs1.Type("Text file", "*.txt;*.log");
	
	if(!fs1.ExecuteOpen("Choose the file"))
	return;
	
//	if(!fs1.ExecuteOK())
//	return;

	fin1.Open(~fs1);
	
	a.AddColumn("Text").Ctrls<EditString>();

	while (!fin1.IsEof() && fin1.IsOK())
	{
	 a.Add(fin1.GetLine());	
	}
	a.SetLineCy(Draw::GetStdFontCy() + 8);

	fin1.Close();
	

	c.AddColumn("Text").Ctrls<EditString>();
	for(int i = 0; i < 10; i++)
		c.Add(FormatIntRoman(i));
	c.SetLineCy(Draw::GetStdFontCy() + 8);
	
	h1 << a  << c ;
	
	h1.Horz();
	h1.SizePos();
	

	TopWindow app;
	app.Add(h1.SizePos());
//	app.Add(a.SizePos());
	app.Sizeable();
	app.Run();
}








Warm Regards

Deepak
Re: ArrayCtrl and FileSel.ExecuteOK [message #33492 is a reply to message #33469] Sat, 13 August 2011 03:54 Go to previous message
mirek is currently offline  mirek
Messages: 12015
Registered: November 2005
Ultimate Member
You should definitely use ExecuteOpen.

ExecuteOK is TopWindow method; perhaps it should be hidden in FileSel.
Previous Topic: DropGrid, DropTree dynamic update.
Next Topic: GridCtrl: assign default value & WhenAcceptRow
Goto Forum:
  


Current Time: Mon Sep 16 06:05:39 CEST 2019

Total time taken to generate the page: 0.01095 seconds