mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-05 22:41:15 +00:00

Cleaned up some std::cerr to use proper logging. Rather ugly proof-of-concept to get the cursor working in a text_box. This still needs quite some polishing but the basics work.
139 lines
2.1 KiB
INI
139 lines
2.1 KiB
INI
###
|
|
### Definition of a single line text box.
|
|
###
|
|
|
|
[text_box_definition]
|
|
id = "default"
|
|
description = "Default text box"
|
|
|
|
[resolution]
|
|
min_width = 40
|
|
min_height = 22
|
|
|
|
default_width = 250
|
|
default_height = 22
|
|
|
|
max_width = 0
|
|
max_height = 22
|
|
|
|
text_font_size = {FONT_SIZE_NORMAL__NORMAL}
|
|
|
|
[state_enabled]
|
|
|
|
full_redraw = "true"
|
|
|
|
[draw]
|
|
|
|
[rectangle]
|
|
x = 0
|
|
y = 0
|
|
w = "(width)"
|
|
h = "(height)"
|
|
|
|
border_thickness = 3
|
|
border_colour = "55, 55, 55, 192"
|
|
|
|
[/rectangle]
|
|
|
|
[text]
|
|
x = "5"
|
|
y = {TEXT_V_CENTRE}
|
|
w = "(text_width)"
|
|
h = "(text_height)"
|
|
font_size = {FONT_SIZE_NORMAL__NORMAL}
|
|
colour = {FONT_COLOUR_ENABLED}
|
|
text = "(text)"
|
|
[/text]
|
|
|
|
# cursor
|
|
[line]
|
|
x1 = "(cursor_offset) + 5"
|
|
y1 = 2
|
|
x2 = "(cursor_offset) + 5"
|
|
y2 = "(height - 4)"
|
|
colour = "255, 255, 255, 255"
|
|
thickness = 1
|
|
[/line]
|
|
|
|
[/draw]
|
|
|
|
[/state_enabled]
|
|
|
|
[state_disabled]
|
|
|
|
full_redraw = "true"
|
|
|
|
[draw]
|
|
|
|
[rectangle]
|
|
x = 0
|
|
y = 0
|
|
w = "(width)"
|
|
h = "(height)"
|
|
|
|
border_thickness = 3
|
|
border_colour = "55, 55, 55, 192"
|
|
|
|
[/rectangle]
|
|
|
|
[text]
|
|
x = "5"
|
|
y = {TEXT_V_CENTRE}
|
|
w = "(text_width)"
|
|
h = "(text_height)"
|
|
font_size = {FONT_SIZE_NORMAL__NORMAL}
|
|
colour = {FONT_COLOUR_DISABLED}
|
|
text = "(text)"
|
|
[/text]
|
|
|
|
# no cursor when disabled.
|
|
|
|
[/draw]
|
|
|
|
[/state_disabled]
|
|
|
|
[state_focussed]
|
|
|
|
full_redraw = "true"
|
|
|
|
[draw]
|
|
|
|
[rectangle]
|
|
x = 0
|
|
y = 0
|
|
w = "(width)"
|
|
h = "(height)"
|
|
|
|
border_thickness = 3
|
|
border_colour = "55, 55, 55, 192"
|
|
|
|
[/rectangle]
|
|
|
|
[text]
|
|
x = "5"
|
|
y = {TEXT_V_CENTRE}
|
|
w = "(text_width)"
|
|
h = "(text_height)"
|
|
font_size = {FONT_SIZE_NORMAL__NORMAL}
|
|
colour = {FONT_COLOUR_ENABLED}
|
|
text = "(text)"
|
|
[/text]
|
|
|
|
# cursor
|
|
[line]
|
|
x1 = "(cursor_offset) + 5"
|
|
y1 = 2
|
|
x2 = "(cursor_offset) + 5"
|
|
y2 = "(height - 4)"
|
|
colour = "0, 0, 0, 255"
|
|
thickness = 1
|
|
[/line]
|
|
|
|
[/draw]
|
|
|
|
[/state_focussed]
|
|
|
|
[/resolution]
|
|
|
|
[/text_box_definition]
|