MMCC MASTHEAD
Mid-Michigan Computer Consultants - Bay City, Michigan
 


CONTENTS       (old style)
Mid-Michigan Computer Consultants
509 Center
Bay City, Michigan

Sales (989) 892-9242
Support (989) 686-8860

Plb-0272.cfm v1.0


plb-t010.cfm
 

ANSI Standard PL/B Language and Visual PL/B

NOTE TO OUR READERS
This web resource is written for our own use. But we feel strongly that the PL/B language should be shared with the software community. So feel free to use this at will! BUT PLEASE... if you find errors or omissions or have a better way to do something. TELL US! Dialog helps us all. Send e-mail to: support@mmcctech.com
ICONS
You can create ICONS at will within your program. Icons are very similar to BUTTONS, although each has it's own unique characteristics.

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.
NOTES
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,    EventMod
ICON 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:



v1.10

Write to MMCC Technical Support at:               Send e-mail to MMCC.
MMCC - Technical Support
600 W. Midland
Bay City, MI 48708
(989) 686-8860
© 1997 - 2017 MMCC - All Rights Reserved