April 29, 2024, 10:43:05 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Skeleton Example

Started by Bruce Peaslee, January 24, 2006, 03:25:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bruce Peaslee

January 24, 2006, 03:25:04 PM Last Edit: January 25, 2006, 10:06:47 AM by peaslee
The attached source code pulls together some of the things I have been discussing on the forum. It doesn't do anything but open its main window and allow aÂÃ,  dialog to open. But it has menus, images, subroutines, subclassed controls, and some other stuff that might be useful to those trying to learn the system. I know putting it together taught me a lot.

It's uploaded as a zip file and includes the two images you should load into a project to get the full effect.

Edit: now uploaded with the project and resource files.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Zen

Thanks a lot bruce. When i eventually get into all the GUI stuff i will find this very usefull. Also you always keep your code nice and neat ;)

Lewis

Doc

Hey Peas, that's nice!

I never could get the image to load in the "About" dialog, but I was also testing it in a really odd folder path, which mau have had something to do with it... Also, I haven't had a chance to look into the code.

I'll recompile into a little cleaner path when I get back home this evening.

-Doc-

Rock Ridge Farm (Larry)

I had the same issue - I just unzipped it in a new dir. Suspect it has something to
do with being a project???

Bruce Peaslee

Yes, it has to be a project in order to get the images.

1. Create a folder for the files. Put them there.
2. From the IDE menu, click new project and select the new folder.
3. Open the source code and add it to the project - save the project.
4. Add the 2 resources (bitmaps) using the Resource View tab (bottom right).
5. Name the resources by putting the name as it appears in the source code.
6. Compile and 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

Ionic Wind Support Team

Bruce,
If all of your files are in one directory you can send along the .awp and .rc files.  The IDE will adjust the path accordingly when the project is first loaded on their end.

Paul.
Ionic Wind Support Team

Bruce Peaslee

January 25, 2006, 09:28:34 AM #6 Last Edit: January 25, 2006, 10:12:09 AM by peaslee
Quote from: Ionic Wizard on January 25, 2006, 09:21:50 AM
Bruce,
If all of your files are in one directory you can send along the .awp and .rc files.ÂÃ,  The IDE will adjust the path accordingly when the project is first loaded on their end.

Paul.

Good to know - I'll adjust the upload after breakfast.

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

Doc

Works great now Bruce! :)

I looked right at the .AWP project file and it never dawned on me to open it as a project. Without ever reading the source, I incorrectly assumed that the images would be read from within the folder. Another one of those "duh" moments on my part.  ::)

Thank you very kindly for the well commented example.

-Doc-

Rock Ridge Farm (Larry)

Duh moments - I know them well - I seem to have more of them as I age.
duh, duh, duh, ..... sound of me thinking.

Bruce Peaslee

January 27, 2006, 10:36:29 PM #9 Last Edit: January 28, 2006, 09:37:09 AM by peaslee
I noticed the image in the dialog has been cut off. Examine the code for the size of the control and shrink the image accordingly. If you just want to see the aurora in its full glory, load the bitmap into a reader. Notice the halo effect. The sun sends a shower of ionized particles in all directions (ionic wind). When they hit the Earth's atmosphere they are redirected by our magnetic field and cause those portions of the atmosphere to enter a higher energy state. When the energy state is reduced a photon is emitted. Very cool if your north enough (or south enough) to see 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

Parker

I've done pretty much no GUI in Aurora except for a simple character to comment + ascii code, and even then I had to look at the examples. Thanks for the example, it looks very professional and will help me learn someday when I get into it :).

Bruce Peaslee

Here is a modification of the example. It now uses a dialog class to create two dialogs. It also corrects the image size problem.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

GWS

I'm struggling to get any pictures to show ..ÂÃ,  :(

I've downloaded the latest zip file, unzipped everything, and put the files into a folder i:\auskel3.
The files are: Aurora.bmp, campo.bmp, and chezpanisse.bmp
plus cc.awp, cc.rc, and cc3.srcÂÃ,  ÂÃ,  (I've abbreviated cafecritique ..)

Since cc.awp existed, I loaded that project file, and made sure cc3.src was part of the project.ÂÃ,  The bmps in resource view didn't show when clicked on, so I removed the resource references to those three files, and re-added them to the resources.

So now the source cc3.src amd the three bitmaps appear to be part of the project, so I saved the project again.ÂÃ,  I exited, and then re-started, loading the cc project.ÂÃ,  All seems to be OK as far as resources are concerned, but a rebuild and run starts the program but with no images in sight. ::)

The loadimage statements are:
m_hImage = LoadImageA(GetModuleHandleA(0),sID,0,0,0,0);ÂÃ,  at line 350 and
Stat.SetImage(LoadImageA(GetModuleHandleA(0),"chezp",0,0,0,0));ÂÃ,  at line 495

(Not sure what sID refers to, and I can't see any reference to the 'campo' bmp).

I've not used projects before, and I haven't a clue what's going on.ÂÃ,  Anyone any idea?

(By the way, I also tried following Bruce's steps, and reached exactly the same position).

I'm in Win98SE if it makes any difference .. :)

Graham
Tomorrow may be too late ..

Bruce Peaslee

February 03, 2006, 11:49:59 AM #13 Last Edit: February 03, 2006, 12:33:47 PM by peaslee
It works here - I can't tell what's wrong.

sID is a parameter that passes the string with the resource ID, making the class method more general.

Edit: I downloaded and unzipped it. Then opened the project folder from the IDE. It said that the folders had changed. I said OK and it runs perfectly. I didn't change anything.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Rock Ridge Farm (Larry)

I got this to work - finally.
I found that the path to 2 of the bitmaps was wrong in the resource file.
They were pointing to a directory that did not exist for me.
I changed the path to the current dir and they worked.

Bruce Peaslee

Quote from: Rock Ridge Farm on February 03, 2006, 08:14:04 PM
I got this to work - finally.
I found that the path to 2 of the bitmaps was wrong in the resource file.
They were pointing to a directory that did not exist for me.
I changed the path to the current dir and they worked.

So, did you like 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

Rock Ridge Farm (Larry)

Yup. Enjoyed getting it to work - that is the fun part for me.
Now to start hacking on it.  :D