Module ui.component

ui.component
Dependencies from vmod:
0
Imports:
8
Imported by:
3
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

Aliases

This section is empty.

Constants

#constant cb_sp

pub const cb_sp = 3

#constant cb_hsv_col

pub const cb_hsv_col = 30

#constant cb_nc

pub const cb_nc = 2

#constant cb_nr

pub const cb_nr = 3

#constant cb_cv_hsv_w

pub const cb_cv_hsv_w = (cb_hsv_col + cb_sp) * cb_nc + cb_sp

#constant cb_cv_hsv_h

pub const cb_cv_hsv_h = (cb_hsv_col + cb_sp) * cb_nr + cb_sp

Sum types

This section is empty.

Functions

#fn accordion_component

fn accordion_component(w ui.ComponentChild) &AccordionComponent

component access

#fn accordion_component_from_id

fn accordion_component_from_id(w ui.Window, id string) &AccordionComponent

TODO: documentation

#fn accordion_stack

fn accordion_stack(c AccordionParams) &ui.Stack

TODO: documentation

#fn alpha_component

fn alpha_component(w ui.ComponentChild) &AlphaComponent

component access

#fn alpha_component_from_id

fn alpha_component_from_id(w ui.Window, id string) &AlphaComponent

TODO: documentation

#fn alpha_stack

fn alpha_stack(p AlphaParams) &ui.Stack

TODO: documentation

#fn base26_to_int

fn base26_to_int(ac string) int

base26 to int conversion

#fn colorbox_component

fn colorbox_component(w ui.ComponentChild) &ColorBoxComponent

component access

#fn colorbox_component_from_id

fn colorbox_component_from_id(w ui.Window, id string) &ColorBoxComponent

TODO: documentation

#fn colorbox_stack

fn colorbox_stack(c ColorBoxParams) &ui.Stack

TODO: documentation

#fn colorbox_subwindow_add

fn colorbox_subwindow_add(mut w &ui.Window)

Append colorbox to window

#fn colorbox_subwindow_connect

fn colorbox_subwindow_connect(w &ui.Window, col &gx.Color, colbtn &ColorButtonComponent, show ShowMode)

to connect the colorbox to gx.Color reference

#fn colorbutton

fn colorbutton(c ColorButtonParams) &ui.Button

TODO: documentation

#fn colorbutton_component

fn colorbutton_component(w ui.ComponentChild) &ColorButtonComponent

component access

#fn colorbutton_component_from_id

fn colorbutton_component_from_id(w ui.Window, id string) &ColorButtonComponent

TODO: documentation

#fn colorpalette_click

fn colorpalette_click(cb &ColorButtonComponent)

TODO: documentation

#fn colorpalette_component

fn colorpalette_component(w ui.ComponentChild) &ColorPaletteComponent

component common access

#fn colorpalette_component_from_id

fn colorpalette_component_from_id(w ui.Window, id string) &ColorPaletteComponent

TODO: documentation

#fn colorpalette_stack

fn colorpalette_stack(p ColorPaletteParams) &ui.Stack

TODO: documentation

#fn colorsliders_component

fn colorsliders_component(w ui.ComponentChild) &ColorSlidersComponent

component access

#fn colorsliders_component_from_id

fn colorsliders_component_from_id(w ui.Window, id string) &ColorSlidersComponent

TODO: documentation

#fn colorsliders_stack

fn colorsliders_stack(p ColorSlidersParams) &ui.Stack

TODO: documentation

#fn datagrid_boxlayout

fn datagrid_boxlayout(p DataGridBoxLayoutParams) &ui.BoxLayout

TODO: documentation

#fn datagrid_stack

fn datagrid_stack(p DataGridParams) &ui.Stack

TODO: documentation

#fn demo_stack

fn demo_stack(p DemoParams) &ui.Stack

TODO: documentation

#fn dirtreeview_stack

fn dirtreeview_stack(p TreeViewDirParams) &ui.Stack

TODO: documentation

#fn doublelistbox_component

fn doublelistbox_component(w ui.ComponentChild) &DoubleListBoxComponent

component common access

#fn doublelistbox_component_from_id

fn doublelistbox_component_from_id(w ui.Window, id string) &DoubleListBoxComponent

TODO: documentation

#fn doublelistbox_stack

fn doublelistbox_stack(c DoubleListBoxParams) &ui.Stack

TODO: documentation

#fn filebrowser_component

fn filebrowser_component(w ui.ComponentChild) &FileBrowserComponent

component access

#fn filebrowser_component_from_id

fn filebrowser_component_from_id(w ui.Window, id string) &FileBrowserComponent

TODO: documentation

#fn filebrowser_stack

fn filebrowser_stack(p FileBrowserParams) &ui.Stack

TODO: documentation

#fn filebrowser_subwindow_add

fn filebrowser_subwindow_add(mut w &ui.Window, p FileBrowserSubWindowParams)

TODO: documentation

#fn filebrowser_subwindow_close

fn filebrowser_subwindow_close(w &ui.Window, id string)

TODO: documentation

#fn filebrowser_subwindow_visible

fn filebrowser_subwindow_visible(w &ui.Window, id string)

TODO: documentation

#fn fontbutton

fn fontbutton(c FontButtonParams) &ui.Button

TODO: documentation

#fn fontbutton_component

fn fontbutton_component(w ui.ComponentChild) &FontButtonComponent

