Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置标注框颜色 #31

Merged
merged 1 commit into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ test_output/select*
*.spec
*.pptx
font/all/

.venv/

11 changes: 11 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,5 +1101,16 @@ def show_scale_change(self, event):
self.show_scale_proportion = 0
self.refresh(event)

def select_img_box_func( self, event ):
if self.select_img_box.Value:
self.box_id = -1

def set_box_color( self, event ):
if self.select_img_box.Value:
if self.box_id != -1:
self.checkBox_auto_draw_color.Value = False
self.color_list[self.box_id] = self.colourPicker_draw.GetColour()
self.refresh(event)

# self.show_scale = wx.TextCtrl( self.scrolledWindow_set, wx.ID_ANY, u"1,1", wx.DefaultPosition, wx.Size( 60,-1 ), style=wx.TE_PROCESS_ENTER)
# wSizer6.Add( self.show_scale, 0, wx.ALL, 5 )
13 changes: 10 additions & 3 deletions main_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ def __init__( self, parent ):
self.box_position.SetSelection( 0 )
wSizer7.Add( self.box_position, 0, wx.ALL, 5 )

self.m_button7 = wx.Button( self.scrolledWindow_set, wx.ID_ANY, u"Set Color", wx.DefaultPosition, wx.Size( -1,-1 ), 0 )
wSizer7.Add( self.m_button7, 0, wx.ALL, 5 )


fgSizer3.Add( wSizer7, 1, wx.EXPAND, 5 )

Expand Down Expand Up @@ -446,7 +449,7 @@ def __init__( self, parent ):

wSizer6.Add( self.m_staticText6, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )

self.show_scale = wx.TextCtrl( self.scrolledWindow_set, wx.ID_ANY, u"1,1", wx.DefaultPosition, wx.Size( 60,-1 ), style=wx.TE_PROCESS_ENTER )
self.show_scale = wx.TextCtrl( self.scrolledWindow_set, wx.ID_ANY, u"1,1", wx.DefaultPosition, wx.Size( 60,-1 ), wx.TE_PROCESS_ENTER )
wSizer6.Add( self.show_scale, 0, wx.ALL, 5 )

self.m_staticText7 = wx.StaticText( self.scrolledWindow_set, wx.ID_ANY, u"Out", wx.DefaultPosition, wx.DefaultSize, 0 )
Expand Down Expand Up @@ -499,15 +502,15 @@ def __init__( self, parent ):

wSizer8.Add( self.m_staticText22, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )

self.colourPicker_draw = wx.ColourPickerCtrl( self.scrolledWindow_set, wx.ID_ANY, wx.Colour( 239, 41, 41 ), wx.DefaultPosition, wx.Size( 40,-1 ), wx.CLRP_DEFAULT_STYLE )
self.colourPicker_draw = wx.ColourPickerCtrl( self.scrolledWindow_set, wx.ID_ANY, wx.Colour( 239, 41, 41 ), wx.DefaultPosition, wx.Size( 30,-1 ), wx.CLRP_DEFAULT_STYLE )
wSizer8.Add( self.colourPicker_draw, 0, wx.ALL, 5 )

self.m_staticText17 = wx.StaticText( self.scrolledWindow_set, wx.ID_ANY, u"Gap", wx.DefaultPosition, wx.Size( -1,-1 ), 0 )
self.m_staticText17.Wrap( -1 )

wSizer8.Add( self.m_staticText17, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )

self.colourPicker_gap = wx.ColourPickerCtrl( self.scrolledWindow_set, wx.ID_ANY, wx.Colour( 255, 255, 255 ), wx.DefaultPosition, wx.Size( 40,-1 ), wx.CLRP_DEFAULT_STYLE )
self.colourPicker_gap = wx.ColourPickerCtrl( self.scrolledWindow_set, wx.ID_ANY, wx.Colour( 255, 255, 255 ), wx.DefaultPosition, wx.Size( 30,-1 ), wx.CLRP_DEFAULT_STYLE )
wSizer8.Add( self.colourPicker_gap, 0, wx.ALL, 5 )


Expand Down Expand Up @@ -656,6 +659,7 @@ def __init__( self, parent ):
self.parallel_sequential.Bind( wx.EVT_CHECKBOX, self.parallel_sequential_fc )
self.parallel_to_sequential.Bind( wx.EVT_CHECKBOX, self.parallel_to_sequential_fc )
self.select_img_box.Bind( wx.EVT_CHECKBOX, self.select_img_box_func )
self.m_button7.Bind( wx.EVT_BUTTON, self.set_box_color )
self.title_auto.Bind( wx.EVT_CHECKBOX, self.title_auto_fc )
self.title_down_up.Bind( wx.EVT_CHECKBOX, self.title_down_up_fc )
self.show_scale.Bind( wx.EVT_TEXT_ENTER, self.show_scale_change )
Expand Down Expand Up @@ -734,6 +738,9 @@ def parallel_to_sequential_fc( self, event ):
def select_img_box_func( self, event ):
event.Skip()

def set_box_color( self, event ):
event.Skip()

def title_auto_fc( self, event ):
event.Skip()

Expand Down
80 changes: 77 additions & 3 deletions wxFromBuilder/main_gui.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -4063,6 +4063,80 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Set Color</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_button7</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size">-1,-1</property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">set_box_color</event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
Expand Down Expand Up @@ -5249,7 +5323,7 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size">60,-1</property>
<property name="style"></property>
<property name="style">wxTE_PROCESS_ENTER</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
Expand Down Expand Up @@ -6002,7 +6076,7 @@
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size">40,-1</property>
<property name="size">30,-1</property>
<property name="style">wxCLRP_DEFAULT_STYLE</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
Expand Down Expand Up @@ -6126,7 +6200,7 @@
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size">40,-1</property>
<property name="size">30,-1</property>
<property name="style">wxCLRP_DEFAULT_STYLE</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
Expand Down