Ejemplo n.º 1
0
 def ApplyAttributes(self, attributes):
     super(uicls.CameraDebugWindow, self).ApplyAttributes(attributes)
     self.SetMinSize([self.default_width, self.default_height])
     self.SetCaption('Camera Debug Window')
     self.sr.content.padding = (5, 16, 5, 5)
     self.debugSelectionClient = sm.GetService('debugSelectionClient')
     self.cameraDebugClient = sm.GetService('cameraDebugClient')
     self.cameraClient = sm.GetService('cameraClient')
     self.cameraStack = uicls.Label(parent=self.sr.content, align=uiconst.TOPLEFT, text=self.PrintCameraStack())
     buttonContainer = uicls.Container(parent=self.sr.content, align=uiconst.TOBOTTOM, height=70, padding=(150, 0, 150, 0))
     self.toggleCamera = uicls.Button(parent=buttonContainer, align=uiconst.TOBOTTOM, label='Activate Normal Camera', func=self.OnToggleDebugCamera)
     self.toggleCamUpdate = uicls.Button(parent=buttonContainer, align=uiconst.TOBOTTOM, label='Toggle Camera Update', func=self.OnToggleDebugCameraUpdate, hint='Toggle between updating the debug, and normal camera.')
     self.showCamCheckBox = uicls.Checkbox(parent=buttonContainer, aligh=uiconst.TOBOTTOM, text='Show Normal Camera', checked=False, callback=self.OnSnowNormalCameraCheckbox)
     self.cameraClient.AddSharedCamera('Debug Camera', cameras.DebugCamera())
     if type(self.cameraClient.GetActiveCamera()) is cameras.DebugCamera:
         self.DisableDebugCamera()
     self.EnableDebugCamera()
     sm.GetService('navigation').hasControl = False
Ejemplo n.º 2
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     cont = attributes.Get('cont')
     color = attributes.Get('color', util.Color.WHITE)
     show = attributes.Get('show', True)
     l, t, w, h = attributes.Get('pos', (0, 0, 0, 0))
     self.renderState = STATE_NORMAL
     self.oldState = STATE_NORMAL
     uicls.Frame(bgParent=self, color=color, width=2)
     self.fill = uicls.Fill(
         bgParent=self, color=util.Color(*color).SetAlpha(0.2).GetRGBA())
     label = cont.name
     self.label = uicls.Label(parent=self,
                              text=label,
                              align=uiconst.TOPLEFT,
                              state=uiconst.UI_HIDDEN,
                              top=-12,
                              color=color)
     if not show:
         self.ShowHidden()
Ejemplo n.º 3
0
 def AddText(self):
     left = self.type.get('left', 0)
     self.new = uicls.Container(name='textField',
                                parent=self.parent,
                                align=uiconst.TOTOP,
                                height=self.type.get('height', 20),
                                padding=(left, 0, 0, 0))
     fontsize = self.type.get('fontsize', 12)
     text = uicls.Label(
         text=self.type.get('text', ''),
         parent=self.new,
         align=uiconst.TOTOP,
         name='text',
         padding=(0, 3, 0, 3),
         fontsize=fontsize,
         maxLines=1 if bool(self.type.get('tabstops', [])) else None,
         state=uiconst.UI_NORMAL,
         tabs=self.type.get('tabstops', []))
     self.new.height = max(self.new.height, int(text.textheight + 6))
     self.refresh.append((self.new, text))
Ejemplo n.º 4
0
    def ApplyAttributes(self, attributes):
        uicls.Container.ApplyAttributes(self, attributes)
        self.entityID = attributes.entityID
        self.cursor = uiconst.UICURSOR_SELECT
        self.hoverFill = uicls.Fill(parent=self,
                                    color=(1.0, 1.0, 1.0, 0.0),
                                    padding=-50)
        uicls.ScreenFrame1(parent=self, align=uiconst.TOALL, padding=10)
        self.circles = []
        for i in xrange(1, 5):
            transform = uicls.Transform(parent=self,
                                        align=uiconst.CENTER,
                                        state=uiconst.UI_DISABLED,
                                        width=540,
                                        height=540,
                                        top=-26)
            circle = uicls.Sprite(
                parent=transform,
                texturePath='res:/UI/Texture/Classes/CQSideScreens/circle%s.png'
                % i,
                align=uiconst.TOALL)
            self.circles.append(transform)

        self.hoverLabel = uicls.Label(
            name='hoverLabel',
            parent=self,
            text=localization.GetByLabel('UI/Common/LocationTypes/Planets'),
            align=uiconst.CENTERBOTTOM,
            top=60,
            uppercase=True,
            fontsize=35,
            state=uiconst.UI_DISABLED,
            color=util.Color.WHITE)
        self.hoverLabel.opacity = 0.0
        self.bgSprite = uicls.Sprite(
            parent=self,
            texturePath='res:/UI/Texture/Classes/CQSideScreens/PIScreenBG.png',
            align=uiconst.TOALL,
            state=uiconst.UI_DISABLED,
            padding=-50)
        uthread.new(self.AnimCircles)
Ejemplo n.º 5
0
 def Prepare_(self):
     self.sr.clipper = uicls.Container(parent=self,
                                       align=uiconst.TOALL,
                                       padding=(6, 1, 6, 1),
                                       clipChildren=True,
                                       state=uiconst.UI_PICKCHILDREN,
                                       name='labelClipper')
     self.sr.label = uicls.Label(parent=self.sr.clipper,
                                 fontStyle=self.fontStyle,
                                 fontFamily=self.fontFamily,
                                 fontPath=self.fontPath,
                                 fontsize=self.fontsize,
                                 letterspace=1,
                                 uppercase=1,
                                 state=uiconst.UI_DISABLED,
                                 align=uiconst.CENTERLEFT,
                                 name='tabLabel')
     self.sr.underlay = uicls.Frame(parent=self,
                                    name='tabBackground',
                                    color=MAINCOLOR,
                                    frameConst=('ui_1_16_94', 7, 0))
Ejemplo n.º 6
0
 def ApplyAttributes(self, attributes):
     super(uicls.DebugSelectionWindow, self).ApplyAttributes(attributes)
     self.SetMinSize([40, self.default_height])
     self.SetCaption('Debug Selection')
     self.sr.content.padding = 5
     self.debugSelectionClient = sm.GetService('debugSelectionClient')
     self.debugSelectionClient._SetUpdateFunc(self._UpdateSelectionEntity)
     self.displayName = uicls.Label(parent=self.sr.content, align=uiconst.TOTOP, text=' ', padding=(0, 5, 0, 5))
     topContainer = uicls.Container(parent=self.sr.content, align=uiconst.CENTER, height=25)
     bottomContainer = uicls.Container(parent=self.sr.content, align=uiconst.CENTERBOTTOM, height=25)
     width = 0
     width += uicls.Button(parent=topContainer, align=uiconst.TOLEFT, label='Select Player', padding=(2, 0, 2, 0), func=self._SelectPlayer).width + 4
     width += uicls.Button(parent=topContainer, align=uiconst.TOLEFT, label='Select Target', padding=(2, 0, 2, 0), func=self._SelectSelected).width
     width += uicls.Button(parent=topContainer, align=uiconst.TOLEFT, label='Clear Selection', padding=(2, 0, 2, 0), func=self._ClearSelection).width + 4
     topContainer.width = width
     width = 0
     width += uicls.Button(parent=bottomContainer, align=uiconst.TOLEFT, label='Select Previous', padding=(2, 0, 2, 0), func=self._SelectPrevious).width + 4
     width += uicls.Button(parent=bottomContainer, align=uiconst.TOLEFT, label='Select Next', padding=(2, 0, 2, 0), func=self._SelectNext).width + 4
     bottomContainer.width = width
     self.SetMinSize([max(bottomContainer.width, topContainer.width) + 10, self.default_height])
     self._UpdateSelectionEntity(self.debugSelectionClient.GetSelectedID(), ' ')
Ejemplo n.º 7
0
 def GetTextWidth(self,
                  strng,
                  fontsize=12,
                  letterspace=0,
                  uppercase=0,
                  font=None,
                  fontPath=None,
                  fontStyle=None,
                  fontFamily=None):
     if not strng:
         return 0
     font = font
     fontsize = fontsize or fontConst.DEFAULT_FONTSIZE
     letterspace = letterspace or fontConst.DEFAULT_LETTERSPACE
     uppercase = uppercase or fontConst.DEFAULT_UPPERCASE
     cacheKey = (strng, fontsize, letterspace, uppercase, font,
                 uicore.fontSizeFactor)
     if cacheKey in self.textMeasureCache:
         return self.textMeasureCache[cacheKey]
     if '<br>' in strng:
         val = max([
             self.GetTextWidth(line, fontsize, letterspace, uppercase, font)
             for line in strng.split('<br>')
         ])
     else:
         textmeasurer = uicls.Label(text=uiutil.StripTags(strng,
                                                          ignoredTags=['b'
                                                                       ]),
                                    parent=None,
                                    align=uiconst.TOPLEFT,
                                    fontsize=fontsize,
                                    letterspace=letterspace,
                                    uppercase=uppercase,
                                    measuringText=True,
                                    fontPath=fontPath,
                                    fontStyle=fontStyle,
                                    fontFamily=fontFamily)
         val = textmeasurer.textwidth
     self.textMeasureCache[cacheKey] = val
     return val