TODO: documentation

#fn fontbutton_component_from_id

fn fontbutton_component_from_id(w ui.Window, id string) &FontButtonComponent

TODO: documentation

#fn fontchooser_component

fn fontchooser_component(w ui.ComponentChild) &FontChooserComponent

TODO: documentation

#fn fontchooser_component_from_id

fn fontchooser_component_from_id(w ui.Window, id string) &FontChooserComponent

TODO: documentation

#fn fontchooser_connect

fn fontchooser_connect(w &ui.Window, dtw ui.DrawTextWidget)

TODO: documentation

#fn fontchooser_listbox

fn fontchooser_listbox(w &ui.Window) &ui.ListBox

TODO: documentation

#fn fontchooser_stack

fn fontchooser_stack(c FontChooserParams) &ui.Stack

TODO: documentation

#fn fontchooser_subwindow

fn fontchooser_subwindow(w &ui.Window) &ui.SubWindow

TODO: documentation

#fn fontchooser_subwindow_add

fn fontchooser_subwindow_add(mut w &ui.Window)

Append fontchooser to window

#fn fontchooser_subwindow_visible

fn fontchooser_subwindow_visible(w &ui.Window)

TODO: documentation

#fn gg_canvaslayout

fn gg_canvaslayout(p GGComponentParams) &ui.CanvasLayout

#fn gg_component

fn gg_component(w ui.ComponentChild) &GGComponent

component access

#fn gg_component_from_id

fn gg_component_from_id(w ui.Window, id string) &GGComponent

#fn grid_canvaslayout

fn grid_canvaslayout(p GridParams) &ui.CanvasLayout

TODO: documentation

#fn grid_checkbox

fn grid_checkbox(p GridCheckBoxParams) &GridCheckBox

TODO: documentation

#fn grid_component

fn grid_component(w ui.ComponentChild) &GridComponent

component access

#fn grid_component_from_id

fn grid_component_from_id(w ui.Window, id string) &GridComponent

TODO: documentation

#fn grid_dropdown

fn grid_dropdown(p GridDropdownParams) &GridDropdown

TODO: documentation

#fn grid_formula_mngr

fn grid_formula_mngr(formulas map[string]string) GridFormulaMngr

constructor

#fn grid_formulas

fn grid_formulas(formulas map[string]string) map[string]GridFormula

TODO: documentation

#fn grid_textbox

fn grid_textbox(p GridTextBoxParams) &GridTextBox

TODO: documentation

#fn gridsettings_component

fn gridsettings_component(w ui.ComponentChild) &GridSettingsComponent

component constructor

#fn gridsettings_component_from_id

fn gridsettings_component_from_id(w ui.Window, id string) &GridSettingsComponent

TODO: documentation

#fn gridsettings_stack

fn gridsettings_stack(p GridSettingsParams) &ui.Stack

TODO: documentation

#fn hideable_add_shortcut

fn hideable_add_shortcut(w &ui.Window, shortcut string, shortcut_fn ui.ShortcutFn)

TODO: documentation

#fn hideable_component

fn hideable_component(w ui.ComponentChild) &HideableComponent

TODO: documentation

#fn hideable_component_from_id

fn hideable_component_from_id(w ui.Window, id string) &HideableComponent

TODO: documentation

#fn hideable_hide

fn hideable_hide(w &ui.Window, id string)

TODO: documentation

#fn hideable_show

fn hideable_show(w &ui.Window, id string)

TODO: documentation

#fn hideable_stack

fn hideable_stack(p HideableParams) &ui.Stack

TODO: documentation

#fn hideable_toggle

fn hideable_toggle(w &ui.Window, id string)

TODO: documentation

#fn messagebox_component

fn messagebox_component(w ui.ComponentChild) &MessageBoxComponent

component access

#fn messagebox_component_from_id

fn messagebox_component_from_id(w ui.Window, id string) &MessageBoxComponent

TODO: documentation

#fn messagebox_stack

fn messagebox_stack(p MessageBoxParams) &ui.Stack

TODO: documentation

#fn messagebox_subwindow_add

fn messagebox_subwindow_add(mut w &ui.Window, p MessageBoxSubWindowParams)

Append colorbox to window

#fn newfilebrowser_subwindow_add

fn newfilebrowser_subwindow_add(mut w &ui.Window, p FileBrowserSubWindowParams)

TODO: documentation

#fn newfilebrowser_subwindow_close

fn newfilebrowser_subwindow_close(w &ui.Window, id string)

TODO: documentation

#fn newfilebrowser_subwindow_visible

fn newfilebrowser_subwindow_visible(w &ui.Window, id string)

TODO: documentation

#fn parse_formula

fn parse_formula(formula string) (string, []string)

TODO: documentation

#fn rasterview_canvaslayout

fn rasterview_canvaslayout(p RasterViewParams) &ui.CanvasLayout

TODO: documentation

#fn rasterview_component

fn rasterview_component(w ui.ComponentChild) &RasterViewComponent

TODO: documentation

#fn rasterview_component_from_id

fn rasterview_component_from_id(w &ui.Window, id string) &RasterViewComponent

TODO: documentation

#fn setting_color

fn setting_color(param string)

TODO: documentation

#fn setting_f32

fn setting_f32(param string) &ui.Stack

TODO: documentation

#fn setting_font

fn setting_font(s SettingFontParams) &ui.Stack

