MMCC's PL/B notes Notes home Intro History Article index v1.10 |
509 Center Bay City, Michigan Sales (989) 892-9242             Support (989) 686-8860 ICONS
|
ICONSYou can create ICONS at will within your program. Icons are very similar to BUTTONS, although each has it's own unique characteristics.NOTES
Icons can be created in the forms designer, but we often create our own within the program:[label] CREATE [{parent};]{icon}={top}:{left},{data}: {property list}...] ACTIVATE {icon},{click-routine},{result} SETPROP {icon},OBJECTID={number} . . . . // The variables used below (EventXxxx) are defined in // our common work area INCLUDE code. icon_click EVENTINFO ZERO: //get info for current event CHAR=EventChar: //character that caused the event MODIFIER=EventMod: //modifier key or mouse button clicked OBJECTID=EventObjID: //event type RESULT=EventResult: //9 digit #: click type, H, V positions TYPE=EventType //click, dblclick, etc.EVENTS If you create and activate the icon yourself, you'll want to have a routine like the one shown above as "icon_click".
If you use the forms designer to create the icon, you don't need the event information because ICON is linked to it's own processing event within the PLFORM. Typically we just look for a CLICK event and move some value (like "ICON1-CLICKED") to our common "ACTION" variable then return to the mainline which takes the appropriate action.
If, on the other hand, you NEED the event info, you have to collect it in the PLFORM event. The event info is not available to your main program as it's recorded in "local" variables within the form. We get that information by capturing the information in our own variables which are defined in the common work areas include:MOVE "BUTTON-CLICK",ACTION MOVE #EventType, EventType MOVE #EventResult, EventResult MOVE #EventObjId, EventObjId MOVE #EventChar, EventChar MOVE #EventMod, EventModICON SIZE: Icons are created with only the TOP and LEFT anchors. You can adjust the width and height using the WIDTH and HEIGHT properties.
ICON IMAGE: From the PLBWIN tech reference:
- "If {data} is a character string variable, numeric variable, an expression, or a decimal constant defining the image."
The "variables" can be literals as well.
- If {data} is a numeric variable or decimal constant, it specifies the RESOURCE number of the image. A set of standard icons has been provided. The resource numbers 10,000 to 11,500 have been reserved for these icons. You can add other icons and, perhaps, images to resources within the PLFORM.
(Note that you can NOT use an IMAGE LISTS for an ICON. That's too bad because the PLBWIN standard image list includes 70+ icons, many of which would be great for an ICON.)
The set of standard resource icons is shown below. These have been augmented by adding three of our own icons to the resource from within the forms designer.
RESOURCE ICONS
Numbers 1,2,3 were created from our own icon
files using the RESOURCES tool in the Designer.
Resource 100 and the series from 10020 to 10143
were provided automatically by PLBWIN.
Display created by UTIL-PLB\RESOURCE.PLS
See also:
- IMAGE LISTS.
- RESOURCES.
- ICONS where resources are used.
- BUTTONS.
- Tool Bars where an image list is used.
- ICON/RESOURCE summary.
CONTENTS
v1.10 Send e-mail to MMCC.
Write to MMCC Technical Support at:MMCC, Inc.
600 W. Midland
Bay City, MI 48708
(989) 686-8860| Home   |
© 2003 MMCC, Inc. All Rights Reserved.
Report problems or suggestions to support@mmcctech.com
Started 06/20/2003