Built-in Controls

Particular FM controls have predefined indices, indicated by the constants below:

CTL_BACKGROUND

CTL_CANCEL

CTL_EDIT

CTL_FRAME

CTL_HOST

CTL_LOGO

CTL_OK

CTL_PREVIEW

CTL_PROGRESS

CTL_ZOOM

Notice: CTL_LAST_USER corresponds to the last available user control index. Check this value to ensure the index you use is not already reserved by a particular FM control.

User Control Properties

BITMAP - Creates a bitmap image

CHECKBOX - Creates a checkbox

COMBOBOX - Creates a pull-down list/combo box

EDIT - Creates a text editbox

FRAME - Creates a frame/border

GROUPBOX - Creates a groupbox for grouping radio buttons

ICON - Creates an icon image

IMAGE - Creates a transparent bitmap image

LISTBOX - Creates a listbox

METAFILE - Creates a vector image

MODIFY - Changes the properties of a predefined control

NONE - Removes a predefined user control

OWNERDRAW - Creates an actionable colored/transparent rectangle control

PUSHBUTTON - Creates a standard button

RADIOBUTTON - Creates a single radio button

RECT - Creates a rectangle

SCROLLBAR - Creates a scrollbar on its own

STANDARD - Creates a scrollbar with a text label and numeric edit control

STATICTEXT - Creates a text label

TRACKBAR - Creates a trackbar (a kind of scrollbar with ticks)

User Control Functions

clearCtlProperties - ??

createCtl - Creates a new user interface control at runtime.

ctlEnabled - Determines if a control is enabled.

deleteCtl - Deletes a user control.

doAction - Performs one of several predefined actions.

enableCtl - Enables, disables & hides user controls.

getCtlClass - Returns the type of a specific user control.

getCtlColor - Returns the current color of a control.

getCtlCoord - Get the mouse coordinates of any control.

getCtlPos - Get the current position and size of any control.

getCtlText - Get the text associated with a user control.

getCtlVal - Returns the current value of a user control.

getPreviewCoordX - Returns the x coordinate in the image above which the mouse pointer is placed.

getPreviewCoordY - Returns the y coordinate in the image above which the mouse pointer is placed.

(getPreviewCursor)? - Returns the resource number of the current preview cursor

mouseOverWhenInvisible - Enables & disables event triggering for disabled or invisible controls

refreshCtl - Redraws or updates a certain control.

scrollPreview - Scrolls the preview window in a given position inside the full image.

setClickDrag - Changes how the user can move the image in the preview window.

setCtlAction - Sets the action performed when a user control is activated.

setCtlColor - Changes the background color of the user control.

setCtlDivisor - Sets the number of decimal places a control appears to have.

setCtlFontColor - Changes the color of the user control's text.

setCtlImage - Changes the image displayed by a control at runtime.

setCtlLineSize - Changes the control's line jump unit.

setCtlPageSize - Changes the control's page jump unit.

setCtlPos - Resizes and repositions a control on the dialog interface.

setCtlProperties - Sets the properties of a control.

setCtlRange - Changes the range of values a user control can return.

setCtlText - Sets the text property of the user control.

setCtlTextv - Sets the text property of the user control to a formatted string.

(setCtlTheme)? - Switches XP/Vista themes on and off for a specific control. (Does not work correctly at the moment.)

setCtlToolTip - Sets the text that appears when the mouse hovers over the control.

setCtlVal - Sets the value associated with the control.

setPreviewCursor - Changes the cursor displayed when the mouse is over the preview window.

setZoom - Sets the zoom level of the filter preview image.

testAbort - Tests for a user-requested abort.

updatePreview - Updates the filter preview image.

updateProgress - Updates the filter progress bar.

Message & Dialog Windows

chooseColor - Invokes the host application's default color picker dialog

Error - Displays an error box dialog with Cancel, Retry and Ignore buttons

ErrorOk - Displays an error box with an OK button

(getOpenFileName)? - Displays the standard Open File dialog

(getSaveFileName)? - Displays the standard Save File dialog

Info - Displays an information box dialog

msgBox - Displays a custom configured message box

Warn - Displays a warning box dialog

YesNo - Displays a message box containing Yes and No buttons

YesNoCancel - Displays a message box containing Yes, No and Cancel buttons

Miscellaneous Dialog Functions

getAsyncKeyState - Determines whether a key is pressed or not

getDisplaySettings - Finds the bit depth, resolution and refresh rate of the screen

HDBUsToPixels - Converts horizontal dialog box units to pixels

(playSoundWave)? - Plays a sound file

(playSoundWaveLoop)? - Plays a sound file repeatedly

(playSoundWaveSync)? - Plays a sound and waits until it finishes playing

triggerEvent - Sets off a dialog, timer or internal event

VDBUsToPixels - Converts vertical dialog box units to pixels

Control drawing functions

Starting/stopping

You can draw in a number of different modes.

In the default mode, you draw directly to the control on screen.

startSetPixel - Start drawing on an OWNERDRAW

endSetPixel - Stop drawing

The buffer mode lets you draw off-screen without a control. Use this mode if you want to use these functions to draw to something other than a control and use (getPixel)? to transfer information between the buffer and your target.

(startSetPixelBuffer)?- Start drawing in buffered mode

(endSetPixelBuffer)? - Stop drawing buffered mode. This destroys the buffer.

In SuperSampling mode, you draw at a scaled up resolution off-screen, after ending the result is scaled down and smoothed.

(startSetPixelSS)? - Start drawing in SuperSampling mode

(endSetPixelSS)? - Stop drawing SuperSampling mode

Meta

(getSetPixelHeight)? - Returns the height of the control canvas or buffer in pixels. Only works between a startSetPixel* and endSetPixel* pair.