TODO: documentation

#fn setting_int

fn setting_int(param string) &ui.Stack

TODO: documentation

#fn settings_bool

fn settings_bool(param string) &ui.Stack

TODO: documentation

#fn splitpanel_component

fn splitpanel_component(w ui.ComponentChild) &SplitPanelComponent

TODO: documentation

#fn splitpanel_component_from_id

fn splitpanel_component_from_id(w ui.Window, id string) &SplitPanelComponent

TODO: documentation

#fn splitpanel_stack

fn splitpanel_stack(p SplitPanelParams) &ui.Stack

TODO: documentation

#fn tabs_component

fn tabs_component(w ui.ComponentChild) &TabsComponent

TODO: documentation

#fn tabs_component_from_id

fn tabs_component_from_id(w ui.Window, id string) &TabsComponent

TODO: documentation

#fn tabs_stack

fn tabs_stack(c TabsParams) &ui.Stack

TODO: documentation

#fn treedir

fn treedir(path string, fpath string, incr_mode bool, hidden_files bool) Tree

TODO: documentation

#fn treeview_component

fn treeview_component(w ui.ComponentChild) &TreeViewComponent

component access

#fn treeview_component_from_id

fn treeview_component_from_id(w ui.Window, id string) &TreeViewComponent

TODO: documentation

#fn treeview_stack

fn treeview_stack(c TreeViewParams) &ui.Stack

TODO: documentation

Structs

#struct AccordionComponent

heap
pub struct AccordionComponent {
pub mut:
	layout     &ui.Stack // required
	titles     map[string]string
	selected   map[string]bool
	views      map[string]int
	z_index    map[string]int
	text_color gx.Color
	text_size  int
	bg_color   gx.Color
}

#fn (&AccordionComponent) activate

fn (mut acc &AccordionComponent) activate(id string)

#fn (&AccordionComponent) deactivate

fn (mut acc &AccordionComponent) deactivate(id string)

#struct AccordionParams

params
pub struct AccordionParams {
	id         string
	titles     []string
	children   []ui.Widget
	text_color gx.Color = gx.black
	text_size  int      = 24
	bg_color   gx.Color = gx.white
	heights    []f64    = [30.0, ui.compact]
	scrollview bool
}

#struct AlphaComponent

heap
pub struct AlphaComponent {
pub mut:
	id         string
	alpha      int
	layout     &ui.Stack
	slider     &ui.Slider
	textbox    &ui.TextBox
	on_changed AlphaFn
}

#fn (&AlphaComponent) set_alpha

fn (mut ac &AlphaComponent) set_alpha(alpha int)

TODO: documentation

#struct AlphaParams

params
pub struct AlphaParams {
	id         string
	alpha      int
	direction  ui.Direction = .column
	on_changed AlphaFn      = AlphaFn(0)
}

#struct ColorBoxComponent

heap
pub struct ColorBoxComponent {
mut:
	simg       C.sg_image
	h          f64 = 0.0
	s          f64 = 0.75
	v          f64 = 0.75
	rgb        gx.Color
	linked     &gx.Color = &gx.Color(unsafe { nil })
	colbtn     &ColorButtonComponent = unsafe { nil }
	ind_sel    int
	hsv_sel    []HSVColor = []HSVColor{len: component.cb_nc * component.cb_nr}
	txt_r      string
	txt_g      string
	txt_b      string
	rgb_to_hsv RgbToHsv = ui.rgb_to_hsv
	hsv_to_rgb HsvToRgb = ui.hsv_to_rgb
	// options
	light bool // light theme
	hsl   bool // use hsl instead of hsv
	drag  bool // drag mode for canvas on h
pub mut:
	layout     &ui.Stack // required
	cv_h       &ui.CanvasLayout
	cv_sv      &ui.CanvasLayout
	r_rgb_cur  &ui.Rectangle
	cv_hsv_sel &ui.CanvasLayout
	tb_r       &ui.TextBox
	tb_g       &ui.TextBox
	tb_b       &ui.TextBox
	lb_r       &ui.Label
	lb_g       &ui.Label
	lb_b       &ui.Label
}

#fn (&ColorBoxComponent) connect

fn (mut cb &ColorBoxComponent) connect(col &gx.Color)

TODO: documentation

#fn (&ColorBoxComponent) connect_colorbutton

fn (mut cb &ColorBoxComponent) connect_colorbutton(b &ColorButtonComponent)

TODO: documentation

#fn (&ColorBoxComponent) update_cur_color

fn (mut cb &ColorBoxComponent) update_cur_color(reactive bool)

TODO: documentation

#fn (&ColorBoxComponent) update_sel_color

fn (mut cb &ColorBoxComponent) update_sel_color()

TODO: documentation

#fn (&ColorBoxComponent) update_buffer

fn (mut cb &ColorBoxComponent) update_buffer()

TODO: documentation

#fn (&ColorBoxComponent) update_from_rgb

fn (mut cb &ColorBoxComponent) update_from_rgb(r int, g int, b int)

TODO: documentation

#fn (&ColorBoxComponent) update_from_tb

fn (mut cb &ColorBoxComponent) update_from_tb()

#fn (&ColorBoxComponent) update_theme

fn (mut cb &ColorBoxComponent) update_theme()

TODO: documentation

#fn (&ColorBoxComponent) update_hsl

