 | | Wide Studio Application Builder User's Guide
| |
Creating an event procedure.
The instance fires the various kind of event on executing.
On WideStudio,It is possible to put some event procedure on the instance
which procedure will be executed with the event fired.
For example, let's create an event procedure which has the following function.
Indicating "Hello!" on the button by clicking it on the window.
Set an event procedure to the instance so that it execute the procedure by
clicking the instance: newvbtn_000.
At first,select the instance: newvbtn_000 by mouse pointer, and
and select the [Procedures] index tab of the inspector,and
click the following icon to create an event procedure.

[ Creating an event procedure]
Input the procdedure name,the C/C++ function name,and so on,to the dialog
as follows.
Procedure name: new_ep
Function name: btn_ep
Trigger: ACTIVATE
The procedure name is used for identification of the event procedure.
it is possible to set any name for it.
The function name is a C/C++ language function name
which function the application developper write some program to do something.
The last one is the trigger, The ACTIVATE trigger will be fired by clicking
the button normally.
It is possible to create a file of the template source code
for the event procedure.

[A event procedure.]
It indicates an editor by double clicking the item
of the list as following event procedure.
It is possible to appoint it which is your favorite.
Select [Project settings] of the [Project] menu and
input your favorite editor into the project settings dialog.
The default editor is vi on the UNIX system and
notepad.exe on the Window systeM.
#include
#include
#include
//-----------------------------------------------
//Function for the event procedure
//-----------------------------------------------
void btn_ep(WSCbase* object){
object->setProperty(WSNlabelString,"Hello!"); //A
}
static WSCfunctionRegister op("btn_ep1",(void*)btn_ep1);
The point object is the instance which has this event procedure.
At //A, set a string "Hello!" to the property: WSNlabelString of the instance
Then,the instance indicates "Hello!".
Document Release 1.3 For Use with Wide Studio Release 1.3, Summer 2001 Wide Stuido Home | Up to Copyright(C) T. Hirabayashi, 2000-2001 | | Last modified: August 20, 2001 | |