Ejemplo n.º 8
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     self.charID = attributes.get('charID')
     self.timeout = attributes.get('timeout')
     self.isDragObject = True
     self.itemID = self.charID
     self.info = cfg.eveowners.Get(self.charID)
     self.activeBlink = None
     self.highlight = uicls.Fill(bgParent=self,
                                 color=(1, 1, 1, 0.1),
                                 state=uiconst.UI_HIDDEN)
     leftCont = uicls.Container(parent=self, align=uiconst.TOLEFT, width=54)
     self.time = uicls.Label(parent=leftCont,
                             name='counter',
                             text='',
                             fontsize=16,
                             bold=False,
                             align=uiconst.CENTERLEFT,
                             color=Colors.Engagement.GetRGBA(),
                             left=2 * const.defaultPadding)
     self.portrait = uicls.Sprite(parent=self,
                                  pos=(50, 0, 32, 32),
                                  state=uiconst.UI_DISABLED)
     uicls.EveLabelSmall(parent=self,
                         name='name',
                         text=self.info.ownerName,
                         align=uiconst.TOPLEFT,
                         top=1,
                         left=96)
     self.corpText = uicls.EveLabelSmall(parent=self,
                                         name='corporation',
                                         text='',
                                         align=uiconst.TOPLEFT,
                                         top=17,
                                         left=96)
     self.stateFlag = uicls.StateFlag(parent=self,
                                      align=uiconst.TOPRIGHT,
                                      pos=(13, 4, 9, 9))
     self.LoadData()
     sm.RegisterNotify(self)
Ejemplo n.º 9
0
 def LoadSettings(self):
     wnd = self.GetWnd()
     uicls.Label(
         text=
         '<br><b>Debug Settings</b> (changing these settings is <b>not</b> recommended):',
         parent=wnd.sr.settingsInner,
         align=uiconst.TOTOP)
     if wnd:
         for cfgname, value, label, checked, group in [
             [
                 'userotcache', None, 'Enable rot cache',
                 settings.public.generic.Get('userotcache', 1), None
             ],
             [
                 'lazyLoading', None, 'Enable Lazy model loading',
                 settings.public.generic.Get('lazyLoading', 1), None
             ],
             [
                 'preload', None, 'Enable Preloading',
                 settings.public.generic.Get('preload', 1), None
             ],
             [
                 'asyncLoad', None,
                 'Enable Asyncronous Loading (change requires reboot)',
                 settings.public.generic.Get('asyncLoad', 1), None
             ],
             [
                 'resourceUnloading', None, 'Enable Resource Unloading',
                 settings.public.generic.Get('resourceUnloading', 1), None
             ]
         ]:
             uicls.Checkbox(text=label,
                            parent=wnd.sr.settingsInner,
                            configName=cfgname,
                            retval=value,
                            checked=checked,
                            groupname=group,
                            callback=self.CheckBoxChange,
                            prefstype=('generic', ))
Ejemplo n.º 10
0
 def UpdateIcon(self):
     if self.iconLabelCont:
         self.iconLabelCont.Close()
     wnd = self.GetWindow()
     if not wnd:
         iconNum = self.btnData.iconPath
     elif self.IsSingleWindow():
         iconNum = wnd.iconNum
     else:
         wnds = self.GetAllWindows()
         iconNum = wnds[0].GetNeocomGroupIcon()
         self.iconLabelCont = uicls.Container(
             parent=self.iconTransform,
             align=uiconst.TOPRIGHT,
             pos=(1, 1, 13, 13),
             idx=0,
             bgColor=util.Color.GetGrayRGBA(0.7, 0.2))
         uicls.Label(parent=self.iconLabelCont,
                     align=uiconst.CENTER,
                     text='<b>%s' % len(wnds),
                     fontsize=10,
                     letterspace=-1)
     self.icon.SetTexturePath(self._GetPathFromIconNum(iconNum))
Ejemplo n.º 11
0
def AskChoice(caption='', question='', choices=[], modal=False):
    import uiconst
    import uicls
    wnd = GetFormWindow(caption)
    if question:
        label = uicls.Label(parent=wnd.sr.content,
                            text=question,
                            align=uiconst.TOTOP,
                            pos=(0, 0, 0, 0))
        wnd.SetMinSize((label.width + 20, wnd.GetMinHeight()))
    combo = uicls.Combo(parent=wnd.sr.content,
                        options=choices,
                        align=uiconst.TOTOP)
    AddFormControl(wnd,
                   combo,
                   'choice',
                   retval=None,
                   required=True,
                   errorcheck=None)
    if modal:
        if wnd.ShowModal() == uiconst.ID_OK:
            return wnd.result
    elif wnd.ShowDialog() == uiconst.ID_OK:
        return wnd.result
Ejemplo n.º 12
0
 def Prepare_ProgressBar_(self):
     if self.sr.progressText is None:
         par = uicls.Container(name='progressParent',
                               parent=self.sr.content,
                               align=uiconst.TOBOTTOM,
                               pos=(0, 0, 0, 20))
         self.sr.content.padding = 6
         fr = uicls.Frame(parent=par,
                          align=uiconst.TOBOTTOM,
                          pos=(0, 0, 0, 10),
                          frameConst=uiconst.FRAME_BORDER1_SHADOW_CORNER0,
                          color=(1.0, 1.0, 1.0, 0.5))
         progressbar = uicls.Fill(parent=fr.sr.content,
                                  align=uiconst.RELATIVE,
                                  pos=(1, 1, 0, 8))
         self.sr.progressBar = progressbar
         self.sr.progressBarParent = fr
         self.sr.progressText = uicls.Label(parent=par,
                                            pos=(0, 12, 300, 0),
                                            fontsize=9,
                                            uppercase=1,
                                            letterspace=2,
                                            align=uiconst.BOTTOMLEFT)
         self.sr.progressParent = par
Ejemplo n.º 13
0
 def CreateLocationInfo(self):
     mapIconContainer = uicls.Container(name='mapIconContainer',
                                        parent=self.sr.location,
                                        align=uiconst.TORIGHT,
                                        pos=(0, 0, 32, 0),
                                        padding=(0, 0, 0, 5))
     self.sr.textContainer = uicls.Container(name='textContainer',
                                             parent=self.sr.location,
                                             align=uiconst.TOALL,
                                             pos=(0, 0, 0, 0),
                                             padding=(0, 0, 0, 0))
     btn = uix.GetBigButton(32, mapIconContainer)
     btn.SetAlign(uiconst.CENTERRIGHT)
     btn.OnClick = self.OpenMap
     btn.hint = localization.GetByLabel('UI/Map/Map')
     btn.sr.icon.LoadIcon('ui_7_64_4')
     locationMenu = uicls.MenuIcon(size=24, ignoreSize=True)
     locationMenu.GetMenu = self.GetLocationMenu
     locationMenu.left = -5
     locationMenu.top = -3
     locationMenu.hint = ''
     self.sr.textContainer.children.append(locationMenu)
     self.sr.breadCrumbs = uicls.Label(name='label',
                                       text='',
                                       parent=self.sr.textContainer,
                                       fontsize=16,
                                       align=uiconst.TOTOP,
                                       padding=(15, 0, 0, 0),
                                       boldlinks=0,
                                       state=uiconst.UI_NORMAL)
     self.sr.dominatorText = uicls.EveLabelMedium(
         text='',
         parent=self.sr.textContainer,
         align=uiconst.TOTOP,
         state=uiconst.UI_NORMAL,
         maxLines=1)