fn (mut cb &ColorBoxComponent) update_hsl()

TODO: documentation

#fn (&ColorBoxComponent) update_drag_mode

fn (mut cb &ColorBoxComponent) update_drag_mode()

TODO: documentation

#struct ColorBoxParams

params
pub struct ColorBoxParams {
	id    string
	light bool
	hsl   bool
	drag  bool
}

#struct ColorButtonComponent

heap
pub struct ColorButtonComponent {
pub mut:
	widget     &ui.Button
	bg_color   gx.Color = gx.white
	alpha      int
	on_click   ColorButtonFn
	on_changed ColorButtonFn
	left_side  bool
}

#struct ColorButtonParams

params
pub struct ColorButtonParams {
	id           string
	text         string
	height       int
	width        int
	z_index      int
	tooltip      string
	tooltip_side ui.Side = .top
	radius       f64 // = 5.0
	padding      f64
	left_side    bool
	bg_color     &gx.Color = unsafe { nil }
	on_click     ColorButtonFn
	on_changed   ColorButtonFn
}

#struct ColorPaletteComponent

heap
pub struct ColorPaletteComponent {
pub mut:
	id       string
	layout   &ui.Stack  // required
	colbtn   &ui.Button // current
	ncolors  int
	alpha    &AlphaComponent = unsafe { nil }
	color    &gx.Color       = unsafe { nil }
	selected string
}

#fn (&ColorPaletteComponent) update_colors

fn (mut cp &ColorPaletteComponent) update_colors(colors []gx.Color)

TODO: documentation

#fn (&ColorPaletteComponent) update_colorbutton

fn (mut cp &ColorPaletteComponent) update_colorbutton(color gx.Color)

TODO: documentation

#fn (&ColorPaletteComponent) connect_color

fn (mut cp &ColorPaletteComponent) connect_color(color &gx.Color)

TODO: documentation

#struct ColorPaletteParams

params
pub struct ColorPaletteParams {
	id        string
	title     string
	items     []string
	direction ui.Direction = .column
	ncolors   int = 6
}

#struct ColorSlidersComponent

heap
pub struct ColorSlidersComponent {
	id string
pub mut:
	layout         &ui.Stack // required
	orientation    ui.Orientation
	r_slider       &ui.Slider  = unsafe { nil }
	r_textbox      &ui.TextBox = unsafe { nil }
	g_slider       &ui.Slider  = unsafe { nil }
	g_textbox      &ui.TextBox = unsafe { nil }
	b_slider       &ui.Slider  = unsafe { nil }
	b_textbox      &ui.TextBox = unsafe { nil }
	r_textbox_text string
	g_textbox_text string
	b_textbox_text string
	on_changed     ColorSlidersFn
}

fn (cs &ColorSlidersComponent) color() gx.Color

TODO: documentation

#fn (&ColorSlidersComponent) set_color

fn (mut cs &ColorSlidersComponent) set_color(color gx.Color)

TODO: documentation

#struct ColorSlidersParams

params
pub struct ColorSlidersParams {
	id          string
	color       gx.Color       = gx.white
	orientation ui.Orientation = .vertical
	on_changed  ColorSlidersFn
}

#struct DemoComponent

heap
pub struct DemoComponent {
pub mut:
	layout   &ui.Stack = unsafe { nil } // required
	tb_text  string    = 'textbox text'
	tbm_text string    = 'textbox multilines text\nsecond line\n' + ('blah blah'.repeat(10) +
	'blah\n').repeat(20)
}

#struct DemoParams

params
pub struct DemoParams {
	id string = 'demo'
}

#struct DoubleListBoxComponent

heap
pub struct DoubleListBoxComponent {
pub mut:
	layout    &ui.Stack // required
	lb_left   &ui.ListBox
	lb_right  &ui.ListBox
	btn_left  &ui.Button
	btn_right &ui.Button
	btn_clear &ui.Button
}

fn (dlb &DoubleListBoxComponent) values() []string

TODO: documentation

#struct DoubleListBoxParams

params
pub struct DoubleListBoxParams {
	id    string
	title string
	items []string
}

#struct FileBrowserComponent

heap
pub struct FileBrowserComponent {
pub mut:
	layout     &ui.Stack
	btn_cancel &ui.Button
	btn_ok     &ui.Button
	tv         &TreeViewComponent = unsafe { nil }
	dir        string
}

#fn (&FileBrowserComponent) selected_full_title

fn (fb &FileBrowserComponent) selected_full_title() string

TODO: documentation

#struct FileBrowserParams

params
pub struct FileBrowserParams {
	id              string
	dirs            []string = [os.expand_tilde_to_home('~'), '/']
	text_ok         string   = 'Ok'
	text_cancel     string   = 'Cancel'
	height          int      = int(ui.compact)
	width           int      = int(ui.compact)
	z_index         int
	folder_only     bool
	filter_types    []string
	with_fpath      bool
	hidden          bool
	bg_color        gx.Color = gx.red // gx.hex(0xfcf4e4ff)
	on_click_ok     ui.ButtonFn
	on_click_cancel ui.ButtonFn
}

#struct FontButtonComponent

heap
pub struct FontButtonComponent {
pub mut:
	btn &ui.Button
	dtw ui.DrawTextWidget
}

#struct FontButtonParams

