edelib  2.1.0
Classes | Enumerations | Functions
FLTK widgets and functions


class  ExpandableGroup
 A group with applied layout on childs. More...
class  FontInfo
 Base structure for storing font information; used by FontCache. More...
class  FontCache
 Allow readable font names and cache their access. More...
class  MessageBox
 Standard dialog. More...
class  SevenSeg
 Digital number widget. More...
class  Theme
 Theming engine for widgets. More...
class  ThemeLoader
 Themes loader. More...
class  Window
 Window class. More...


 Type of MessageBox dialog. More...
 Type of added button to MessageBox class. More...
enum  MessageBoxIconType {
 Type of the icon in message box. More...
enum  WindowComponents { WIN_INIT_NONE = (1 << 1), WIN_INIT_ICON_THEME = (1 << 2), WIN_INIT_IMAGES = (1 << 3), WIN_INIT_ALL = (WIN_INIT_ICON_THEME | WIN_INIT_IMAGES) }
 Components used to be loaded with the window. More...


bool font_cache_find (const char *face, Fl_Font &f, int &s, Fl_Font df=FL_HELVETICA, int ds=12)
int font_chooser (const char *name, const char *family, int &retsize, const char *default_name=0, int default_size=0)
String icon_chooser (const char *dir)
String icon_chooser (IconSizes sz, IconContext ctx=ICON_CONTEXT_ANY, bool always_full_path=false, bool *outside_theme_ret=((void *) 0))
void clear_dialog_icons (void)
void window_xid_create (Fl_Window *win, void(*before_map_func)(Fl_Window *)=((void *) 0), int background_pixel=-1)
void window_center_on_screen (Fl_Window *win)

Detailed Description

Enumeration Type Documentation

enum MessageBoxButtonType

Type of added button to MessageBox class.


Ordinary button (Fl_Button)


Button with 'enter' shortcut (Fl_Return_Button)

enum MessageBoxIconType

Type of the icon in message box.


Info-like icon.


Alert-like icon.


Question-like icon.


Input-like icon.


Password-like icon.

enum MessageBoxType

Type of MessageBox dialog.


Plain dialog.


Dialog with input field.


Dialog with secret input field.

enum WindowComponents

Components used to be loaded with the window.


Do not load anything except XSETTINGS code.


Load IconTheme code.


Call fl_register_images.


Load above.

Function Documentation

void edelib::clear_dialog_icons ( void  )
bool edelib::font_cache_find ( const char *  face,
Fl_Font &  f,
int &  s,
Fl_Font  df = FL_HELVETICA,
int  ds = 12 

Function that will initialize FontCache object, load database from standard cache directory and find given font name. If fails, it will set default values.

int edelib::font_chooser ( const char *  name,
const char *  family,
int &  retsize,
const char *  default_name = 0,
int  default_size = 0 

font_chooser() is a dialog for choosing fonts. After this function was called, it will display a dialog with available fonts and their sizes and will wait untill user choose an action.

If user canceled it (or it was closed) it will return -1 and retsize will be set to -1.

Note that dialog returns (besides font size), integer value for font name, so it can be directly used by FLTK. Returned value is not valuable for end user (e.g. when you want to display it in some dialog), so you must use Fl::get_font_name((Fl_Font)returned_value, 0) to obtain stringized name (e.g. helvetica, courier, etc.)

font name as integer, known to FLTK
nameis titlebar
familyis family of fonts (like ISO8859-1). If given NULL, it will use ISO8859-1; if given -* will get all fonts with any encoding as long as they have normal X font names with dashes in them; if given * will get every font that exists.
retsizeif not NULL will return selected font size
default_nameif not NULL will select given font name
default_sizeif greater than 0 will select font size
String edelib::icon_chooser ( const char *  dir)

icon_chooser() is a dialog containing a list of visible icons so user can choose desired one. Given directory will be scanned for known image/icon types and those will be shown.

If given path does not exists, or directory is not readable, empty dialog will be shown.

icon_chooser() will skip those icons who's size is greater than 128 pixels, width or height.
full path to choosed icon, or empty string if directory is inaccessible, or pressed Cancel
dira path to directory that contains icons
String edelib::icon_chooser ( IconSizes  sz,
IconContext  ctx = ICON_CONTEXT_ANY,
bool  always_full_path = false,
bool *  outside_theme_ret = ((void *) 0) 

Load dialog with icons from currently loaded icon theme. This function will assume IconTheme::init(...) was previously called and (if not) it will show empty dialog. If user select icon inside icon theme, returned value will be icon name base: only file name without folder prefix and extension.

However, if user select icon outside icon theme, it will return full path. This is because IconTheme loader can also load icons if was given full path to icon file.

full path to choosed icon or empty string if theme was not loaded or pressed Cancel
szis icon size
ctxis icon context
always_full_pathif set, icons will not be stripped
outside_theme_retif variable was given, returns true if icon was selected inside or outside icon theme
void edelib::window_center_on_screen ( Fl_Window *  win)

Center window on screen. It will take current window width and height and, including screen size, calculate correct position and set window on it. The best way is to call this function before window show().

void edelib::window_xid_create ( Fl_Window *  win,
void(*)(Fl_Window *)  before_map_func = ((void *) 0),
int  background_pixel = -1 

This function is intended to be used inside inherited show() member (from Fl_Window familly) and do the same job as Fl_X::make_xid(). The main difference is that it will call before_map_func() (if given) before window is actually mapped.

This is usefull for cases when window data must exists (when FLTK creates them) so some properties can be set before mapping on the screen (actually these properties can be set after window was mapped but many window managers, panels, etc. will not be notified correctly and will not use them; of course not all properies must be set before window was mapped, but for those that must, this function is intended).

In short, if you have not clue what I was talking about, then you don't need this function at all ;-).