Ejemplo n.º 14
0
 def ApplyAttributes(self, attributes):
     uicls.Window.ApplyAttributes(self, attributes)
     trustUrl = attributes.trustUrl
     inputUrl = attributes.inputUrl
     self.SetCaption(localization.GetByLabel('UI/Browser/AskTrustedSites'))
     self.SetMinSize((400, 300))
     main = self.GetMainArea()
     self.ignoreAlwaysBtnPar = uicls.Container(name='ignoreAlwaysBtnPar',
                                               parent=main,
                                               align=uiconst.TOBOTTOM,
                                               height=22,
                                               top=2)
     self.ignoreBtnPar = uicls.Container(name='ignoreBtnPar',
                                         parent=main,
                                         align=uiconst.TOBOTTOM,
                                         height=22,
                                         top=2)
     self.trustBtn = uicls.Button(
         parent=self.ignoreBtnPar,
         label=localization.GetByLabel('UI/Browser/TrustPrompt/TrustSite'),
         align=uiconst.TOLEFT,
         pos=(4, 0, 0, 0),
         func=self.TrustSite)
     self.trustBtn.hint = localization.GetByLabel(
         'UI/Browser/TrustPrompt/TrustButtonHint')
     self.ignoreBtn = uicls.Button(
         parent=self.ignoreBtnPar,
         label=localization.GetByLabel('UI/Browser/TrustPrompt/IgnoreOnce'),
         align=uiconst.TORIGHT,
         pos=(4, 0, 0, 0),
         func=self.IgnoreThisRequest)
     self.ignoreBtn.hint = localization.GetByLabel(
         'UI/Browser/TrustPrompt/IgnoreOnceHint')
     self.ignoreAlwaysBtn = uicls.Button(
         parent=self.ignoreAlwaysBtnPar,
         label=localization.GetByLabel(
             'UI/Browser/TrustPrompt/IgnoreAlways'),
         align=uiconst.TORIGHT,
         pos=(4, 0, 0, 0),
         func=self.AlwaysIgnoreRequests)
     self.ignoreAlwaysBtn.hint = localization.GetByLabel(
         'UI/Browser/TrustPrompt/IgnoreAlwaysHint')
     self.sourcePar = uicls.Container(name='sourcePar',
                                      parent=main,
                                      align=uiconst.TOBOTTOM,
                                      height=32)
     self.sourceTxtPar = uicls.Container(name='sourceTxtPar',
                                         parent=self.sourcePar,
                                         align=uiconst.TOTOP,
                                         height=14)
     self.sourceUrlPar = uicls.Container(name='sourceUrlPar',
                                         parent=self.sourcePar,
                                         align=uiconst.TOTOP,
                                         height=16)
     self.sourceTxt = uicls.Label(
         text=localization.GetByLabel('UI/Browser/TrustPrompt/RequestFrom'),
         parent=self.sourceTxtPar,
         state=uiconst.UI_DISABLED,
         color=(0.5, 0.5, 0.5, 0.7),
         align=uiconst.TOALL,
         padLeft=8)
     self.sourceUrl = uicls.Label(text=inputUrl,
                                  parent=self.sourceUrlPar,
                                  state=uiconst.UI_NORMAL,
                                  color=(0.5, 0.5, 0.5, 0.7),
                                  align=uiconst.TOALL,
                                  padLeft=8)
     self.sourceUrl.hint = inputUrl
     uicls.Line(parent=self.sourcePar,
                align=uiconst.TOTOP,
                color=(0.4, 0.4, 0.4, 0.9))
     self.promptPar = uicls.Container(name='promptPar',
                                      parent=main,
                                      align=uiconst.TOALL,
                                      pos=(8, 2, 8, 2))
     trustDescription = localization.GetByLabel(
         'UI/Browser/TrustPrompt/TrustDescription', trustUrl=trustUrl)
     self.promptTxt = uicls.Edit(setvalue=trustDescription,
                                 parent=self.promptPar,
                                 readonly=1,
                                 align=uiconst.TOALL)
     self.trustUrl = trustUrl
     self.inputUrl = inputUrl
Ejemplo n.º 15
0
    def ConstructSlider(self):
        sliderTextCont = uicls.GridContainer(name='mainCont',
                                             parent=self.sliderCont,
                                             align=uiconst.TOTOP,
                                             height=16)
        sliderTextCont.lines = 1
        sliderTextCont.columns = SLIDER_COLUMNS * 2
        sliderCont = uicls.GridContainer(name='mainCont',
                                         parent=self.sliderCont,
                                         align=uiconst.TOALL)
        sliderCont.lines = 1
        sliderCont.columns = SLIDER_COLUMNS
        for i in xrange(1, SLIDER_COLUMNS + 1):
            textcontLeft = uicls.Container(parent=sliderTextCont,
                                           align=uiconst.TOALL,
                                           state=uiconst.UI_NORMAL)
            textcontLeft.OnClick = (self.OnLevelClick, i)
            textcontRight = uicls.Container(parent=sliderTextCont,
                                            align=uiconst.TOALL,
                                            state=uiconst.UI_NORMAL)
            textcontRight.OnClick = (self.OnLevelClick, i + 1)
            cont = uicls.Container(parent=sliderCont, align=uiconst.TOALL)
            label = uicls.Label(text='',
                                parent=textcontRight,
                                align=uiconst.TOPRIGHT,
                                state=uiconst.UI_NORMAL,
                                left=-6,
                                fontsize=18,
                                top=-4)
            label.SetAlpha(NORMAL_ALPHA)
            label.OnClick = (self.OnLevelClick, i + 1)
            label.GetMenu = []
            label.OnMouseExit = (self.OnAdjusterMouseExit, label)
            label.OnMouseEnter = (self.OnAdjusterMouseEnter, label)
            labelName = 'level%d' % i
            setattr(self.sr, labelName, label)
            uicls.Line(name='scaleBase',
                       parent=cont,
                       align=uiconst.TOBOTTOM,
                       color=LINE_COLOR)
            if i == 1:
                labelTxt = localizationUtil.FormatNumeric(i, decimalPlaces=0)
                firstLabel = uicls.Label(text=labelTxt,
                                         parent=textcontLeft,
                                         left=-4,
                                         state=uiconst.UI_NORMAL,
                                         fontsize=18,
                                         top=-4)
                labelName = 'label%s' % i
                setattr(self, labelName, firstLabel)
                firstLabel.SetAlpha(NORMAL_ALPHA)
                firstLabel.GetMenu = []
                firstLabel.OnClick = (self.OnLevelClick, i)
                firstLabel.OnMouseExit = (self.OnAdjusterMouseExit, firstLabel)
                firstLabel.OnMouseEnter = (self.OnAdjusterMouseEnter,
                                           firstLabel)
                textcontLeft.OnMouseEnter = (self.OnAdjusterMouseEnter,
                                             firstLabel)
                textcontLeft.OnMouseExit = (self.OnAdjusterMouseExit,
                                            firstLabel)
                uicls.Line(name='leftTick',
                           parent=cont,
                           align=uiconst.TOLEFT,
                           color=LINE_COLOR)
            else:
                prevLabel = self.sr.Get('level%d' % (i - 1))
                textcontLeft.OnMouseEnter = (self.OnAdjusterMouseEnter,
                                             prevLabel)
                textcontLeft.OnMouseExit = (self.OnAdjusterMouseExit,
                                            prevLabel)
            textcontRight.OnMouseEnter = (self.OnAdjusterMouseEnter, label)
            textcontRight.OnMouseExit = (self.OnAdjusterMouseExit, label)
            label.text = localizationUtil.FormatNumeric(i + 1, decimalPlaces=0)
            uicls.Line(name='rightTick',
                       parent=cont,
                       align=uiconst.TORIGHT,
                       color=LINE_COLOR)

        self.leftSpacer = uicls.Container(parent=self.sliderAdjusterCont,
                                          name='leftSpacer',
                                          align=uiconst.TOLEFT,
                                          pos=(-ADJUSTER_WIDTH / 2, 0,
                                               ADJUSTER_WIDTH, ADJUSTER_WIDTH),
                                          state=uiconst.UI_PICKCHILDREN)
        adjuster = uicls.Icon(name='adjuster',
                              icon='38_230',
                              parent=self.leftSpacer,
                              align=uiconst.TORIGHT,
                              pos=(0, 0, ADJUSTER_WIDTH, ADJUSTER_WIDTH),
                              state=uiconst.UI_NORMAL,
                              color=LINE_COLOR)
        adjuster.OnMouseDown = self.OnAdjustMouseDown
        adjuster.OnMouseUp = self.OnAdjustMouseUp
        adjuster.OnMouseMove = self.OnAdjustMouseMove
        adjuster.OnMouseEnter = (self.OnAdjusterMouseEnter, adjuster)
        adjuster.OnMouseExit = (self.OnAdjusterMouseExit, adjuster)
        self.adjuster = adjuster
        self.UpdateAdjuster()
Ejemplo n.º 16
0
 def PrepareLayout(self):
     uicls.Line(parent=self, align=uiconst.TORIGHT)
     self.label = uicls.Label(text=self.name, parent=self, align=uiconst.CENTER, fontsize=9, letterspace=1, top=1, state=uiconst.UI_DISABLED, uppercase=1)
     self.hilite = uicls.Fill(parent=self, state=uiconst.UI_HIDDEN, padding=1)
     self.width = self.label.width + 10
     self.cursor = uiconst.UICURSOR_SELECT
Ejemplo n.º 17
0
 def Prepare_Label_(self, *args):
     label = uicls.Label(parent=self, pos=(8, 1, 0, 0), align=uiconst.CENTERLEFT, letterspace=1, fontStyle=self.fontStyle, fontFamily=self.fontFamily, fontPath=self.fontPath, fontsize=self.fontsize, state=uiconst.UI_DISABLED)
     self.sr.label = label
Ejemplo n.º 18
0
    def ConstructLayout(self):
        pad = const.defaultPadding
        self.sr.footer = uicls.Container(name='footer',
                                         parent=self.sr.main,
                                         align=uiconst.TOBOTTOM,
                                         pos=(0, 0, 0, 25),
                                         padding=(pad, pad, pad, pad))
        self.sr.cols = uicls.Container(name='col1',
                                       parent=self.sr.main,
                                       align=uiconst.TOALL)
        uicls.Line(parent=self.sr.cols, align=uiconst.TOTOP)
        uicls.Line(parent=self.sr.cols, align=uiconst.TOBOTTOM)
        self.sr.col1 = uicls.Container(name='col1',
                                       parent=self.sr.cols,
                                       align=uiconst.TOLEFT,
                                       padding=(pad, pad, pad, pad),
                                       clipChildren=True)
        self.sr.col2 = uicls.Container(name='col1',
                                       parent=self.sr.cols,
                                       align=uiconst.TOLEFT,
                                       padding=(pad, pad, pad, pad),
                                       clipChildren=True)
        uicls.Line(parent=self.sr.cols, align=uiconst.TOLEFT)
        self.sr.col3 = uicls.Container(name='col1',
                                       parent=self.sr.cols,
                                       align=uiconst.TOLEFT,
                                       padding=(pad, pad, pad, pad),
                                       clipChildren=True)
        colTopHeight = 60
        self.sr.sourcePinHeader = uicls.Container(name='pinHeader',
                                                  parent=self.sr.col1,
                                                  align=uiconst.TOTOP,
                                                  padding=(pad, 0, pad, pad),
                                                  pos=(0, 0, 0, colTopHeight))
        self.sr.sourcePinList = uicls.Container(name='pinList',
                                                parent=self.sr.col1,
                                                align=uiconst.TOALL,
                                                state=uiconst.UI_PICKCHILDREN)
        self.sr.transferHeader = uicls.Container(name='transferHeader',
                                                 parent=self.sr.col2,
                                                 align=uiconst.TOTOP,
                                                 padding=(pad, 0, pad, pad),
                                                 pos=(0, 0, 0, colTopHeight))
        self.sr.transferList = uicls.Container(name='transferList',
                                               parent=self.sr.col2,
                                               align=uiconst.TOALL,
                                               state=uiconst.UI_PICKCHILDREN)
        self.sr.destPinHeader = uicls.Container(name='destPinHeader',
                                                parent=self.sr.col3,
                                                align=uiconst.TOTOP,
                                                padding=(pad, 0, pad, pad),
                                                pos=(0, 0, 0, colTopHeight))
        self.sr.destPinList = uicls.Container(name='destPinList',
                                              parent=self.sr.col3,
                                              align=uiconst.TOALL,
                                              state=uiconst.UI_PICKCHILDREN)
        self.sr.footerLeft = uicls.Container(name='footerLeft',
                                             parent=self.sr.footer,
                                             align=uiconst.TOLEFT)
        self.sr.footerRight = uicls.Container(name='footerRight',
                                              parent=self.sr.footer,
                                              align=uiconst.TORIGHT)
        btns = [(localization.GetByLabel('UI/PI/Common/ExecuteTransfer'),
                 self.GoForTransfer, (), None)]
        uicls.ButtonGroup(btns=btns, parent=self.sr.footerRight, line=0)
        self.sr.volumeText = uicls.EveLabelSmall(text='',
                                                 parent=self.sr.transferHeader,
                                                 left=0,
                                                 top=20,
                                                 state=uiconst.UI_NORMAL)
        self.sr.timeText = uicls.EveLabelSmall(text='',
                                               parent=self.sr.transferHeader,
                                               left=0,
                                               top=35,
                                               state=uiconst.UI_NORMAL)
        self.sr.timeText.hint = localization.GetByLabel(
            'UI/PI/Common/ExpeditedTransferProcessingHint')
        self.sr.cooldownTimeText = uicls.EveLabelSmall(
            parent=self.sr.transferHeader, left=0, top=46)
        self.sr.cooldownTimeText.hint = localization.GetByLabel(
            'UI/PI/Common/CoolDownTimeHint')
        btns = [(localization.GetByLabel('UI/PI/Common/Add'),
                 self.AddBtnClicked, (), None),
                (localization.GetByLabel('UI/PI/Common/Remove'),
                 self.RemoveBtnClicked, (), None)]
        btns = uicls.ButtonGroup(btns=btns, parent=self.sr.footerLeft, line=0)
        for b in btns.children[0].children:
            b.SetHint(
                localization.GetByLabel(
                    'UI/PI/Common/ExpeditedTransferSplitHint'))

        self.OnResizeUpdate()
        self.sr.sourcePinHeaderText = uicls.Label(
            text=planetCommon.GetGenericPinName(self.sourcePin.typeID,
                                                self.sourcePin.id),
            parent=self.sr.sourcePinHeader,
            align=uiconst.TOPLEFT,
            fontsize=16,
            left=0,
            state=uiconst.UI_NORMAL)
        self.sr.sourcePinSubGauge = uicls.Gauge(
            parent=self.sr.sourcePinHeader,
            value=0.0,
            color=planetCommon.PLANET_COLOR_STORAGE,
            label=localization.GetByLabel('UI/PI/Common/Capacity'),
            left=0,
            top=24,
            state=uiconst.UI_NORMAL)
        self.sr.sourcePinListScroll = uicls.Scroll(
            parent=self.sr.sourcePinList, name='pinList')
        content = self.sr.sourcePinListScroll.sr.content
        content.OnDropData = self.OnSourceScrollDropData
        self.sr.transferHeaderText = uicls.Label(
            text=localization.GetByLabel('UI/PI/Common/ToBeTransferred'),
            parent=self.sr.transferHeader,
            align=uiconst.TOPLEFT,
            fontsize=16,
            left=0,
            state=uiconst.UI_NORMAL)
        self.sr.transferListScroll = uicls.Scroll(parent=self.sr.transferList,
                                                  name='transferList')
        content = self.sr.transferListScroll.sr.content
        content.OnDropData = self.OnTransferScrollDropData
        self.sr.destPinText = uicls.Label(text='',
                                          parent=self.sr.destPinHeader,
                                          align=uiconst.TOTOP,
                                          fontsize=16,
                                          state=uiconst.UI_NORMAL,
                                          maxLines=1)
        self.sr.destPinSubText = uicls.EveLabelLarge(
            text='',
            parent=self.sr.destPinHeader,
            align=uiconst.TOTOP,
            top=5,
            state=uiconst.UI_HIDDEN)
        self.sr.destPinSubGauge = uicls.Gauge(
            parent=self.sr.destPinHeader,
            value=0.0,
            color=planetCommon.PLANET_COLOR_STORAGE,
            label=localization.GetByLabel('UI/PI/Common/Capacity'),
            left=0,
            top=24,
            state=uiconst.UI_HIDDEN)
        self.sr.destPinListScroll = uicls.Scroll(parent=self.sr.destPinList)
Ejemplo n.º 19
0
    def ApplyAttributes(self, attributes):
        uicls.Window.ApplyAttributes(self, attributes)
        self.itemID = attributes.Get('itemID')
        lpPool = sm.GetService('facwar').GetSolarSystemLPs()
        topCont = uicls.Container(name='topCont',
                                  parent=self.sr.main,
                                  align=uiconst.TOTOP,
                                  height=40,
                                  padding=(self.PADSIDE, self.PADTOP,
                                           self.PADSIDE, self.PADSIDE))
        mainCont = uicls.ContainerAutoSize(name='mainCont',
                                           parent=self.sr.main,
                                           align=uiconst.TOTOP)
        bottomCont = uicls.Container(name='bottomCont',
                                     parent=self.sr.main,
                                     align=uiconst.TOBOTTOM,
                                     height=100,
                                     padTop=self.PADTOP)
        uicls.EveLabelLarge(parent=topCont,
                            text=localization.GetByLabel(
                                'UI/FactionWarfare/IHub/SystemUpgradePanel',
                                systemName=cfg.evelocations.Get(
                                    session.solarsystemid2).name),
                            align=uiconst.TOPLEFT,
                            top=5)
        uicls.EveLabelLarge(
            parent=topCont,
            text=localization.GetByLabel('UI/FactionWarfare/IHub/TotalLP'),
            align=uiconst.TOPRIGHT,
            top=5)
        self.lpPoolLabel = uicls.EveCaptionSmall(parent=topCont,
                                                 align=uiconst.TOPRIGHT,
                                                 top=25)
        limits = [0] + const.facwarSolarSystemUpgradeThresholds + [
            const.facwarSolarSystemMaxLPPool
        ]
        self.upgradeBars = []
        for i in xrange(1, 7):
            bar = uicls.FWUpgradeLevelCont(parent=mainCont,
                                           align=uiconst.TOTOP,
                                           padding=(self.PADSIDE, 0, 10, 10),
                                           lowerLimit=limits[i - 1],
                                           upperLimit=limits[i],
                                           lpAmount=lpPool,
                                           level=i,
                                           idx=0)
            self.upgradeBars.append(bar)

        self.bottomGradient = uicls.GradientSprite(bgParent=bottomCont,
                                                   rotation=-pi / 2,
                                                   rgbData=[(0, (0.3, 0.3,
                                                                 0.3))],
                                                   alphaData=[(0, 0.3),
                                                              (0.9, 0.0)])
        self.bottomFlashEffect = uicls.GradientSprite(bgParent=bottomCont,
                                                      rotation=-pi / 2,
                                                      rgbData=[(0, (0.6, 0.6,
                                                                    0.6))],
                                                      alphaData=[(0, 0.3),
                                                                 (0.9, 0.0)],
                                                      opacity=0.0)
        uicls.Line(parent=bottomCont,
                   align=uiconst.TOTOP,
                   color=(0.3, 0.3, 0.3, 0.3))
        bottomMainCont = uicls.Container(name='bottomMainCont',
                                         parent=bottomCont,
                                         align=uiconst.CENTER,
                                         width=450,
                                         height=100)
        self.myLPLabel = uicls.Label(parent=bottomMainCont,
                                     text=self.GetLPOwnedLabel(),
                                     align=uiconst.TOPLEFT,
                                     left=self.PADSIDE,
                                     top=self.PADTOP)
        self.bottomBottomCont = uicls.Container(name='bottomBottom',
                                                align=uiconst.TOPLEFT,
                                                pos=(self.PADSIDE, 40, 450,
                                                     25),
                                                parent=bottomMainCont)
        self.donateAmountEdit = uicls.SinglelineEdit(
            parent=self.bottomBottomCont,
            name='donateAmountEdit',
            align=uiconst.TOLEFT,
            setvalue=0,
            width=155,
            OnReturn=self.OnDonateLPBtn,
            OnChange=self.OnDonateValueChanged)
        self.donateBtn = uicls.Button(
            parent=self.bottomBottomCont,
            align=uiconst.TOLEFT,
            func=self.OnDonateLPBtn,
            label=localization.GetByLabel('UI/FactionWarfare/IHub/DonateLPs'),
            padLeft=4)
        self.donationReceivedLabel = uicls.EveCaptionMedium(
            name='donationReceivedLabel',
            parent=bottomMainCont,
            align=uiconst.TOPLEFT,
            text=localization.GetByLabel(
                'UI/FactionWarfare/IHub/DonationReceived'),
            left=self.PADSIDE,
            top=50,
            opacity=0.0)
        self.bottomTaxCont = uicls.Container(name='bottomTax',
                                             align=uiconst.TOPLEFT,
                                             pos=(self.PADSIDE, 73, 400, 25),
                                             parent=bottomMainCont)
        self.myLPToIhubLabel = None
        factionID = sm.GetService('facwar').GetSystemOccupier(
            session.solarsystemid)
        self.myLPTaxLabel = uicls.Label(
            name='myLPTaxLabel',
            parent=self.bottomTaxCont,
            text=localization.GetByLabel(
                'UI/FactionWarfare/IHub/maintenanceTax',
                tax=int(facwarCommon.GetDonationTax(factionID) * 100)),
            align=uiconst.TOLEFT,
            state=uiconst.UI_NORMAL,
            left=5)
        self.SetLPPoolAmount(lpPool)
        self.UpdateMyLPAmount()
        self.UpdateMyLPToIHubLabel()
        uthread.new(self.CheckOpenThread)
Ejemplo n.º 20
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     uicls.Label(parent=self,
                 pos=(20, 200, 300, 60),
                 maxLines=1,
                 text='Hello_world!')
 def ApplyAttributes(self, attributes):
     uicls.Window.ApplyAttributes(self, attributes)
     self.sr.main = uiutil.GetChild(self, 'main')
     uicls.Line(align=uiconst.TOTOP, parent=self.sr.main)
     self.SetWndIcon('40_11')
     self.heading = uicls.Label(text='Change Camera Settings',
                                parent=self.sr.main,
                                align=uiconst.TOPLEFT,
                                left=65,
                                top=-40,
                                width=self.width - 10,
                                height=self.height - 10,
                                fontsize=25,
                                maxLines=1,
                                uppercase=1)
     self.camClient = sm.GetService('cameraClient')
     camera = self.camClient.GetActiveCamera()
     rowPos = 15
     colPos = 15
     self.editControls = []
     rowPos = self.AddEntry(rowPos, colPos, 'minZoom', 'Min Zoom', camera)
     rowPos = self.AddEntry(rowPos, colPos, 'maxZoom', 'Max Zoom', camera)
     rowPos = self.AddEntry(rowPos, colPos, 'minPitch', 'Min Pitch', camera)
     rowPos = self.AddEntry(rowPos, colPos, 'maxPitch', 'Max Pitch', camera)
     rowPos = self.AddEntry(rowPos, colPos, 'fieldOfView', 'Field of View',
                            camera)
     rowPos = self.AddEntry(rowPos, colPos, 'MAX_SPIN_SPEED',
                            'Max Spin Speed', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'SPIN_RESISTANCE',
                            'Spin Resistance', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'SPIN_DELTA_MODIFIER',
                            'Spin Delta Modifier', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'ZOOM_SPEED_MODIFIER',
                            'Zoom Speed Modifier', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'SPIN_FALLOFF_RATIO',
                            'Spin Falloff Ratio', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'AVATAR_SHOULDER_HEIGHT',
                            'Avatar Shoulder Height', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'CHARACTER_OFFSET_FACTOR',
                            'Avatar Offset', cameras)
     rowPos = self.AddEntry(rowPos, colPos,
                            'ZOOM_TOGGLE_TRANSITION_SPEEDUP_FACTOR',
                            'Zoom toggle speedup factor', cameras)
     rowPos = self.AddEntry(rowPos, colPos,
                            'ZOOM_TOGGLE_TRANSITION_SPEEDUP_TEMPERING',
                            'Zoom toggle tempering', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'MAX_MOUSE_DELTA',
                            'Max mouse move speed', cameras)
     rowPos = 15
     colPos += 265
     rowPos = self.AddEntry(rowPos, colPos, 'OPTIMAL_SCREEN_ASPECT_RATIO',
                            'Optimal Screen Ratio', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'PITCH_OFFSET_LENGTH_MODIFIER',
                            'Pitch Offset Length Modifier', cameras)
     rowPos = self.AddEntry(rowPos, colPos,
                            'AVATAR_COLLISION_RESTRICTION_ANGLE',
                            'Avatar coll. restriction angle', animation)
     rowPos = self.AddEntry(rowPos, colPos, 'FLY_CAMERA_ACCELERATION',
                            'Fly camera speed', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'CLOSEST',
                            'Collision Closest Point', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'ZOOM_POWER_FAR',
                            'Zoom In Speed (Far)', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'ZOOM_POWER_CLOSE',
                            'Zoom In Speed (Close)', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'NORMAL_COLLISION_SPHERE',
                            'Normal Collision Radius', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'CAMERA_BUFFER_SPHERE_RADIUS',
                            'Collision Buffer', cameras)
     rowPos = self.AddEntry(rowPos, colPos, 'AVATAR_MIN_DISPLAY_DISTANCE',
                            'Avatar Min Display Distance', cameras)
     rowPos = self.AddEntry(rowPos, colPos,
                            'CRITICAL_COLLISION_SMOOTHING_STEPS',
                            'Critical Collision Smoothing Steps', cameras)
     player = sm.GetService('entityClient').GetPlayerEntity()
     rowPos = self.AddEntry(rowPos, colPos,
                            'collisionDetectionFeelerLength',
                            'Animation collision look-ahead',
                            player.movement.characterController)
     sb = uicls.Button(parent=self.sr.main,
                       label='Submit',
                       func=self.Submit,
                       pos=(212, rowPos + 5, 90, 25))
     uicls.Button(parent=self.sr.main,
                  label='Reset',
                  func=self.Reset,
                  pos=(sb.left + sb.width + 2, rowPos + 5, 90, 25))