params
pub struct FontButtonParams {
	id           string
	dtw          ui.DrawTextWidget = ui.canvas_plus()
	text         string
	height       int
	width        int
	z_index      int
	tooltip      string
	tooltip_side ui.Side = .top
	radius       f64     = .25
	padding      f64
	bg_color     &gx.Color = unsafe { nil }
}

#struct FontChooserComponent

heap
pub struct FontChooserComponent {
pub mut:
	layout &ui.Stack // required
	dtw    ui.DrawTextWidget
}

#struct FontChooserParams

params
pub struct FontChooserParams {
	id         string = component.fontchooser_lb_id
	draw_lines bool   = true
	dtw        ui.DrawTextWidget = ui.canvas_plus() // since it requires an intialisation
}

#struct GGComponentParams

params
pub struct GGComponentParams {
	id  string = 'gg_app'
	app ui.GGApplication
}

#struct Factor

pub struct Factor {
mut:
	levels []string
	values []int
}

#struct GridComponent

heap
pub struct GridComponent {
pub mut:
	id           string
	layout       &ui.CanvasLayout
	vars         []GridVar
	types        []GridType
	formula_mngr GridFormulaMngr
	headers      []string
	widths       []int
	heights      []int
	nrow         int
	ncol         int
	tb_string    &ui.TextBox  = unsafe { nil }
	cb_bool      &ui.CheckBox = unsafe { nil }
	dd_factor    map[string]&ui.Dropdown
	tb_colbar    &ui.TextBox = unsafe { nil }
	tb_rowbar    &ui.TextBox = unsafe { nil }
	// selectors
	selectors []ui.Widget
	// sizes
	rowbar_width  int = 80
	colbar_height int = 25
	header_size   int = 3
	// height
	cell_height int // when > 0 all cells have same height to speed up visible_cells
	min_height  int
	// index for swap of rows
	index []int
	// current
	cur_i int
	cur_j int
	// position
	pos_x int
	pos_y int
	// selection
	sel_i int = -1
	sel_j int = -1
	// from
	from_x int
	from_y int
	from_i int
	to_i   int
	from_j int
	to_j   int
	// edge selection
	edge_size   int = 5
	edge_i      int = -1
	edge_j      int = -1
	edge_x_orig int
	edge_w_orig int = -1
	// shortcuts
	shortcuts ui.Shortcuts
}

#fn (&GridComponent) value

fn (g &GridComponent) value(i int, j int) (string, GridType)

#fn (&GridComponent) set_value

fn (mut g &GridComponent) set_value(i int, j int, s string)

fn (g &GridComponent) ind(i int) int

#fn (&GridComponent) nrow

fn (g &GridComponent) nrow() int

#fn (&GridComponent) draw_device_current

fn (mut g &GridComponent) draw_device_current(mut d &ui.DrawDevice)

#fn (&GridComponent) draw_device_colbar

fn (mut g &GridComponent) draw_device_colbar(mut d &ui.DrawDevice)

#fn (&GridComponent) draw_device_rowbar

fn (mut g &GridComponent) draw_device_rowbar(mut d &ui.DrawDevice)

#fn (&GridComponent) set_check_nrow

fn (mut g &GridComponent) set_check_nrow(var_len int)

#fn (&GridComponent) size

fn (g &GridComponent) size() (int, int)

#fn (&GridComponent) is_selected

fn (g &GridComponent) is_selected() bool

#fn (&GridComponent) unselect

fn (mut g &GridComponent) unselect()

#fn (&GridComponent) colbar_selected

fn (mut g &GridComponent) colbar_selected()

#fn (&GridComponent) show_selected

fn (mut g &GridComponent) show_selected()

#fn (&GridComponent) get_index_pos_x

fn (g &GridComponent) get_index_pos_x(x int) int

#fn (&GridComponent) get_index_pos_y

fn (g &GridComponent) get_index_pos_y(y int) int

#fn (&GridComponent) get_index_pos

fn (g &GridComponent) get_index_pos(x int, y int) (int, int)

#fn (&GridComponent) get_pos

fn (g &GridComponent) get_pos(i int, j int) (int, int)

#fn (&GridComponent) height

fn (g &GridComponent) height(i int) int

#fn (&GridComponent) get_index_edge_x

fn (g &GridComponent) get_index_edge_x(x int) int

#fn (&GridComponent) visible_cells

fn (mut g &GridComponent) visible_cells()

#fn (&GridComponent) visible_fixed_cells

fn (mut g &GridComponent) visible_fixed_cells()

TODO: documentation

#fn (&GridComponent) cur_allways_visible

fn (mut g &GridComponent) cur_allways_visible()

TODO: documentation

#fn (&GridComponent) scroll_x_to_cur

fn (mut g &GridComponent) scroll_x_to_cur(end bool)

TODO: documentation

#fn (&GridComponent) scroll_y_to_cur

fn (mut g &GridComponent) scroll_y_to_cur(end bool)

TODO: documentation

#fn (&GridComponent) scroll_y_to_end

fn (mut g &GridComponent) scroll_y_to_end()

TODO: documentation

#fn (&GridComponent) init_ranked_grid_data

fn (mut g &GridComponent) init_ranked_grid_data(vars []int, orders []int)

TODO: documentation

#fn (&GridComponent) new_formula

fn (mut g &GridComponent) new_formula(gc GridCell, formula string)

TODO: documentation

#fn (&GridComponent) init_formulas

fn (mut g &GridComponent) init_formulas()

