Exemple #1
0
from BritefuryJ.Pres.RichText import TitleBar, HSeparator, Head, Body, Page, SplitLinkHeaderBar, NormalText, StrongSpan, EmphSpan
from BritefuryJ.Pres.UI import Section, SectionHeading1
from BritefuryJ.Pres.Help import AttachTooltip, TipBox

from BritefuryJ.Projection import Perspective

from LarchCore.MainApp import Application
from LarchCore.MainApp import DocumentManagement

_appDocRightPadding = 30.0
_controlsPadding = 5.0
_appDocumentControlsStyle = StyleSheet.style(Primitive.rowSpacing(20.0))
_appDocumentControlsBorder = FilledBorder(5.0, 5.0, 5.0, 5.0,
                                          Color(0.9, 0.9, 0.9))
_documentListTableStyle = StyleSheet.style(Primitive.tableColumnSpacing(15.0),
                                           Primitive.tableRowSpacing(5.0))


def _newDocumentName(docs):
    usedNames = set([doc.getName() for doc in docs])

    name = 'Untitled'
    if name not in usedNames:
        return name

    index = 2
    name = 'Untitled' + str(index)
    while name in usedNames:
        index += 1
        name = 'Untitled' + str(index)
from BritefuryJ.Controls import Button, RealSpinEntry

from BritefuryJ.Pres import Pres
from BritefuryJ.Pres.Primitive import Primitive, Label, Bin, Row, Column, Table

from BritefuryJ.StyleSheet import StyleSheet

from LarchCore.Languages.Python2 import Schema as Py

from LarchTools.PythonTools.GUIEditor.DataModel import GUIObject, TypedEvalField



_uniformStyle = StyleSheet.style(Primitive.foreground(Color(0.2, 0.25, 0.3)), Primitive.fontSize(11))
_boxStyle = StyleSheet.style(Primitive.background(FilledOutlinePainter(Color(0.7, 0.75, 0.8), Color(0.6, 0.65, 0.7))), Primitive.fontSize(11), Primitive.foreground(Color(0.0, 0.0, 0.0, 0.5)), Primitive.fontItalic(True))
_tableStyle = StyleSheet.style(Primitive.tableColumnSpacing(2.0), Primitive.tableRowSpacing(2.0))
_liveLabelStyle = StyleSheet.style(Primitive.foreground(Color(0.4, 0.45, 0.5)))



class AbstractPadding (GUIObject):
	def apply(self, p):
		raise NotImplementedError, 'abstract'

	def __apply_py_evalmodel__(self, codeGen, py_p):
		raise NotImplementedError, 'abstract'



def _liveLabel(live):
	@LiveFunction