mirror of https://github.com/chriskiehl/Gooey.git
Browse Source
Added layout manager shell for subparsers. Converted core gui components to work with new data schema
subparsing
Added layout manager shell for subparsers. Converted core gui components to work with new data schema
subparsing
chriskiehl
9 years ago
8 changed files with 180 additions and 42 deletions
Split View
Diff Options
-
6gooey/gui/application.py
-
30gooey/gui/commands.py
-
6gooey/gui/routes.py
-
45gooey/gui/windows/advanced_config.py
-
41gooey/gui/windows/base_window.py
-
47gooey/gui/windows/layouts.py
-
2gooey/gui/windows/runtime_display_panel.py
-
45gooey/gui/windows/sidebar.py
@ -0,0 +1,30 @@ |
|||
import itertools |
|||
import docopt |
|||
from gooey.python_bindings import argparse_to_json |
|||
|
|||
|
|||
class Required(object): |
|||
def __init__(self, id): |
|||
|
|||
class Optional(object): |
|||
pass |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
parser = [] |
|||
|
|||
command_list = CommandList(argparse_to_json.convert(parser)) |
|||
|
|||
print command_list.required_args |
|||
command_list['filter'].value = 123 |
|||
command_list['compress'].value = True |
|||
|
|||
if not command_list.is_valid(): |
|||
raise "invalid" |
|||
|
|||
|
|||
|
@ -0,0 +1,6 @@ |
|||
|
|||
import wx |
|||
|
|||
|
|||
|
|||
config = lambda self: self.Bind(wx.EVT_BUTTON, 'handler', id=wx.NewId()) |
@ -0,0 +1,45 @@ |
|||
|
|||
import wx |
|||
from wx.lib.pubsub import pub |
|||
|
|||
from gooey.gui import styling |
|||
|
|||
class Sidebar(wx.Panel): |
|||
|
|||
def __init__(self, parent, *args, **kwargs): |
|||
self.contents = kwargs.pop('contents', []) |
|||
super(Sidebar, self).__init__(parent, *args, **kwargs) |
|||
self.SetDoubleBuffered(True) |
|||
|
|||
self._parent = parent |
|||
|
|||
self._controller = None |
|||
|
|||
self._init_components() |
|||
self._do_layout() |
|||
|
|||
def _init_components(self): |
|||
pass |
|||
|
|||
def _do_layout(self): |
|||
self.SetDoubleBuffered(True) |
|||
self.SetBackgroundColour('#f2f2f2') |
|||
self.SetSize((180, 0)) |
|||
self.SetMinSize((180, 0)) |
|||
|
|||
STD_LAYOUT = (0, wx.LEFT | wx.RIGHT | wx.EXPAND, 10) |
|||
|
|||
container = wx.BoxSizer(wx.VERTICAL) |
|||
container.AddSpacer(15) |
|||
container.Add(styling.H1(self, 'Actions'), *STD_LAYOUT) |
|||
container.AddSpacer(5) |
|||
thing = wx.ListBox(self, -1, choices=['Connect', 'process', 'commit', 'fetch']) |
|||
container.Add(thing, 1, wx.LEFT | wx.RIGHT | wx.EXPAND, 10) |
|||
container.AddSpacer(20) |
|||
self.SetSizer(container) |
|||
|
|||
self.Bind(wx.EVT_LISTBOX, self.onClick, thing) |
|||
|
|||
def onClick(self, evt): |
|||
pub.sendMessage("panelListener", message=evt.GetString()) |
|||
evt.Skip() |
Write
Preview
Loading…
Cancel
Save