TODO: documentation

#fn (&GridComponent) activate_formula_cells

fn (mut g &GridComponent) activate_formula_cells()

TODO: documentation

#fn (&GridComponent) update_formulas

fn (mut g &GridComponent) update_formulas()

TODO: documentation

#fn (&GridComponent) activate_cell

fn (mut g &GridComponent) activate_cell(c AlphaCell)

TODO: documentation

#fn (&GridComponent) propagate_cell

fn (mut g &GridComponent) propagate_cell(c AlphaCell)

TODO: documentation

#fn (&GridComponent) update_formula

fn (mut g &GridComponent) update_formula(formula GridFormula, activate bool)

TODO: documentation

#fn (&GridComponent) value_at

fn (mut g &GridComponent) value_at(c AlphaCell) string

#fn (&GridComponent) values_at

fn (mut g &GridComponent) values_at(c ActiveCells) []string

#fn (&GridComponent) is_formula

fn (mut g &GridComponent) is_formula() bool

#fn (&GridComponent) show_formula

fn (mut g &GridComponent) show_formula()

#struct GridParams

params
pub struct GridParams {
	vars         map[string]GridData
	formulas     map[string]string
	width        int  = 100
	height       int  = 25
	scrollview   bool = true
	is_focused   bool
	fixed_height bool = true
mut:
	id string
}

#struct GridTextBoxParams

pub struct GridTextBoxParams {
	id   string
	grid &GridComponent = unsafe { nil }
	var  []string
}

#struct GridDropdownParams

pub struct GridDropdownParams {
	id   string
	grid &GridComponent = unsafe { nil }
	name string
	var  Factor
}

#struct GridCheckBoxParams

pub struct GridCheckBoxParams {
	id   string
	grid &GridComponent = unsafe { nil }
	var  []bool
}

#struct DataGridComponent

heap
pub struct DataGridComponent {
pub mut:
	layout   &ui.Stack      = unsafe { nil }
	grid     &GridComponent = unsafe { nil }
	settings &GridSettingsComponent = unsafe { nil }
}

#struct DataGridParams

params
pub struct DataGridParams {
	GridParams // for settings prepended by settings_
	settings_bg_color gx.Color = gx.light_blue
	settings_z_index  int      = 100
}

#struct DataGridBoxLayoutComponent

heap
pub struct DataGridBoxLayoutComponent {
pub mut:
	layout &ui.BoxLayout  = unsafe { nil }
	grid   &GridComponent = unsafe { nil }
	// settings &GridSettingsComponent = unsafe { nil }
}

#struct DataGridBoxLayoutParams

params
pub struct DataGridBoxLayoutParams {
	GridParams // for settings prepended by settings_
	// settings_bg_color gx.Color = gx.light_blue
	// settings_z_index  int      = 100
}

#struct GridCell

pub struct GridCell {
	i int
	j int
}

Matrix-like (zero indexed)

#fn (GridCell) alphacell

fn (gc GridCell) alphacell() string

TODO: documentation

#struct GridSettingsComponent

heap
pub struct GridSettingsComponent {
pub mut:
	id       string
	layout   &ui.Stack      = unsafe { nil }
	grid     &GridComponent = unsafe { nil }
	lb_left  &ui.ListBox    = unsafe { nil }
	lb_right &ui.ListBox    = unsafe { nil }
}

#fn (&GridSettingsComponent) update_sorted_vars

fn (mut gs &GridSettingsComponent) update_sorted_vars()

TODO: documentation

#struct GridSettingsParams

params
pub struct GridSettingsParams {
	id       string
	bg_color gx.Color       = gx.light_blue
	grid     &GridComponent = unsafe { nil }
	z_index  int = 100
}

#struct HideableComponent

heap
pub struct HideableComponent {
pub mut:
	id              string
	layout          &ui.Stack
	child_layout_id string
	window          &ui.Window = &ui.Window(unsafe { nil })
	z_index         map[string]int
	children        map[string]ui.Widget
	shortcut        string
	open            bool
}

fn (mut h &HideableComponent) show()

TODO: documentation

fn (mut h &HideableComponent) hide()

TODO: documentation

#fn (HideableComponent) is_active

fn (h HideableComponent) is_active() bool

TODO: documentation

#fn (&HideableComponent) toggle

fn (mut h &HideableComponent) toggle()

TODO: documentation

#fn (&HideableComponent) show_children

fn (mut h &HideableComponent) show_children()

TODO: documentation

#fn (&HideableComponent) hide_children

fn (mut h &HideableComponent) hide_children()

TODO: documentation

#fn (&HideableComponent) set_children_depth

fn (mut h &HideableComponent) set_children_depth()

TODO: documentation

#fn (&HideableComponent) save_children_depth

fn (mut h &HideableComponent) save_children_depth(children []ui.Widget)

TODO: documentation

#struct HideableParams

params
pub struct HideableParams {
	id       string
	bg_color gx.Color
	layout   &ui.Stack
	hidden   bool = true
	shortcut string
	open     bool = true
}

#fn (&MenuFileComponent) treeview_component

fn (mf &MenuFileComponent) treeview_component() &TreeViewComponent

TODO: documentation

#struct MessageBoxComponent

heap
pub struct MessageBoxComponent {
	id       string
	layout   &ui.Stack
	tb       &ui.TextBox
	btn      &ui.Button
	text     string
	on_click MessageBoxFn
}

