UBBFriend: Email This Page to Someone!
  Computer Workshop User Forums
  General Questions about EZGUI
  Help for a beginner..

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Help for a beginner..
Gary Stout
Member
posted 02-07-2001 09:38 PM     Click Here to See the Profile for Gary Stout     Edit/Delete Message Reply w/Quote
Hi Chris and others on the forum,

I have had a hard time moving from Dos style programming to Windows programming. I have played with VB5 some but never mastered it by any means. My question is this... If I create a form with EZGUI with a label or text box and a button, what needs to be in the button click event to cause some text to appear in the label. I have looked through the samples and scanned through the Docs, but haven't found the answer yet.
I want to play around with some very simple examples to get the hang of it and thought this would help "re-program" my brain.

Thanks for your help.

Gary Stout

MikeTx
Member
posted 02-07-2001 10:09 PM     Click Here to See the Profile for MikeTx     Edit/Delete Message Reply w/Quote
Gary,

You would use the EZ_SetText to put text in a label or textbox.

code:



EZ_SetText "FormName",TextControlID&,"Button Clicked"

Mike

MikeTx
Member
posted 02-07-2001 10:11 PM     Click Here to See the Profile for MikeTx     Edit/Delete Message Reply w/Quote
Sorry .. you asked about setting the label .. you use the same EZ_SetText except use the LabelControlID& (the number you assigned to the label control) ...

As an aside .. setting the ID to 0 will change the Window Title (for that form)

code:



EZ_SetText "FormName", 0&, "New Window Title"

Mike

[This message has been edited by MikeTx (edited 02-07-2001).]

Gary Stout
Member
posted 02-07-2001 10:16 PM     Click Here to See the Profile for Gary Stout     Edit/Delete Message Reply w/Quote
Thanks for the quick reply, Mike!

I will play with that and give it a try. I didn't think it could be too hard and figured that I was probably making it much harder than need be. Hard to teach an old dos programmer new tricks <LOL>

Thanks again,
Gary Stout

Chris Boss
Administrator
posted 02-07-2001 10:23 PM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
Gary;

Do you have EZGUI 1.0 or are you using my Freeware (DDT) Visual Designer ?

If you are using EZGUI 1.0, the help file lists all the available functions/commands !

Gary Stout
Member
posted 02-08-2001 01:51 AM     Click Here to See the Profile for Gary Stout     Edit/Delete Message Reply w/Quote
Chris ,
I am using EZGUI 1.0. I looked through the docs trying to find the answer but didn't find what I was looking for (not that its not there). I was searching for something similar to the way that VB does it like form1.label1.caption = "some text"
Can't hardly wait for version 2.0 with the VB form import option.

Thanks for the reply..
Gary Stout

Chris Boss
Administrator
posted 02-08-2001 08:31 AM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
Gary;

First thing to remember is that EZGUI is not VB and you will need to forget about using things like properties and methods (ie. MyControl.Caption).

All EZGUI commands are simply Function or Subroutine calls.

That said, the best way to get a feel for what functions EZGUI has, is to use the Index feature of the Help file. All the commands will be listed in the Index . All EZGUI commands start with the prefix EZ_ so it is easy to see what items are actually EZGUI commands.

Most of the functions that would do what VB properties do, start with either EZ_Set or EZ_Get (ie EZ_SetText, EZ_GetText).

Probably, I ought to add a VB to EZGUI conversion document in EZGUI 2.0 which would show you how to do something in EZGUI, that would be done in VB.

Gary, Are you an experienced VB programmer ?

Gary Stout
Member
posted 02-08-2001 11:00 AM     Click Here to See the Profile for Gary Stout     Edit/Delete Message Reply w/Quote
Hi Chris,

I wouldn't say experienced VB programmer. <Big LOL> Only know enough to be dangerous!
I have take several VB programming classes but they only touched on creating forms and setting properties and very elementary file handling routines.

I tried Tom's example and still having a little bit of trouble. I created a form with only a label and a button. I am trying to click on the button and put some text in the label. When I use 0& for the ID, it does change the form title, but using a 1& doesn't change anything on the label. Basically, I need to read a little deeper into the docs. Still don't quite understand the ID&. Is that assigned by EZGUI or something that I assign?
Thanks for your help Chris and Tom!

Gary Stout

Chris Boss
Administrator
posted 02-08-2001 01:19 PM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
Gary;

Each Form has a Name to identify it !

Each Control has a unique ID number to indentify it !

When you use EZ_SetText (or any similiar type command), you must use the correct Form Name and the correct Control ID Number.

The ID Number for your label control will be the one used in the EZ_Label command which created the label control.

Many EZGUI functions and commands use the standard : FormName$, IDNum& format for parameters to select which Form and control on the Form is acted upon.

Just remember:

Forms have a Name (a string)

Controls use an ID number to indentify them (number)

Chris Boss
Administrator
posted 02-08-2001 01:23 PM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
I forgot to mention, that the Visual Designer has options (when generating code) which determine whether the control ID numbers are actual numbers or whether constants will be used for the numbers.

You could use a control ID number either way:

ie.

code:



EZ_SetText "MYFORM", 100, "Here is some text"

or
code:



' listed in beginning of program
%MYFORM_MyControlID = 100

...

EZ_SetText "MYFORM", %MYFORM_MyControlID, "Here is some text"


[This message has been edited by Chris Boss (edited 02-08-2001).]

Gary Stout
Member
posted 02-08-2001 02:01 PM     Click Here to See the Profile for Gary Stout     Edit/Delete Message Reply w/Quote
Hey Chris, I think I did it!

It was that control ID# that was confusing me. Once I read through your last post, a light went off and cleared things up. I now see how to determine which control has which ID#.

I knew I was making it much harder than it need to be.

Thanks again for all the replies...
Gary Stout

Frank Kelley
Member
posted 02-08-2001 05:56 PM     Click Here to See the Profile for Frank Kelley     Edit/Delete Message Reply w/Quote
Gary:

You and I are on the same track...you're just a couple of laps behind.

My background was DOS and quite frankly Windows programming was a total non-starter for me...until the advent of Chris and EZGUI! At first I experienced exactly what you're going through -- confusion. Then, I started building simple forms with EZGUI's Designer and experimenting with them. It didn't take long to figure out what works and what doesn't. Then, I moved up to multiple forms in the same app. The more you try (at your own pace), the better it gets.

Last night, I developed a simple "phone book" app that allows the user to add, edit and delete names and phone numbers from a list. From start to finish (form design, code, functional app) it took me 90 minutes. The finished exe is only 40k (plus the EZGUI dll). Try that with VB!

Don't be discouraged. Keep working with EZGUI to gradually build more complex apps. EZGUI is a RAD tool and a teaching tool in one. (As a beta-tester for 2.0, I can tell you the upcoming release is GREAT! And wait til you use the new List View and Rich Text controls! AWESOME!!)

Frank

Gary Stout
Member
posted 02-08-2001 07:06 PM     Click Here to See the Profile for Gary Stout     Edit/Delete Message Reply w/Quote
Thanks Frank for the comments! The 90 minute developement time for a completed app is impressive. I have never been a VB fan but a die hard PB fan. It is GREAT that EZGUI works with both PB/CC and PB/DLL. I haven't compared the EXE results of the two compilers but since the same source will compile without changes, it might be interesting to see if there is much difference in the two.

Thanks for your reply...
Gary Stout

All times are EST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Computer Workshop ( EZGUI ) Home Page

Copyright 2000 to 2007 Christopher R. Boss

Powered by: Ultimate Bulletin Board, Version 5.44
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.