Fnd_Bttn
28 shared methods.
- Fnd_Bttn_AlternativePicturePath
- Fnd_Bttn_Cache_Image_Add
- Fnd_Bttn_Cache_Image_Delete
- Fnd_Bttn_Cache_Image_Get
- Fnd_Bttn_Cache_Startup
- Fnd_Bttn_CacheMaximumSize
- Fnd_Bttn_ColorToString
- Fnd_Bttn_CreateBackgrounds
- Fnd_Bttn_CreateButton
- Fnd_Bttn_GetIcon
- Fnd_Bttn_GetPicture
- Fnd_Bttn_GetPictureName
- Fnd_Bttn_GetPictureWidth
- Fnd_Bttn_GetSizedIconName
- Fnd_Bttn_Info
- Fnd_Bttn_LibraryToResource
- Fnd_Bttn_MakeBackground
- Fnd_Bttn_MakeButton
- Fnd_Bttn_MakeCrntBackground
- Fnd_Bttn_MakeIconPicture
- Fnd_Bttn_MakeMenuIndicatorPic
- Fnd_Bttn_MakeTextPicture
- Fnd_Bttn_Platform
- Fnd_Bttn_SetBackgroundPict
- Fnd_Bttn_SetTextProperties
- Fnd_Bttn_SetVariables
- Fnd_Bttn_Style
- Fnd_Bttn_TextToPict
Fnd_Bttn_AlternativePicturePath
Fnd_Bttn_AlternativePicturePath {(Path)} --> Text
Foundation normally creates buttons based on icons in the Fnd_Bttn_Pictures folder within the component resource folder. This allows the developer to specify an alternative location for example in the host resource folder. Foundation will first of all check this location first and then the Fnd_Bttn_Pictures folder in component resoure folder
| Parameter | Type | Direction | Description |
|---|---|---|---|
inPath | Text | in | The Path (optional) |
Result | Text | out | The path |
Fnd_Bttn_Cache_Image_Add
Fnd_Bttn_Cache_Image_Add (composite name; image)
Adds an image to the RAM cache of button images.
| Parameter | Type | Direction | Description |
|---|---|---|---|
compositeName | Text | in | The name returned by the Fnd_Bttn_GetPictureName function |
image | Picture | in | The picture to add to the cache |
Fnd_Bttn_Cache_Image_Delete
Fnd_Bttn_Cache_Image_Delete (composite image name)
Deletes an image from the cache using its composite name as the key.
| Parameter | Type | Direction | Description |
|---|---|---|---|
compositeName | Text | in | The image name returned by Fnd_Bttn_GetPictureName |
Fnd_Bttn_Cache_Image_Get
Fnd_Bttn_Cache_Image_Get (composite name) --> Picture
Returns an image from the cache using its composite name.
Modified from Mark's original design. This routine no longer displays an alert
if the image isn't found in the cache. It just returns a blank image, so the
developer needs to check to see if an image was returned.
| Parameter | Type | Direction | Description |
|---|---|---|---|
name | Text | in | The name returned by the Fnd_Bttn_GetPictureName function |
Result | Picture | out | The image from the cache |
Fnd_Bttn_Cache_Startup
Fnd_Bttn_Cache_Startup
These arrays keep track of those Rollovers we've created in the application. We will only be rollovers as well need them, then not creating the picture again. This allows us to easily switch languages and have all the text in the rollovers be easily converted without storing loads of pictures in different languages.
No parameters.
Fnd_Bttn_CacheMaximumSize
Fnd_Bttn_CacheMaximumSize {(New Cache size)} --> longint
Allows you to get and set the maximum cache size The default (and minimum) is 2 MB (2048*1024)
| Parameter | Type | Direction | Description |
|---|---|---|---|
inNewCacheSize | longint | in | The new cache size |
Result | longint | out | The cache size |
Fnd_Bttn_ColorToString
Fnd_Bttn_ColorToString (rgb color) --> Text
Converts a 4D RGB color value to a CSS2-compatible string in the format "#rrggbb".
| Parameter | Type | Direction | Description |
|---|---|---|---|
color | Longint | in | The 4D RGB color |
Result | Text | out | The color string |
Fnd_Bttn_CreateBackgrounds
Fnd_Bttn_CreateBackgrounds
Because of the time to do the picture maths for the middle bit of the button, we
will pre-build different sized middle slices and store them in an array.
No parameters.
Fnd_Bttn_CreateButton
Fnd_Bttn_CreateButton (->button object; ->picture variable; icon name; label)
Helps the developer create and size a picture button created with the Foundation Buttons component.
Creates the image needed from the icon name and label, assigns it to the picture variable, then assigns the picture variable to the button.
| Parameter | Type | Direction | Description |
|---|---|---|---|
button | Pointer | in | The form button object |
picture | Pointer | in | A picture variable |
iconName | Text | in | An icon name |
label | Text | in | Any text |
Fnd_Bttn_GetIcon
Fnd_Bttn_GetIcon (name{; state}) --> Picture
This method just wraps the GET PICTURE FROM LIBRARY command, but if you wanted to store your pictures in resources or some other way, you could modify this command for getting the pictures.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inIconName | Text | in | The picture name |
inState | Text | in | The icon state: "selected" or "disabled" (optional) |
Result | Picture | out | The picture |
Fnd_Bttn_GetPicture
Fnd_Bttn_GetPicture (icon name; button label{; variation}) --> Picture
This routine returns a picture of a rollover based on the parameters you pass for the icon, text, size and type. If the picture already exists in the Cache, it is retreived from there instead of being generated again.
Supports these variations: "current" : The currently selected button (Mac OS X Prefs style)
| Parameter | Type | Direction | Description |
|---|---|---|---|
inIconName | Text | in | The name of the icon to use from the 4D picture library |
buttonLabel | Text | in | The label for the button |
inVariation | Text | in | The variaton name (optional) |
Result | Picture | out | A picture to use for a 4D picture rollover button |
Fnd_Bttn_GetPictureName
Fnd_Bttn_GetPictureName (icon name; label{; variation}) --> Text
Creates a composite name for the picture which will be used to
reference it quickly in the cache.
| Parameter | Type | Direction | Description |
|---|---|---|---|
iconName | Text | in | The button icon name |
buttonLabel | Text | in | The button label name |
inVariation | Text | in | The variaton name (optional) |
Result | Text | out | The cache picture name |
Fnd_Bttn_GetPictureWidth
Fnd_Bttn_GetPictureWidth (icon; text{; variation}) --> Number
Returns the width of the rollover picture that uses the specified icon and text.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inIconName | Text | in | The name of the icon |
buttonLabel | Text | in | The button label |
variation | Text | in | The button variation ("current" or "menu") |
Result | Longint | out | The width of the picture button. |
Fnd_Bttn_GetSizedIconName
Fnd_Bttn_GetSizedIconName (icon name) -> Text
Returns the name of the icon with the size embeded.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inIconName | Text | in | The icon name without the size |
Result | Text | out | The icon name with the size |
Fnd_Bttn_Info
Fnd_Bttn_Info (label) --> Text
Returns requested information. See the Fnd_Gen_ComponentInfo method for more information.
| Parameter | Type | Direction | Description |
|---|---|---|---|
request | Text | in | Info desired ("version" or "name") |
Result | Text | out | Response |
Fnd_Bttn_LibraryToResource
Fnd_Bttn_LibraryToResource
Takes all the pictures in the 4D Picture Library and writes them to a separate .png file for each picture in the library in the 4D Resources folder in a folder named Fnd_Bttn_Pictures.
Used by Fnd_Bttn subcomponent to allow developer to easily edit or replace the icons used throughout Foundation.
Special thanks to John Craig for this implementation.
No parameters.
Fnd_Bttn_MakeBackground
Fnd_Bttn_MakeBackground (width) --> Picture
Builds a button background to the specified width.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inWidth | Longint | in | The width needed |
Result | Picture | out | The buton background image of the right width |
Fnd_Bttn_MakeButton
Fnd_Bttn_MakeButton (icon name; button label; variation) --> Picture
Returns a picture of the button * 4 for use as a 4D picture button.
Assumes the button style has been previously defined.
This isn't called directly. Call Fnd_Bttn_GetPicture. It will check the cache first, then call this only if necessary.
Supports these variations: "" : A standard button "current" : The currently selected button (Mac OS X Prefs style) "menu" : Adds a menu indicator triangle
| Parameter | Type | Direction | Description |
|---|---|---|---|
iconName | Text | in | The name of the icon to use from the 4D picture library |
buttonText | Text | in | The label for the button |
variation | Text | in | The variation name |
Result | Picture | out | A picture to use for a 4D picture rollover button |
Fnd_Bttn_MakeCrntBackground
Fnd_Bttn_MakeCrntBackground (width) --> Picture
Returns the background to use with the currently selected "Pref" style button.
Similar to Fnd_Bttn_MakeBackground, but designed for the background of the currently selected button (Mac OS X Prefs style).
This routine also isn't as optimized as Fnd_Bttn_MakeBackground.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inWidth | Longint | in | The required width of the background |
Result | Picture | out | The background picture |
Fnd_Bttn_MakeIconPicture
Fnd_Bttn_MakeIconPicture (icon name) --> Picture
Creates a picture containing the 4 icons arranged for the rollover button,
spaced according to the button height.
| Parameter | Type | Direction | Description |
|---|---|---|---|
iconName | Text | in | The name of the icon |
Result | Picture | out | A picture of the icon over the background |
Fnd_Bttn_MakeMenuIndicatorPic
Fnd_Bttn_MakeMenuIndicatorPic --> Picture
Creates a picture of the specified label.
No parameters.
Fnd_Bttn_MakeTextPicture
Fnd_Bttn_MakeTextPicture (button label) --> Picture
Creates a picture of the specified label.
| Parameter | Type | Direction | Description |
|---|---|---|---|
buttonText | Text | in | The label for the button |
Result | Picture | out | A picture of the label (x4) |
Fnd_Bttn_Platform
Fnd_Bttn_Platform ({platform name}) --> Text
Sets and gets the toolbar platform name.
Can be: "Win" "Mac" "Auto" Only "Mac" or "Win" will be returned.
| Parameter | Type | Direction | Description |
|---|---|---|---|
requestedPlatform | Text | in | The platform to use (optional) |
Result | Text | out | The selected platform |
Fnd_Bttn_SetBackgroundPict
Fnd_Bttn_SetBackgroundPict (left, middle, right{; pref left; pref middle; pref right})
Call this to specify the images to use for the button background.
| Parameter | Type | Direction | Description |
|---|---|---|---|
left | Picture | in | The left edge of the button |
middle | Picture | in | The middle of the button (generally 1 pixel wide) |
right | Picture | in | The right edge of the button |
selectedLeft | Picture | in | The left edge of the currently selected button (optional) |
selectedMiddle | Picture | in | The middle of the currently selected button (optional) |
inSelectedRight | Picture | in | The right edge of the currently selected button (optional) |
Fnd_Bttn_SetTextProperties
Fnd_Bttn_SetTextProperties (font name; font size; font style)
Sets the text properties for the button labels.
| Parameter | Type | Direction | Description |
|---|---|---|---|
fontName | Text | in | The font name |
fontSize | Longint | in | The font size |
fontStyle | Longint | in | The font style (use 4D constants) |
Fnd_Bttn_SetVariables
Fnd_Bttn_SetVariables
Updates the toolbar variables depending on the current platform, size, and style settings.
No parameters.
Fnd_Bttn_Style
Fnd_Bttn_Style ({Style name}) --> Text
Sets and gets the toolbar style name.
Can be: "Large" "Prefs" "Small1" "Small2"
| Parameter | Type | Direction | Description |
|---|---|---|---|
requestedStyle | Text | in | The style to use (optional) |
Result | Text | out | The selected style |
Fnd_Bttn_TextToPict
Fnd_Bttn_TextToPict (text;fontName;fontSize;fontFace;width;height{;color}) --> Picture
Converts a text string to a picture of the text.
| Parameter | Type | Direction | Description |
|---|---|---|---|
text | Text | in | Text to make into picture |
Result | Picture | out | A picture of the text |