(getSetPixelWidth)? - Returns the width of the control canvas or buffer in pixels. Only works between a startSetPixel* and endSetPixel* pair.

Pixels

(getPixel)? - Read single pixel

setPixel - Set single pixel

Text

setFont - lets you choose the font name, its size, angle, boldness, and italics

setText - lets you draw a certain text with the chosen font, color and alignment (Available alignment constants: TA_BASELINE, TA_BOTTOM, TA_TOP, TA_CENTER, TA_LEFT, TA_RIGHT, TA_NOUPDATECP, TA_RTLREADING, TA_UPDATECP, VTA_BASELINE, VTA_CENTER)

(setTextv)? - Identical to setText but with support for formatted text.

Shapes

(setAngleArc)? - Draws the outlines of a pie segment of a circle.

(setAngleArcFill)? - Draws a filled pie segment of a circle.

(setEllipse)? - draws an ellipse

(setEllipseFill)? - draws a filled ellipse

(setEndCaps)? - sets the method used to cap the ends of lines with the constants PS_ENDCAP_ROUND, PS_ENDCAP_SQUARE and PS_ENDCAP_FLAT.

(setFill)? - fills the whole ownerdraw control with a certain color e.g. setFill(getCtlColor(n))

(setInsideFrame)? - determines whether the pen lines of shapes are drawn on the edge or inside the edge.

(setJoin)? - sets the method used to join thick lines at corners of shapes with the constants PS_JOIN_ROUND, PS_JOIN_BEVEL and PS_JOIN_MITER.

setLine - draws a line

(setPenWidth)? - lets you change the broadness of drawn lines.

(setRectFrame)? - draws a rectangle

setRectFill - draws a filled rectangle

setRectGradient - draws a gradient into the rectangle

Anti-aliased shapes

If you only need these shapes or non-anti-aliased shapes, these functions will be both faster and better quality than using SuperSampling mode.

(setThinLineAA)? - Draw anti-aliased line of one pixel width

(setThinEllipseAA)? - draw anti-aliased lines and ellipses

Filter Dialog Window Functions

(clearDialogStyle)? - ??

(clearDialogStyleEx)? - ??

createCircularRgn

(createClientRgn)? - ??

(createDialogRgn)? - ??

createEllipticRgn

(createMenubarRgn)? - ??

createPolyRgn

createRectRgn

createRoundRectRgn

(createStatusbarRgn)? - ??

(createTitlebarRgn)? - ??

getDialogHeight - Gets the current width of the dialog in vertical DBUs.

getDialogWidth - Gets the current width of the dialog in horizontal DBUs.

lockWindow - Enables / disables drawing in the filter dialog area.

refreshRgn - Redraws or updates a certain region of the filter dialog.

refreshWindow - Redraws or updates the filter dialog.

(setDialogColor)? - ??

(setDialogDragMode)? - ??

(setDialogGradient)? - ??

setDialogImage - Changes the image used in the filter dialog background.

(setDialogImageMode)? - ??

setDialogMinMax - Sets the minimum and maximum dimensions of the filter dialog.

(setDialogMode)? - ??

setDialogPos - Sets the position and size of the filter dialog window.

setDialogRegion

(setDialogShowState)? - ??

(setDialogSizeGrip)? - ??

(setDialogStyle)? - ??

(setDialogStyleEx)? - ??

(setDialogText)? - ??

(setDialogTextv)? - ??

(setDialogTheme)? - Switches XP/Vista themes on and off. (Does not work correctly at the moment.)

Events or FME_ constants

All constants that begin by the FME_ prefix, are used to identify events, i.e actions done by the user.They must be used inside the OnCtl handler.

FME_CANCEL

(FME_CHANGED)?

(FME_CLICKED)?

(FME_COMBO_CLOSEUP)?

(FME_COMBO_DROPDOWN)?

(FME_CONTEXTMENU)?

(FME_CUSTOMEVENT)?

FME_DRAWITEM

(FME_EXITSIZE)?

FME_INIT

FME_KEYDOWN

FME_KEYUP

(FME_KILLEDITFOCUS)? (deprecated)

(FME_KILLFOCUS)?

(FME_LEFTCLICKED_DOWN)?

(FME_LEFTCLICKED_UP)?

FME_MOUSEMOVE

FME_MOUSEOUT

FME_MOUSEOVER

(FME_PREVIEWDRAG)?

(FME_RIGHTCLICKED_DOWN)?

(FME_RIGHTCLICKED_UP)?

(FME_SETEDITFOCUS)?

(FME_SETFOCUS)? (deprecated)

(FME_SIZE)?

(FME_TIMER)?

(FME_VALUECHANGED)? (deprecated)

Constants

(ALTERNATE)?

(BLACKONWHITE)?

(COLORONCOLOR)?

(DIM_EXACT)?

(DIM_STRETCHED)?

(DIM_TILED)?

(HALFTONE)?

(IDABORT)?

(IDCANCEL)?

(IDIGNORE)?

(IDNO)?

(IDOK)?

(IDRETRY)?

(IDYES)?

(MAXSTRETCHBLTMODE)?

(RGN_AND)?

(RGN_COPY)?

(RGN_DIFF)?

(RGN_MAX)?

(RGN_MIN)?

(RGN_OR)?

(RGN_XOR)?

(STRETCH_ANDSCANS)?

(STRETCH_DELETESCANS)?

(STRETCH_HALFTONE)?

(STRETCH_ORSCANS)?

(WHITEONBLACK)?

(WINDING)?

Also see

Command Reference, Image Functions, System Functions, C Runtime Functions

Comments

Add your comments about this page here. Tips for using it are welcome, too.