mirror of
https://github.com/enso-org/enso.git
synced 2024-11-29 03:08:55 +03:00
Update widget visibility
This commit is contained in:
parent
7c68bf170d
commit
2e2db37b48
@ -109,7 +109,7 @@ type File_Format
|
||||
default_widget =
|
||||
all_types = [Auto_Detect] + format_types
|
||||
make_name type_obj = type_obj.to_text.replace "_Format" "" . replace "_" " "
|
||||
Single_Choice display=Display.Always values=(all_types.map n->(Option (make_name n) (File_Format.constructor_code n)))
|
||||
Single_Choice values=(all_types.map n->(Option (make_name n) (File_Format.constructor_code n)))
|
||||
|
||||
## A file format for plain text files.
|
||||
type Plain_Text_Format
|
||||
|
@ -5,6 +5,7 @@ import project.Data.Time.Date_Time.Date_Time
|
||||
import project.Data.Time.Date_Time_Formatter.Date_Time_Formatter
|
||||
import project.Data.Time.Time_Of_Day.Time_Of_Day
|
||||
import project.Meta
|
||||
import project.Metadata.Display
|
||||
import project.Metadata.Widget
|
||||
from project.Data.Boolean import Boolean, False, True
|
||||
from project.Metadata import make_single_choice
|
||||
@ -111,4 +112,4 @@ make_format_chooser include_number:Boolean=True include_date:Boolean=True includ
|
||||
time = if include_time.not then [] else
|
||||
['HH:mm[:ss]', 'h:mm[:ss] a'].map f-> [f + " (e.g. " + (Time_Of_Day.new 13 30 55 123).format f + ")", f.pretty]
|
||||
boolean = if include_boolean.not then [] else ['Yes|No', '1|0'].map f-> [f + " (Boolean)", f.pretty]
|
||||
make_single_choice (numeric + date + date_time + time + custom_locale_format + boolean)
|
||||
make_single_choice (numeric + date + date_time + time + custom_locale_format + boolean) display=Display.When_Modified
|
||||
|
@ -188,7 +188,8 @@ parse_type_selector include_auto=True =
|
||||
choice = names.map n-> if n=='Auto' then (Meta.get_qualified_type_name Auto) else fqn+'.'+n
|
||||
|
||||
options = names.zip choice . map pair-> Option pair.first pair.second
|
||||
Single_Choice display=Display.Always values=options
|
||||
display = if include_auto then Display.Always else Display.When_Modified
|
||||
Single_Choice display=display values=options
|
||||
|
||||
## PRIVATE
|
||||
Selector for writing a table to a file.
|
||||
@ -198,7 +199,7 @@ write_table_selector =
|
||||
Meta.meta type . methods . contains "write_table"
|
||||
all_types = [Auto_Detect] + (format_types.filter can_write)
|
||||
make_name type_obj = type_obj.to_text.replace "_Format" "" . replace "_" " "
|
||||
Single_Choice display=Display.Always values=(all_types.map n->(Option (make_name n) (File_Format.constructor_code n)))
|
||||
Single_Choice display=Display.When_Modified values=(all_types.map n->(Option (make_name n) (File_Format.constructor_code n)))
|
||||
|
||||
## PRIVATE
|
||||
Make format selector based off value type
|
||||
|
Loading…
Reference in New Issue
Block a user