IupFontDlg

5

IupFontDlg

@serial = 739

dialog

Description

Creates the Font Dialog element. It is a predefined dialog for selecting a font. The dialog can be shown with the IupPopup function only.

Include

iup.e

Namespace

iup

Signature

public function IupFontDlg()

Creation

Returns: the identifier of the created element, or NULL if an error occurs.

Attribute

PREVIEWTEXT [GTK and Motif only]: the text shown in the preview area. If not defined, the system will provide a default text.

COLOR [Windows Only]: The initial color value and the returned selected value if the user pressed the Ok button. In Windows the Choose Font dialog allows the user to select a color from a pre-defined list of colors. Since IUP 3.15 must set SHOWCOLOR=Yes to enable this option.

PARENTDIALOG (creation only): Name of a dialog to be used as parent. This dialog will be always in front of the parent dialog.

STATUS (read-only): defined to "1" if the user pressed the Ok button, "0" or NULL if pressed the Cancel button.

TITLE: Dialog title.

VALUE: The initial font value and the selected value returned if the user pressed the Ok button. Has the same format as the FONT attribute.

Callback

HELP_CB: Action generated when the Help button is pressed.

Notes

The IupFontDlg is a native pre-defined dialog not altered by IupSetLanguage.

To show the dialog, use function IupPopup. In Lua, use the popup function.

The dialog is mapped only inside IupPopup, IupMap does nothing.

In Windows, the dialog will be modal relative only to its parent or to the active dialog.

Example

Help is not working

include iup/iup.e  
IupOpen(NULL)  
  
atom dlg = IupFontDlg()  
  
function help_cb() 
	IupMessage("Help","Help Text") 
return IUP_DEFAULT 
end function 
 
IupSetAttribute(dlg, "VALUE", "Times New Roman, Bold 20")  
IupSetAttribute(dlg, "SHOWCOLOR", "Yes")  
IupSetAttribute(dlg, "TITLE", "IupFontDlg Test") 
IupSetCallback(dlg, "HELP_CB", Icallback("help_cb"))  
  
IupPopup(dlg, IUP_CURRENT, IUP_CURRENT)  
  
if (IupGetInt(dlg, "STATUS")) then  
  
  IupMessage("Font",IupGetAttribute(dlg, "VALUE"))  
  IupMessage("Color",IupGetAttribute(dlg, "COLOR")) 
  
else  
  IupMessage("Cancel","Action cancelled") 
end if  
IupDestroy(dlg)  
  
IupMainLoop()  
IupClose()  

See Also

IupFileDlg IupMessageDlg IupFontDlg IupProgressDlg IupAlarm IupGetFile IupGetColor IupGetParam IupGetText IupListDialog IupMessage IupScanf IupLayoutDialog IupElementPropertiesDialog
Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu