Beispiel #1
0
    def __init__(self):
        self.Margin = Thickness(5)
        self.Background = SolidColorBrush(Colors.Green)
        self.create_headline()

        top_panel = ScrollViewer()
        top_panel.Height = 475
        top_panel.Background = SolidColorBrush(Colors.White)
        top_panel.VerticalScrollBarVisibility = ScrollBarVisibility.Auto
        self.top_panel = top_panel

        border = Border()
        border.BorderThickness = Thickness(5)
        border.CornerRadius = CornerRadius(10)
        border.BorderBrush = SolidColorBrush(Colors.Blue)
        border.Background = SolidColorBrush(Colors.Yellow)
        border.Padding = Thickness(5)
        
        bottom_panel = StackPanel()
        bottom_panel.VerticalAlignment = VerticalAlignment.Stretch
        bottom_panel.HorizontalAlignment = HorizontalAlignment.Stretch
        bottom_panel.Background = SolidColorBrush(Colors.Red)
        bottom_panel.Orientation = Orientation.Horizontal
        
        border.Child = bottom_panel
        self.Children.Add(top_panel)
        self.Children.Add(border)
        
        self.bottom_panel = bottom_panel
        self.populate_login_panel()
Beispiel #2
0
 def __init__(self):
    grid = self.getGrid()
    grid.Background = GetLinearGradientBrush()
    self.createControls(grid)
    
    border = Border()
    border.BorderThickness = Thickness(5)
    border.CornerRadius = CornerRadius(10)
    border.BorderBrush = Brushes.Blue
    border.Background = Brushes.Yellow
    border.Padding = Thickness(5)
    border.Child = grid
    self.Content = border
    
    self.Title = 'Windows Presentation Foundation Controls Example'
    self.SizeToContent = SizeToContent.Height
    self.Width = 800
 def getTabItem(self, Control, xaml):
    bytes = Encoding.UTF8.GetBytes(xaml)
    stream = MemoryStream(bytes)
    name = Control.__name__
    
    viewer = Control()
    flowDocument = XamlReader.Load(stream)
    self.processObjectTree(flowDocument)
    viewer.Document = flowDocument
    
    border = Border()
    border.BorderThickness = Thickness(5)
    border.CornerRadius = CornerRadius(10)
    border.BorderBrush = Brushes.Blue
    border.Background = Brushes.AntiqueWhite
    border.Padding = Thickness(5)
    border.Child = viewer
    
    item = TabItem()
    item.Content = border
    item.Header = name
    return item
Beispiel #4
0
class Writer(object):
    def __init__(self):
        self.stdout = ''
        
    def write(self, text):
        Dispatch(self.do_write, text)
        
    def do_write(self, text):
        self.stdout += text
        HtmlPage.Document.debugging.value = self.stdout


output_writer = Writer()
sys.stdout = output_writer

border = Border()
border.BorderThickness = Thickness(5)
border.CornerRadius = CornerRadius(10)
border.BorderBrush = SolidColorBrush(Colors.Blue)
border.Background = SolidColorBrush(Colors.Yellow)
border.Padding = Thickness(5)

border.Child = MainPanel()


Application.Current.RootVisual = border

SetDispatcher(border)
print 'App started'