Ejemplo n.º 22
0
 def Layout(self):
     self.SetMinSize([560, 400])
     self.SetWndIcon('53_11')
     self.SetTopparentHeight(56)
     self.MakeUnstackable()
     checkIsMyCorps = self.customsOfficeItem.ownerID == session.corpid
     checkIsStationManager = session.corprole & const.corpRoleStationManager == const.corpRoleStationManager
     if checkIsMyCorps and checkIsStationManager:
         self.SetHeaderIcon()
         self.settingsIcon = self.sr.headerIcon
         self.settingsIcon.state = uiconst.UI_NORMAL
         self.settingsIcon.GetMenu = self.GetSettingsMenu
         self.settingsIcon.expandOnLeft = 1
         self.settingsIcon.hint = localization.GetByLabel(
             'UI/DustLink/ConfigureOrbital')
     self.windowCaption = uicls.WndCaptionLabel(
         text=localization.GetByLabel(
             'UI/PI/Common/PlanetaryCustomsOfficeName',
             planetName=cfg.evelocations.Get(self.planet.planetID).name),
         subcaption=localization.GetByLabel(
             'UI/PI/Common/ImportExportSubHeading'),
         parent=self.sr.topParent,
         align=uiconst.RELATIVE)
     self.SetCaption(
         localization.GetByLabel('UI/PI/Common/PlanetaryCustomsOfficeName',
                                 planetName=cfg.evelocations.Get(
                                     self.planet.planetID).name))
     pad = const.defaultPadding
     self.sr.footer = uicls.Container(name='footer',
                                      parent=self.sr.main,
                                      align=uiconst.TOBOTTOM,
                                      pos=(0, 0, 0, 25),
                                      padding=(pad * 2, 0, pad, 2))
     self.sr.cols = uicls.Container(name='colums',
                                    parent=self.sr.main,
                                    align=uiconst.TOALL,
                                    padding=(pad, 0, 0, 0))
     uicls.Line(parent=self.sr.cols, align=uiconst.TOTOP)
     uicls.Line(parent=self.sr.cols, align=uiconst.TOBOTTOM)
     self.sr.leftColumn = uicls.Container(name='leftColumn',
                                          parent=self.sr.cols,
                                          align=uiconst.TOLEFT,
                                          padding=(pad, pad, pad, pad),
                                          clipChildren=True)
     self.sr.rightColumn = uicls.Container(name='rightColumn',
                                           parent=self.sr.cols,
                                           align=uiconst.TOLEFT,
                                           padding=(pad, pad, pad, pad),
                                           clipChildren=True)
     colTopHeight = 45
     self.sr.customsHeader = uicls.Container(name='customsHeader',
                                             parent=self.sr.leftColumn,
                                             align=uiconst.TOTOP,
                                             padding=(pad, 0, pad, pad),
                                             pos=(0, 0, 0, colTopHeight))
     self.sr.customsList = uicls.Container(name='customsList',
                                           parent=self.sr.leftColumn,
                                           align=uiconst.TOALL,
                                           state=uiconst.UI_PICKCHILDREN)
     self.sr.customsHeaderTitle = uicls.Label(text=localization.GetByLabel(
         'UI/PI/Common/PlanetaryCustomsOffice'),
                                              parent=self.sr.customsHeader,
                                              align=uiconst.TOPLEFT,
                                              fontsize=16,
                                              state=uiconst.UI_NORMAL)
     self.sr.customsGauge = uicls.Gauge(
         parent=self.sr.customsHeader,
         value=0.0,
         color=planetCommon.PLANET_COLOR_STORAGE,
         left=0,
         top=25,
         state=uiconst.UI_HIDDEN,
         align=uiconst.TOPLEFT)
     self.sr.spaceportHeader = uicls.Container(name='spaceportHeader',
                                               parent=self.sr.rightColumn,
                                               align=uiconst.TOTOP,
                                               padding=(pad, 0, pad, pad),
                                               pos=(0, 0, 0, colTopHeight))
     self.sr.spaceportList = uicls.Container(name='spaceportList',
                                             parent=self.sr.rightColumn,
                                             align=uiconst.TOALL,
                                             state=uiconst.UI_PICKCHILDREN)
     self.sr.spaceportGauge = uicls.Gauge(
         parent=self.sr.spaceportHeader,
         value=0.0,
         color=planetCommon.PLANET_COLOR_STORAGE,
         left=0,
         top=25,
         state=uiconst.UI_HIDDEN,
         align=uiconst.TOPRIGHT)
     self.sr.spaceportCombo = uicls.Combo(
         label=None,
         parent=self.sr.spaceportHeader,
         options=[],
         name='imex_import_select',
         callback=self.OnSpaceportComboChanged,
         width=70,
         align=uiconst.TOTOP)
     self.sr.transferCostLabel = uicls.EveLabelSmall(
         parent=self.sr.footer, state=uiconst.UI_NORMAL, top=7)
     btns = [(localization.GetByLabel('UI/PI/Common/CustomsOfficeTransfer'),
              self.ConfirmCommodityTransfer, (), None)]
     btns = uicls.ButtonGroup(btns=btns,
                              parent=self.sr.footer,
                              line=0,
                              align=uiconst.TOPRIGHT)
     self.transferBtn = btns.GetBtnByIdx(0)
     self.__OnResizeUpdate()
     self.sr.customsListScroll = uicls.Scroll(parent=self.sr.customsList,
                                              name='customsList')
     self.sr.spaceportListScroll = uicls.Scroll(
         parent=self.sr.spaceportList, name='spaceportList')
Ejemplo n.º 23
0
 def Prepare_Label_(self):
     if self.showLabel:
         self.label = uicls.Label(parent=self, fontsize=self.fontsize, pos=(self.labeltab,
          2,
          0,
          0), state=uiconst.UI_NORMAL, hint=self.hint)
Ejemplo n.º 24
0
 def ApplyAttributes(self, attributes):
     SE_BaseClassCore.ApplyAttributes(self, attributes)
     self.sr.label = uicls.Label(name='text', text='', parent=self, pos=(5, 0, 0, 0), state=uiconst.UI_DISABLED, align=uiconst.CENTERLEFT, maxLines=1)
     self.sr.line = uicls.Line(name='line', align=uiconst.TOBOTTOM, parent=self, pos=(0, 0, 0, 1), idx=0)
     self.sr.selection = uicls.Fill(name='selection', parent=self, align=uiconst.TOALL, pos=(0, 1, 0, 1), color=(1.0, 1.0, 1.0, 0.25))
     self.sr.hilite = uicls.Fill(name='hilite', parent=self, align=uiconst.TOALL, pos=(0, 1, 0, 1), color=(1.0, 1.0, 1.0, 0.25))
Ejemplo n.º 25
0
 def Prepare_Label_(self):
     self.sr.labelClipper = uicls.Container(parent=self, pos=(0, 0, 0, 0), clipChildren=1)
     self.sr.label = uicls.Label(text='', parent=self.sr.labelClipper, pos=(5, 0, 0, 0), state=uiconst.UI_DISABLED, maxLines=1, idx=0, align=uiconst.CENTERLEFT, fontsize=12)
Ejemplo n.º 26
0
 def ApplyAttributes(self, attributes):
     SE_BaseClassCore.ApplyAttributes(self, attributes)
     self.sr.text = uicls.Label(text='', parent=self, state=uiconst.UI_NORMAL, fontsize=12, align=uiconst.TOTOP, padLeft=6, padRight=6, padTop=2)
