Here is an example of custom control for custom buttons. Font, Size, Color, Background Color, pictures are supported, as well as a toggle button type (see the included picture for samples).
Best Regards
Gildas
ps : As always (! ), this lacks real documentation, but the name of the predicates and the example should be sufficient (? ).
Seems the package size exceeds the allowed size for attachment, so you can download the package there : http://www.arsaniit.com/vp_tools/buttons.htm
Code: Select all
domains
ebuttonCallback = (boolean State, string Text) procedure (i,i).
predicates
% to change or get the text, use settext and gettext (defined in userControlSupport)
% you can even set the button text in the custom control wizard.
setBackgroundColor : (color) procedure (i). % sets the color of the button's background (gray is the default value)
setBackgroundPicture : (string FileName) procedure (i). % sets the filename (a .bmp file) of the background
enableBackgroundPicture: (). % should be called to display a background picture
disableBackGroundPicture: (). % no background picture (default value)
enableBackGroundPictureFull: (). % if a background picture is used, then it is resized to use the full button area (default value)
disableBackGroundPictureFull: (). % in this case, PictureClip and backgroundclip are used
setBackGroundPictureClip: (rct) procedure (i). % defines the part of the picture...
setBackGroundClip: (rct) procedure (i). % ... that will be displayed in the part of the button defined here
setTextColor : (color) procedure (i). % color of the text (Default is White)
setTextSize : (integer) procedure (i). % Size of the font
setTextFontName : (string) procedure (i). % Fontname
enableCenterText : (). % if defined (default value) then the text is displayed at the center of the button
disableCenterText :(). % if disable, then 'setTextPosition' is used to point the position
setTextPosition : (pnt) procedure (i).
enableShadow : (). % if used, then a shadow of the char is displayed - in the color of settextShadowcolor
disableShadow : (). % disable the shadow display
setTextShadowColor : (color) procedure (i). % sets the color of the shadow (you may use a black text, with a white shadow on deep blue
enableTwoStates :(). % if set, the button is a toggle button
disableTwoStates :(). % (default) simple push button
getButtonState :() -> boolean. % returns true if the button is pressed - false if not.
setButtonState :(boolean). % sets the button state
setCallBack : (ebuttonCallback) procedure (i). % defines the predicate to evaluate on a click