Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl and FileSel.ExecuteOK
ArrayCtrl and FileSel.ExecuteOK [message #33469] |
Wed, 10 August 2011 18:10 |
|
deep
Messages: 263 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
|
|
|
|
Goto Forum:
Current Time: Fri Mar 29 12:36:20 CET 2024
Total time taken to generate the page: 0.01766 seconds
|