#textdomain wesnoth-lib ### ### Definition of a single line text box. ### #define _GUI_DRAW_BACKGROUND COLOR [rectangle] x = 0 y = 0 w = "(width)" h = "(height)" fill_color = {COLOR} [/rectangle] #enddef #define _GUI_TEXTBOX_BACKGROUND_ENABLED {_GUI_DRAW_BACKGROUND ({GUI__BACKGROUND_COLOR_ENABLED})} #enddef #define _GUI_TEXTBOX_BACKGROUND_DISABLED {_GUI_DRAW_BACKGROUND ({GUI__BACKGROUND_COLOR_DISABLED})} #enddef #define _GUI_DRAW_BORDER COLOR [rectangle] x = 0 y = 0 w = "(width)" h = "(height)" border_thickness = 1 border_color = {COLOR} [/rectangle] #enddef #define _GUI_DRAW_TEXT SIZE COLOR [rectangle] x = "(text_x_offset + selection_offset)" y = "(text_y_offset)" w = "(selection_width)" h = "(text_font_height)" border_thickness = 0 fill_color = "21, 53, 80, 255" [/rectangle] [text] x = "(text_x_offset)" y = "(text_y_offset)" w = "(text_width)" h = "(text_height)" maximum_width = "(text_maximum_width)" font_size = {SIZE} color = {COLOR} text = "(text)" [/text] #enddef #define _GUI_DRAW_CURSOR X_OFFSET [line] x1 = "(cursor_offset + {X_OFFSET})" y1 = "(text_y_offset + 2)" x2 = "(cursor_offset + {X_OFFSET})" y2 = "(text_y_offset + text_font_height - 2)" color = "255, 255, 255, 255" # TODO: disabled until there's a way to deal with textboxes on multiple windows #alpha = "(cursor_alpha)" thickness = 1 [/line] #enddef #define _GUI_RESOLUTION RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT X_OFFSET EXTRA_WIDTH FONT_SIZE BACKGROUND_ENABLED BACKGROUND_DISABLED [resolution] {RESOLUTION} min_width = {MIN_WIDTH} min_height = {HEIGHT} default_width = {DEFAULT_WIDTH} default_height = {HEIGHT} max_width = 0 max_height = {HEIGHT} text_font_size = {FONT_SIZE} text_x_offset = {X_OFFSET} text_y_offset = "(if(text_font_height <= height, (height - text_font_height) / 2, 0))" text_extra_width = {EXTRA_WIDTH} [state_enabled] [draw] {BACKGROUND_ENABLED} {_GUI_DRAW_BORDER ({GUI__BORDER_COLOR_DARK}) } {_GUI_DRAW_TEXT ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__DEFAULT}) } [/draw] [/state_enabled] [state_disabled] [draw] {BACKGROUND_DISABLED} {_GUI_DRAW_BORDER ({GUI__FONT_COLOR_DISABLED_DARK__DEFAULT}) } {_GUI_DRAW_TEXT ({FONT_SIZE}) ({GUI__FONT_COLOR_DISABLED__DEFAULT}) } [/draw] [/state_disabled] [state_focused] [draw] {BACKGROUND_ENABLED} {_GUI_DRAW_BORDER ({GUI__BORDER_COLOR}) } {_GUI_DRAW_TEXT ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__DEFAULT}) } {_GUI_DRAW_CURSOR ({X_OFFSET}) } [/draw] [/state_focused] [/resolution] #enddef [text_box_definition] id = "default" description = "Default text box" {_GUI_RESOLUTION () 40 250 25 5 10 ({GUI_FONT_SIZE_DEFAULT}) ({_GUI_TEXTBOX_BACKGROUND_ENABLED}) ({_GUI_TEXTBOX_BACKGROUND_DISABLED})} [/text_box_definition] [text_box_definition] id = "transparent" description = "Background-less text box, used for WML messages" {_GUI_RESOLUTION () 40 250 25 5 10 ({GUI_FONT_SIZE_DEFAULT}) () ()} [/text_box_definition] #define _GUI_FILTER_BOX_STUFF FONT_SIZE [image] x = "(width - image_width)" y = 0 name = "(if(text = '', 'icons/action/zoomdefault_25.png~FL(horiz)', ''))" [/image] [text] x = "(text_x_offset)" y = "(text_y_offset)" w = "(text_width)" h = "(text_height)" maximum_width = "(text_maximum_width)" font_size = {GUI_FONT_SIZE_SMALL} color = {GUI__FONT_COLOR_DISABLED__DEFAULT} text = "(if(text = '', 'Search', ''))" [/text] #enddef #define _GUI_RESOLUTION_FILTER RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT X_OFFSET EXTRA_WIDTH FONT_SIZE BACKGROUND_ENABLED BACKGROUND_DISABLED [resolution] {RESOLUTION} min_width = {MIN_WIDTH} min_height = {HEIGHT} default_width = {DEFAULT_WIDTH} default_height = {HEIGHT} max_width = 0 max_height = {HEIGHT} text_font_size = {FONT_SIZE} text_x_offset = {X_OFFSET} text_y_offset = "(if(text_font_height <= height, (height - text_font_height) / 2, 0))" text_extra_width = {EXTRA_WIDTH} [state_enabled] [draw] {BACKGROUND_ENABLED} {_GUI_DRAW_BORDER ({GUI__BORDER_COLOR_DARK}) } {_GUI_DRAW_TEXT ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__DEFAULT}) } {_GUI_FILTER_BOX_STUFF ({FONT_SIZE})} [/draw] [/state_enabled] [state_disabled] [draw] {BACKGROUND_DISABLED} {_GUI_DRAW_BORDER ({GUI__FONT_COLOR_DISABLED_DARK__DEFAULT}) } {_GUI_DRAW_TEXT ({FONT_SIZE}) ({GUI__FONT_COLOR_DISABLED__DEFAULT}) } {_GUI_FILTER_BOX_STUFF ({FONT_SIZE})} [/draw] [/state_disabled] [state_focused] [draw] {BACKGROUND_ENABLED} {_GUI_DRAW_BORDER ({GUI__BORDER_COLOR}) } {_GUI_DRAW_TEXT ({FONT_SIZE}) ({GUI__FONT_COLOR_ENABLED__DEFAULT}) } {_GUI_DRAW_CURSOR ({X_OFFSET}) } [/draw] [/state_focused] [/resolution] #enddef [text_box_definition] id = "filter" description = "Filter text box" {_GUI_RESOLUTION_FILTER () 40 250 25 5 10 ({GUI_FONT_SIZE_DEFAULT}) ({_GUI_TEXTBOX_BACKGROUND_ENABLED}) ({_GUI_TEXTBOX_BACKGROUND_DISABLED})} [/text_box_definition] #undef _GUI_RESOLUTION #undef _GUI_RESOLUTION_FILTER #undef _GUI_FILTER_BOX_STUFF #undef _GUI_DRAW_CURSOR #undef _GUI_DRAW_TEXT #undef _GUI_DRAW_BORDER #undef _GUI_DRAW_BACKGROUND #undef _GUI_TEXTBOX_BACKGROUND_ENABLED #undef _GUI_TEXTBOX_BACKGROUND_DISABLED