May 01, 2024, 05:03:23 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Build a window with Aurora

Started by nico, July 12, 2007, 07:33:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nico

I am not a beginner but I have never programmed with the classes, also I ask for your help to understand!

I have en error in my code:

Compiling...
Aurora1.src
No Errors

Linking...
Aurora Linker v1.0 Copyright ÂÃ,©2005,2006 Ionic Wind Software
Unresolved external MyWindow@Create
Error: Unresolved extern MyWindow@Create
Error(s) in linking C:\Program Files\Aurora\Aurora1.exe


My code:
//MyWindow definition
class MyWindow : CWindow
{
declare MyWindow();
declare _MyWindow();
declare virtual Create(int l,int t,int w,int h,int style,int exstyle,string title,CWindow *parent),int;
declare virtual OnClose(),int;
int run;
}

//MyWindow Implementation
MyWindow::MyWindow()
{
}

MyWindow::_MyWindow()
{
}

global sub main()
{
MyWindow win;
win.Create(0,0,300,100,AWS_CAPTION | AWS_SYSMENU | AWS_AUTODRAW | AWS_VISIBLE | AWS_BORDER,0,"Demo",0);

win.CenterWindow();
win.run = 1;
do
{
wait();
} until win.run = 0;
return;
}

MyWindow::OnClose(),int
{
run = 0;
return true;
}



nico

i do not declare //declare virtual Create(int l,int t,int w,int h,int style,int exstyle,string title,CWindow *parent),int; but i don't know why!

Bruce Peaslee

Remove the declare for Create. It is already part of Aurora. It will then run.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

nico

Thanks,

Another problem, where is my RichEdit?

//MyWindow definition
class MyWindow : CWindow
{
declare MyWindow();
declare _MyWindow();
declare virtual OnCreate(),int;
declare virtual OnClose(),int;

CRichEdit *m_pRichEdit;

int run;
}

//MyWindow Implementation
MyWindow::MyWindow()
{
}

MyWindow::_MyWindow()
{
}


global sub main()
{
MyWindow win;
win.Create(0,0,300,300,AWS_CAPTION | AWS_SYSMENU | AWS_AUTODRAW | AWS_VISIBLE | AWS_BORDER,0,"Demo",0);

win.CenterWindow();
win.run = 1;
do
{
wait();
} until win.run = 0;
return;
}

MyWindow::OnCreate(),int
{
m_pRichEdit=new(CRichEdit,1);
m_pRichEdit->Create(10,10,280,280,AES_MULTILINE|AES_AUTOVSCROLL|AES_AUTOHSCROLL ,1,"",this);

}

MyWindow::OnClose(),int
{
run = 0;
return true;
}


Bruce Peaslee

Try this way:


//MyWindow definition
class MyWindow : CWindow
{
declare MyWindow();
declare _MyWindow();
declare virtual OnCreate(),int;
declare virtual OnClose(),int;

int run;
}

//MyWindow Implementation
MyWindow::MyWindow()
{
}
MyWindow::_MyWindow()
{
}


global sub main()
{
MyWindow win;
win.Create(0,0,300,300,AWS_CAPTION | AWS_SYSMENU | AWS_AUTODRAW | AWS_VISIBLE | AWS_BORDER,0,"Demo",0);
win.AddControl(CTRICHEDIT,"",10,10,280,260,AWS_VISIBLE|AES_MULTILINE|AES_AUTOVSCROLL|AES_AUTOHSCROLL,0x200,1); // '1' is control number

win.CenterWindow();
win.run = 1;
do
{
wait();
} until win.run = 0;
return;
}

MyWindow::OnCreate(),int
{
}

MyWindow::OnClose(),int
{
run = 0;
return true;
}


Looks like it covers the whole window. Type into it.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

nico

Yes, but i try different method

It's run for a CComboBoxEx

Is there a bug?

//MyWindow definition



class MyWindow : CWindow
{
declare MyWindow();
declare _MyWindow();
declare virtual OnCreate(),int;
declare virtual OnClose(),int;

CRichEdit *m_pRichEdit;

    CComboBoxEx *m_pComboBoxEx;


int run;
}

//MyWindow Implementation
MyWindow::MyWindow()
{
}

MyWindow::_MyWindow()
{
}


global sub main()
{
MyWindow win;
win.Create(0,0,300,300,AWS_CAPTION | AWS_SYSMENU | AWS_AUTODRAW | AWS_VISIBLE | AWS_BORDER,0,"Demo",0);

win.run = 1;
do
{
wait();
} until win.run = 0;
return;
}

MyWindow::OnCreate(),int
{
CenterWindow();
m_pRichEdit=new(CRichEdit,1);
m_pRichEdit->Create(10,10,280,280,AES_MULTILINE|AES_AUTOVSCROLL|AES_AUTOHSCROLL ,1,"",this);

    m_pComboBoxEx = new(CComboBoxEx, 1);
m_pComboBoxEx->Create(10,10,100,20,AWS_VISIBLE|ACBS_DROPDOWN,2,"",this);
}

MyWindow::OnClose(),int
{
run = 0;
return true;
}

Bruce Peaslee

Add AWS_VISIBLE.

Also, adjust the x,y as the controls currently overlap.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

nico

Thank's, sorry  for my stupidity  ::)

Bruce Peaslee

Quote from: nico on July 12, 2007, 09:25:02 AM
Thank's, sorry  for my stupidity  ::)
It's only stupid to refuse to seek help when you need it. We have all been there.

I believe you need to release the pointers.


MyWindow::OnClose(),int
{
delete m_pRichEdit;
delete m_pComboboxEx;
run = 0;
return true;
}
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

nico

There is a bug, The border of RichEdit does not appear to the creation ! ???

//MyWindow definition
#INCLUDE "Windows.inc"

class MyWindow : CWindow
{
declare MyWindow();
declare _MyWindow();
declare virtual OnClose(),int;

int run;
}

//MyWindow Implementation
MyWindow::MyWindow()
{
}

MyWindow::_MyWindow()
{
}


global sub main()
{
MyWindow win;
win.Create(0,0,320,320,AWS_CAPTION | AWS_SYSMENU | AWS_AUTODRAW | AWS_VISIBLE | AWS_BORDER,0,"Demo",0);
win.AddControl(CTRICHEDIT,"",10,10,280,260,AES_MULTILINE|AES_AUTOVSCROLL|AES_AUTOHSCROLL|AWS_VISIBLE|WS_BORDER,0x200,1);
win.run = 1;
do
{
wait();
} until win.run = 0;
return;
}


MyWindow::OnClose(),int
{
//delete(m_pRichEdit);
run = 0;
return true;
}

Bruce Peaslee

For reasons that are unclear to me, Aurora uses some of its own window constants. Replace WS_BORDER with AWS_BORDER, like you have it in the window creation line.

Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

nico

AWS_BORDER change nothing for me !

Also if i do:
   win.AddControl(CTRICHEDIT,"",10,10,280,260,AES_MULTILINE|AES_AUTOVSCROLL|AES_AUTOHSCROLL|AWS_VISIBLE|AWS_BORDER,0x200,1);

I can paste image


if i do:

m_pRichEdit->Create(10,10,280,280,AES_MULTILINE|AES_AUTOVSCROLL|AES_AUTOHSCROLL|AWS_VISIBLE ,1,"",this);

I can't paste image, it's normal?