Documentation ¶
Index ¶
- Constants
- Variables
- func Activate(matcher func(d unison.Dockable) bool) bool
- func ActivateDockable(d unison.Dockable)
- func ActiveDockable() unison.Dockable
- func AddHelpToInfoPop(target unison.Paneler, text string)
- func AddKeyBindingInfoToInfoPop(target unison.Paneler, keyBinding unison.KeyBinding, text string)
- func AddScalingHelpToInfoPop(target unison.Paneler)
- func AllDockables() []unison.Dockable
- func AllMatchingDockables(matcher func(d unison.Dockable) bool) []unison.Dockable
- func AppDescription() string
- func AppUpdateResult() (title string, releases []gurps.Release, updating bool)
- func ApplyTemplate(filePath string)
- func AttemptCloseForDockable(d unison.Dockable) bool
- func CanApplyTemplate() bool
- func CanConvertToContainer[T ConvertableNodeTypes](table *unison.Table[*Node[T]]) bool
- func CanConvertToNonContainer[T ConvertableNodeTypes](table *unison.Table[*Node[T]]) bool
- func CanOpenPageRef[T gurps.NodeTypes](table *unison.Table[*Node[T]]) bool
- func CheckForAppUpdates()
- func ClearInfoPop(target unison.Paneler)
- func ClearSourceFromSelection[T gurps.NodeTypes](table *unison.Table[*Node[T]])
- func CloseGroup(d unison.Dockable) bool
- func CloseID(ids map[tid.TID]bool) bool
- func ConvertToContainer[T ConvertableNodeTypes](owner Rebuildable, table *unison.Table[*Node[T]])
- func ConvertToNonContainer[T ConvertableNodeTypes](owner Rebuildable, table *unison.Table[*Node[T]])
- func CopyRowsTo[T gurps.NodeTypes](table *unison.Table[*Node[T]], rows []*Node[T], ...)
- func CurrentlyFocusedDockContainer() *unison.DockContainer
- func DeepSync(panel unison.Paneler)
- func DefaultDockContainer() *unison.DockContainer
- func DeleteSelection[T gurps.NodeTypes](table *unison.Table[*Node[T]], recordUndo bool)
- func DetermineDataOwnerProvider(target unison.Paneler) gurps.DataOwnerProvider
- func DisableSorting[T unison.TableRowConstraint[T]](headers []unison.TableColumnHeader[T]) []unison.TableColumnHeader[T]
- func DisplayCalculator(sheet *Sheet)
- func DisplayNewDockable(dockable unison.Dockable)
- func DockContainerForGroup(dock *unison.Dock, group dgroup.Group) *unison.DockContainer
- func DockContainerHasGroup(dc *unison.DockContainer, group dgroup.Group) bool
- func DockContainerHoldsExtension(dc *unison.DockContainer, ext ...string) bool
- func DuplicateSelection[T gurps.NodeTypes](table *unison.Table[*Node[T]])
- func EditEquipment(owner Rebuildable, equipment *gurps.Equipment, carried bool)
- func EditEquipmentModifier(owner Rebuildable, modifier *gurps.EquipmentModifier)
- func EditNote(owner Rebuildable, note *gurps.Note)
- func EditSkill(owner Rebuildable, skill *gurps.Skill)
- func EditSpell(owner Rebuildable, spell *gurps.Spell)
- func EditTrait(owner Rebuildable, t *gurps.Trait)
- func EditTraitModifier(owner Rebuildable, modifier *gurps.TraitModifier)
- func EditWeapon(owner Rebuildable, w *gurps.Weapon)
- func ExtractNodeDataFromList[T gurps.NodeTypes](list []*Node[T]) []T
- func ExtractPageReferences(s string) []string
- func FindRowIndexByID[T gurps.NodeTypes](table *unison.Table[*Node[T]], id tid.TID) int
- func FocusFirstContent(toolbar, content unison.Paneler)
- func HandleLink(p unison.Paneler, target string)
- func HasSelectionAndNotFiltered[T gurps.NodeTypes](table *unison.Table[*Node[T]]) bool
- func InitWorkspace(wnd *unison.Window)
- func InsertCmdContextMenuItem[T gurps.NodeTypes](table *unison.Table[*Node[T]], title string, cmdID int, id *int, ...)
- func InsertItems[T gurps.NodeTypes](owner Rebuildable, table *unison.Table[*Node[T]], topList func() []T, ...)
- func InstallContainerConversionHandlers[T ConvertableNodeTypes](paneler unison.Paneler, owner Rebuildable, table *unison.Table[*Node[T]])
- func InstallDockUndockCmd(dockable unison.Dockable)
- func InstallTableDropSupport[T gurps.NodeTypes](table *unison.Table[*Node[T]], provider TableProvider[T])
- func IsDockableInWorkspace(d unison.Dockable) bool
- func LoadLanguageSetting()
- func LocateDockContainerForExtension(ext ...string) *unison.DockContainer
- func MarkForLayoutWithinDockable(panel unison.Paneler)
- func MarkModified(panel unison.Paneler)
- func MarkRootAncestorForLayoutRecursively(p unison.Paneler)
- func MayAttemptCloseOfGroup(d unison.Dockable) bool
- func MoveDockableToWindow(dockable unison.Dockable) (*unison.Window, error)
- func MoveDockableToWorkspace(dockable unison.Dockable)
- func NewCampaignFromFile(filePath string) (unison.Dockable, error)
- func NewDefaultInfoPop() *unison.Label
- func NewEditorListHeader[T gurps.NodeTypes](title, tooltip string, forPage bool) unison.TableColumnHeader[*Node[T]]
- func NewEditorListSVGHeader[T gurps.NodeTypes](icon *unison.SVG, tooltip string, forPage bool) unison.TableColumnHeader[*Node[T]]
- func NewEditorListSVGPairHeader[T gurps.NodeTypes](leftSVG, rightSVG *unison.SVG, tooltip string, forPage bool) unison.TableColumnHeader[*Node[T]]
- func NewEquipmentModifierTableDockableFromFile(filePath string) (unison.Dockable, error)
- func NewEquipmentTableDockableFromFile(filePath string) (unison.Dockable, error)
- func NewFieldInteriorLeadingLabel(text string, small bool) *unison.Label
- func NewFieldLeadingLabel(text string, small bool) *unison.Label
- func NewFieldTrailingLabel(text string, small bool) *unison.Label
- func NewImageDockable(filePath string) (unison.Dockable, error)
- func NewInfoPop() *unison.Label
- func NewMarkdownDockable(filePath string, allowEditing, startInEditMode bool) (unison.Dockable, error)
- func NewMarkdownDockableWithContent(title, content string, allowEditing, startInEditMode bool) (unison.Dockable, error)
- func NewNodeTable[T gurps.NodeTypes](provider TableProvider[T], font unison.Font) (header *unison.TableHeader[*Node[T]], table *unison.Table[*Node[T]])
- func NewNoteTableDockableFromFile(filePath string) (unison.Dockable, error)
- func NewPDFDockable(filePath string, initialPage int) (unison.Dockable, error)
- func NewPageHeader(title string, hSpan int) *unison.Label
- func NewPageInternalHeader(title string, span int) unison.Paneler
- func NewPageLabel(title string) *unison.Label
- func NewPageLabelCenter(title string) *unison.Label
- func NewPageLabelEnd(title string) *unison.Label
- func NewPageLabelWithInk(title string, ink unison.Ink) *unison.Label
- func NewPageLabelWithRandomizer(title, tooltip string, clickCallback func()) *unison.Panel
- func NewSVGButtonForFont(svg *unison.SVG, font unison.Font, sizeAdjust float32) *unison.Button
- func NewSearchField(watermark string, modifiedCallback func(before, after *unison.FieldState)) *unison.Field
- func NewSheetFromFile(filePath string) (unison.Dockable, error)
- func NewSheetFromTemplate(filePath string)
- func NewSkillTableDockableFromFile(filePath string) (unison.Dockable, error)
- func NewSpellTableDockableFromFile(filePath string) (unison.Dockable, error)
- func NewTableColumnHeader[T gurps.NodeTypes](title, tooltip string) *unison.DefaultTableColumnHeader[*Node[T]]
- func NewTagFilterPopup(tagProvider TagProvider) *unison.PopupMenu[string]
- func NewTemplateFromFile(filePath string) (unison.Dockable, error)
- func NewToolbarSeparator() *unison.Separator
- func NewTraitModifierTableDockableFromFile(filePath string) (unison.Dockable, error)
- func NewTraitTableDockableFromFile(filePath string) (unison.Dockable, error)
- func NewWindowForDockable(dockable unison.Dockable, group dgroup.Group) (*unison.Window, error)
- func NotifyOfAppUpdate()
- func OpenEachPageRef[T gurps.NodeTypes](table *unison.Table[*Node[T]])
- func OpenEditor[T gurps.NodeTypes](table *unison.Table[*Node[T]], edit func(item T))
- func OpenFile(filePath string, initialPage int) (dockable unison.Dockable, wasOpen bool)
- func OpenFiles(filePaths []string)
- func OpenPageRef[T gurps.NodeTypes](table *unison.Table[*Node[T]])
- func OpenPageReference(ref, highlight string, promptContext map[string]bool) bool
- func PageRefKeyToName(key string) string
- func PlaceInDock(dockable unison.Dockable, group dgroup.Group, forceIntoDock bool)
- func ProcessModifiers[T gurps.NodeTypes](owner unison.Paneler, rows []T)
- func ProcessModifiersForSelection[T gurps.NodeTypes](table *unison.Table[*Node[T]])
- func ProcessNameables[T gurps.NodeTypes](owner unison.Paneler, rows []T)
- func ProcessNameablesForSelection[T gurps.NodeTypes](table *unison.Table[*Node[T]])
- func PromptForDestination[T FileBackedDockable](choices []T) []T
- func RefreshPageRefMappingsView()
- func RegisterExternalFileTypes()
- func RegisterGCSFileTypes()
- func RegisterKnownFileTypes()
- func SaveDockable(d FileBackedDockable, saver func(filePath string) error, setUnmodified func()) bool
- func SaveDockableAs(d FileBackedDockable, extension string, saver func(filePath string) error, ...) bool
- func SelectedTags(popup *unison.PopupMenu[string]) []string
- func SetCheckBoxState(checkbox *CheckBox, checked bool)
- func SetDataOwnerProvider(target unison.Paneler, provider gurps.DataOwnerProvider)
- func SetFieldValue(field *unison.Field, value string)
- func SetParents[T gurps.NodeTypes](items []T, parent T)
- func SetTextAndMarkModified(field *unison.Field, text string)
- func SetupMenuBar(wnd *unison.Window)
- func ShowAbout(_ unison.MenuItem)
- func ShowAttributeSettings(owner EntityPanel)
- func ShowBodySettings(owner EntityPanel)
- func ShowColorSettings()
- func ShowFontSettings()
- func ShowGeneralSettings()
- func ShowLibrarySettings(lib *gurps.Library)
- func ShowMenuKeySettings()
- func ShowNameablesDialog(titles []string, nameables []map[string]string) bool
- func ShowPageRefMappings()
- func ShowReadOnlyMarkdown(title, content string)
- func ShowSheetSettings(owner EntityPanel)
- func ShowWebSettings()
- func Start(files []string, afterStartup func())
- func SyncWithSourceForSelection[T gurps.NodeTypes](table *unison.Table[*Node[T]])
- func UpdateCalculator(sheet *Sheet)
- func UpdateTitleForDockable(d unison.Dockable)
- func WorkingDirProvider(p unison.Paneler) string
- func WrapWithSpan(span int, children ...unison.Paneler) *unison.Panel
- type AltDropSupport
- type ApplyTemplateUndoEditData
- type AttrPanel
- type BodyPanel
- type Calculator
- func (c *Calculator) AttemptClose() bool
- func (c *Calculator) CloseWithGroup(other unison.Paneler) bool
- func (c *Calculator) MayAttemptClose() bool
- func (c *Calculator) Modified() bool
- func (c *Calculator) String() string
- func (c *Calculator) Title() string
- func (c *Calculator) TitleIcon(suggestedSize unison.Size) unison.Drawable
- func (c *Calculator) Tooltip() string
- func (c *Calculator) UndoManager() *unison.UndoManager
- type Campaign
- func (c *Campaign) AttemptClose() bool
- func (c *Campaign) BackingFilePath() string
- func (c *Campaign) MayAttemptClose() bool
- func (c *Campaign) Modified() bool
- func (c *Campaign) SetBackingFilePath(p string)
- func (c *Campaign) String() string
- func (c *Campaign) Title() string
- func (c *Campaign) TitleIcon(suggestedSize unison.Size) unison.Drawable
- func (c *Campaign) Tooltip() string
- type CellCache
- type CheckBox
- type ContextMenuItem
- type ConvertableNodeTypes
- type DamagePanel
- type DecimalField
- type DescriptionPanel
- type DocumentDock
- type DragHandle
- type DrawableSVGPair
- type EncumbrancePanel
- type EntityPanel
- type FileBackedDockable
- type FocusRef
- type GroupedCloser
- type IdentityPanel
- type ImageDockable
- func (d *ImageDockable) AttemptClose() bool
- func (d *ImageDockable) BackingFilePath() string
- func (d *ImageDockable) MayAttemptClose() bool
- func (d *ImageDockable) Modified() bool
- func (d *ImageDockable) SetBackingFilePath(p string)
- func (d *ImageDockable) Title() string
- func (d *ImageDockable) TitleIcon(suggestedSize unison.Size) unison.Drawable
- func (d *ImageDockable) Tooltip() string
- type IntegerField
- type ItemVariant
- type LengthField
- type LiftingPanel
- type MarkdownDockable
- func (d *MarkdownDockable) AttemptClose() bool
- func (d *MarkdownDockable) BackingFilePath() string
- func (d *MarkdownDockable) MarkModified(_ unison.Paneler)
- func (d *MarkdownDockable) MayAttemptClose() bool
- func (d *MarkdownDockable) Modified() bool
- func (d *MarkdownDockable) SetBackingFilePath(p string)
- func (d *MarkdownDockable) Title() string
- func (d *MarkdownDockable) TitleIcon(suggestedSize unison.Size) unison.Drawable
- func (d *MarkdownDockable) Tooltip() string
- func (d *MarkdownDockable) UndoManager() *unison.UndoManager
- type MiscPanel
- type ModifiableRoot
- type Navigator
- func (n *Navigator) ApplyDisclosedPaths(paths []string)
- func (n *Navigator) ApplySelectedPaths(paths []string)
- func (n *Navigator) DisclosedPaths() []string
- func (n *Navigator) EventuallyReload()
- func (n *Navigator) InitialFocus()
- func (n *Navigator) Modified() bool
- func (n *Navigator) Reload()
- func (n *Navigator) SelectedPaths() []string
- func (n *Navigator) Title() string
- func (n *Navigator) TitleIcon(suggestedSize unison.Size) unison.Drawable
- func (n *Navigator) Tooltip() string
- type NavigatorNode
- func NewDirectoryNode(nav *Navigator, lib *gurps.Library, dirPath string, parent *NavigatorNode) *NavigatorNode
- func NewFavoritesNode(nav *Navigator) *NavigatorNode
- func NewFileNode(lib *gurps.Library, filePath string, parent *NavigatorNode) *NavigatorNode
- func NewLibraryNode(nav *Navigator, lib *gurps.Library) *NavigatorNode
- func (n *NavigatorNode) CanHaveChildren() bool
- func (n *NavigatorNode) CellDataForSort(col int) string
- func (n *NavigatorNode) Children() []*NavigatorNode
- func (n *NavigatorNode) CloneForTarget(_ unison.Paneler, _ *NavigatorNode) *NavigatorNode
- func (n *NavigatorNode) ColumnCell(_, col int, foreground, _ unison.Ink, _, _, _ bool) unison.Paneler
- func (n *NavigatorNode) Container() bool
- func (n *NavigatorNode) ID() tid.TID
- func (n *NavigatorNode) IsDirectory() bool
- func (n *NavigatorNode) IsFavorites() bool
- func (n *NavigatorNode) IsFile() bool
- func (n *NavigatorNode) IsLibrary() bool
- func (n *NavigatorNode) IsOpen() bool
- func (n *NavigatorNode) Match(text string) bool
- func (n *NavigatorNode) OpenNodeContent() (dockable unison.Dockable, wasOpen bool)
- func (n *NavigatorNode) Parent() *NavigatorNode
- func (n *NavigatorNode) Path() string
- func (n *NavigatorNode) Refresh()
- func (n *NavigatorNode) SetChildren(_ []*NavigatorNode)
- func (n *NavigatorNode) SetOpen(open bool)
- func (n *NavigatorNode) SetParent(_ *NavigatorNode)
- type Node
- func (n *Node[T]) CanHaveChildren() bool
- func (n *Node[T]) CellDataForSort(index int) string
- func (n *Node[T]) CellFromCellData(c *gurps.CellData, width float32, foreground, background unison.Ink) unison.Paneler
- func (n *Node[T]) Children() []*Node[T]
- func (n *Node[T]) CloneForTarget(target unison.Paneler, newParent *Node[T]) *Node[T]
- func (n *Node[T]) ColumnCell(row, col int, foreground, background unison.Ink, _, _, _ bool) unison.Paneler
- func (n *Node[T]) Data() T
- func (n *Node[T]) HasTag(tag string) bool
- func (n *Node[T]) ID() tid.TID
- func (n *Node[T]) IsOpen() bool
- func (n *Node[T]) Match(text string) bool
- func (n *Node[T]) Parent() *Node[T]
- func (n *Node[T]) PartialMatchExceptTag(text string) bool
- func (n *Node[T]) SetChildren(children []*Node[T])
- func (n *Node[T]) SetOpen(open bool)
- func (n *Node[T]) SetParent(parent *Node[T])
- type NonEditableField
- type NonEditablePageField
- type NumericField
- func (f *NumericField[T]) CurrentValue() T
- func (f *NumericField[T]) Exception() T
- func (f *NumericField[T]) HasException() bool
- func (f *NumericField[T]) Max() T
- func (f *NumericField[T]) Min() T
- func (f *NumericField[T]) SetMarksModified(marksModified bool)
- func (f *NumericField[T]) SetMinMax(minValue, maxValue T)
- func (f *NumericField[T]) Sync()
- type PDFDockable
- func (d *PDFDockable) AttemptClose() bool
- func (d *PDFDockable) Back()
- func (d *PDFDockable) BackingFilePath() string
- func (d *PDFDockable) ClearHistory()
- func (d *PDFDockable) Forward()
- func (d *PDFDockable) LoadPage(pageNumber int)
- func (d *PDFDockable) MayAttemptClose() bool
- func (d *PDFDockable) Modified() bool
- func (d *PDFDockable) SetBackingFilePath(p string)
- func (d *PDFDockable) SetSearchText(text string)
- func (d *PDFDockable) Title() string
- func (d *PDFDockable) TitleIcon(suggestedSize unison.Size) unison.Drawable
- func (d *PDFDockable) Tooltip() string
- type PDFLink
- type PDFPage
- type PDFRenderer
- func (p *PDFRenderer) CurrentPage() *PDFPage
- func (p *PDFRenderer) LoadPage(pageNumber int, search string)
- func (p *PDFRenderer) MostRecentPageNumber() int
- func (p *PDFRenderer) PageCount() int
- func (p *PDFRenderer) RenderingFinished() (finished bool, pageNumber int, requested time.Time)
- func (p *PDFRenderer) RequestRenderPriority()
- type PDFTableOfContents
- type Page
- type PageList
- func NewCarriedEquipmentPageList(owner Rebuildable, provider gurps.ListProvider) *PageList[*gurps.Equipment]
- func NewConditionalModifiersPageList(entity *gurps.Entity) *PageList[*gurps.ConditionalModifier]
- func NewMeleeWeaponsPageList(entity *gurps.Entity) *PageList[*gurps.Weapon]
- func NewNotesPageList(owner Rebuildable, provider gurps.ListProvider) *PageList[*gurps.Note]
- func NewOtherEquipmentPageList(owner Rebuildable, provider gurps.ListProvider) *PageList[*gurps.Equipment]
- func NewRangedWeaponsPageList(entity *gurps.Entity) *PageList[*gurps.Weapon]
- func NewReactionsPageList(entity *gurps.Entity) *PageList[*gurps.ConditionalModifier]
- func NewSkillsPageList(owner Rebuildable, provider gurps.ListProvider) *PageList[*gurps.Skill]
- func NewSpellsPageList(owner Rebuildable, provider gurps.SpellListProvider) *PageList[*gurps.Spell]
- func NewTraitsPageList(owner Rebuildable, provider gurps.ListProvider) *PageList[*gurps.Trait]
- func (p *PageList[T]) ApplySelection(selection map[tid.TID]bool)
- func (p *PageList[T]) CreateItem(owner Rebuildable, variant ItemVariant)
- func (p *PageList[T]) CurrentDrawRowRange() (start, endBefore int)
- func (p *PageList[T]) OverheadHeight() float32
- func (p *PageList[T]) RecordSelection() map[tid.TID]bool
- func (p *PageList[T]) RowCount() int
- func (p *PageList[T]) RowHeights() []float32
- func (p *PageList[T]) SelectedNodes(minimal bool) []*Node[T]
- func (p *PageList[T]) SetDrawRowRange(start, endBefore int)
- func (p *PageList[T]) Sync()
- type PageTableColumnHeader
- func (h *PageTableColumnHeader[T]) DefaultDraw(gc *unison.Canvas, dirty unison.Rect)
- func (h *PageTableColumnHeader[T]) DefaultMouseUp(where unison.Point, _ int, _ unison.Modifiers) bool
- func (h *PageTableColumnHeader[T]) DefaultSizes(hint unison.Size) (minSize, prefSize, maxSize unison.Size)
- func (h *PageTableColumnHeader[T]) SetSortState(state unison.SortState)
- func (h *PageTableColumnHeader[T]) SortState() unison.SortState
- type PercentageField
- type PointsPanel
- type Popup
- type PortraitPanel
- type PreservedTableData
- type Rebuildable
- type Selectable
- type SettingsDockable
- func (d *SettingsDockable) AttemptClose() bool
- func (d *SettingsDockable) MarkModified(_ unison.Paneler)
- func (d *SettingsDockable) MayAttemptClose() bool
- func (d *SettingsDockable) Modified() bool
- func (d *SettingsDockable) Setup(addToStartToolbar, addToEndToolbar, initContent func(*unison.Panel))
- func (d *SettingsDockable) Title() string
- func (d *SettingsDockable) TitleIcon(suggestedSize unison.Size) unison.Drawable
- func (d *SettingsDockable) Tooltip() string
- type Sheet
- func (s *Sheet) AttemptClose() bool
- func (s *Sheet) BackingFilePath() string
- func (s *Sheet) DataOwner() gurps.DataOwner
- func (s *Sheet) DockableKind() string
- func (s *Sheet) Entity() *gurps.Entity
- func (s *Sheet) MarkModified(src unison.Paneler)
- func (s *Sheet) MayAttemptClose() bool
- func (s *Sheet) Modified() bool
- func (s *Sheet) Rebuild(full bool)
- func (s *Sheet) SetBackingFilePath(p string)
- func (s *Sheet) SheetSettingsUpdated(entity *gurps.Entity, blockLayout bool)
- func (s *Sheet) String() string
- func (s *Sheet) Title() string
- func (s *Sheet) TitleIcon(suggestedSize unison.Size) unison.Drawable
- func (s *Sheet) Tooltip() string
- func (s *Sheet) UndoManager() *unison.UndoManager
- type StringField
- func NewMultiLineStringField(targetMgr *TargetMgr, targetKey, undoTitle string, get func() string, ...) *StringField
- func NewStringField(targetMgr *TargetMgr, targetKey, undoTitle string, get func() string, ...) *StringField
- func NewStringPageField(targetMgr *TargetMgr, targetKey, undoTitle string, get func() string, ...) *StringField
- func NewStringPageFieldNoGrab(targetMgr *TargetMgr, targetKey, undoTitle string, get func() string, ...) *StringField
- type Syncer
- type TableDockable
- func NewEquipmentModifierTableDockable(filePath string, modifiers []*gurps.EquipmentModifier) *TableDockable[*gurps.EquipmentModifier]
- func NewEquipmentTableDockable(filePath string, equipment []*gurps.Equipment) *TableDockable[*gurps.Equipment]
- func NewNoteTableDockable(filePath string, notes []*gurps.Note) *TableDockable[*gurps.Note]
- func NewSkillTableDockable(filePath string, skills []*gurps.Skill) *TableDockable[*gurps.Skill]
- func NewSpellTableDockable(filePath string, spells []*gurps.Spell) *TableDockable[*gurps.Spell]
- func NewTableDockable[T gurps.NodeTypes](filePath, extension string, provider TableProvider[T], ...) *TableDockable[T]
- func NewTraitModifierTableDockable(filePath string, modifiers []*gurps.TraitModifier) *TableDockable[*gurps.TraitModifier]
- func NewTraitTableDockable(filePath string, traits []*gurps.Trait) *TableDockable[*gurps.Trait]
- func (d *TableDockable[T]) AllTags() []string
- func (d *TableDockable[T]) ApplyFilter(tags []string)
- func (d *TableDockable[T]) AttemptClose() bool
- func (d *TableDockable[T]) BackingFilePath() string
- func (d *TableDockable[T]) DockableKind() string
- func (d *TableDockable[T]) Entity() *gurps.Entity
- func (d *TableDockable[T]) Hash(h hash.Hash)
- func (d *TableDockable[T]) MarkModified(_ unison.Paneler)
- func (d *TableDockable[T]) MayAttemptClose() bool
- func (d *TableDockable[T]) Modified() bool
- func (d *TableDockable[T]) Rebuild(_ bool)
- func (d *TableDockable[T]) SetBackingFilePath(p string)
- func (d *TableDockable[T]) String() string
- func (d *TableDockable[T]) Title() string
- func (d *TableDockable[T]) TitleIcon(suggestedSize unison.Size) unison.Drawable
- func (d *TableDockable[T]) Tooltip() string
- func (d *TableDockable[T]) UndoManager() *unison.UndoManager
- type TableDragUndoEditData
- type TableProvider
- func NewConditionalModifiersProvider(provider gurps.ConditionalModifierListProvider) TableProvider[*gurps.ConditionalModifier]
- func NewEquipmentModifiersProvider(provider gurps.EquipmentModifierListProvider, forEditor bool) TableProvider[*gurps.EquipmentModifier]
- func NewEquipmentProvider(provider gurps.EquipmentListProvider, carried, forPage bool) TableProvider[*gurps.Equipment]
- func NewNotesProvider(provider gurps.NoteListProvider, forPage bool) TableProvider[*gurps.Note]
- func NewReactionModifiersProvider(provider gurps.ReactionModifierListProvider) TableProvider[*gurps.ConditionalModifier]
- func NewSkillsProvider(provider gurps.SkillListProvider, forPage bool) TableProvider[*gurps.Skill]
- func NewSpellsProvider(provider gurps.SpellListProvider, forPage bool) TableProvider[*gurps.Spell]
- func NewTraitModifiersProvider(provider gurps.TraitModifierListProvider, forEditor bool) TableProvider[*gurps.TraitModifier]
- func NewTraitsProvider(provider gurps.TraitListProvider, forPage bool) TableProvider[*gurps.Trait]
- func NewWeaponsProvider(provider gurps.WeaponListProvider, melee, forPage bool) TableProvider[*gurps.Weapon]
- type TableUndoEditData
- type TagProvider
- type TargetMgr
- type TargetUndo
- type Template
- func (t *Template) AttemptClose() bool
- func (t *Template) BackingFilePath() string
- func (t *Template) DockableKind() string
- func (t *Template) Entity() *gurps.Entity
- func (t *Template) MarkModified(_ unison.Paneler)
- func (t *Template) MayAttemptClose() bool
- func (t *Template) Modified() bool
- func (t *Template) Rebuild(full bool)
- func (t *Template) SetBackingFilePath(p string)
- func (t *Template) SheetSettingsUpdated(e *gurps.Entity, blockLayout bool)
- func (t *Template) String() string
- func (t *Template) Title() string
- func (t *Template) TitleIcon(suggestedSize unison.Size) unison.Drawable
- func (t *Template) Tooltip() string
- func (t *Template) UndoManager() *unison.UndoManager
- type TitledBorder
- type WeightField
Constants ¶
const ( NewSheetItemID = unison.UserBaseID + iota NewTemplateItemID NewCampaignItemID NewTraitsLibraryItemID NewTraitModifiersLibraryItemID NewEquipmentLibraryItemID NewEquipmentModifiersLibraryItemID NewNotesLibraryItemID NewSkillsLibraryItemID NewSpellsLibraryItemID NewMarkdownFileItemID OpenItemID CloseTabID RecentFilesMenuID SaveItemID SaveAsItemID ExportToMenuID ExportAsPDFItemID ExportAsWEBPItemID ExportAsPNGItemID ExportAsJPEGItemID PrintItemID UndoItemID RedoItemID DuplicateItemID ExportPortraitItemID ClearPortraitItemID ClearSourceItemID SyncWithSourceItemID JumpToSearchFilterItemID ConvertToContainerItemID ConvertToNonContainerItemID ToggleStateItemID IncrementItemID DecrementItemID IncrementUsesItemID DecrementUsesItemID IncrementSkillLevelItemID DecrementSkillLevelItemID IncrementTechLevelItemID DecrementTechLevelItemID IncrementEquipmentLevelItemID DecrementEquipmentLevelItemID SwapDefaultsItemID MoveToOtherEquipmentItemID MoveToCarriedEquipmentItemID ItemMenuID AddNaturalAttacksItemID OpenEditorItemID CopyToSheetItemID CopyToTemplateItemID ApplyTemplateItemID NewSheetFromTemplateItemID OpenOnePageReferenceItemID OpenEachPageReferenceItemID SettingsMenuID PerSheetSettingsItemID PerSheetAttributeSettingsItemID PerSheetBodyTypeSettingsItemID DefaultSheetSettingsItemID DefaultAttributeSettingsItemID DefaultBodyTypeSettingsItemID GeneralSettingsItemID WebSettingsItemID PageRefMappingsItemID ColorSettingsItemID FontSettingsItemID MenuKeySettingsItemID SponsorGCSDevelopmentItemID MakeDonationItemID UpdateAppStatusItemID CheckForAppUpdatesItemID ReleaseNotesItemID LicenseItemID WebSiteItemID MailingListItemID UserGuideItemID ViewMenuID ScaleDefaultItemID ScaleUpItemID ScaleDownItemID Scale25ItemID Scale50ItemID Scale75ItemID Scale100ItemID Scale200ItemID Scale300ItemID Scale400ItemID Scale500ItemID Scale600ItemID DockUnDockItemID FirstNonContainerMarker // Keep this block grouped together NewCarriedEquipmentItemID NewEquipmentModifierItemID NewNoteItemID NewOtherEquipmentItemID NewSkillItemID NewSpellItemID NewTraitItemID NewTraitModifierItemID LastNonContainerMarker FirstContainerMarker // Keep this block grouped together NewCarriedEquipmentContainerItemID NewEquipmentContainerModifierItemID NewNoteContainerItemID NewOtherEquipmentContainerItemID NewSkillContainerItemID NewSpellContainerItemID NewTraitContainerItemID NewTraitContainerModifierItemID LastContainerMarker FirstAlternateNonContainerMarker // Keep this block grouped together NewRitualMagicSpellItemID NewTechniqueItemID LastAlternateNonContainerMarker NewMeleeWeaponItemID NewRangedWeaponItemID OpenInWindowMenuID LibraryBaseItemID = OpenInWindowMenuID + int(dgroup.LastGroup) + 2 RecentFieldBaseItemID = LibraryBaseItemID + 500 ExportToTextBaseItemID = RecentFieldBaseItemID + 500 DeepSearchableMenuID = ExportToTextBaseItemID + 500 DeepSearchableBaseItemID = DeepSearchableMenuID + 1 )
Menu, Item & Action IDs
const ( SheetDockableKind = "sheet" TemplateDockableKind = "template" ListDockableKind = "list" )
Known dockable kinds
const AssociatedIDKey = "associated_id"
AssociatedIDKey is the key used with CloseID().
const ScaleDelta = 10
ScaleDelta is the delta used when adjusting the view scale incrementally.
const SkipDeepSync = "!deepsync"
SkipDeepSync is set on components that should not trigger a deep sync.
const TableProviderClientKey = "table-provider"
TableProviderClientKey is the key used to store the table provider with the table.
const WebSiteDomain = "gurpscharactersheet.com"
WebSiteDomain holds the web site domain for GCS.
const WorkingDirKey = "working_dir"
WorkingDirKey the client data key for setting the working directory for markdown and link resolution.
Variables ¶
var ( StartServer func(func(error)) StopServer func() )
These need to be initialized by whatever instantiates the ux package, typically main.go. They are here to break the circular reference that would otherwise occur.
var PageRefKeyNameMappings = map[string]string{}/* 265 elements not displayed */
PageRefKeyNameMappings holds the known page reference key to PDF name mappings. This does not include open-ended, but known, mappings, such as those for Pyramid Magazine issues. nolint:misspell // Proper names
var PageTableColumnHeaderTheme = unison.LabelTheme{ TextDecoration: unison.TextDecoration{ Font: fonts.PageLabelPrimary, OnBackgroundInk: colors.OnHeader, }, Gap: 3, HAlign: align.Middle, VAlign: align.Middle, Side: side.Left, }
PageTableColumnHeaderTheme holds the theme values for PageTableColumnHeaders. Modifying this data will not alter existing PageTableColumnHeaders, but will alter any PageTableColumnHeaders created in the future.
var Workspace struct { Window *unison.Window TopDock *unison.Dock Navigator *Navigator DocumentDock *DocumentDock }
Workspace holds the data necessary to track the Workspace.
Functions ¶
func Activate ¶
Activate attempts to locate an existing dockable that 'matcher' returns true for. Will return true if a suitable match was found. If found, it will have been activated and focused.
func ActivateDockable ¶ added in v5.10.0
ActivateDockable activates the dockable, giving it focus.
func ActiveDockable ¶
ActiveDockable returns the currently active dockable in the active window.
func AddHelpToInfoPop ¶
AddHelpToInfoPop adds one or more lines of help text to an InfoPop.
func AddKeyBindingInfoToInfoPop ¶
func AddKeyBindingInfoToInfoPop(target unison.Paneler, keyBinding unison.KeyBinding, text string)
AddKeyBindingInfoToInfoPop adds information about a key binding to an InfoPop.
func AddScalingHelpToInfoPop ¶
AddScalingHelpToInfoPop adds the help info about scaling to an InfoPop.
func AllDockables ¶ added in v5.14.0
AllDockables returns all Dockables, whether in the workspace or in a separate window.
func AllMatchingDockables ¶ added in v5.14.0
AllMatchingDockables returns all Dockables that 'matcher' returns true for.
func AppDescription ¶
func AppDescription() string
AppDescription returns a description of the software.
func AppUpdateResult ¶
AppUpdateResult returns the current results of any outstanding app update check.
func ApplyTemplate ¶
func ApplyTemplate(filePath string)
ApplyTemplate loads the specified template file and applies it to a sheet.
func AttemptCloseForDockable ¶ added in v5.10.0
AttemptCloseForDockable attempts to close a dockable.
func CanApplyTemplate ¶
func CanApplyTemplate() bool
CanApplyTemplate returns true if a template can be applied.
func CanConvertToContainer ¶
func CanConvertToContainer[T ConvertableNodeTypes](table *unison.Table[*Node[T]]) bool
CanConvertToContainer returns true if the table's current selection has a row that can be converted to a container.
func CanConvertToNonContainer ¶ added in v5.5.3
func CanConvertToNonContainer[T ConvertableNodeTypes](table *unison.Table[*Node[T]]) bool
CanConvertToNonContainer returns true if the table's current selection has a row that can be converted to a non-container.
func CanOpenPageRef ¶
CanOpenPageRef returns true if the current selection on the table has a page reference.
func CheckForAppUpdates ¶
func CheckForAppUpdates()
CheckForAppUpdates initiates a fresh check for application updates.
func ClearSourceFromSelection ¶ added in v5.24.0
ClearSourceFromSelection clears the source from the selected nodes.
func CloseGroup ¶
CloseGroup attempts to close any grouped Dockables associated with the given Dockable. Returns false if a dockable refused to close.
func CloseID ¶ added in v5.24.0
CloseID attempts to close any Dockables associated with the given UUIDs. Returns false if a dockable refused to close.
func ConvertToContainer ¶
func ConvertToContainer[T ConvertableNodeTypes](owner Rebuildable, table *unison.Table[*Node[T]])
ConvertToContainer converts any selected rows to containers, if possible.
func ConvertToNonContainer ¶ added in v5.5.3
func ConvertToNonContainer[T ConvertableNodeTypes](owner Rebuildable, table *unison.Table[*Node[T]])
ConvertToNonContainer converts any selected rows to non-containers, if possible.
func CopyRowsTo ¶
func CopyRowsTo[T gurps.NodeTypes](table *unison.Table[*Node[T]], rows []*Node[T], postProcessor func(rows []*Node[T]), recordUndo bool)
CopyRowsTo copies the provided rows to the target table.
func CurrentlyFocusedDockContainer ¶ added in v5.10.0
func CurrentlyFocusedDockContainer() *unison.DockContainer
CurrentlyFocusedDockContainer returns the currently focused DockContainer, if any.
func DeepSync ¶
DeepSync does a depth-first traversal of the panel and all of its descendents and calls Sync() on any Syncer objects it finds.
func DefaultDockContainer ¶ added in v5.10.0
func DefaultDockContainer() *unison.DockContainer
DefaultDockContainer returns the currently focused DockContainer, if possible. If not, returns the first DockContainer that can be found.
func DeleteSelection ¶
DeleteSelection removes the selected nodes from the table.
func DetermineDataOwnerProvider ¶ added in v5.24.0
func DetermineDataOwnerProvider(target unison.Paneler) gurps.DataOwnerProvider
DetermineDataOwnerProvider returns the DataOwnerProvider for the given target.
func DisableSorting ¶ added in v5.7.0
func DisableSorting[T unison.TableRowConstraint[T]](headers []unison.TableColumnHeader[T]) []unison.TableColumnHeader[T]
DisableSorting disables the sorting capability in the table headers.
func DisplayCalculator ¶ added in v5.6.0
func DisplayCalculator(sheet *Sheet)
DisplayCalculator displays the calculator for the given Sheet.
func DisplayNewDockable ¶
DisplayNewDockable adds the Dockable to the dock and gives it the focus.
func DockContainerForGroup ¶
DockContainerForGroup returns the first DockContainer which has a Dockable with the given group, if any.
func DockContainerHasGroup ¶
func DockContainerHasGroup(dc *unison.DockContainer, group dgroup.Group) bool
DockContainerHasGroup returns true if the DockContainer contains at least one Dockable associated with the given group. May pass nil for the dc.
func DockContainerHoldsExtension ¶
func DockContainerHoldsExtension(dc *unison.DockContainer, ext ...string) bool
DockContainerHoldsExtension returns true if an immediate child of the given DockContainer has a FileBackedDockable with the given extension.
func DuplicateSelection ¶
DuplicateSelection duplicates the selected nodes in the table.
func EditEquipment ¶
func EditEquipment(owner Rebuildable, equipment *gurps.Equipment, carried bool)
EditEquipment displays the editor for equipment.
func EditEquipmentModifier ¶
func EditEquipmentModifier(owner Rebuildable, modifier *gurps.EquipmentModifier)
EditEquipmentModifier displays the editor for an equipment modifier.
func EditNote ¶
func EditNote(owner Rebuildable, note *gurps.Note)
EditNote displays the editor for a note.
func EditSkill ¶
func EditSkill(owner Rebuildable, skill *gurps.Skill)
EditSkill displays the editor for an skill.
func EditSpell ¶
func EditSpell(owner Rebuildable, spell *gurps.Spell)
EditSpell displays the editor for an spell.
func EditTrait ¶
func EditTrait(owner Rebuildable, t *gurps.Trait)
EditTrait displays the editor for a trait.
func EditTraitModifier ¶
func EditTraitModifier(owner Rebuildable, modifier *gurps.TraitModifier)
EditTraitModifier displays the editor for a trait modifier.
func EditWeapon ¶
func EditWeapon(owner Rebuildable, w *gurps.Weapon)
EditWeapon displays the editor for a weapon.
func ExtractNodeDataFromList ¶
ExtractNodeDataFromList returns the underlying node data.
func ExtractPageReferences ¶
ExtractPageReferences extracts any page references from the string.
func FindRowIndexByID ¶
FindRowIndexByID returns the row index of the row with the given ID in the given table.
func FocusFirstContent ¶
FocusFirstContent attempts to focus the first non-button widget in the content. Failing that, tries to focus the first focusable widget in the content. Failing that, tries to focus the first focusable widget in the toolbar.
func HandleLink ¶ added in v5.5.0
HandleLink will try to open http, https, and md links, as well as resolve page references.
func HasSelectionAndNotFiltered ¶ added in v5.24.0
HasSelectionAndNotFiltered returns true if the table has a selection and is not filtered.
func InitWorkspace ¶ added in v5.10.0
InitWorkspace initializes the Workspace singleton.
func InsertCmdContextMenuItem ¶
func InsertCmdContextMenuItem[T gurps.NodeTypes](table *unison.Table[*Node[T]], title string, cmdID int, id *int, cm unison.Menu)
InsertCmdContextMenuItem inserts a context menu item for the given command.
func InsertItems ¶
func InsertItems[T gurps.NodeTypes](owner Rebuildable, table *unison.Table[*Node[T]], topList func() []T, setTopList func([]T), rowData func(table *unison.Table[*Node[T]]) []*Node[T], items ...T)
InsertItems into a table.
func InstallContainerConversionHandlers ¶ added in v5.5.3
func InstallContainerConversionHandlers[T ConvertableNodeTypes](paneler unison.Paneler, owner Rebuildable, table *unison.Table[*Node[T]])
InstallContainerConversionHandlers installs the to & from container conversion handlers.
func InstallDockUndockCmd ¶ added in v5.10.0
InstallDockUndockCmd installs the dock or undock command handler.
func InstallTableDropSupport ¶
func InstallTableDropSupport[T gurps.NodeTypes](table *unison.Table[*Node[T]], provider TableProvider[T])
InstallTableDropSupport installs our standard drop support on a table.
func IsDockableInWorkspace ¶ added in v5.10.0
IsDockableInWorkspace returns true if the Dockable is inside the Workspace as opposed to an external window.
func LoadLanguageSetting ¶ added in v5.6.0
func LoadLanguageSetting()
LoadLanguageSetting loads the language setting from disk, if present, and applies it.
func LocateDockContainerForExtension ¶ added in v5.10.0
func LocateDockContainerForExtension(ext ...string) *unison.DockContainer
LocateDockContainerForExtension searches for the first FileBackedDockable with the given extension and returns its DockContainer.
func MarkForLayoutWithinDockable ¶
MarkForLayoutWithinDockable sets the NeedsLayout flag on the provided panel and all of its parents up to the first Dockable.
func MarkModified ¶
MarkModified looks for a ModifiableRoot, starting at the panel. If found, it then called MarkModified() on it.
func MarkRootAncestorForLayoutRecursively ¶ added in v5.10.0
MarkRootAncestorForLayoutRecursively looks for a parent DockContainer (and, failing to find one of those, a parent Dockable) and marks it and all of its descendents as needing to be laid out.
func MayAttemptCloseOfGroup ¶
MayAttemptCloseOfGroup returns true if the grouped Dockables associated with the given dockable may be closed.
func MoveDockableToWindow ¶ added in v5.10.0
MoveDockableToWindow closes the tab a dockable is in within the workspace and opens a windows for it instead. If already in its own window, does nothing.
func MoveDockableToWorkspace ¶ added in v5.10.0
MoveDockableToWorkspace closes the window a dockable is in and places it within the workspace. If already in the workspace, does nothing.
func NewCampaignFromFile ¶ added in v5.16.2
NewCampaignFromFile loads a GURPS campaign file and creates a new unison.Dockable for it.
func NewDefaultInfoPop ¶
NewDefaultInfoPop creates a new InfoPop with the message about mouse wheel scaling.
func NewEditorListHeader ¶
func NewEditorListHeader[T gurps.NodeTypes](title, tooltip string, forPage bool) unison.TableColumnHeader[*Node[T]]
NewEditorListHeader creates a new list header for an editor.
func NewEditorListSVGHeader ¶
func NewEditorListSVGHeader[T gurps.NodeTypes](icon *unison.SVG, tooltip string, forPage bool) unison.TableColumnHeader[*Node[T]]
NewEditorListSVGHeader creates a new list header with an SVG image as its content rather than text.
func NewEditorListSVGPairHeader ¶
func NewEditorListSVGPairHeader[T gurps.NodeTypes](leftSVG, rightSVG *unison.SVG, tooltip string, forPage bool) unison.TableColumnHeader[*Node[T]]
NewEditorListSVGPairHeader creates a new list header with a pair of SVG images as its content rather than text.
func NewEquipmentModifierTableDockableFromFile ¶
NewEquipmentModifierTableDockableFromFile loads a list of equipment modifiers from a file and creates a new unison.Dockable for them.
func NewEquipmentTableDockableFromFile ¶
NewEquipmentTableDockableFromFile loads a list of equipment from a file and creates a new unison.Dockable for them.
func NewFieldInteriorLeadingLabel ¶
NewFieldInteriorLeadingLabel creates a new label appropriate for the label in the interior of a row before a field.
func NewFieldLeadingLabel ¶
NewFieldLeadingLabel creates a new label appropriate for the first label in a row before a field.
func NewFieldTrailingLabel ¶
NewFieldTrailingLabel creates a new label appropriate for after a field.
func NewImageDockable ¶
NewImageDockable creates a new unison.Dockable for image files.
func NewMarkdownDockable ¶
func NewMarkdownDockable(filePath string, allowEditing, startInEditMode bool) (unison.Dockable, error)
NewMarkdownDockable creates a new unison.Dockable for markdown files.
func NewMarkdownDockableWithContent ¶
func NewMarkdownDockableWithContent(title, content string, allowEditing, startInEditMode bool) (unison.Dockable, error)
NewMarkdownDockableWithContent creates a new unison.Dockable for markdown content.
func NewNodeTable ¶
func NewNodeTable[T gurps.NodeTypes](provider TableProvider[T], font unison.Font) (header *unison.TableHeader[*Node[T]], table *unison.Table[*Node[T]])
NewNodeTable creates a new node table of the specified type, returning the header and table. Pass nil for 'font' if this should be a standalone top-level table for a dockable. Otherwise, pass in the typical font used for a cell.
func NewNoteTableDockableFromFile ¶
NewNoteTableDockableFromFile loads a list of notes from a file and creates a new unison.Dockable for them.
func NewPDFDockable ¶
NewPDFDockable creates a new unison.Dockable for PDFRenderer files.
func NewPageHeader ¶
NewPageHeader creates a new center-aligned header for a sheet page.
func NewPageInternalHeader ¶
NewPageInternalHeader creates a new center-aligned internal header for a sheet page.
func NewPageLabel ¶
NewPageLabel creates a new start-aligned field label for a sheet page.
func NewPageLabelCenter ¶
NewPageLabelCenter creates a new center-aligned field label for a sheet page.
func NewPageLabelEnd ¶
NewPageLabelEnd creates a new end-aligned field label for a sheet page.
func NewPageLabelWithInk ¶ added in v5.22.0
NewPageLabelWithInk creates a new start-aligned field label for a sheet page with the given Ink.
func NewPageLabelWithRandomizer ¶
NewPageLabelWithRandomizer creates a new end-aligned field label for a sheet page that includes a randomization button.
func NewSVGButtonForFont ¶ added in v5.11.0
NewSVGButtonForFont creates a new SVG button with the given font and a size adjustment.
func NewSearchField ¶
func NewSearchField(watermark string, modifiedCallback func(before, after *unison.FieldState)) *unison.Field
NewSearchField creates a new search widget.
func NewSheetFromFile ¶
NewSheetFromFile loads a GURPS character sheet file and creates a new unison.Dockable for it.
func NewSheetFromTemplate ¶ added in v5.11.0
func NewSheetFromTemplate(filePath string)
NewSheetFromTemplate loads the specified template file and creates a new character sheet from it.
func NewSkillTableDockableFromFile ¶
NewSkillTableDockableFromFile loads a list of skills from a file and creates a new unison.Dockable for them.
func NewSpellTableDockableFromFile ¶
NewSpellTableDockableFromFile loads a list of spells from a file and creates a new unison.Dockable for them.
func NewTableColumnHeader ¶ added in v5.22.0
func NewTableColumnHeader[T gurps.NodeTypes](title, tooltip string) *unison.DefaultTableColumnHeader[*Node[T]]
NewTableColumnHeader creates a new table column header panel with the given title in small caps.
func NewTagFilterPopup ¶ added in v5.11.0
func NewTagFilterPopup(tagProvider TagProvider) *unison.PopupMenu[string]
NewTagFilterPopup creates a new tag filter popup.
func NewTemplateFromFile ¶
NewTemplateFromFile loads a GURPS template file and creates a new unison.Dockable for it.
func NewToolbarSeparator ¶
NewToolbarSeparator creates a new vertical separator for the toolbar.
func NewTraitModifierTableDockableFromFile ¶
NewTraitModifierTableDockableFromFile loads a list of trait modifiers from a file and creates a new unison.Dockable for them.
func NewTraitTableDockableFromFile ¶
NewTraitTableDockableFromFile loads a list of traits from a file and creates a new unison.Dockable for them.
func NewWindowForDockable ¶ added in v5.10.0
NewWindowForDockable creates a new window and places a Dockable inside it.
func NotifyOfAppUpdate ¶
func NotifyOfAppUpdate()
NotifyOfAppUpdate notifies the user of the available update.
func OpenEachPageRef ¶
OpenEachPageRef opens the all page references on each selected item in the table.
func OpenEditor ¶
OpenEditor opens an editor for each selected row in the table.
func OpenFiles ¶
func OpenFiles(filePaths []string)
OpenFiles attempts to open the given file paths.
func OpenPageRef ¶
OpenPageRef opens the first page reference on each selected item in the table.
func OpenPageReference ¶
OpenPageReference opens the given page reference. Returns true if the the user asked to cancel further processing.
func PageRefKeyToName ¶
PageRefKeyToName returns a PDF name for the given mapping, if known.
func PlaceInDock ¶
PlaceInDock places the Dockable into the workspace document dock, grouped with the provided group, if that group is present.
func ProcessModifiers ¶
ProcessModifiers processes the rows for modifiers that can be toggled on or off.
func ProcessModifiersForSelection ¶
ProcessModifiersForSelection processes the selected rows for modifiers that can be toggled on or off.
func ProcessNameables ¶
ProcessNameables processes the rows and their children for any nameables.
func ProcessNameablesForSelection ¶
ProcessNameablesForSelection processes the selected rows and their children for any nameables.
func PromptForDestination ¶
func PromptForDestination[T FileBackedDockable](choices []T) []T
PromptForDestination puts up a modal dialog to choose one or more destinations if choices contains more than one choice. Return an empty list if canceled or there are no selections made.
func RefreshPageRefMappingsView ¶
func RefreshPageRefMappingsView()
RefreshPageRefMappingsView causes the Page References Mappings view to be refreshed if it is open.
func RegisterExternalFileTypes ¶
func RegisterExternalFileTypes()
RegisterExternalFileTypes registers the external file types.
func RegisterGCSFileTypes ¶
func RegisterGCSFileTypes()
RegisterGCSFileTypes registers the GCS file types.
func RegisterKnownFileTypes ¶
func RegisterKnownFileTypes()
RegisterKnownFileTypes registers the known files types.
func SaveDockable ¶
func SaveDockable(d FileBackedDockable, saver func(filePath string) error, setUnmodified func()) bool
SaveDockable attempts to save the contents of the dockable using its existing path.
func SaveDockableAs ¶
func SaveDockableAs(d FileBackedDockable, extension string, saver func(filePath string) error, setUnmodifiedAndNewPath func(filePath string)) bool
SaveDockableAs attempts to save the contents of the dockable, prompting for a new path.
func SelectedTags ¶ added in v5.11.0
SelectedTags returns the set of tags currently selected in a tag filter popup.
func SetCheckBoxState ¶
SetCheckBoxState sets the checkbox state based on the value of checked.
func SetDataOwnerProvider ¶ added in v5.24.0
func SetDataOwnerProvider(target unison.Paneler, provider gurps.DataOwnerProvider)
SetDataOwnerProvider sets the DataOwnerProvider into the client data of the target.
func SetFieldValue ¶
SetFieldValue sets the value of this field, marking the field and all of its parents as needing to be laid out again if the value is not what is currently in the field.
func SetTextAndMarkModified ¶
SetTextAndMarkModified sets the field to the given text, selects it, requests focus, then calls MarkModified().
func ShowAttributeSettings ¶
func ShowAttributeSettings(owner EntityPanel)
ShowAttributeSettings the Attribute Settings. Pass in nil to edit the defaults or a sheet to edit the sheet's.
func ShowBodySettings ¶
func ShowBodySettings(owner EntityPanel)
ShowBodySettings the Body Settings. Pass in nil to edit the defaults or a sheet to edit the sheet's.
func ShowGeneralSettings ¶
func ShowGeneralSettings()
ShowGeneralSettings the General Settings window.
func ShowLibrarySettings ¶
ShowLibrarySettings the Library Settings view for a specific library.
func ShowMenuKeySettings ¶
func ShowMenuKeySettings()
ShowMenuKeySettings shows the Menu Key settings.
func ShowNameablesDialog ¶ added in v5.25.0
ShowNameablesDialog shows a dialog for editing nameables.
func ShowPageRefMappings ¶
func ShowPageRefMappings()
ShowPageRefMappings shows the Page Reference Mappings.
func ShowReadOnlyMarkdown ¶ added in v5.5.1
func ShowReadOnlyMarkdown(title, content string)
ShowReadOnlyMarkdown attempts to show the given markdown content in a dockable.
func ShowSheetSettings ¶
func ShowSheetSettings(owner EntityPanel)
ShowSheetSettings the Sheet Settings. Pass in nil to edit the defaults or a sheet to edit the sheet's.
func ShowWebSettings ¶ added in v5.21.0
func ShowWebSettings()
ShowWebSettings the Web Settings window.
func SyncWithSourceForSelection ¶ added in v5.24.0
SyncWithSourceForSelection synchronizes the selected nodes with their source.
func UpdateCalculator ¶ added in v5.6.0
func UpdateCalculator(sheet *Sheet)
UpdateCalculator for the given owner.
func UpdateTitleForDockable ¶ added in v5.10.0
UpdateTitleForDockable updates the title for the given Dockable, whether it is within the workspace or a separate window.
func WorkingDirProvider ¶ added in v5.13.0
WorkingDirProvider extracts a working dir for the given panel, if possible, otherwise returns ".".
Types ¶
type AltDropSupport ¶
AltDropSupport holds handlers for supporting an alternate drop type that drops onto a specific row, rather than moving or adding rows.
type ApplyTemplateUndoEditData ¶
type ApplyTemplateUndoEditData struct {
// contains filtered or unexported fields
}
ApplyTemplateUndoEditData holds the sheet table data for an undo.
func NewApplyTemplateUndoEditData ¶
func NewApplyTemplateUndoEditData(sheet *Sheet) (*ApplyTemplateUndoEditData, error)
NewApplyTemplateUndoEditData creates a new undo that preserves the current sheet table data.
func (*ApplyTemplateUndoEditData) Apply ¶
func (a *ApplyTemplateUndoEditData) Apply()
Apply the data.
type AttrPanel ¶ added in v5.22.0
AttrPanel holds the contents of an attributes block on the sheet.
func NewPointPoolsPanel ¶
NewPointPoolsPanel creates a new point pools panel.
func NewPrimaryAttrPanel ¶
NewPrimaryAttrPanel creates a new primary attributes panel.
func NewSecondaryAttrPanel ¶
NewSecondaryAttrPanel creates a new secondary attributes panel.
type BodyPanel ¶
BodyPanel holds the contents of the body block on the sheet.
func NewBodyPanel ¶
NewBodyPanel creates a new body panel.
type Calculator ¶ added in v5.6.0
Calculator provides calculations for various physical tasks, such as jumping.
func (*Calculator) AttemptClose ¶ added in v5.6.0
func (c *Calculator) AttemptClose() bool
AttemptClose implements GroupedCloser
func (*Calculator) CloseWithGroup ¶ added in v5.6.0
func (c *Calculator) CloseWithGroup(other unison.Paneler) bool
CloseWithGroup implements GroupedCloser
func (*Calculator) MayAttemptClose ¶ added in v5.6.0
func (c *Calculator) MayAttemptClose() bool
MayAttemptClose implements GroupedCloser
func (*Calculator) Modified ¶ added in v5.6.0
func (c *Calculator) Modified() bool
Modified implements unison.Dockable
func (*Calculator) String ¶ added in v5.6.0
func (c *Calculator) String() string
func (*Calculator) Title ¶ added in v5.6.0
func (c *Calculator) Title() string
Title implements unison.Dockable
func (*Calculator) TitleIcon ¶ added in v5.6.0
func (c *Calculator) TitleIcon(suggestedSize unison.Size) unison.Drawable
TitleIcon implements unison.Dockable
func (*Calculator) Tooltip ¶ added in v5.6.0
func (c *Calculator) Tooltip() string
Tooltip implements unison.Dockable
func (*Calculator) UndoManager ¶ added in v5.6.0
func (c *Calculator) UndoManager() *unison.UndoManager
UndoManager implements unison.UndoManagerProvider
type Campaign ¶ added in v5.16.2
Campaign holds the view for a GURPS campaign.
func NewCampaign ¶ added in v5.16.2
NewCampaign creates a new unison.Dockable for GURPS campaign files.
func (*Campaign) AttemptClose ¶ added in v5.16.2
AttemptClose implements unison.TabCloser
func (*Campaign) BackingFilePath ¶ added in v5.16.2
BackingFilePath implements workspace.FileBackedDockable
func (*Campaign) MayAttemptClose ¶ added in v5.16.2
MayAttemptClose implements unison.TabCloser
func (*Campaign) SetBackingFilePath ¶ added in v5.16.2
SetBackingFilePath implements workspace.FileBackedDockable
type CellCache ¶
CellCache holds data for a table row's cell to reduce the need to constantly recreate them.
type CheckBox ¶
CheckBox provides a checkbox that works with undo.
type ContextMenuItem ¶
ContextMenuItem holds the title and ID of a context menu item that is derived from a command ID.
func AppendDefaultContextMenuItems ¶ added in v5.6.0
func AppendDefaultContextMenuItems(list []ContextMenuItem) []ContextMenuItem
AppendDefaultContextMenuItems appends the default set of context menu items for lists.
type ConvertableNodeTypes ¶ added in v5.5.3
type ConvertableNodeTypes interface { *gurps.Equipment | *gurps.Note fmt.Stringer nameable.Applier Container() bool CanConvertToFromContainer() bool ConvertToContainer() ConvertToNonContainer() }
ConvertableNodeTypes defines the types that the container conversion can work on.
type DamagePanel ¶
DamagePanel holds the contents of the damage block on the sheet.
func NewDamagePanel ¶
func NewDamagePanel(entity *gurps.Entity) *DamagePanel
NewDamagePanel creates a new damage panel.
type DecimalField ¶
type DecimalField = NumericField[fxp.Int]
DecimalField is field that holds a decimal (fixed-point) number.
type DescriptionPanel ¶
DescriptionPanel holds the contents of the description block on the sheet.
func NewDescriptionPanel ¶
func NewDescriptionPanel(entity *gurps.Entity, targetMgr *TargetMgr) *DescriptionPanel
NewDescriptionPanel creates a new description panel.
type DocumentDock ¶
DocumentDock holds the document dock.
func NewDocumentDock ¶
func NewDocumentDock() *DocumentDock
NewDocumentDock creates a new DocumentDock.
func (*DocumentDock) Modified ¶
func (d *DocumentDock) Modified() bool
Modified implements unison.Dockable
func (*DocumentDock) TitleIcon ¶
func (d *DocumentDock) TitleIcon(suggestedSize unison.Size) unison.Drawable
TitleIcon implements unison.Dockable
func (*DocumentDock) Tooltip ¶
func (d *DocumentDock) Tooltip() string
Tooltip implements unison.Dockable
type DragHandle ¶
DragHandle provides a simple draggable handle.
func NewDragHandle ¶
func NewDragHandle(data map[string]any) *DragHandle
NewDragHandle creates a new draggable handle widget.
type DrawableSVGPair ¶
DrawableSVGPair draws two SVG's side-by-side.
func (*DrawableSVGPair) DrawInRect ¶
func (s *DrawableSVGPair) DrawInRect(canvas *unison.Canvas, rect unison.Rect, _ *unison.SamplingOptions, paint *unison.Paint)
DrawInRect implements the Drawable interface.
func (*DrawableSVGPair) LogicalSize ¶
func (s *DrawableSVGPair) LogicalSize() unison.Size
LogicalSize implements the Drawable interface.
type EncumbrancePanel ¶
EncumbrancePanel holds the contents of the encumbrance block on the sheet.
func NewEncumbrancePanel ¶
func NewEncumbrancePanel(entity *gurps.Entity) *EncumbrancePanel
NewEncumbrancePanel creates a new encumbrance panel.
type EntityPanel ¶
EntityPanel defines methods for a panel that can hold an entity.
type FileBackedDockable ¶
type FileBackedDockable interface { unison.Dockable unison.TabCloser BackingFilePath() string SetBackingFilePath(p string) }
FileBackedDockable defines methods a Dockable that is based on a file should implement.
func LocateFileBackedDockable ¶ added in v5.10.0
func LocateFileBackedDockable(filePath string) FileBackedDockable
LocateFileBackedDockable searches for a FileBackedDockable with the given path.
type GroupedCloser ¶
GroupedCloser defines the methods required of a tab that wishes to be closed when another tab is closed.
type IdentityPanel ¶
IdentityPanel holds the contents of the identity block on the sheet.
func NewIdentityPanel ¶
func NewIdentityPanel(entity *gurps.Entity, targetMgr *TargetMgr) *IdentityPanel
NewIdentityPanel creates a new identity panel.
type ImageDockable ¶
ImageDockable holds the view for an image file.
func (*ImageDockable) AttemptClose ¶
func (d *ImageDockable) AttemptClose() bool
AttemptClose implements unison.TabCloser
func (*ImageDockable) BackingFilePath ¶
func (d *ImageDockable) BackingFilePath() string
BackingFilePath implements workspace.FileBackedDockable
func (*ImageDockable) MayAttemptClose ¶
func (d *ImageDockable) MayAttemptClose() bool
MayAttemptClose implements unison.TabCloser
func (*ImageDockable) Modified ¶
func (d *ImageDockable) Modified() bool
Modified implements workspace.FileBackedDockable
func (*ImageDockable) SetBackingFilePath ¶
func (d *ImageDockable) SetBackingFilePath(p string)
SetBackingFilePath implements workspace.FileBackedDockable
func (*ImageDockable) Title ¶
func (d *ImageDockable) Title() string
Title implements workspace.FileBackedDockable
func (*ImageDockable) TitleIcon ¶
func (d *ImageDockable) TitleIcon(suggestedSize unison.Size) unison.Drawable
TitleIcon implements workspace.FileBackedDockable
func (*ImageDockable) Tooltip ¶
func (d *ImageDockable) Tooltip() string
Tooltip implements workspace.FileBackedDockable
type IntegerField ¶
type IntegerField = NumericField[int]
IntegerField is field that holds an integer.
func NewIntegerField ¶
func NewIntegerField(targetMgr *TargetMgr, targetKey, undoTitle string, get func() int, set func(int), minValue, maxValue int, forceSign, noMinWidth bool) *IntegerField
NewIntegerField creates a new field that holds an int.
func NewIntegerPageField ¶
func NewIntegerPageField(targetMgr *TargetMgr, targetKey, undoTitle string, get func() int, set func(int), minValue, maxValue int, showSign, noMinWidth bool) *IntegerField
NewIntegerPageField creates a new integer entry field for a sheet page.
type ItemVariant ¶
type ItemVariant int
ItemVariant holds the type of item variant to create.
const ( NoItemVariant ItemVariant = iota ContainerItemVariant AlternateItemVariant )
Possible values for ItemVariant.
type LengthField ¶
type LengthField = NumericField[fxp.Length]
LengthField is field that holds a length value.
type LiftingPanel ¶
LiftingPanel holds the contents of the lifting block on the sheet.
func NewLiftingPanel ¶
func NewLiftingPanel(entity *gurps.Entity) *LiftingPanel
NewLiftingPanel creates a new lifting panel.
type MarkdownDockable ¶
MarkdownDockable holds the view for an image file.
func (*MarkdownDockable) AttemptClose ¶
func (d *MarkdownDockable) AttemptClose() bool
AttemptClose implements unison.TabCloser
func (*MarkdownDockable) BackingFilePath ¶
func (d *MarkdownDockable) BackingFilePath() string
BackingFilePath implements workspace.FileBackedDockable
func (*MarkdownDockable) MarkModified ¶ added in v5.5.0
func (d *MarkdownDockable) MarkModified(_ unison.Paneler)
MarkModified implements ModifiableRoot.
func (*MarkdownDockable) MayAttemptClose ¶
func (d *MarkdownDockable) MayAttemptClose() bool
MayAttemptClose implements unison.TabCloser
func (*MarkdownDockable) Modified ¶
func (d *MarkdownDockable) Modified() bool
Modified implements workspace.FileBackedDockable
func (*MarkdownDockable) SetBackingFilePath ¶
func (d *MarkdownDockable) SetBackingFilePath(p string)
SetBackingFilePath implements workspace.FileBackedDockable
func (*MarkdownDockable) Title ¶
func (d *MarkdownDockable) Title() string
Title implements workspace.FileBackedDockable
func (*MarkdownDockable) TitleIcon ¶
func (d *MarkdownDockable) TitleIcon(suggestedSize unison.Size) unison.Drawable
TitleIcon implements workspace.FileBackedDockable
func (*MarkdownDockable) Tooltip ¶
func (d *MarkdownDockable) Tooltip() string
Tooltip implements workspace.FileBackedDockable
func (*MarkdownDockable) UndoManager ¶ added in v5.5.0
func (d *MarkdownDockable) UndoManager() *unison.UndoManager
UndoManager implements undo.Provider
type MiscPanel ¶
MiscPanel holds the contents of the miscellaneous block on the sheet.
func NewMiscPanel ¶
NewMiscPanel creates a new miscellaneous panel.
func (*MiscPanel) UpdateModified ¶
func (m *MiscPanel) UpdateModified()
UpdateModified updates the current modification timestamp.
type ModifiableRoot ¶
ModifiableRoot marks the root of a modifable tree of components, typically a Dockable.
type Navigator ¶
type Navigator struct { // contains filtered or unexported fields }
Navigator holds the workspace navigation panel.
func (*Navigator) ApplyDisclosedPaths ¶
ApplyDisclosedPaths closes all nodes except the ones provided, which are explicitly opened.
func (*Navigator) ApplySelectedPaths ¶
ApplySelectedPaths replaces the selection with the nodes that match the given paths.
func (*Navigator) DisclosedPaths ¶
DisclosedPaths returns a list of paths that are currently disclosed.
func (*Navigator) EventuallyReload ¶
func (n *Navigator) EventuallyReload()
EventuallyReload calls Reload() after a small delay, collapsing intervening requests to do the same.
func (*Navigator) InitialFocus ¶
func (n *Navigator) InitialFocus()
InitialFocus causes the navigator to focus its initial component.
func (*Navigator) SelectedPaths ¶
SelectedPaths returns a list of paths that are currently selected.
type NavigatorNode ¶
type NavigatorNode struct {
// contains filtered or unexported fields
}
NavigatorNode holds a library, directory or file.
func NewDirectoryNode ¶
func NewDirectoryNode(nav *Navigator, lib *gurps.Library, dirPath string, parent *NavigatorNode) *NavigatorNode
NewDirectoryNode creates a new DirectoryNode.
func NewFavoritesNode ¶ added in v5.12.0
func NewFavoritesNode(nav *Navigator) *NavigatorNode
NewFavoritesNode creates the Favorites node.
func NewFileNode ¶
func NewFileNode(lib *gurps.Library, filePath string, parent *NavigatorNode) *NavigatorNode
NewFileNode creates a new FileNode.
func NewLibraryNode ¶
func NewLibraryNode(nav *Navigator, lib *gurps.Library) *NavigatorNode
NewLibraryNode creates a new library node.
func (*NavigatorNode) CanHaveChildren ¶
func (n *NavigatorNode) CanHaveChildren() bool
CanHaveChildren implements unison.TableRowData.
func (*NavigatorNode) CellDataForSort ¶
func (n *NavigatorNode) CellDataForSort(col int) string
CellDataForSort implements unison.TableRowData.
func (*NavigatorNode) Children ¶
func (n *NavigatorNode) Children() []*NavigatorNode
Children implements unison.TableRowData.
func (*NavigatorNode) CloneForTarget ¶
func (n *NavigatorNode) CloneForTarget(_ unison.Paneler, _ *NavigatorNode) *NavigatorNode
CloneForTarget implements unison.TableRowData. Not permitted at the moment.
func (*NavigatorNode) ColumnCell ¶
func (n *NavigatorNode) ColumnCell(_, col int, foreground, _ unison.Ink, _, _, _ bool) unison.Paneler
ColumnCell implements unison.TableRowData.
func (*NavigatorNode) Container ¶ added in v5.24.0
func (n *NavigatorNode) Container() bool
Container returns true if this node can have children.
func (*NavigatorNode) ID ¶ added in v5.24.0
func (n *NavigatorNode) ID() tid.TID
ID implements unison.TableRowData.
func (*NavigatorNode) IsDirectory ¶ added in v5.24.0
func (n *NavigatorNode) IsDirectory() bool
IsDirectory returns true if this is a directory node.
func (*NavigatorNode) IsFavorites ¶ added in v5.24.0
func (n *NavigatorNode) IsFavorites() bool
IsFavorites returns true if this is a favorites node.
func (*NavigatorNode) IsFile ¶ added in v5.24.0
func (n *NavigatorNode) IsFile() bool
IsFile returns true if this is a file node.
func (*NavigatorNode) IsLibrary ¶ added in v5.24.0
func (n *NavigatorNode) IsLibrary() bool
IsLibrary returns true if this is a library node.
func (*NavigatorNode) IsOpen ¶
func (n *NavigatorNode) IsOpen() bool
IsOpen implements unison.TableRowData.
func (*NavigatorNode) Match ¶
func (n *NavigatorNode) Match(text string) bool
Match looks for the text in the node and return true if it is present. Note that calls to this method should always pass in text that has already been run through strings.ToLower().
func (*NavigatorNode) OpenNodeContent ¶ added in v5.24.0
func (n *NavigatorNode) OpenNodeContent() (dockable unison.Dockable, wasOpen bool)
OpenNodeContent opens the node's content.
func (*NavigatorNode) Parent ¶
func (n *NavigatorNode) Parent() *NavigatorNode
Parent implements unison.TableRowData.
func (*NavigatorNode) Path ¶
func (n *NavigatorNode) Path() string
Path returns the full path on disk for this node.
func (*NavigatorNode) Refresh ¶
func (n *NavigatorNode) Refresh()
Refresh the contents of this node.
func (*NavigatorNode) SetChildren ¶
func (n *NavigatorNode) SetChildren(_ []*NavigatorNode)
SetChildren implements unison.TableRowData.
func (*NavigatorNode) SetOpen ¶
func (n *NavigatorNode) SetOpen(open bool)
SetOpen implements unison.TableRowData.
func (*NavigatorNode) SetParent ¶
func (n *NavigatorNode) SetParent(_ *NavigatorNode)
SetParent implements unison.TableRowData.
type Node ¶
Node represents a row in a table.
func NewNode ¶
func NewNode[T gurps.NodeTypes](table *unison.Table[*Node[T]], parent *Node[T], data T, forPage bool) *Node[T]
NewNode creates a new node for a table.
func NewNodeLike ¶
NewNodeLike creates a new node for a table based on the characteristics of an existing node in that table.
func (*Node[T]) CanHaveChildren ¶
CanHaveChildren implements unison.TableRowData.
func (*Node[T]) CellDataForSort ¶
CellDataForSort implements unison.TableRowData.
func (*Node[T]) CellFromCellData ¶
func (n *Node[T]) CellFromCellData(c *gurps.CellData, width float32, foreground, background unison.Ink) unison.Paneler
CellFromCellData creates a new panel for the given cell data.
func (*Node[T]) CloneForTarget ¶
CloneForTarget implements unison.TableRowData.
func (*Node[T]) ColumnCell ¶
func (n *Node[T]) ColumnCell(row, col int, foreground, background unison.Ink, _, _, _ bool) unison.Paneler
ColumnCell implements unison.TableRowData.
func (*Node[T]) HasTag ¶
HasTag returns true if the specified tag is present on the node. An empty tag will match all nodes.
func (*Node[T]) Match ¶
Match looks for the text in the node and return true if it is present. Note that calls to this method should always pass in text that has already been run through strings.ToLower().
func (*Node[T]) PartialMatchExceptTag ¶
PartialMatchExceptTag returns true if the specified text is present in the node's displayable columns other than the the tags column. An empty text will match all nodes.
func (*Node[T]) SetChildren ¶
SetChildren implements unison.TableRowData.
type NonEditableField ¶
NonEditableField holds the data for a non-editable field.
func NewNonEditableField ¶
func NewNonEditableField(syncer func(*NonEditableField)) *NonEditableField
NewNonEditableField creates a new start-aligned non-editable field that uses the same font and size as the field.
func (*NonEditableField) Sync ¶
func (f *NonEditableField) Sync()
Sync the field to the current value.
type NonEditablePageField ¶
NonEditablePageField holds the data for a non-editable page field.
func NewNonEditablePageField ¶
func NewNonEditablePageField(syncer func(*NonEditablePageField)) *NonEditablePageField
NewNonEditablePageField creates a new start-aligned non-editable field that uses the same font and size as the page field.
func NewNonEditablePageFieldCenter ¶
func NewNonEditablePageFieldCenter(syncer func(*NonEditablePageField)) *NonEditablePageField
NewNonEditablePageFieldCenter creates a new center-aligned non-editable field that uses the same font and size as the page field.
func NewNonEditablePageFieldEnd ¶
func NewNonEditablePageFieldEnd(syncer func(*NonEditablePageField)) *NonEditablePageField
NewNonEditablePageFieldEnd creates a new end-aligned non-editable field that uses the same font and size as the page field.
func (*NonEditablePageField) Sync ¶
func (f *NonEditablePageField) Sync()
Sync the field to the current value.
type NumericField ¶
type NumericField[T xmath.Numeric] struct { *unison.Field Format func(T) string // contains filtered or unexported fields }
NumericField holds a numeric value that can be edited.
func NewNumericField ¶
func NewNumericField[T xmath.Numeric](targetMgr *TargetMgr, targetKey, undoTitle string, getPrototypes func(minValue, maxValue T) []T, get func() T, set func(T), format func(T) string, extract func(s string) (T, error), minValue, maxValue T) *NumericField[T]
NewNumericField creates a new field that formats its content.
func NewNumericFieldWithException ¶ added in v5.8.0
func NewNumericFieldWithException[T xmath.Numeric](targetMgr *TargetMgr, targetKey, undoTitle string, getPrototypes func(minValue, maxValue T) []T, get func() T, set func(T), format func(T) string, extract func(s string) (T, error), minValue, maxValue, exception T) *NumericField[T]
NewNumericFieldWithException creates a new field that formats its content and can hold an exceptional value (one outside of the minimum/maximum range.
func (*NumericField[T]) CurrentValue ¶ added in v5.14.0
func (f *NumericField[T]) CurrentValue() T
CurrentValue returns the current committed value, which may not be the same as the value showing.
func (*NumericField[T]) Exception ¶ added in v5.8.0
func (f *NumericField[T]) Exception() T
Exception returns the exception value.
func (*NumericField[T]) HasException ¶ added in v5.8.0
func (f *NumericField[T]) HasException() bool
HasException returns true if an exception value can be used.
func (*NumericField[T]) Max ¶
func (f *NumericField[T]) Max() T
Max returns the maximum value allowed.
func (*NumericField[T]) Min ¶
func (f *NumericField[T]) Min() T
Min returns the minimum value allowed.
func (*NumericField[T]) SetMarksModified ¶
func (f *NumericField[T]) SetMarksModified(marksModified bool)
SetMarksModified sets whether this field will attempt to mark its ModifiableRoot as modified. Default is true.
func (*NumericField[T]) SetMinMax ¶
func (f *NumericField[T]) SetMinMax(minValue, maxValue T)
SetMinMax sets the minimum and maximum values and then adjusts the minimum text width, if a prototype function has been set.
func (*NumericField[T]) Sync ¶
func (f *NumericField[T]) Sync()
Sync the field to the current value.
type PDFDockable ¶
PDFDockable holds the view for a PDFRenderer file.
func (*PDFDockable) AttemptClose ¶
func (d *PDFDockable) AttemptClose() bool
AttemptClose implements unison.TabCloser
func (*PDFDockable) BackingFilePath ¶
func (d *PDFDockable) BackingFilePath() string
BackingFilePath implements workspace.FileBackedDockable
func (*PDFDockable) ClearHistory ¶
func (d *PDFDockable) ClearHistory()
ClearHistory clears the existing history.
func (*PDFDockable) Forward ¶
func (d *PDFDockable) Forward()
Forward moves forward in history one step.
func (*PDFDockable) LoadPage ¶
func (d *PDFDockable) LoadPage(pageNumber int)
LoadPage loads the specified page.
func (*PDFDockable) MayAttemptClose ¶
func (d *PDFDockable) MayAttemptClose() bool
MayAttemptClose implements unison.TabCloser
func (*PDFDockable) Modified ¶
func (d *PDFDockable) Modified() bool
Modified implements workspace.FileBackedDockable
func (*PDFDockable) SetBackingFilePath ¶
func (d *PDFDockable) SetBackingFilePath(p string)
SetBackingFilePath implements workspace.FileBackedDockable
func (*PDFDockable) SetSearchText ¶
func (d *PDFDockable) SetSearchText(text string)
SetSearchText sets the search text and updates the display.
func (*PDFDockable) Title ¶
func (d *PDFDockable) Title() string
Title implements workspace.FileBackedDockable
func (*PDFDockable) TitleIcon ¶
func (d *PDFDockable) TitleIcon(suggestedSize unison.Size) unison.Drawable
TitleIcon implements workspace.FileBackedDockable
func (*PDFDockable) Tooltip ¶
func (d *PDFDockable) Tooltip() string
Tooltip implements workspace.FileBackedDockable
type PDFLink ¶
PDFLink holds a single link on a page. If PageNumber if >= 0, then this is an internal link and the URI will be empty.
type PDFPage ¶
type PDFPage struct { Error error PageNumber int Image *unison.Image TOC []*PDFTableOfContents Links []*PDFLink Matches []unison.Rect }
PDFPage holds a rendered PDFRenderer page.
type PDFRenderer ¶
type PDFRenderer struct {
// contains filtered or unexported fields
}
PDFRenderer holds a PDFRenderer page renderer.
func NewPDFRenderer ¶
func NewPDFRenderer(filePath string, pageLoadedCallback func()) (*PDFRenderer, error)
NewPDFRenderer creates a new PDFRenderer page renderer.
func (*PDFRenderer) CurrentPage ¶
func (p *PDFRenderer) CurrentPage() *PDFPage
CurrentPage returns the currently rendered page.
func (*PDFRenderer) LoadPage ¶
func (p *PDFRenderer) LoadPage(pageNumber int, search string)
LoadPage requests the given page to be loaded and rendered.
func (*PDFRenderer) MostRecentPageNumber ¶
func (p *PDFRenderer) MostRecentPageNumber() int
MostRecentPageNumber returns the most recent page number that has been asked to be rendered.
func (*PDFRenderer) PageCount ¶
func (p *PDFRenderer) PageCount() int
PageCount returns the total page count.
func (*PDFRenderer) RenderingFinished ¶
func (p *PDFRenderer) RenderingFinished() (finished bool, pageNumber int, requested time.Time)
RenderingFinished returns true if there is no rendering being done for this PDFRenderer at the moment.
func (*PDFRenderer) RequestRenderPriority ¶
func (p *PDFRenderer) RequestRenderPriority()
RequestRenderPriority attempts to bump this PDFRenderer's rendering to the head of the queue.
type PDFTableOfContents ¶
type PDFTableOfContents struct { Title string PageNumber int PageLocation unison.Point Children []*PDFTableOfContents }
PDFTableOfContents holds a table of contents entry.
type Page ¶
Page holds a logical page worth of content.
func (*Page) ApplyPreferredSize ¶
func (p *Page) ApplyPreferredSize()
ApplyPreferredSize to this panel.
func (*Page) LayoutSizes ¶
LayoutSizes implements unison.Layout
func (*Page) PerformLayout ¶
PerformLayout implements unison.Layout
type PageList ¶
type PageList[T gurps.NodeTypes] struct { unison.Panel Table *unison.Table[*Node[T]] // contains filtered or unexported fields }
PageList holds a list for a sheet page.
func NewCarriedEquipmentPageList ¶
func NewCarriedEquipmentPageList(owner Rebuildable, provider gurps.ListProvider) *PageList[*gurps.Equipment]
NewCarriedEquipmentPageList creates the carried equipment page list.
func NewConditionalModifiersPageList ¶
func NewConditionalModifiersPageList(entity *gurps.Entity) *PageList[*gurps.ConditionalModifier]
NewConditionalModifiersPageList creates the conditional modifiers page list.
func NewMeleeWeaponsPageList ¶
NewMeleeWeaponsPageList creates the melee weapons page list.
func NewNotesPageList ¶
func NewNotesPageList(owner Rebuildable, provider gurps.ListProvider) *PageList[*gurps.Note]
NewNotesPageList creates the notes page list.
func NewOtherEquipmentPageList ¶
func NewOtherEquipmentPageList(owner Rebuildable, provider gurps.ListProvider) *PageList[*gurps.Equipment]
NewOtherEquipmentPageList creates the other equipment page list.
func NewRangedWeaponsPageList ¶
NewRangedWeaponsPageList creates the ranged weapons page list.
func NewReactionsPageList ¶
func NewReactionsPageList(entity *gurps.Entity) *PageList[*gurps.ConditionalModifier]
NewReactionsPageList creates the reaction modifiers page list.
func NewSkillsPageList ¶
func NewSkillsPageList(owner Rebuildable, provider gurps.ListProvider) *PageList[*gurps.Skill]
NewSkillsPageList creates the skills page list.
func NewSpellsPageList ¶
func NewSpellsPageList(owner Rebuildable, provider gurps.SpellListProvider) *PageList[*gurps.Spell]
NewSpellsPageList creates the spells page list.
func NewTraitsPageList ¶
func NewTraitsPageList(owner Rebuildable, provider gurps.ListProvider) *PageList[*gurps.Trait]
NewTraitsPageList creates the traits page list.
func (*PageList[T]) ApplySelection ¶
ApplySelection locates the rows with the given IDs and selects them, replacing any existing selection.
func (*PageList[T]) CreateItem ¶
func (p *PageList[T]) CreateItem(owner Rebuildable, variant ItemVariant)
CreateItem calls CreateItem on the contained TableProvider.
func (*PageList[T]) CurrentDrawRowRange ¶
CurrentDrawRowRange returns the current row range that will be drawn.
func (*PageList[T]) OverheadHeight ¶
OverheadHeight returns the overhead for this page list, i.e. the border and header space.
func (*PageList[T]) RecordSelection ¶
RecordSelection collects the currently selected row IDs.
func (*PageList[T]) RowHeights ¶
RowHeights returns the heights of each row.
func (*PageList[T]) SelectedNodes ¶
SelectedNodes returns the set of selected nodes. If 'minimal' is true, then children of selected rows that may also be selected are not returned, just the topmost row that is selected in any given hierarchy.
func (*PageList[T]) SetDrawRowRange ¶
SetDrawRowRange sets the row range that will be drawn.
type PageTableColumnHeader ¶
type PageTableColumnHeader[T gurps.NodeTypes] struct { *unison.Label // contains filtered or unexported fields }
PageTableColumnHeader provides a default page table column header panel.
func NewPageTableColumnHeader ¶
func NewPageTableColumnHeader[T gurps.NodeTypes](title, tooltip string) *PageTableColumnHeader[T]
NewPageTableColumnHeader creates a new page table column header panel with the given title.
func (*PageTableColumnHeader[T]) DefaultDraw ¶
func (h *PageTableColumnHeader[T]) DefaultDraw(gc *unison.Canvas, dirty unison.Rect)
DefaultDraw provides the default drawing.
func (*PageTableColumnHeader[T]) DefaultMouseUp ¶
func (h *PageTableColumnHeader[T]) DefaultMouseUp(where unison.Point, _ int, _ unison.Modifiers) bool
DefaultMouseUp provides the default mouse up handling.
func (*PageTableColumnHeader[T]) DefaultSizes ¶
func (h *PageTableColumnHeader[T]) DefaultSizes(hint unison.Size) (minSize, prefSize, maxSize unison.Size)
DefaultSizes provides the default sizing.
func (*PageTableColumnHeader[T]) SetSortState ¶
func (h *PageTableColumnHeader[T]) SetSortState(state unison.SortState)
SetSortState sets the SortState.
func (*PageTableColumnHeader[T]) SortState ¶
func (h *PageTableColumnHeader[T]) SortState() unison.SortState
SortState returns the current SortState.
type PercentageField ¶
type PercentageField = NumericField[int]
PercentageField is field that holds a percentage.
func NewPercentageField ¶
func NewPercentageField(targetMgr *TargetMgr, targetKey, undoTitle string, get func() int, set func(int), minValue, maxValue int, forceSign, noMinWidth bool) *PercentageField
NewPercentageField creates a new field that holds a percentage.
func NewScaleField ¶
func NewScaleField(minValue, maxValue int, defValue, get func() int, set func(int), afterApply func(), attemptCenter bool, scroller *unison.ScrollPanel) *PercentageField
NewScaleField creates a new scale field and hooks it into the target.
type PointsPanel ¶
PointsPanel holds the contents of the points block on the sheet.
func NewPointsPanel ¶
func NewPointsPanel(entity *gurps.Entity, targetMgr *TargetMgr) *PointsPanel
NewPointsPanel creates a new points panel.
type Popup ¶
type Popup[T comparable] struct { *unison.PopupMenu[T] // contains filtered or unexported fields }
Popup provides a popup menu that works with undo.
type PortraitPanel ¶
PortraitPanel holds the contents of the portrait block on the sheet.
func NewPortraitPanel ¶
func NewPortraitPanel(entity *gurps.Entity) *PortraitPanel
NewPortraitPanel creates a new portrait panel.
type PreservedTableData ¶
PreservedTableData holds the data and selection state of a table in a serialized form.
type Rebuildable ¶
Rebuildable defines the methods a rebuildable panel should provide.
type Selectable ¶
Selectable panels can have their selection queried and set.
type SettingsDockable ¶
type SettingsDockable struct { unison.Panel TabTitle string TabIcon *unison.SVG Extensions []string Loader func(fileSystem fs.FS, filePath string) error Saver func(filePath string) error Resetter func() ModifiedCallback func() bool WillCloseCallback func() bool }
SettingsDockable holds common settings dockable data.
func (*SettingsDockable) AttemptClose ¶
func (d *SettingsDockable) AttemptClose() bool
AttemptClose implements unison.TabCloser
func (*SettingsDockable) MarkModified ¶
func (d *SettingsDockable) MarkModified(_ unison.Paneler)
MarkModified implements widget.ModifiableRoot
func (*SettingsDockable) MayAttemptClose ¶
func (d *SettingsDockable) MayAttemptClose() bool
MayAttemptClose implements unison.TabCloser
func (*SettingsDockable) Modified ¶
func (d *SettingsDockable) Modified() bool
Modified implements unison.Dockable
func (*SettingsDockable) Setup ¶
func (d *SettingsDockable) Setup(addToStartToolbar, addToEndToolbar, initContent func(*unison.Panel))
Setup the dockable and display it.
func (*SettingsDockable) Title ¶
func (d *SettingsDockable) Title() string
Title implements unison.Dockable
func (*SettingsDockable) TitleIcon ¶
func (d *SettingsDockable) TitleIcon(suggestedSize unison.Size) unison.Drawable
TitleIcon implements unison.Dockable
func (*SettingsDockable) Tooltip ¶
func (d *SettingsDockable) Tooltip() string
Tooltip implements unison.Dockable
type Sheet ¶
type Sheet struct { unison.Panel Reactions *PageList[*gurps.ConditionalModifier] ConditionalModifiers *PageList[*gurps.ConditionalModifier] MeleeWeapons *PageList[*gurps.Weapon] RangedWeapons *PageList[*gurps.Weapon] Traits *PageList[*gurps.Trait] Skills *PageList[*gurps.Skill] Spells *PageList[*gurps.Spell] CarriedEquipment *PageList[*gurps.Equipment] OtherEquipment *PageList[*gurps.Equipment] Notes *PageList[*gurps.Note] // contains filtered or unexported fields }
Sheet holds the view for a GURPS character sheet.
func OpenSheets ¶
OpenSheets returns the currently open sheets.
func (*Sheet) AttemptClose ¶
AttemptClose implements unison.TabCloser
func (*Sheet) BackingFilePath ¶
BackingFilePath implements workspace.FileBackedDockable
func (*Sheet) DockableKind ¶
DockableKind implements widget.DockableKind
func (*Sheet) MarkModified ¶
MarkModified implements widget.ModifiableRoot.
func (*Sheet) MayAttemptClose ¶
MayAttemptClose implements unison.TabCloser
func (*Sheet) SetBackingFilePath ¶
SetBackingFilePath implements workspace.FileBackedDockable
func (*Sheet) SheetSettingsUpdated ¶
SheetSettingsUpdated implements gurps.SheetSettingsResponder.
func (*Sheet) UndoManager ¶
func (s *Sheet) UndoManager() *unison.UndoManager
UndoManager implements undo.Provider
type StringField ¶
StringField holds the value for a string field.
func NewMultiLineStringField ¶
func NewMultiLineStringField(targetMgr *TargetMgr, targetKey, undoTitle string, get func() string, set func(string)) *StringField
NewMultiLineStringField creates a new field for editing a string.
func NewStringField ¶
func NewStringField(targetMgr *TargetMgr, targetKey, undoTitle string, get func() string, set func(string)) *StringField
NewStringField creates a new field for editing a string.
func NewStringPageField ¶
func NewStringPageField(targetMgr *TargetMgr, targetKey, undoTitle string, get func() string, set func(string)) *StringField
NewStringPageField creates a new text entry field for a sheet page.
func NewStringPageFieldNoGrab ¶
func NewStringPageFieldNoGrab(targetMgr *TargetMgr, targetKey, undoTitle string, get func() string, set func(string)) *StringField
NewStringPageFieldNoGrab creates a new text entry field for a sheet page, but with HGrab set to false.
type Syncer ¶
type Syncer interface {
Sync()
}
Syncer should be called to sync an object's UI state to its model.
type TableDockable ¶
type TableDockable[T gurps.NodeTypes] struct { unison.Panel // contains filtered or unexported fields }
TableDockable holds the view for a file that contains a (potentially hierarchical) list of data.
func NewEquipmentModifierTableDockable ¶
func NewEquipmentModifierTableDockable(filePath string, modifiers []*gurps.EquipmentModifier) *TableDockable[*gurps.EquipmentModifier]
NewEquipmentModifierTableDockable creates a new unison.Dockable for equipment modifier list files.
func NewEquipmentTableDockable ¶
func NewEquipmentTableDockable(filePath string, equipment []*gurps.Equipment) *TableDockable[*gurps.Equipment]
NewEquipmentTableDockable creates a new unison.Dockable for equipment list files.
func NewNoteTableDockable ¶
NewNoteTableDockable creates a new unison.Dockable for note list files.
func NewSkillTableDockable ¶
NewSkillTableDockable creates a new unison.Dockable for skill list files.
func NewSpellTableDockable ¶
NewSpellTableDockable creates a new unison.Dockable for spell list files.
func NewTableDockable ¶
func NewTableDockable[T gurps.NodeTypes](filePath, extension string, provider TableProvider[T], saver func(path string) error, canCreateIDs ...int) *TableDockable[T]
NewTableDockable creates a new TableDockable for list data files.
func NewTraitModifierTableDockable ¶
func NewTraitModifierTableDockable(filePath string, modifiers []*gurps.TraitModifier) *TableDockable[*gurps.TraitModifier]
NewTraitModifierTableDockable creates a new unison.Dockable for trait modifier list files.
func NewTraitTableDockable ¶
NewTraitTableDockable creates a new unison.Dockable for trait list files.
func (*TableDockable[T]) AllTags ¶ added in v5.11.0
func (d *TableDockable[T]) AllTags() []string
AllTags returns all tags currently present in the data.
func (*TableDockable[T]) ApplyFilter ¶ added in v5.11.0
func (d *TableDockable[T]) ApplyFilter(tags []string)
ApplyFilter applies the current filtering, if any.
func (*TableDockable[T]) AttemptClose ¶
func (d *TableDockable[T]) AttemptClose() bool
AttemptClose implements unison.TabCloser
func (*TableDockable[T]) BackingFilePath ¶
func (d *TableDockable[T]) BackingFilePath() string
BackingFilePath implements workspace.FileBackedDockable
func (*TableDockable[T]) DockableKind ¶
func (d *TableDockable[T]) DockableKind() string
DockableKind implements widget.DockableKind
func (*TableDockable[T]) Entity ¶
func (d *TableDockable[T]) Entity() *gurps.Entity
Entity implements gurps.EntityProvider
func (*TableDockable[T]) Hash ¶ added in v5.28.0
func (d *TableDockable[T]) Hash(h hash.Hash)
Hash writes this object's contents into the hasher.
func (*TableDockable[T]) MarkModified ¶
func (d *TableDockable[T]) MarkModified(_ unison.Paneler)
MarkModified implements widget.ModifiableRoot.
func (*TableDockable[T]) MayAttemptClose ¶
func (d *TableDockable[T]) MayAttemptClose() bool
MayAttemptClose implements unison.TabCloser
func (*TableDockable[T]) Modified ¶
func (d *TableDockable[T]) Modified() bool
Modified implements workspace.FileBackedDockable
func (*TableDockable[T]) Rebuild ¶
func (d *TableDockable[T]) Rebuild(_ bool)
Rebuild implements widget.Rebuildable.
func (*TableDockable[T]) SetBackingFilePath ¶
func (d *TableDockable[T]) SetBackingFilePath(p string)
SetBackingFilePath implements workspace.FileBackedDockable
func (*TableDockable[T]) String ¶
func (d *TableDockable[T]) String() string
func (*TableDockable[T]) Title ¶
func (d *TableDockable[T]) Title() string
Title implements workspace.FileBackedDockable
func (*TableDockable[T]) TitleIcon ¶
func (d *TableDockable[T]) TitleIcon(suggestedSize unison.Size) unison.Drawable
TitleIcon implements workspace.FileBackedDockable
func (*TableDockable[T]) Tooltip ¶
func (d *TableDockable[T]) Tooltip() string
Tooltip implements workspace.FileBackedDockable
func (*TableDockable[T]) UndoManager ¶
func (d *TableDockable[T]) UndoManager() *unison.UndoManager
UndoManager implements undo.Provider
type TableDragUndoEditData ¶
type TableDragUndoEditData[T gurps.NodeTypes] struct { From *TableUndoEditData[T] To *TableUndoEditData[T] }
TableDragUndoEditData holds the undo edit data for a table drag.
func NewTableDragUndoEditData ¶
func NewTableDragUndoEditData[T gurps.NodeTypes](from, to *unison.Table[*Node[T]]) *TableDragUndoEditData[T]
NewTableDragUndoEditData collects the undo edit data for a table drag.
func (*TableDragUndoEditData[T]) Apply ¶
func (t *TableDragUndoEditData[T]) Apply()
Apply the undo edit data to a table.
type TableProvider ¶
type TableProvider[T gurps.NodeTypes] interface { unison.TableModel[*Node[T]] gurps.DataOwnerProvider SetTable(table *unison.Table[*Node[T]]) RootData() []T SetRootData(data []T) DragKey() string DragSVG() *unison.SVG DropShouldMoveData(from, to *unison.Table[*Node[T]]) bool ProcessDropData(from, to *unison.Table[*Node[T]]) AltDropSupport() *AltDropSupport ItemNames() (singular, plural string) Headers() []unison.TableColumnHeader[*Node[T]] SyncHeader(headers []unison.TableColumnHeader[*Node[T]]) ColumnIDs() []int HierarchyColumnID() int ExcessWidthColumnID() int ContextMenuItems() []ContextMenuItem OpenEditor(owner Rebuildable, table *unison.Table[*Node[T]]) CreateItem(owner Rebuildable, table *unison.Table[*Node[T]], variant ItemVariant) Serialize() ([]byte, error) Deserialize(data []byte) error RefKey() string AllTags() []string }
TableProvider defines the methods a table provider must contain.
func NewConditionalModifiersProvider ¶
func NewConditionalModifiersProvider(provider gurps.ConditionalModifierListProvider) TableProvider[*gurps.ConditionalModifier]
NewConditionalModifiersProvider creates a new table provider for conditional modifiers.
func NewEquipmentModifiersProvider ¶
func NewEquipmentModifiersProvider(provider gurps.EquipmentModifierListProvider, forEditor bool) TableProvider[*gurps.EquipmentModifier]
NewEquipmentModifiersProvider creates a new table provider for equipment modifiers.
func NewEquipmentProvider ¶
func NewEquipmentProvider(provider gurps.EquipmentListProvider, carried, forPage bool) TableProvider[*gurps.Equipment]
NewEquipmentProvider creates a new table provider for equipment. 'carried' is only relevant if 'forPage' is true.
func NewNotesProvider ¶
func NewNotesProvider(provider gurps.NoteListProvider, forPage bool) TableProvider[*gurps.Note]
NewNotesProvider creates a new table provider for notes.
func NewReactionModifiersProvider ¶
func NewReactionModifiersProvider(provider gurps.ReactionModifierListProvider) TableProvider[*gurps.ConditionalModifier]
NewReactionModifiersProvider creates a new table provider for reaction modifiers.
func NewSkillsProvider ¶
func NewSkillsProvider(provider gurps.SkillListProvider, forPage bool) TableProvider[*gurps.Skill]
NewSkillsProvider creates a new table provider for skills.
func NewSpellsProvider ¶
func NewSpellsProvider(provider gurps.SpellListProvider, forPage bool) TableProvider[*gurps.Spell]
NewSpellsProvider creates a new table provider for spells.
func NewTraitModifiersProvider ¶
func NewTraitModifiersProvider(provider gurps.TraitModifierListProvider, forEditor bool) TableProvider[*gurps.TraitModifier]
NewTraitModifiersProvider creates a new table provider for trait modifiers.
func NewTraitsProvider ¶
func NewTraitsProvider(provider gurps.TraitListProvider, forPage bool) TableProvider[*gurps.Trait]
NewTraitsProvider creates a new table provider for traits.
func NewWeaponsProvider ¶
func NewWeaponsProvider(provider gurps.WeaponListProvider, melee, forPage bool) TableProvider[*gurps.Weapon]
NewWeaponsProvider creates a new table provider for weapons.
type TableUndoEditData ¶
type TableUndoEditData[T gurps.NodeTypes] struct { Table *unison.Table[*Node[T]] Data PreservedTableData[T] }
TableUndoEditData holds the data necessary to provide undo for a table.
func NewTableUndoEditData ¶
NewTableUndoEditData collects the undo edit data for a table.
func (*TableUndoEditData[T]) Apply ¶
func (t *TableUndoEditData[T]) Apply()
Apply the undo edit data to a table.
type TagProvider ¶ added in v5.11.0
TagProvider defines the methods required for the tag filter popup.
type TargetMgr ¶
type TargetMgr struct {
// contains filtered or unexported fields
}
TargetMgr provides management of target panels.
func NewTargetMgr ¶
NewTargetMgr creates a new TargetMgr with the given root.
func (*TargetMgr) CurrentFocusRef ¶
CurrentFocusRef returns the current FocusRef, if any.
func (*TargetMgr) Find ¶
Find searches the tree of panels starting at the root, looking for a specific refKey.
func (*TargetMgr) NextPrefix ¶
NextPrefix returns the next unique prefix to use.
type TargetUndo ¶
TargetUndo provides undo support for fields that may be swapped out during updates by using a TargetMgr to locate the real target.
func NewTargetUndo ¶
func NewTargetUndo[T any](targetMgr *TargetMgr, targetKey, title string, undoID int64, applyCallback func(target *unison.Panel, data T), beforeData T) *TargetUndo[T]
NewTargetUndo creates a new undo that supports having a revisable target.
type Template ¶
type Template struct { unison.Panel Traits *PageList[*gurps.Trait] Skills *PageList[*gurps.Skill] Spells *PageList[*gurps.Spell] Equipment *PageList[*gurps.Equipment] Notes *PageList[*gurps.Note] // contains filtered or unexported fields }
Template holds the view for a GURPS character template.
func NewTemplate ¶
NewTemplate creates a new unison.Dockable for GURPS template files.
func OpenTemplates ¶
OpenTemplates returns the currently open templates.
func (*Template) AttemptClose ¶
AttemptClose implements unison.TabCloser
func (*Template) BackingFilePath ¶
BackingFilePath implements workspace.FileBackedDockable
func (*Template) DockableKind ¶
DockableKind implements widget.DockableKind
func (*Template) MarkModified ¶
MarkModified implements widget.ModifiableRoot.
func (*Template) MayAttemptClose ¶
MayAttemptClose implements unison.TabCloser
func (*Template) SetBackingFilePath ¶
SetBackingFilePath implements workspace.FileBackedDockable
func (*Template) SheetSettingsUpdated ¶
SheetSettingsUpdated implements gurps.SheetSettingsResponder.
func (*Template) UndoManager ¶
func (t *Template) UndoManager() *unison.UndoManager
UndoManager implements undo.Provider
type TitledBorder ¶
TitledBorder provides a titled line border.
func (*TitledBorder) Draw ¶
func (t *TitledBorder) Draw(gc *unison.Canvas, rect unison.Rect)
Draw implements unison.Border
func (*TitledBorder) Insets ¶
func (t *TitledBorder) Insets() unison.Insets
Insets implements unison.Border
type WeightField ¶
type WeightField = NumericField[fxp.Weight]
WeightField is field that holds a weight value.
Source Files ¶
- about.go
- actions.go
- adjust_eqp_level.go
- adjust_points.go
- adjust_quantity.go
- adjust_skill_level.go
- adjust_tech_level.go
- adjust_trait_level.go
- adjust_uses.go
- app_updater.go
- attr_def_settings_panel.go
- attr_panel.go
- attribute_settings_dockable.go
- body_panel.go
- body_settings_dockable.go
- body_settings_panel.go
- body_settings_sub_table_panel.go
- calculator.go
- campaign.go
- checkbox.go
- color_settings.go
- conditional_modifiers_provider.go
- container_conversion.go
- damage_panel.go
- decimal_field.go
- defaults_panel.go
- description_panel.go
- document_dock.go
- drag_handle.go
- drawable_svg_pair.go
- editor.go
- editor_header.go
- editor_table.go
- encumbrance_panel.go
- equipment_editor.go
- equipment_modifier_editor.go
- equipment_modifier_table.go
- equipment_modifiers_panel.go
- equipment_modifiers_provider.go
- equipment_provider.go
- equipment_table.go
- features_panel.go
- field_label.go
- file_types.go
- font_settings.go
- general_settings_dockable.go
- handoff.go
- helpers.go
- hit_location_settings_panel.go
- identity_panel.go
- img_dockable.go
- infopop.go
- integer_field.go
- length_field.go
- library_settings.go
- library_update.go
- lifting_panel.go
- link_resolution.go
- markdown_dockable.go
- menu_key_settings.go
- menus.go
- menus_other.go
- misc_panel.go
- modifier_processing.go
- nameables_processing.go
- navigator.go
- navigator_node.go
- non_editable_field.go
- note_editor.go
- note_table.go
- notes_provider.go
- numeric_field.go
- page.go
- page_blocks.go
- page_exporter.go
- page_list.go
- page_non_editable_field.go
- page_ref.go
- page_widgets.go
- pageref_mappings_dockable.go
- pageref_name_mappings.go
- pdf_dockable.go
- pdf_queue.go
- pdf_renderer.go
- percentage_field.go
- platform_linux.go
- points_editor.go
- points_panel.go
- pool_settings_panel.go
- popup.go
- portait_panel.go
- portrait_layout.go
- prereq_panel.go
- preserved_table_data.go
- reactions_provider.go
- scale.go
- search_field.go
- search_tracker.go
- separator.go
- settings_dockable.go
- sheet.go
- sheet_settings_dockable.go
- skill_editor.go
- skill_table.go
- skills_provider.go
- spell_editor.go
- spell_table.go
- spells_provider.go
- startup.go
- string_field.go
- study_panel.go
- table.go
- table_dockable.go
- table_drop.go
- table_node.go
- table_undo.go
- tag_filter.go
- target_manager.go
- target_undo.go
- template.go
- template_content.go
- template_undo.go
- threshold_settings_panel.go
- titled_border.go
- toc_node.go
- toggle_disabled.go
- toggle_equipped.go
- trait_editor.go
- trait_modifier_editor.go
- trait_modifier_table.go
- trait_modifiers_panel.go
- trait_modifiers_provider.go
- trait_table.go
- traits_provider.go
- updatable_library_cell.go
- weapon_editor.go
- weapons_panel.go
- weapons_provider.go
- web_settings_dockable.go
- weight_field.go
- widgets.go
- workspace.go