Wide Studio Object Reference

Wide Studio Home
Up to


Class Name

WSCpopupMenu

Specification of methods



registerClient method

Form
long registerClient(WSCbase* client)
Function
Resisters the instance to display the popup menu.
Description
It becames that the popup menu appears when the specified instance is clicked by the mouse pointer.
Parameters
(in)WSCbase* client the GUI instance
Return value
Nothing
Notice
Do not register twice or more. You must cancel the registration of the instance by the unregisterClient() method, if you destroy it.
Samples
A example of the initialize event procedure.
#include 
void menu1_proc(WSCbase* client){
  //executes by Menu 1 
}
void menu2_proc(WSCbase* client){
  //executes by Menu 2
}
void menu3_proc(WSCbase* client){
  //executes by Menu 3
}
void init_event_proc(WSCbase* client){
  //Creates a instance of the popup menu.
  WSCpopupMenu*  pmenu = new WSCpopupMenu(NULL,"menu");
  pmenu->initialize();
  //Setups properties of the menu.
  pmenu->setPropertyV(WSNmenuItemHeight,(WSCushort)20);
  pmenu->setPropertyV(WSNshadowThickness,(WSCuchar)1);
  pmenu->setPropertyV(WSNbackColor,"gray85");
  pmenu->setPropertyV(WSNtopShadowColor,"gray95");
  pmenu->setPropertyV(WSNbottomShadowColor,"gray55");
  //Setups the elements of the menu.
  pmenu->setPropertyV(WSNmenuItems,
       "Menu 1:menu1,Menu 2:menu2,Menu 3:menu3");

  WSCprocedure* 
  pmop = new WSCprocedure("menu1",WSEV_NONE);
  pmop->setFunction(menu1_proc,"_menu1_proc");
  pmenu->addProcedure(pmop);

  pmop = new WSCprocedure("menu2",WSEV_NONE);
  pmop->setFunction(menu2_proc,"menu2_proc");
  pmenu->addProcedure(pmop);

  pmop = new WSCprocedure("menu3",WSEV_NONE);
  pmop->setFunction(menu3_work,"menu3_proc");
  pmenu->addProcedure(pmop);

  pmenu->registerClient(client);
}



unregisterClient method

Form
long unregisterClient(WSCbase*)
Function
Cancels the registration of the specified instance.
Description
Removes the specified instance from the list of registered instances.
Parameters
(in)WSCbase* client the registered instance
Return value
Nothing.
Notice
Nothing.
Samples
Refer to registerClient().



onActivate method

Form
void onActivate()
Function
It executes this method when the menu item is selected.
Description
Instead of the event procedure by the WSEV_ACTIVATE trigger, the WSEV_ACTIVATE event can be handled by overloading of this method.
Parameters
Nothing.
Return value
Nothing.
Notice
If needed, overload this method on the sub classes.
Samples
void new_class::onActivate(){
  //do something when the menu item is selected.

  //call the method of the parent class.
  old_class::onActivate();
}


Document Release 3.20

For Use with Wide Studio Release 3.20, Spring 2003


Wide Stuido Home | Up to

Copyright(C) T. Hirabayashi, 1999-2003 Last modified: February 3, 2003