#struct MessageBoxParams

params
pub struct MessageBoxParams {
	id       string
	text     string
	on_click MessageBoxFn
	width    int
	height   int
}

#struct RasterViewComponent

heap
pub struct RasterViewComponent {
pub mut:
	id     string
	layout &ui.CanvasLayout
	r      &libvg.Raster
	// width      int
	// height     int
	// channels   int = 4
	// data       []byte
	size       int = 11 // pixel_size + inter
	inter      int = 1
	pixel_size int = 10
	// cur_pos
	cur_i int = -1
	cur_j int = -1
	// bounds
	bounds_i int // top
	bounds_j int // left
	bounds_w int // width
	bounds_h int // height
	// selection
	sel_i int = -1
	sel_j int = -1
	// from
	from_x int
	from_y int
	from_i int
	to_i   int
	from_j int
	to_j   int
	// current color
	color   gx.Color = gx.black
	palette &ColorPaletteComponent = unsafe { nil }
	// shortcuts
	key_shortcuts  ui.KeyShortcuts
	char_shortcuts ui.CharShortcuts
	// callback
	on_click RasterViewFn
}

#fn (&RasterViewComponent) connect_palette

fn (mut rv &RasterViewComponent) connect_palette(pa &ColorPaletteComponent)

TODO: documentation

#fn (&RasterViewComponent) point_inside

fn (rv &RasterViewComponent) point_inside(x int, y int) bool

#fn (&RasterViewComponent) get_index_pos

fn (rv &RasterViewComponent) get_index_pos(x int, y int) (int, int)

#fn (&RasterViewComponent) top_colors

fn (rv &RasterViewComponent) top_colors() []gx.Color

TODO: documentation

fn (rv &RasterViewComponent) get_pos(i int, j int) (int, int)

#fn (&RasterViewComponent) draw_device_current

fn (rv &RasterViewComponent) draw_device_current(d ui.DrawDevice)

#fn (&RasterViewComponent) draw_device_selection

fn (rv &RasterViewComponent) draw_device_selection(d ui.DrawDevice)

fn (rv &RasterViewComponent) size() (int, int)

#fn (&RasterViewComponent) visible_pixels

fn (mut rv &RasterViewComponent) visible_pixels()

#fn (&RasterViewComponent) new_image

fn (mut rv &RasterViewComponent) new_image()

TODO: documentation

#fn (&RasterViewComponent) load_image

fn (mut rv &RasterViewComponent) load_image(path string)

TODO: documentation

#fn (&RasterViewComponent) save_image_as

fn (mut rv &RasterViewComponent) save_image_as(path string)

TODO: documentation

#fn (&RasterViewComponent) update_bounds

fn (mut rv &RasterViewComponent) update_bounds()

TODO: documentation

#fn (&RasterViewComponent) get_margins

fn (rv &RasterViewComponent) get_margins() (int, int, int, int)

TODO: documentation

#fn (&RasterViewComponent) move_pixels

fn (mut rv &RasterViewComponent) move_pixels(di int, dj int)

TODO: documentation

#fn (&RasterViewComponent) extract_size

fn (mut rv &RasterViewComponent) extract_size(pngfile string)

TODO: documentation

fn (rv &RasterViewComponent) width() int

TODO: documentation

fn (rv &RasterViewComponent) height() int

TODO: documentation

#fn (&RasterViewComponent) channels

fn (rv &RasterViewComponent) channels() int

TODO: documentation

fn (rv &RasterViewComponent) data() &byte

TODO: documentation

#fn (&RasterViewComponent) set_raster_size

fn (mut rv &RasterViewComponent) set_raster_size(w int, h int)

TODO: documentation

#fn (&RasterViewComponent) get_pixel

fn (rv &RasterViewComponent) get_pixel(i int, j int) gx.Color

TODO: documentation

#fn (&RasterViewComponent) set_pixel

fn (mut rv &RasterViewComponent) set_pixel(i int, j int, col gx.Color)

TODO: documentation

#struct RasterViewParams

params
pub struct RasterViewParams {
	id       string
	width    int = 16
	height   int = 16
	channels int = 4
	on_click RasterViewFn = RasterViewFn(0)
}

#struct SettingFont

pub struct SettingFont {
	param   string
	lb_text string
mut:
	layout   &ui.Stack
	lb_param &ui.Label
	lb_font  &ui.Label
	btn_font &ui.Button
}

#struct SettingFontParams

params
pub struct SettingFontParams {
	id    string
	param string
	text  string
}

#struct SplitPanelComponent

heap
pub struct SplitPanelComponent {
pub mut:
	id        string
	layout    &ui.Stack
	child1    &ui.Widget
	child2    &ui.Widget
	direction ui.Direction
	active    bool
	weight    f32
	btn_size  int
}

#struct SplitPanelParams

params
pub struct SplitPanelParams {
	id        string
	child1    &ui.Widget
	child2    &ui.Widget
	direction ui.Direction = .row
	weight    f64 = 50.0
	btn_size  int = component.splitpanel_btn_size
}

#struct FileBrowserSubWindowParams

params
pub struct FileBrowserSubWindowParams {
	FileBrowserParams
	x int
	y int
}

Subwindow

#struct MessageBoxSubWindowParams

