Created
November 5, 2020 02:33
-
-
Save arizvisa/61cd4dc4da232d3bf9cdb38e26c80cb3 to your computer and use it in GitHub Desktop.
vincenthEE/DotEditor/tree/v0.3.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/DEUtils.py b/DEUtils.py | |
index 90c781e..542ee32 100644 | |
--- a/DEUtils.py | |
+++ b/DEUtils.py | |
@@ -280,7 +280,8 @@ def normalize_imglist(image_list): | |
pos_y = int((max_h-h)/2) | |
new_img = wx.EmptyImage(max_w, max_h) | |
- new_img.Clear(0xff) | |
+ #new_img.Clear(0xff) | |
+ new_img.Clear(b'\xff') | |
new_img.Paste(img, pos_x, pos_y) | |
il.Add(new_img.ConvertToBitmap()) | |
diff --git a/DotEditor.py b/DotEditor.py | |
index 2c0f0ec..93ba171 100644 | |
--- a/DotEditor.py | |
+++ b/DotEditor.py | |
@@ -259,7 +259,8 @@ class MF(MainFrame): | |
for btn_name in ['new', 'open', 'save', 'export', 'script', 'add', 'minus', 'graphsetting', 'help']: | |
set_s = 'self.m_bpButton_%s.SetBitmap( wx.Bitmap( resource_path("resource/icon/%s.png"), wx.BITMAP_TYPE_ANY ) )' | |
eval(set_s%(btn_name,btn_name)) | |
- set_s = 'self.m_bpButton_%s.SetBitmapHover( wx.Bitmap( resource_path("resource/icon/%s-highlight.png"), wx.BITMAP_TYPE_ANY ) )' | |
+ #set_s = 'self.m_bpButton_%s.SetBitmapHover( wx.Bitmap( resource_path("resource/icon/%s-highlight.png"), wx.BITMAP_TYPE_ANY ) )' | |
+ set_s = 'self.m_bpButton_%s.SetBitmapCurrent( wx.Bitmap( resource_path("resource/icon/%s-highlight.png"), wx.BITMAP_TYPE_ANY ) )' | |
eval(set_s%(btn_name, btn_name)) | |
# Set icon. | |
@@ -926,9 +927,12 @@ class MF(MainFrame): | |
if md.ShowModal() != wx.ID_YES: | |
return | |
+ #fd = wx.FileDialog(self, "Open Dot File", "", "", | |
+ # "Graphviz Dot Script (*.*)|*.*", | |
+ # wx.OPEN|wx.FD_FILE_MUST_EXIST) | |
fd = wx.FileDialog(self, "Open Dot File", "", "", | |
"Graphviz Dot Script (*.*)|*.*", | |
- wx.OPEN|wx.FD_FILE_MUST_EXIST) | |
+ wx.FD_OPEN|wx.FD_FILE_MUST_EXIST) | |
if fd.ShowModal() == wx.ID_OK: | |
fp = fd.GetPath() | |
else: | |
diff --git a/ExtGraph.py b/ExtGraph.py | |
index 9797fc0..5761d2d 100644 | |
--- a/ExtGraph.py | |
+++ b/ExtGraph.py | |
@@ -118,7 +118,8 @@ class ExtGraph(pydot.Dot): | |
def refresh_bitmap(self): | |
self.write(TEMP_IMG_FILE, self.prog, 'png') | |
- self.__bitmap = wx.EmptyBitmap(0,0) | |
+ #self.__bitmap = wx.EmptyBitmap(0,0) | |
+ self.__bitmap = wx.EmptyBitmap(1,1) | |
self.__bitmap.LoadFile(TEMP_IMG_FILE, wx.BITMAP_TYPE_PNG) | |
return | |
diff --git a/ExtPG.py b/ExtPG.py | |
index 84f7320..b9e09cf 100644 | |
--- a/ExtPG.py | |
+++ b/ExtPG.py | |
@@ -12,6 +12,7 @@ Some editor dialog use the singleton method to promote efficiency. | |
import os | |
import wx.propgrid as wxpg | |
+wxpg.LABEL_AS_NAME = wxpg.PG_LABEL | |
import AttrsDef | |
import wx, types, colour | |
import re | |
@@ -54,7 +55,8 @@ class CSDialog(ColorSchemeDialog): | |
def __init__(self, parent, scheme='x11'): | |
- ColorSchemeDialog.__init__(self, parent) | |
+ #ColorSchemeDialog.__init__(self, parent) | |
+ super(CSDialog, self).__init__(parent) | |
self.choice = AttrsDef.E_COLORSCHEME | |
@@ -127,7 +129,8 @@ class CSCDialog(ColorSingleChoiceDialog): | |
'''A Dialog to select a color.''' | |
def __init__(self, parent, scheme='x11'): | |
- ColorSingleChoiceDialog.__init__(self, parent) | |
+ #ColorSingleChoiceDialog.__init__(self, parent) | |
+ super(CSCDialog, self).__init__(parent) | |
self.SetTitle('Pick a color') | |
self.m_staticText_message.SetLabel('Select a color in "%s":'%scheme) | |
@@ -205,7 +208,8 @@ class NodeShapeDialog(ImageSingleChoiceDialog): | |
def __init__(self, parent): | |
- ImageSingleChoiceDialog.__init__(self, parent) | |
+ #ImageSingleChoiceDialog.__init__(self, parent) | |
+ super(NodeShapeDialog, self).__init__(parent) | |
self.SetTitle('Select node shape') | |
self.m_message.SetLabel('Choice a node shape below:') | |
@@ -270,7 +274,8 @@ class ATDialog(ArrowTypeDialog): | |
return AT_DIALOG | |
def __init__(self, parent): | |
- ArrowTypeDialog.__init__(self, parent) | |
+ #ArrowTypeDialog.__init__(self, parent) | |
+ super(ATDialog, self).__init__(parent) | |
self.base_at_list = AttrsDef.E_ARROWTYPE | |
il = get_root_window(self).image_list['arrow_style'] | |
@@ -400,12 +405,14 @@ class ATDialog(ArrowTypeDialog): | |
self.EndModal(wx.ID_OK) | |
-class DotStringProperty(wxpg.PyProperty): | |
+#class DotStringProperty(wxpg.PyProperty): | |
+class DotStringProperty(wxpg.PGProperty): | |
''' | |
Why this? This class existed because the build-in wxpg.PyStringProperty not trigger event when zero-length string input. | |
''' | |
def __init__(self, label, name=wxpg.LABEL_AS_NAME, value=''): | |
- wxpg.PyProperty.__init__(self, label, name) | |
+ #wxpg.PyProperty.__init__(self, label, name) | |
+ super(DotStringProperty, self).__init__(label, name) | |
self.SetValue(value) | |
def GetClassName(self): | |
@@ -455,7 +462,8 @@ class DotBigStringProperty(DotStringProperty): | |
return ok | |
-class DotFloatProperty(wxpg.PyFloatProperty): | |
+#class DotFloatProperty(wxpg.PyFloatProperty): | |
+class DotFloatProperty(wxpg.FloatProperty): | |
def ValueToString(self, v, flags): | |
c_str = str(v) | |
@@ -468,9 +476,11 @@ class DotFloatProperty(wxpg.PyFloatProperty): | |
return self.ValueToString(self.m_value, None) | |
-class DotColorSchemeProperty(wxpg.PyProperty): | |
+#class DotColorSchemeProperty(wxpg.PyProperty): | |
+class DotColorSchemeProperty(wxpg.PGProperty): | |
def __init__(self, label, name=wxpg.LABEL_AS_NAME, value=''): | |
- wxpg.PyProperty.__init__(self, label, name) | |
+ #wxpg.PyProperty.__init__(self, label, name) | |
+ super(DotColorSchemeProperty, self).__init__(label, name) | |
self.SetValue(value) | |
self.choices = AttrsDef.E_COLORSCHEME | |
@@ -508,7 +518,8 @@ class DotColorSchemeProperty(wxpg.PyProperty): | |
return ok | |
-class DotColorProperty(wxpg.PyProperty): | |
+#class DotColorProperty(wxpg.PyProperty): | |
+class DotColorProperty(wxpg.PGProperty): | |
'''The value of pg should be 3 type: | |
1. A color name in string. | |
2. A RGB/RGBA value in tuple(r,g,b in 0~255). | |
@@ -516,7 +527,8 @@ class DotColorProperty(wxpg.PyProperty): | |
''' | |
def __init__(self, label, name=wxpg.LABEL_AS_NAME, value=''): | |
- wxpg.PyProperty.__init__(self, label, name) | |
+ #wxpg.PyProperty.__init__(self, label, name) | |
+ super(DotColorProperty, self).__init__(label, name) | |
self.SetValue(value) | |
def GetClassName(self): | |
@@ -630,10 +642,12 @@ class DotColorProperty(wxpg.PyProperty): | |
return c_str | |
-class DotEnumProperty(wxpg.PyProperty): | |
+#class DotEnumProperty(wxpg.PyProperty): | |
+class DotEnumProperty(wxpg.PGProperty): | |
def __init__(self, label, name=wxpg.LABEL_AS_NAME, value=''): | |
- wxpg.PyProperty.__init__(self, label, name) | |
+ #wxpg.PyProperty.__init__(self, label, name) | |
+ super(DotEnumProperty, self).__init__(label, name) | |
self.SetValue(value) | |
def GetClassName(self): | |
@@ -653,10 +667,11 @@ class DotEnumProperty(wxpg.PyProperty): | |
return str(value) | |
-class DotEnumCombineProperty(wxpg.PyProperty): | |
+#class DotEnumCombineProperty(wxpg.PyProperty): | |
+class DotEnumCombineProperty(wxpg.PGProperty): | |
def __init__(self, label, name=wxpg.LABEL_AS_NAME, value=''): | |
- wxpg.PyProperty.__init__(self, label, name) | |
+ super(DotEnumCombineProperty, self).__init__(label, name) | |
self.SetValue(value) | |
def GetClassName(self): | |
@@ -708,10 +723,12 @@ class DotEnumCombineProperty(wxpg.PyProperty): | |
return str(value) | |
-class DotEnumNodeShapeProperty(wxpg.PyProperty): | |
+#class DotEnumNodeShapeProperty(wxpg.PyProperty): | |
+class DotEnumNodeShapeProperty(wxpg.PGProperty): | |
def __init__(self, label, name=wxpg.LABEL_AS_NAME, value=''): | |
- wxpg.PyProperty.__init__(self, label, name) | |
+ #wxpg.PyProperty.__init__(self, label, name) | |
+ super(DotEnumNodeShapeProperty, self).__init__(label, name) | |
self.SetValue(value) | |
self.choices = AttrsDef.E_SHAPE | |
@@ -751,10 +768,12 @@ class DotEnumNodeShapeProperty(wxpg.PyProperty): | |
return str(value) | |
-class DotEnumArrowTypeProperty(wxpg.PyProperty): | |
+#class DotEnumArrowTypeProperty(wxpg.PyProperty): | |
+class DotEnumArrowTypeProperty(wxpg.PGProperty): | |
def __init__(self, label, name=wxpg.LABEL_AS_NAME, value=''): | |
- wxpg.PyProperty.__init__(self, label, name) | |
+ #wxpg.PyProperty.__init__(self, label, name) | |
+ super(DotEnumArrowTypeProperty, self).__init__(label, name) | |
self.SetValue(value) | |
def GetClassName(self): | |
@@ -792,7 +811,8 @@ class DotEnumArrowTypeProperty(wxpg.PyProperty): | |
def ValueToString(self, value, flags): | |
return str(value) | |
-class DotEditEnumProperty(wxpg.PyStringProperty): | |
+#class DotEditEnumProperty(wxpg.PyStringProperty): | |
+class DotEditEnumProperty(wxpg.StringProperty): | |
def GetEditor(self): | |
return "ComboBox" | |
@@ -801,7 +821,8 @@ map_type2class = {'string': DotStringProperty, | |
'bigstring': DotBigStringProperty, | |
'int': wxpg.UIntProperty, | |
'bool': wxpg.BoolProperty, | |
- 'float': DotFloatProperty, | |
+ #'float': DotFloatProperty, | |
+ 'float': wxpg.FloatProperty, | |
'color': DotColorProperty, | |
'colorscheme': DotColorSchemeProperty, | |
'enum': DotEnumProperty, | |
@@ -821,7 +842,8 @@ def buildPG(attr_name, g_type): | |
pg_item = pg_class(attr_name) | |
if info['type'] in ['enum', 'enum_edit', 'enum_combine']: | |
- pg_item.SetChoices(info['param']) | |
+ #pg_item.SetChoices(info['param']) | |
+ [ pg_item.AddChoice(item) for item in info['param'] ] | |
#elif info['type'] == 'bool': | |
# pg_item.SetEditor('CheckBox') | |
diff --git a/UIClass.py b/UIClass.py | |
index 3f13225..61a79eb 100644 | |
--- a/UIClass.py | |
+++ b/UIClass.py | |
@@ -43,21 +43,25 @@ class MainFrame ( wx.Frame ): | |
fgSizer15.Add( self.m_panel17, 1, wx.EXPAND |wx.ALL, 0 ) | |
- fgSizer15.AddSpacer( ( 8, 30), 1, wx.EXPAND, 5 ) | |
+ #fgSizer15.AddSpacer( ( 8, 30), 1, wx.EXPAND, 5 ) | |
+ fgSizer15.Add( ( 8, 30), 1, wx.EXPAND, 5 ) | |
self.m_bpButton_new = wx.BitmapButton( self.m_panel16, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.Size( 50,-1 ), wx.BU_AUTODRAW|wx.NO_BORDER ) | |
self.m_bpButton_new.SetBitmapFocus( wx.NullBitmap ) | |
- self.m_bpButton_new.SetBitmapHover( wx.NullBitmap ) | |
+ #self.m_bpButton_new.SetBitmapHover( wx.NullBitmap ) | |
+ self.m_bpButton_new.SetBitmapCurrent( wx.NullBitmap ) | |
self.m_bpButton_new.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) ) | |
self.m_bpButton_new.SetToolTipString( u"Create a new Graph" ) | |
- fgSizer15.Add( self.m_bpButton_new, 0, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5 ) | |
+ #fgSizer15.Add( self.m_bpButton_new, 0, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5 ) | |
+ fgSizer15.Add( self.m_bpButton_new, 0, wx.ALL|wx.EXPAND, 5 ) | |
self.m_bpButton_open = wx.BitmapButton( self.m_panel16, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.Size( 50,-1 ), wx.BU_AUTODRAW|wx.NO_BORDER ) | |
self.m_bpButton_open.SetBitmapFocus( wx.NullBitmap ) | |
- self.m_bpButton_open.SetBitmapHover( wx.NullBitmap ) | |
+ #self.m_bpButton_open.SetBitmapHover( wx.NullBitmap ) | |
+ self.m_bpButton_open.SetBitmapCurrent( wx.NullBitmap ) | |
self.m_bpButton_open.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) ) | |
self.m_bpButton_open.SetToolTipString( u"Open a existed Graph file" ) | |
@@ -66,7 +70,8 @@ class MainFrame ( wx.Frame ): | |
self.m_bpButton_save = wx.BitmapButton( self.m_panel16, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.Size( 50,-1 ), wx.BU_AUTODRAW|wx.NO_BORDER ) | |
self.m_bpButton_save.SetBitmapFocus( wx.NullBitmap ) | |
- self.m_bpButton_save.SetBitmapHover( wx.NullBitmap ) | |
+ #self.m_bpButton_save.SetBitmapHover( wx.NullBitmap ) | |
+ self.m_bpButton_save.SetBitmapCurrent( wx.NullBitmap ) | |
self.m_bpButton_save.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) ) | |
self.m_bpButton_save.SetToolTipString( u"Save graph to file" ) | |
@@ -75,7 +80,8 @@ class MainFrame ( wx.Frame ): | |
self.m_bpButton_script = wx.BitmapButton( self.m_panel16, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.Size( 50,-1 ), wx.BU_AUTODRAW|wx.NO_BORDER ) | |
self.m_bpButton_script.SetBitmapFocus( wx.NullBitmap ) | |
- self.m_bpButton_script.SetBitmapHover( wx.NullBitmap ) | |
+ #self.m_bpButton_script.SetBitmapHover( wx.NullBitmap ) | |
+ self.m_bpButton_script.SetBitmapCurrent( wx.NullBitmap ) | |
self.m_bpButton_script.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) ) | |
self.m_bpButton_script.SetToolTipString( u"View dot script" ) | |
@@ -84,7 +90,8 @@ class MainFrame ( wx.Frame ): | |
self.m_bpButton_export = wx.BitmapButton( self.m_panel16, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.Size( 50,-1 ), wx.BU_AUTODRAW|wx.NO_BORDER ) | |
self.m_bpButton_export.SetBitmapFocus( wx.NullBitmap ) | |
- self.m_bpButton_export.SetBitmapHover( wx.NullBitmap ) | |
+ #self.m_bpButton_export.SetBitmapHover( wx.NullBitmap ) | |
+ self.m_bpButton_export.SetBitmapCurrent( wx.NullBitmap ) | |
self.m_bpButton_export.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) ) | |
self.m_bpButton_export.SetToolTipString( u"Save graph to image file" ) | |
@@ -96,7 +103,8 @@ class MainFrame ( wx.Frame ): | |
fgSizer15.Add( self.m_button_save_as, 0, wx.ALL, 5 ) | |
- fgSizer15.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) | |
+ #fgSizer15.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) | |
+ fgSizer15.Add( ( 0, 0), 1, wx.EXPAND, 5 ) | |
self.m_bpButton_help = wx.BitmapButton( self.m_panel16, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.Size( 50,-1 ), wx.BU_AUTODRAW|wx.NO_BORDER ) | |
self.m_bpButton_help.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) ) | |
@@ -149,18 +157,21 @@ class MainFrame ( wx.Frame ): | |
self.m_bpButton_graphsetting = wx.BitmapButton( self.m_panel7, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW|wx.NO_BORDER ) | |
self.m_bpButton_graphsetting.SetBitmapFocus( wx.NullBitmap ) | |
- self.m_bpButton_graphsetting.SetBitmapHover( wx.NullBitmap ) | |
+ #self.m_bpButton_graphsetting.SetBitmapHover( wx.NullBitmap ) | |
+ self.m_bpButton_graphsetting.SetBitmapCurrent( wx.NullBitmap ) | |
self.m_bpButton_graphsetting.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) | |
fgSizer7.Add( self.m_bpButton_graphsetting, 0, wx.ALL, 5 ) | |
- fgSizer7.AddSpacer( ( 12, 0), 1, wx.EXPAND, 5 ) | |
+ #fgSizer7.AddSpacer( ( 12, 0), 1, wx.EXPAND, 5 ) | |
+ fgSizer7.Add( ( 12, 0), 1, wx.EXPAND, 5 ) | |
self.m_bpButton_add = wx.BitmapButton( self.m_panel7, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW|wx.NO_BORDER ) | |
self.m_bpButton_add.SetBitmapFocus( wx.NullBitmap ) | |
- self.m_bpButton_add.SetBitmapHover( wx.NullBitmap ) | |
+ #self.m_bpButton_add.SetBitmapHover( wx.NullBitmap ) | |
+ self.m_bpButton_add.SetBitmapCurrent( wx.NullBitmap ) | |
self.m_bpButton_add.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) | |
fgSizer7.Add( self.m_bpButton_add, 0, wx.ALL, 5 ) | |
@@ -168,13 +179,15 @@ class MainFrame ( wx.Frame ): | |
self.m_bpButton_minus = wx.BitmapButton( self.m_panel7, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW|wx.NO_BORDER ) | |
self.m_bpButton_minus.SetBitmapFocus( wx.NullBitmap ) | |
- self.m_bpButton_minus.SetBitmapHover( wx.NullBitmap ) | |
+ #self.m_bpButton_minus.SetBitmapHover( wx.NullBitmap ) | |
+ self.m_bpButton_minus.SetBitmapCurrent( wx.NullBitmap ) | |
self.m_bpButton_minus.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) | |
fgSizer7.Add( self.m_bpButton_minus, 0, wx.ALL, 5 ) | |
- fgSizer7.AddSpacer( ( 5, 0), 1, wx.EXPAND, 5 ) | |
+ #fgSizer7.AddSpacer( ( 5, 0), 1, wx.EXPAND, 5 ) | |
+ fgSizer7.Add( ( 5, 0), 1, wx.EXPAND, 5 ) | |
self.m_panel7.SetSizer( fgSizer7 ) | |
@@ -224,7 +237,8 @@ class MainFrame ( wx.Frame ): | |
self.m_pgManager1.SetExtraStyle( wx.propgrid.PG_EX_MODE_BUTTONS ) | |
self.m_pgManager1.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) | |
- fgSizer5.Add( self.m_pgManager1, 2, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 2 ) | |
+ #fgSizer5.Add( self.m_pgManager1, 2, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 2 ) | |
+ fgSizer5.Add( self.m_pgManager1, 2, wx.ALL|wx.EXPAND, 2 ) | |
self.m_panel5.SetSizer( fgSizer5 ) | |
@@ -261,7 +275,8 @@ class MainFrame ( wx.Frame ): | |
fgSizer11.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 1 ) | |
- fgSizer11.AddSpacer( ( 0, 26), 1, wx.EXPAND, 5 ) | |
+ #fgSizer11.AddSpacer( ( 0, 26), 1, wx.EXPAND, 5 ) | |
+ fgSizer11.Add( ( 0, 26), 1, wx.EXPAND, 5 ) | |
self.m_staticText_zoom = wx.StaticText( self.m_panel12, wx.ID_ANY, u"Zoom:100%", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT ) | |
self.m_staticText_zoom.Wrap( -1 ) | |
@@ -275,7 +290,8 @@ class MainFrame ( wx.Frame ): | |
fgSizer11.Add( self.m_button16, 0, wx.ALIGN_CENTER|wx.FIXED_MINSIZE, 5 ) | |
- fgSizer11.AddSpacer( ( 3, 0), 1, wx.EXPAND, 5 ) | |
+ #fgSizer11.AddSpacer( ( 3, 0), 1, wx.EXPAND, 5 ) | |
+ fgSizer11.Add( ( 3, 0), 1, wx.EXPAND, 5 ) | |
self.m_panel12.SetSizer( fgSizer11 ) | |
@@ -313,7 +329,8 @@ class MainFrame ( wx.Frame ): | |
self.m_staticText1_hint.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), 72, 90, 90, False, wx.EmptyString ) ) | |
self.m_staticText1_hint.SetForegroundColour( wx.Colour( 21, 120, 180 ) ) | |
- fgSizer151.Add( self.m_staticText1_hint, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL|wx.EXPAND, 5 ) | |
+ #fgSizer151.Add( self.m_staticText1_hint, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL|wx.EXPAND, 5 ) | |
+ fgSizer151.Add( self.m_staticText1_hint, 0, wx.ALIGN_LEFT|wx.ALL|wx.EXPAND, 5 ) | |
self.m_panel18.SetSizer( fgSizer151 ) | |
@@ -457,7 +474,8 @@ class DialogAppend ( wx.Dialog ): | |
m_comboBox_nodeAChoices = [] | |
self.m_comboBox_nodeA = wx.ComboBox( self.m_panel_node, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_comboBox_nodeAChoices, 0 ) | |
- fgSizer2.Add( self.m_comboBox_nodeA, 0, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5 ) | |
+ #fgSizer2.Add( self.m_comboBox_nodeA, 0, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5 ) | |
+ fgSizer2.Add( self.m_comboBox_nodeA, 0, wx.ALL|wx.EXPAND, 5 ) | |
self.m_staticText2 = wx.StaticText( self.m_panel_node, wx.ID_ANY, u"Node B:", wx.DefaultPosition, wx.DefaultSize, 0 ) | |
self.m_staticText2.Wrap( -1 ) | |
@@ -467,7 +485,8 @@ class DialogAppend ( wx.Dialog ): | |
self.m_comboBox_nodeB = wx.ComboBox( self.m_panel_node, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_comboBox_nodeBChoices, 0 ) | |
self.m_comboBox_nodeB.Enable( False ) | |
- fgSizer2.Add( self.m_comboBox_nodeB, 0, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5 ) | |
+ #fgSizer2.Add( self.m_comboBox_nodeB, 0, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5 ) | |
+ fgSizer2.Add( self.m_comboBox_nodeB, 0, wx.ALL|wx.EXPAND, 5 ) | |
self.m_staticText16 = wx.StaticText( self.m_panel_node, wx.ID_ANY, u"Lable:", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT ) | |
self.m_staticText16.Wrap( -1 ) | |
@@ -696,12 +715,14 @@ class DialogAbout ( wx.Dialog ): | |
self.m_staticText4.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), 70, 90, 92, False, wx.EmptyString ) ) | |
self.m_staticText4.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) ) | |
- fgSizer27.Add( self.m_staticText4, 0, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5 ) | |
+ #fgSizer27.Add( self.m_staticText4, 0, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5 ) | |
+ fgSizer27.Add( self.m_staticText4, 0, wx.ALL|wx.EXPAND, 5 ) | |
self.m_hyperlink1 = wx.HyperlinkCtrl( self.m_panel28, wx.ID_ANY, u"DotEditor Website", u"http://vincenthee.github.io/DotEditor/", wx.DefaultPosition, wx.DefaultSize, wx.HL_ALIGN_CENTRE|wx.HL_DEFAULT_STYLE ) | |
self.m_hyperlink1.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), 70, 90, 90, False, wx.EmptyString ) ) | |
- fgSizer27.Add( self.m_hyperlink1, 0, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5 ) | |
+ #fgSizer27.Add( self.m_hyperlink1, 0, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5 ) | |
+ fgSizer27.Add( self.m_hyperlink1, 0, wx.ALL|wx.EXPAND, 5 ) | |
self.m_panel28.SetSizer( fgSizer27 ) | |
@@ -787,7 +808,8 @@ class DialogGraphSetting ( wx.Dialog ): | |
self.m_staticText8 = wx.StaticText( self.m_panel15, wx.ID_ANY, u"Strict:", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT ) | |
self.m_staticText8.Wrap( -1 ) | |
- fgSizer14.Add( self.m_staticText8, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL|wx.EXPAND, 5 ) | |
+ #fgSizer14.Add( self.m_staticText8, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL|wx.EXPAND, 5 ) | |
+ fgSizer14.Add( self.m_staticText8, 0, wx.ALIGN_RIGHT|wx.ALL|wx.EXPAND, 5 ) | |
self.m_checkBox_strict = wx.CheckBox( self.m_panel15, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) | |
fgSizer14.Add( self.m_checkBox_strict, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) | |
@@ -809,10 +831,12 @@ class DialogGraphSetting ( wx.Dialog ): | |
fgSizer14.Add( self.m_choice_layout_cmd, 0, wx.ALL|wx.EXPAND, 5 ) | |
- fgSizer14.AddSpacer( ( 0, 5), 1, wx.EXPAND, 5 ) | |
+ #fgSizer14.AddSpacer( ( 0, 5), 1, wx.EXPAND, 5 ) | |
+ fgSizer14.Add( ( 0, 5), 1, wx.EXPAND, 5 ) | |
- fgSizer14.AddSpacer( ( 0, 5), 1, wx.EXPAND, 5 ) | |
+ #fgSizer14.AddSpacer( ( 0, 5), 1, wx.EXPAND, 5 ) | |
+ fgSizer14.Add( ( 0, 5), 1, wx.EXPAND, 5 ) | |
fgSizer22.Add( fgSizer14, 1, wx.EXPAND, 5 ) | |
@@ -961,10 +985,12 @@ class ArrowTypeDialog ( wx.Dialog ): | |
gbSizer3.Add( self.m_bitmap_preview, wx.GBPosition( 0, 0 ), wx.GBSpan( 1, 1 ), wx.ALIGN_CENTER|wx.ALL, 5 ) | |
- gbSizer3.AddSpacer( ( 0, 0 ), wx.GBPosition( 4, 1 ), wx.GBSpan( 1, 1 ), wx.EXPAND, 5 ) | |
+ #gbSizer3.AddSpacer( ( 0, 0 ), wx.GBPosition( 4, 1 ), wx.GBSpan( 1, 1 ), wx.EXPAND, 5 ) | |
+ gbSizer3.Add( ( 0, 0 ), wx.GBPosition( 4, 1 ), wx.GBSpan( 1, 1 ), wx.EXPAND, 5 ) | |
self.m_list = wx.ListCtrl( self.m_panel26, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LC_AUTOARRANGE|wx.LC_ICON ) | |
- gbSizer3.Add( self.m_list, wx.GBPosition( 0, 1 ), wx.GBSpan( 4, 1 ), wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5 ) | |
+ #gbSizer3.Add( self.m_list, wx.GBPosition( 0, 1 ), wx.GBSpan( 4, 1 ), wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5 ) | |
+ gbSizer3.Add( self.m_list, wx.GBPosition( 0, 1 ), wx.GBSpan( 4, 1 ), wx.ALL|wx.EXPAND, 5 ) | |
gbSizer3.AddGrowableCol( 1 ) | |
diff --git a/dot_parser.py b/dot_parser.py | |
index 5262b9e..8f86aaa 100644 | |
--- a/dot_parser.py | |
+++ b/dot_parser.py | |
@@ -22,11 +22,11 @@ import codecs | |
from pyparsing import __version__ as pyparsing_version | |
-from pyparsing import ( nestedExpr, Literal, CaselessLiteral, Word, Upcase, OneOrMore, ZeroOrMore, | |
+from pyparsing import ( nestedExpr, Literal, CaselessLiteral, Word, upcaseTokens, OneOrMore, ZeroOrMore, | |
Forward, NotAny, delimitedList, oneOf, Group, Optional, Combine, alphas, nums, | |
restOfLine, cStyleComment, nums, alphanums, printables, empty, quotedString, | |
ParseException, ParseResults, CharsNotIn, dblQuotedString, QuotedString, ParserElement ) | |
- | |
+Upcase=upcaseTokens | |
class P_AttrList: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment