Hi.
I took my first steps in making a basic GUI today, and I'm already in trouble *embarrassed*
Here is what I've done (by going through the examples in the documentation):
class myWindow : CWindow
{
declare virtual OnClose(),int;
declare virtual OnCreate(),int;
}
global sub main()
{
myWindow w;
w.Create(0, 0, 750, 500, AWS_VISIBLE|AWS_SYSMENU,0,"Test", NULL);
w.AddControl(CTLISTBOX,"Test",5,5,120,420,0x50000000,0x0,1);
w.AddControl(CTBUTTON,"Test",5,433,120,30,0x50000001,0x0,2);
w.AddControl(CTRICHEDIT,"Hello",130,5,610,460,0x50800000,0x200,3);
do
{
wait();
}
until !w.IsValid();
}
myWindow::OnCreate()
{
CenterWindow();
return 0;
}
myWindow::OnClose()
{
Destroy();
return 0;
}
Here's the things I have been trying to figure out:
1. How to change the background colour of the window
2. How to give the RichEdit box a border
3. How to add items to the ListBox - I know it is the 'AddString(text)' method but I don't see how to use it
I'd really appreciate some help, thanks.
Also, is there a list of what the hex values in the control flags mean? I have checked the constants section of the documentation but it isn't filled in at the moment.
lots of the stuff you are asking about is in an old example I did.
http://www.ionicwind.com/forums/index.php?topic=229.0
Not sure it will still compile but it is a starting point.
There are lots of good examples in the Software Projects section.
#1. The SetWindowColor method of CWindow.
myWindow w;
w.Create(0, 0, 750, 500, AWS_VISIBLE|AWS_SYSMENU,0,"Test", NULL);
w.SetWindowColor(RGB(255,0,0));
#2. Add AWS_BORDER style by using the | opreator.
w.AddControl(CTRICHEDIT,"Hello",130,5,610,460,0x50800000 | AWS_BORDER,0x200,3);
#3.
CListBox *pBox = win.GetControl(1);
pBox->AddString("Hello there");
do
{
wait();
}
until !w.IsValid();
The question depends on whether your using a dialog or window. See the example program "weatherman.src". In a dialog you initialize controls in the OnInitDialog handler.
The control flags are an ORed value and are different for every control. There isn't really a convenient way to dehexify them. The basic flag is AWS_CHILD | AWS_VISIBLE which turns out to be 0x50000000
Paul.
Thank you Paul. All 3 sorted.
Thank you too Larry. It didn't compile but I'll try again later as a learning project.
I think the window references need to be changed to Cwindow.
I should fix it - if time permits.
If I weren't so modestÂÃ, 8)ÂÃ, I point you here: http://www.ionicwind.com/forums/index.php?topic=348.0
Bruce,
dead link - this one works: http://www.campanilesystems.com/Programmers_Toolkit.zip
Off Topic - Mike your machining software is how I found Aurora.
I found your site while taking a course in machining - from there I found Ibasic which I bought - then
discovered Aurora and been here since - so Thanks.l
You're sure welcome. ;)