Ejemplo n.º 27
0
    def ApplyAttributes(self, attributes):
        uicls.Window.ApplyAttributes(self, attributes)
        initialUrl = attributes.initialUrl
        self.reloadingTrustedSites = False
        self.awaitingTitle = False
        self.nextTabID = 1
        self.currentTab = None
        self.browserHostManager = sm.GetService('browserHostManager').GetBrowserHost()
        self.tabs = []
        self.browserButtons = (('Back',
          self.HistoryBack,
          20,
          'back',
          'UI/Browser/Back'),
         ('Forward',
          self.HistoryForward,
          60,
          'next',
          'UI/Browser/Forward'),
         (None, None, None, None, None),
         ('Reload',
          self.ReloadPage,
          -40,
          'reload',
          'UI/Browser/Reload'),
         ('Stop',
          self.StopLoading,
          20,
          'stop',
          'UI/Browser/Stop'),
         (None, None, None, None, None),
         ('Home',
          self.GoHome,
          0,
          'home',
          'UI/Browser/Home'))
        self.MakeUnstackable()
        self.SetMinSize([260, 180])
        self.SetMaxSize([uicore.desktop.width, uicore.desktop.height])
        self.PrepareMenuBar()
        self.PrepareNavigationBar()
        self.PrepareNavigationButtons()
        self.PrepareTabBar()
        self.PrepareStatusBar()
        mainArea = self.GetMainArea()
        if not settings.user.ui.Get('browserShowNavBar', True):
            self.navigationBar.state = uiconst.UI_HIDDEN
        if not settings.user.ui.Get('browserShowStatusBar', True):
            self.statusBar.state = uiconst.UI_HIDDEN
        for name, GetMenu in [(localization.GetByLabel('UI/Browser/View'), lambda : [(localization.GetByLabel('UI/Browser/Reload'), self.ReloadPage, ()), (localization.GetByLabel('UI/Browser/ViewSource'), self.DocumentSource, ()), (localization.GetByLabel('UI/Browser/BrowserHistory/BrowserHistoryCaption'), self.OpenBrowserHistory, ())]), (localization.GetByLabel('UI/Browser/Bookmarks'), self.GetBookmarkMenu), (localization.GetByLabel('UI/Browser/Options'), lambda : [(localization.GetByLabel('UI/Browser/GeneralSettings'), self.EditGeneralSettings, ()), None, (localization.GetByLabel('UI/Browser/TrustedSites'), self.EditSites, ('trusted',))])]:
            opt = uicls.WindowDropDownMenu(name='menuoption', parent=self.menuBar)
            opt.Setup(name, GetMenu)

        self.crashNotifierContainer = uicls.Container(name='crashNotifierContainer', parent=mainArea, align=uiconst.CENTER, state=uiconst.UI_HIDDEN, width=240, height=80, idx=0)
        crashText = uicls.Label(text=localization.GetByLabel('UI/Browser/Crashed'), parent=self.crashNotifierContainer, width=220, left=10, top=10, fontsize=16, letterspace=1)
        uicls.Fill(parent=self.crashNotifierContainer, color=(0.0, 0.0, 0.0, 1.0))
        self.crashNotifierContainer.height = max(80, crashText.textheight + 20)
        bp = browser.BrowserPane(parent=mainArea, align=uiconst.TOALL, state=uiconst.UI_NORMAL, padLeft=const.defaultPadding + 6, padRight=const.defaultPadding + 6, padTop=6, padBottom=6)
        bp.Startup()
        self.browserPane = bp
        uicls.Fill(parent=mainArea, color=(0.0, 0.0, 0.0, 1.0), padLeft=const.defaultPadding, padRight=const.defaultPadding)
        self.OnClientFlaggedListsChange()
        browseToUrl = initialUrl
        if browseToUrl is None or browseToUrl == 'home':
            browseToUrl = str(settings.user.ui.Get('HomePage2', browserutil.DefaultHomepage()))
        self.AddTab(browseToUrl)
Ejemplo n.º 28
0
    def GetWnd(self, new=0):
        wnd = uicls.MonitorWnd.GetIfOpen()
        if wnd is None and new:
            wnd = uicls.MonitorWnd.Open()
            wnd.OnClose = self.CloseWnd
            wnd._OnResize = self._OnResize
            main = wnd.sr.maincontainer
            topcontainer = uicls.Container(name='push',
                                           parent=main,
                                           align=uiconst.TOTOP,
                                           height=46,
                                           clipChildren=1)
            w = wnd.sr.telemetryButton = uicls.Button(parent=topcontainer,
                                                      label='Telemetry',
                                                      align=uiconst.TOPRIGHT,
                                                      func=self.RunTelemetry)
            w = wnd.sr.fpsText = uicls.Label(text='',
                                             parent=topcontainer,
                                             align=uiconst.TOPLEFT,
                                             top=0,
                                             left=8)
            w = wnd.sr.vmText = uicls.Label(text='',
                                            parent=topcontainer,
                                            align=uiconst.TOPLEFT,
                                            top=14,
                                            left=8)
            w = wnd.sr.cacheText = uicls.Label(text='',
                                               parent=topcontainer,
                                               align=uiconst.TOPLEFT,
                                               top=28,
                                               left=8)
            self.tabs = maintabs = uicls.TabGroup(parent=main)
            wnd.sr.scroll = uicls.Scroll(
                parent=main,
                padding=(const.defaultPadding, const.defaultPadding,
                         const.defaultPadding, const.defaultPadding))
            wnd.sr.scroll.sr.id = 'monitorscroll'
            textonly = uicls.Container(name='textonly',
                                       parent=main,
                                       clipChildren=1,
                                       padding=8)
            graph = wnd.sr.graph = uicls.Container(name='graph',
                                                   parent=main,
                                                   clipChildren=1,
                                                   padding=8)
            statusHeader = ' '
            for tme in self.intvals:
                statusHeader += '<t><right>%s' % util.FmtDate(
                    long(tme * 10000), 'ss')

            statusHeader += '<t><right>total'
            wnd.statusLabels = []
            txt = uicls.Label(text=statusHeader,
                              parent=textonly,
                              align=uiconst.TOPLEFT,
                              tabs=[80, 130, 180, 230, 280, 330, 380],
                              state=uiconst.UI_DISABLED)
            for i in xrange(7):
                statusLabel = uicls.Label(
                    text='',
                    parent=textonly,
                    top=(i + 1) * txt.height + 1,
                    align=uiconst.TOPLEFT,
                    tabs=[80, 130, 180, 230, 280, 330, 380],
                    state=uiconst.UI_DISABLED)
                wnd.statusLabels.append(statusLabel)

            wnd.sr.settings = uicls.Container(name='settings',
                                              parent=main,
                                              clipChildren=1,
                                              padding=8)
            w = wnd.sr.queueText = uicls.Label(text='',
                                               parent=wnd.sr.settings,
                                               align=uiconst.TOTOP)
            wnd.sr.settingsInner = uicls.Container(name='settingsInner',
                                                   parent=wnd.sr.settings,
                                                   align=uiconst.TOALL)
            tabs = [('Main', wnd.sr.settings, self, 'settings'),
                    ('Network', textonly, self, 'network'),
                    ('Rot', wnd.sr.scroll, self, 'rot'),
                    ('Timers', wnd.sr.scroll, self, 'timers'),
                    ('Objects', wnd.sr.scroll, self, 'objects'),
                    ('Memory', graph, self, 'memory'),
                    ('Performance', graph, self, 'performance'),
                    ('Outstanding', wnd.sr.scroll, self, 'outstanding'),
                    ('Logs', wnd.sr.scroll, self, 'logs')]
            if prefs.GetValue('heapinfo', 0):
                tabs.append(['Heap', graph, self, 'heap'])
            if session.role & service.ROLE_GML:
                tabs.append(
                    ['Method Calls', wnd.sr.scroll, self, 'methodcalls'])
            tabData = []
            for label, panel, code, args in tabs:
                tabData.append(
                    uiutil.Bunch(label=label,
                                 panel=panel,
                                 code=code,
                                 args=args,
                                 LoadTabCallback=self.Load))

            self.tabs.LoadTabs(tabData, 1, settingsID='monitortabs')
            wnd.sr.bottomCont = bottomCont = uicls.Container(
                parent=main, align=uiconst.TOBOTTOM, height=48, idx=0)
            wnd.sr.resetWnd = uicls.Container(name='resetwnd',
                                              parent=bottomCont,
                                              align=uiconst.TOTOP,
                                              height=24,
                                              idx=0)
            wnd.sr.logWnd = uicls.Container(name='logwnd',
                                            parent=bottomCont,
                                            align=uiconst.TOTOP,
                                            height=24,
                                            idx=0)
            wnd.sr.logWnd2 = uicls.Container(name='logwnd2',
                                             parent=bottomCont,
                                             align=uiconst.TOTOP,
                                             height=24,
                                             idx=0)
            btns = uicls.ButtonGroup(
                parent=wnd.sr.logWnd,
                line=False,
                btns=[['Start', self.StartLogInMemory, (), 51],
                      ['Stop', self.StopLogInMemory, (), 51],
                      ['Clear', self.ClearLogInMemory, (), 51],
                      ['Copy', self.ExportLogInMemory, (), 51],
                      ['Attach', self.AttachToLogServer, (), 51],
                      ['Save', self.SaveLogsToFile, (), 51]])
            uicls.Label(parent=wnd.sr.logWnd2,
                        text='<b>Threshold:</b>',
                        align=uiconst.TOLEFT,
                        padLeft=10,
                        padTop=1)
            options = (('Info', 0), ('Notice', 1), ('Warning', 2), ('Error',
                                                                    3))
            for text, value in options:
                isChecked = blue.logInMemory.threshold == value
                uicls.Checkbox(parent=wnd.sr.logWnd2,
                               text=text,
                               groupname='threshold',
                               align=uiconst.TOLEFT,
                               width=100,
                               top=5,
                               checked=isChecked,
                               callback=self.OnLogThresholdRadioButtons,
                               retval=value)

            edit = uicls.SinglelineEdit(parent=wnd.sr.logWnd2,
                                        name='capacityEdit',
                                        align=uiconst.TORIGHT,
                                        ints=(1, MAX_LOG_CAPACITY),
                                        padRight=5,
                                        padBottom=5,
                                        setvalue=blue.logInMemory.capacity,
                                        OnChange=self.OnLogCapacityEdit)
            uicls.Label(parent=wnd.sr.logWnd2,
                        text='<b>Capacity:</b>',
                        align=uiconst.TORIGHT,
                        padLeft=10,
                        padTop=1)
            wnd.sr.methodcallWnd = uicls.Container(name='methodcallwnd',
                                                   parent=bottomCont,
                                                   align=uiconst.TOTOP,
                                                   height=24,
                                                   idx=0)
            btns = uicls.ButtonGroup(
                btns=[['Copy', self.ExportMethodCalls, (), 51]])
            wnd.sr.methodcallWnd.children.insert(0, btns)
            uicls.Line(parent=wnd.sr.resetWnd, align=uiconst.TOTOP)
            uicls.Button(parent=wnd.sr.resetWnd,
                         label='Reset',
                         align=uiconst.CENTER,
                         func=self.Reset)
            wnd.SetMinSize([400, 300])
            wnd.Maximize(1)
            wnd.SetParent(uicore.layer.abovemain)
        return wnd
