mlhim-specs-dev team mailing list archive
-
mlhim-specs-dev team
-
Mailing list archive
-
Message #00568
[Branch ~cdd-dev/cdd/trunk] Rev 154: Added a quit button.
------------------------------------------------------------
revno: 154
fixes bug: https://launchpad.net/bugs/1021110
committer: Eduardo César <xcesar@xxxxxxxxx>
branch nick: cdd
timestamp: Wed 2012-07-04 23:22:25 -0300
message:
Added a quit button.
modified:
Generator/cdg/MainFrame.py
Generator/cdg/cdg_extra.py
Generator/cdg_wxglade.wxg
--
lp:cdd
https://code.launchpad.net/~cdd-dev/cdd/trunk
Your team MLHIM Specifications Developers is subscribed to branch lp:cdd.
To unsubscribe from this branch go to https://code.launchpad.net/~cdd-dev/cdd/trunk/+edit-subscription
=== modified file 'Generator/cdg/MainFrame.py'
--- Generator/cdg/MainFrame.py 2012-07-04 20:15:49 +0000
+++ Generator/cdg/MainFrame.py 2012-07-05 02:22:25 +0000
@@ -48,6 +48,7 @@
self.button_about = wx.Button(self.panel_principal, -1, "&About")
self.button_help = wx.Button(self.panel_principal, wx.ID_HELP, "")
self.button_generate = wx.Button(self.panel_principal, -1, "&Generate")
+ self.button_1 = wx.Button(self.panel_principal, wx.ID_EXIT, "")
self.__set_properties()
self.__do_layout()
@@ -55,6 +56,7 @@
self.Bind(wx.EVT_BUTTON, self.about, self.button_about)
self.Bind(wx.EVT_BUTTON, self.help, self.button_help)
self.Bind(wx.EVT_BUTTON, self.generate, self.button_generate)
+ self.Bind(wx.EVT_BUTTON, self.quit_program, self.button_1)
# end wxGlade
cdg_extra.set_icon(self)
@@ -136,6 +138,8 @@
sizer_2_copy.Add(self.button_help, 0, wx.ALIGN_BOTTOM, 0)
sizer_2_copy.Add((20, 20), 0, 0, 0)
sizer_2_copy.Add(self.button_generate, 0, wx.ALIGN_RIGHT | wx.ALIGN_BOTTOM | wx.ALIGN_CENTER_VERTICAL, 1)
+ sizer_2_copy.Add((20, 20), 0, 0, 0)
+ sizer_2_copy.Add(self.button_1, 0, wx.ALIGN_BOTTOM, 0)
sizer_3.Add(sizer_2_copy, 1, wx.EXPAND, 0)
sizer_3.Add((20, 20), 0, 0, 0)
sizer_vertical.Add(sizer_3, 1, wx.EXPAND, 0)
@@ -190,4 +194,7 @@
pass
#self.choice_text = self.choice_ccd.GetStringSelection()
+ def quit_program(self, event): # wxGlade: MainFrame.<event_handler>
+ cdg_extra.quit_program(self)
+
# end of class MainFrame
=== modified file 'Generator/cdg/cdg_extra.py'
--- Generator/cdg/cdg_extra.py 2012-07-02 17:23:35 +0000
+++ Generator/cdg/cdg_extra.py 2012-07-05 02:22:25 +0000
@@ -91,6 +91,16 @@
icon = wx.IconFromBitmap(bitmap)
self.SetIcon(icon)
+def quit_program(self):
+ dlg = wx.MessageDialog(self,
+ "Are you sure you want to exit?",
+ "Quit", wx.OK|wx.CANCEL|wx.ICON_QUESTION)
+ result = dlg.ShowModal()
+ dlg.Destroy()
+ if result == wx.ID_OK:
+ self.Destroy()
+
+
LICENSE = """
This program is free software: you can redistribute it and/or modify
@@ -106,3 +116,4 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
+
=== modified file 'Generator/cdg_wxglade.wxg'
--- Generator/cdg_wxglade.wxg 2012-07-05 02:04:03 +0000
+++ Generator/cdg_wxglade.wxg 2012-07-05 02:22:25 +0000
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<!-- generated by wxGlade 0.6.4 on Wed Jul 4 23:03:25 2012 -->
+<!-- generated by wxGlade 0.6.4 on Wed Jul 4 23:14:52 2012 -->
<application path="cdg" name="" class="" option="1" language="python" top_window="frame_principal" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.8" is_template="0" indent_amount="4" indent_symbol="space" source_extension=".cpp" header_extension=".h">
<object class="MainFrame" name="frame_principal" base="EditFrame">
@@ -446,6 +446,25 @@
</events>
</object>
</object>
+ <object class="sizeritem">
+ <border>0</border>
+ <option>0</option>
+ <object class="spacer" name="spacer" base="EditSpacer">
+ <height>20</height>
+ <width>20</width>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_BOTTOM</flag>
+ <border>0</border>
+ <option>0</option>
+ <object class="wxButton" name="button_1" base="EditButton">
+ <stockitem>EXIT</stockitem>
+ <events>
+ <handler event="EVT_BUTTON">quit_program</handler>
+ </events>
+ </object>
+ </object>
</object>
</object>
<object class="sizeritem">