params
pub struct MessageBoxSubWindowParams {
	id       string
	text     string
	shortcut string = 'ctrl + h'
	x        int    = 100
	y        int    = 100
	width    int    = 400
	height   int    = 400
}

#struct TabsComponent

heap
pub struct TabsComponent {
pub mut:
	id                 string
	layout             &ui.Stack // required
	active             string
	prev_active        string
	tab_bar            &ui.Stack
	pages              map[string]ui.Widget
	z_index            map[string]int
	mode               TabsMode
	tab_width          f64
	tab_height         f64
	tab_spacing        f64
	bg_color           gx.Color = gx.white
	bg_color_selection gx.Color = gx.rgb(200, 200, 100)
	justify            []f64    = ui.center_center
}

#fn (&TabsComponent) on_top

fn (mut tabs &TabsComponent) on_top()

#fn (&TabsComponent) update_tab_colors

fn (mut tabs &TabsComponent) update_tab_colors()

#fn (&TabsComponent) print_styles

fn (mut tabs &TabsComponent) print_styles()

#fn (&TabsComponent) transpose

fn (mut tabs &TabsComponent) transpose()

#fn (&TabsComponent) update_pos

fn (tabs &TabsComponent) update_pos(win &ui.Window)

#struct TabsParams

params
pub struct TabsParams {
	id          string
	mode        TabsMode = .vertical
	active      int
	tabs        []string
	pages       []ui.Widget
	tab_width   f64 = 50.0
	tab_height  f64 = 30.0
	tab_spacing f64 = 5.0
}

#struct Tree

pub struct Tree {
mut:
	title string
	items []TreeItem
}

#fn (&Tree) create_root

fn (mut t &Tree) create_root(mut tv &TreeViewComponent, mut layout &ui.Stack, id_root string, level int) &ui.Stack

#fn (&Tree) add_root_children

fn (mut t &Tree) add_root_children(mut tv &TreeViewComponent, mut l &ui.Stack, id_root string, level int)

#fn (&Tree) create_layout

fn (mut t &Tree) create_layout(mut tv &TreeViewComponent, mut layout &ui.Stack, id_root string, level int) &ui.Stack

#struct TreeViewComponent

heap
pub struct TreeViewComponent {
pub mut:
	id         string
	layout     &ui.Stack // required
	trees      []Tree
	icon_paths map[string]string
	text_color gx.Color
	text_size  int
	bg_color   gx.Color
	// selection
	sel_id       string
	old_sel_id   string
	bg_sel_color gx.Color
	// related to items
	titles   map[string]string
	parents  map[string]string
	types    map[string]string
	levels   map[string]int
	selected map[string]bool
	// related to roots
	root_trees   map[string]Tree
	root_created map[string]bool
	id_root      map[string]string
	containers   map[string]&ui.Stack
	views        map[string]string
	// others
	z_index      map[string]int
	root_ids     []string
	filter_types []string
	hidden_files bool
	incr_mode    bool
	indent       int
	// mode
	mode string
	// event
	on_click TreeViewClickFn
}

#fn (&TreeViewComponent) cleanup_layout

fn (mut tv &TreeViewComponent) cleanup_layout()

TODO: documentation

fn (tv &TreeViewComponent) size() (int, int)

TODO: documentation

#fn (&TreeViewComponent) point_inside

fn (tv &TreeViewComponent) point_inside(x int, y int) bool

#fn (&TreeViewComponent) full_title

fn (tv &TreeViewComponent) full_title(id string) string

TODO: documentation

#fn (&TreeViewComponent) activate

fn (mut tv &TreeViewComponent) activate(id string)

#fn (&TreeViewComponent) deactivate

fn (mut tv &TreeViewComponent) deactivate(id string)

#fn (&TreeViewComponent) activate_all

fn (mut tv &TreeViewComponent) activate_all()

#fn (&TreeViewComponent) deactivate_all

fn (mut tv &TreeViewComponent) deactivate_all()

#fn (&TreeViewComponent) selected_title

fn (tv &TreeViewComponent) selected_title() string

TODO: documentation

#fn (&TreeViewComponent) selected_full_title

fn (tv &TreeViewComponent) selected_full_title() string

TODO: documentation

#fn (&TreeViewComponent) open_dir

fn (mut tv &TreeViewComponent) open_dir(folder string)

dirtreeview related

#struct TreeViewParams

params
pub struct TreeViewParams {
	id           string
	trees        []Tree
	icons        map[string]string
	text_color   gx.Color = gx.black
	text_size    int      = 24
	incr_mode    bool
	bg_color     gx.Color        = gx.white
	bg_sel_color gx.Color        = gx.light_gray
	on_click     TreeViewClickFn = TreeViewClickFn(0)
	indent       int = 10
	filter_types []string
	hidden_files bool
	mode         string = 'default'
}

#struct TreeViewDirParams

params
pub struct TreeViewDirParams {
	id           string = 'tvd'
	trees        []string
	icons        map[string]string
	text_color   gx.Color = gx.black
	text_size    int      = 24
	incr_mode    bool     = true
	indent       int      = 10
	folder_only  bool
	filter_types []string
	hidden_files bool
	bg_color     gx.Color        = gx.hex(0xfcf4e4ff)
	on_click     TreeViewClickFn = TreeViewClickFn(0)
}

Interfaces

This section is empty.

Enums

#enum ShowMode

pub enum ShowMode {
	show
	hide
	toggle
}