Ejemplo n.º 29
0
 def PanelLaunch(self):
     self.ResetPayloadContents()
     cont = uicls.Container(parent=self.actionCont,
                            pos=(0, 0, 0, 272),
                            align=uiconst.TOTOP,
                            state=uiconst.UI_HIDDEN)
     self.contentsScroll = uicls.Scroll(parent=cont,
                                        name='contentsScroll',
                                        align=uiconst.TOTOP,
                                        height=100)
     self.contentsScroll.HideUnderLay()
     uicls.Frame(parent=self.contentsScroll, color=(1.0, 1.0, 1.0, 0.2))
     self.launchTextCont = uicls.Container(name='launchTextContainer',
                                           parent=cont,
                                           align=uiconst.CENTERTOP,
                                           state=uiconst.UI_DISABLED,
                                           pos=(0, 100, 200, 50))
     self.launchText = uicls.Label(text='3',
                                   parent=self.launchTextCont,
                                   align=uiconst.TOALL,
                                   fontsize=48,
                                   state=uiconst.UI_HIDDEN)
     costCont = uicls.Container(parent=cont,
                                pos=(0, 6, 0, 20),
                                align=uiconst.TOTOP,
                                state=uiconst.UI_NORMAL)
     self.costText = uicls.EveLabelMedium(text='',
                                          parent=costCont,
                                          align=uiconst.TOALL,
                                          state=uiconst.UI_DISABLED)
     btnCont = uicls.Container(parent=cont,
                               pos=(0, 6, 0, 20),
                               align=uiconst.TOTOP,
                               state=uiconst.UI_PICKCHILDREN)
     manipBtns = [[
         localization.GetByLabel('UI/PI/Common/Add'), self._AddCommodities,
         None
     ],
                  [
                      localization.GetByLabel('UI/PI/Common/Remove'),
                      self._RemCommodities, None
                  ]]
     self.manipBtns = uicls.ButtonGroup(btns=manipBtns,
                                        parent=btnCont,
                                        line=False,
                                        alwaysLite=True)
     self.payloadScroll = uicls.Scroll(parent=cont,
                                       name='payloadScroll',
                                       align=uiconst.TOTOP,
                                       height=100)
     self.payloadScroll.HideUnderLay()
     uicls.Frame(parent=self.payloadScroll, color=(1.0, 1.0, 1.0, 0.2))
     self._ReloadScrolls()
     self.countdownCont = uicls.Container(parent=cont,
                                          pos=(0, 0, 0, 35),
                                          align=uiconst.TOTOP,
                                          state=uiconst.UI_HIDDEN)
     btns = [[
         localization.GetByLabel('UI/PI/Common/GoForLaunch'),
         self._DoLaunch, None
     ],
             [
                 localization.GetByLabel('UI/PI/Common/ScrubLaunch'),
                 self._CancelLaunch, None
             ]]
     self.launchBtns = uicls.ButtonGroup(btns=btns,
                                         parent=cont,
                                         line=False,
                                         alwaysLite=True)
     return cont
Ejemplo n.º 30
0
    def ShowReadingWindow(self, cList = None):
        if self.debug:
            self.LogInfo('    ShowReadingWindow')
        if not self.compWindow:
            if self.debug:
                self.LogInfo('    Not showing reading window as no self.compWindow')
            return
        edit = self.currentFocus
        if not edit or not cList:
            self.HideCompWindow()
            if self.debug:
                self.LogWarn('<< ShowReadingWindow: not edit or cList')
            return
        if isinstance(edit, (uicls.EditPlainTextCore,)):
            entry = edit.GetActiveNode()
            if not entry.panel:
                if self.debug:
                    self.LogInfo('    <<ShowCompWindow failed to get the panel')
                return
            panel = entry.panel
        else:
            panel = edit
        if self.debug:
            self.LogInfo('++++++++ %s' % self.imeFileName)
            for k, v in cList.iteritems():
                self.LogInfo('cList[%s] = %s' % (k, v))

            self.LogInfo('--------')
        pagestart = cList.get('PageStart', 0)
        if self.debug:
            self.LogInfo('    cList.keys:', cList.keys())
        if self.doesNotHonorPageStart:
            self.nPageTopIndex = cList['Selection'] / cList['PageSize'] * cList['PageSize']
        elif self.primaryLanguage == LANG_JAPANESE:
            self.nPageTopIndex = cList['Selection'] / cList['PageSize'] * cList['PageSize']
        else:
            self.nPageTopIndex = pagestart
        cList['Selection'] = [cList['Selection'] - self.nPageTopIndex, -1][self.currentLanguage == LANG_CHS and not self.GetImeId()]
        i = self.nPageTopIndex
        j = 0
        displayString = u''
        if self.debug:
            for key, val in cList.iteritems():
                self.LogInfo('    ShowReadingWindow - ', key, ' = ', val)

        s_nFirstTargetConv = -1
        bVerticalCand = self.s_bVerticalCand
        if self.bShowReadingWindow:
            if self.debug:
                self.LogWarn('SHOW READING WINDOW')
            while i < len(cList['Strings']):
                if not bVerticalCand:
                    displayString += u'%s' % unichr(cList['Strings'][i])
                else:
                    displayString += u'%s<br>' % unichr(cList['Strings'][i])
                i += 1

            cList['display'] = displayString
            cList['Count'] = len(cList['Strings'])
        elif self.bShowCandidateWindow:
            if self.debug:
                self.LogWarn('SHOW CANDIDATE WINDOW')
            while i < len(cList['Strings']) and j < cList['PageSize']:
                if not bVerticalCand:
                    displayString += u' %d %s ' % ((1 + j) % 10, cList['Strings'][i])
                else:
                    displayString += u'%d %s<br>' % ((1 + j) % 10, cList['Strings'][i])
                i += 1
                j += 1

            cList['display'] = displayString
            cList['Count'] = len(cList['Strings']) - pagestart
            if cList['Count'] > cList['PageSize']:
                cList['Count'] = cList['PageSize']
        elif self.debug:
            self.LogWarn('NOT CANDIDATE OR READING WINDOW?')
        if panel:
            if self.primaryLanguage == LANG_CHINESE and not self.GetImeId():
                nXComp = 0
            elif self.primaryLanguage == LANG_JAPANESE:
                nXComp = self.GetCompCursorPos(self.s_nCompCaret)
            else:
                nXComp = self.GetCompCursorPos(self.s_nCompCaret)
            x = self.compWindow.left + nXComp
            y = self.compWindow.top
            if not self.readingWindow:
                self.readingWindow = uicls.Container(name='IME', parent=uicore.desktop, align=uiconst.TOPLEFT, idx=0)
                self.readingText = uicls.Label(text='', parent=self.readingWindow, fontsize=14, state=uiconst.UI_DISABLED, left=5, top=3)
                uicls.Frame(parent=self.readingWindow)
                uicls.Fill(parent=self.readingWindow, color=(0.0, 0.0, 0.0, 1.0))
            if cList['display']:
                self.readingWindow.display = True
                self.readingText.text = cList['display']
                self.readingWindow.width = self.readingText.textwidth + 10
                self.readingWindow.height = self.readingText.textheight + 6
            else:
                self.readingWindow.display = False
            if self.debug:
                self.LogInfo('cList["display"]:', cList['display'])
                self.LogInfo('panel.height:', panel.height)
                self.LogInfo('not bVerticalCand:', not bVerticalCand)
                self.LogInfo('cList["Count"]:', cList['Count'])
                self.LogInfo('panel.height * [cList["Count"],1][not bVerticalCand]:', panel.height * [cList['Count'], 1][not bVerticalCand])
            for xOffset, yOffset in [(0, self.compWindow.height + 6),
             (0, -self.readingWindow.height - 6),
             (6, 0),
             (-self.readingWindow.width - 6, 0)]:
                if 0 < x + xOffset < uicore.desktop.width - self.readingWindow.width and 0 < y + yOffset < uicore.desktop.height - self.readingWindow.height:
                    self.readingWindow.left = x + xOffset
                    self.readingWindow.top = y + yOffset
                    break

            self.readingWindow.state = uiconst.UI_DISABLED