Module m_frame
Documentation for the modules-m_frame module in /std/modules/m_frame.c.
Module Information
This module creates fancy and colourful frames using unicode characters and 256 colour based from XTERM256_D.
Functions
-
int colour_strlen(string str)
Gives the length of the visible portion of s. Colour codes (e.g. %^GREEN%^ <123>) are ignored.
-
string use_colour(string *cols, int position, int width)
Returns the colour in the colour array, cols, to use given the position out of the width (typically screen width).
-
string query_style()
Returns the current frame style.
-
void set_style(string t)
Set a specific style if it exists.
-
string *query_frame_colour_themes()
Returns a list of the frame colour themes available. The list is sorted alphabetically.
-
int valid_theme(string t)
Checks if string t is a valid theme, and returns 1 if it is, otherwise 0.
-
string *query_frame_styles()
Returns all the implemented frame styles.
-
void set_frame_left_header()
Sets the frame into a mode where the header is not shown at the top, but shown at the left side.
- nomask int frame_simplify()
Returns TRUE if the current user (not the object receiving the message!) has simplify turned on.
-
string title(mixed t)
Sets the title of the frame.
-
string accent(mixed t)
Takes a string and applies the accent colour to it.
-
string raw_accent()
Returns the raw accent colour, i.e. the XXX number triplet.
-
string raw_title()
Returns the raw title colour, i.e. the XXX number triplet.
-
string warning(mixed t)
Takes a string and applies the warning colour to it.
-
void set_frame_title(string s)
Sets the frame title. Big surprise.
-
void set_width(int w)
Sets the width of the frame. Minimum is 10, maximum is 1000. Other values will be capped.
-
int query_width()
Returns the width of the frame.
-
void set_title_margin(int hm)
Sets the margin for the title. It’s the space between the frame and the title.
-
void set_text_margin(int tm)
Set the text margin.
-
void frame_init_user()
Init the frame based on the user settings. This is normally always called before the rendering to set the frame up correctly. See most commands using frames.
-
void set_frame_header(string hc)
Set the frame header, works both vertically and horizontally.
Sets the frame footer.
-
void set_frame_content(mixed c)
This is the main function to call for the main content of the frame. Content must either be an array of strings or a single string.
-
void set_frame_hcolours(string *hc)
Inject the colour array raw into the frame. Don’t call this unless you’ve read the source code for M_FRAME.
-
void set_theme(string t)
Sets the frame theme.
-
string query_frame_title(string theme)
Returns the frame title.
-
string query_frame_accent(string theme)
Returns the frame accent colour given theme.
-
string query_frame_warning(string theme)
Returns the frame warning colour given theme.
-
string frame_demo_string(string style, int w)
Returns a simple demo string.
-
string frame_colour_demo(string style, string colour, int w)
Do a frame colour demo using style using colour in width w.
Produces a render of the current menu.
-
string frame_render()
Renders the final frame into a string for printing.
- varargs void frame_add_column(string name, mixed *data, function colour_function, int max_width)
Adds a column with a name, and an array of strings or integers to be shown.
This can only be rendered if all contents are columns. Use frame_render_columns() to render.
Call frame_init_user() before adding columns.
If max_width is not specified, it will be calculated based on the longest string in the column.
Important: Frame header and frame content should
not be called as they are calculated automatically.
-
string frame_render_columns()
Render the columns added via frame_add_column().
Important: Frame header and frame content should
not be called as they are calculated automatically.
File generated by Lima 1.1a4 reStructured Text daemon.