![]() | Programming Guide | WideStudio Index Table of contents |
Sample:3 (label)
The following is a demonstration of the event procedure about labels.
The source code is ws/samples/C/labelwork/labelwork.prj. Please load it and build it by the application builder.
this sample shows the following things.
- To highlight the label by mouse
implemented by normal event procedures.- To highlight the label by mouse(2)
implemented by an initialize procedure and sub-procedures.- To group the labels by an event procedure
[A view of the application window]
- To highlight the label
The button which displays "highlight by mouse" has two event procedures with WSEV_MOUSE_IN trigger and WSEV_MOUSE_OUT trigger.
The WSEV_MOUSE_IN procedure stores the original back-color to WSNuserString and stores the highlight color to WSNbackColor.
The WSEV_MOUSE_OUT procedure gets the original back-color from WSNuserString and stores it to WSNbackColor.- To highlight the label (2)
The button which displays "highlight by mouse(2)" has an event procedures with WSEV_INITIALIZE trigger which setups sub-procedures which trigger is WSN_MOUSE_IN and WSN_MOUSE_OUT.
The initialize procedure like this simplifies because it not require that the instance has many procedures for one-function.- To group the labels by an event procedure
The button which displays "Click!" has a event procedures which trigger is WSEV_MOUSE_PRESS. This procedure make a group of the labels which has it by storing selected label to the parent instance : form or window. Then the labels highlights cooperated.
Copyright(C) WideStudio Development Team, 1999-2005 | Last modified: Jan 05, 2005 |