Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When using only the Caption and Icon property, the best anyone could hope for was a button that looked something like this:

Code Block
Set_Property(Ctrl, "OLE.Caption", "Cancel")  

...


Set_Property(Ctrl, "OLE.Icon", "BMPS\delete.png")

...

With the CaptionList and IconList properties, you can make a button that looks like this:

Code Block
Set_Property(Ctrl, "OLE.CaptionList", "Cancel":@VM:@VM:"C6") 

...


Set_Property(Ctrl, "OLE.IconList", "BMPS\delete.png":@VM:@VM:"C-6")

...

Multiple Captions

The reason we created the CaptionList and IconList properties in the first place was to meet the need of a client that wanted to emulate the buttons of a keyboard. This required multiple captions or images with a variety of layout and style options. Here is a sample button that uses two caption to emulate the '5' button on a typical keyboard:

Code Block
BigFont = "Arial":@SVM:16:@SVM:700 

...


LittleFont = "Arial":@SVM:10 

...


CaptionList = "" 

...


CaptionList<1> = "5":@VM:"C":@VM:"C":@VM:BigFont 

...


CaptionList<2> = "%":@VM:"L3":@VM:"T3":@VM:LittleFont 

...


Set_Property(Ctrl, "OLE.CaptionList", CaptionList)

...

Notice how each caption uses a different font. The main part of the key uses a larger font and is perfectly centered. A smaller font is used for the percent symbol and is offset relative to the top left corner.

...