← Back to team overview

mlhim-specs-dev team mailing list archive

[Branch ~cdd-dev/cdd/trunk] Rev 194: Added simple config dialog (to be expanded).

 

------------------------------------------------------------
revno: 194
committer: Eduardo C. P. Ribeiro <eduardo.cesar@xxxxxxx>
branch nick: cdd
timestamp: Tue 2012-07-24 23:29:40 -0300
message:
  Added simple config dialog (to be expanded).
modified:
  src/cdd.py
  src/cdg_cdd.wxg
  src/cdg_main.py


--
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 'src/cdd.py'
--- src/cdd.py	2012-07-22 09:52:33 +0000
+++ src/cdd.py	2012-07-25 02:29:40 +0000
@@ -76,9 +76,15 @@
 
         # Config Menu
         configMenu = wx.Menu()
+        config_options = wx.MenuItem(configMenu, wx.ID_ANY, _("&Options"))
+        configMenu.AppendItem(config_options)
+        self.Bind(wx.EVT_MENU, self.show_config, config_options)
+
         configMenu.Append(wx.ID_ANY, _("&Save"), "", wx.ITEM_NORMAL)
         self.menubar.Append(configMenu, _("&Config"))
 
+
+
         # Help Menu
         helpMenu = wx.Menu()
         ugmi = wx.MenuItem(helpMenu, wx.ID_HELP, _("&Users Guide"))
@@ -151,6 +157,10 @@
         self.Centre()
         self.Show()
 
+
+        # Misc initializations
+        self.config_dialog = cdg_main.ConfigDialog(self)
+
     def OnSelChanged(self, event):
         item =  event.GetItem()
         _data = None
@@ -371,6 +381,9 @@
         wx.AboutBox(about)
 
 
+    def show_config(self, event):
+        self.config_dialog.ShowModal()
+
 # end of class MainFrame
 
 credits = ["Eduardo César", "Timothy W.Cook", "Luciana Tricai Cavalini"]

=== modified file 'src/cdg_cdd.wxg'
--- src/cdg_cdd.wxg	2012-07-20 09:43:45 +0000
+++ src/cdg_cdd.wxg	2012-07-25 02:29:40 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<!-- generated by wxGlade 0.6.4 on Fri Jul 20 03:05:53 2012 -->
+<!-- generated by wxGlade 0.6.4 on Tue Jul 24 23:29:05 2012 -->
 
 <application path="cdg_main.py" name="" class="" option="0" 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="MainDialog" name="dialog_principal" base="EditDialog">
@@ -422,4 +422,76 @@
             </object>
         </object>
     </object>
+    <object class="ConfigDialog" name="dialog_config" base="EditDialog">
+        <style>wxDEFAULT_DIALOG_STYLE</style>
+        <title>Configuration</title>
+        <size>588, 128</size>
+        <object class="wxBoxSizer" name="sizer_main" base="EditBoxSizer">
+            <orient>wxVERTICAL</orient>
+            <object class="sizeritem">
+                <flag>wxEXPAND</flag>
+                <border>0</border>
+                <option>1</option>
+                <object class="wxBoxSizer" name="sizer_2" base="EditBoxSizer">
+                    <orient>wxHORIZONTAL</orient>
+                    <object class="sizeritem">
+                        <flag>wxEXPAND</flag>
+                        <border>7</border>
+                        <option>1</option>
+                        <object class="wxStaticBoxSizer" name="sizer_9" base="EditStaticBoxSizer">
+                            <orient>wxHORIZONTAL</orient>
+                            <label>Workspace path:</label>
+                            <object class="sizeritem">
+                                <border>0</border>
+                                <option>1</option>
+                                <object class="wxTextCtrl" name="text_ctrl_workspace" base="EditTextCtrl">
+                                </object>
+                            </object>
+                        </object>
+                    </object>
+                    <object class="sizerslot" />
+                </object>
+            </object>
+            <object class="sizeritem">
+                <flag>wxEXPAND</flag>
+                <border>0</border>
+                <option>1</option>
+                <object class="wxBoxSizer" name="sizer_10" base="EditBoxSizer">
+                    <orient>wxHORIZONTAL</orient>
+                    <object class="sizeritem">
+                        <border>0</border>
+                        <option>1</option>
+                        <object class="spacer" name="spacer" base="EditSpacer">
+                            <height>20</height>
+                            <width>20</width>
+                        </object>
+                    </object>
+                    <object class="sizeritem">
+                        <flag>wxALIGN_CENTER_VERTICAL</flag>
+                        <border>0</border>
+                        <option>0</option>
+                        <object class="wxButton" name="button_2" base="EditButton">
+                            <stockitem>CANCEL</stockitem>
+                        </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_CENTER_VERTICAL</flag>
+                        <border>0</border>
+                        <option>0</option>
+                        <object class="wxButton" name="button_1" base="EditButton">
+                            <stockitem>OK</stockitem>
+                        </object>
+                    </object>
+                </object>
+            </object>
+        </object>
+    </object>
 </application>

=== modified file 'src/cdg_main.py'
--- src/cdg_main.py	2012-07-24 14:56:34 +0000
+++ src/cdg_main.py	2012-07-25 02:29:40 +0000
@@ -21,6 +21,53 @@
 # end wxGlade
 
 
+
+class ConfigDialog(wx.Dialog):
+    def __init__(self, *args, **kwds):
+        # begin wxGlade: ConfigDialog.__init__
+        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
+        wx.Dialog.__init__(self, *args, **kwds)
+        self.text_ctrl_workspace = wx.TextCtrl(self, -1, "")
+        self.sizer_9_staticbox = wx.StaticBox(self, -1, "Workspace path:")
+        self.button_2 = wx.Button(self, wx.ID_CANCEL, "")
+        self.button_1 = wx.Button(self, wx.ID_OK, "")
+
+        self.__set_properties()
+        self.__do_layout()
+        # end wxGlade
+        self.init_things()
+
+    def __set_properties(self):
+        # begin wxGlade: ConfigDialog.__set_properties
+        self.SetTitle("Configuration")
+        self.SetSize((588, 128))
+        # end wxGlade
+
+    def __do_layout(self):
+        # begin wxGlade: ConfigDialog.__do_layout
+        sizer_main = wx.BoxSizer(wx.VERTICAL)
+        sizer_10 = wx.BoxSizer(wx.HORIZONTAL)
+        sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
+        self.sizer_9_staticbox.Lower()
+        sizer_9 = wx.StaticBoxSizer(self.sizer_9_staticbox, wx.HORIZONTAL)
+        sizer_9.Add(self.text_ctrl_workspace, 1, 0, 0)
+        sizer_2.Add(sizer_9, 1, wx.EXPAND, 7)
+        sizer_main.Add(sizer_2, 1, wx.EXPAND, 0)
+        sizer_10.Add((20, 20), 1, 0, 0)
+        sizer_10.Add(self.button_2, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+        sizer_10.Add((20, 20), 0, 0, 0)
+        sizer_10.Add(self.button_1, 0, wx.ALIGN_CENTER_VERTICAL, 0)
+        sizer_main.Add(sizer_10, 1, wx.EXPAND, 0)
+        self.SetSizer(sizer_main)
+        self.Layout()
+        # end wxGlade
+
+    def init_things(self):
+        home = wx.GetUserHome()
+        self.text_ctrl_workspace.SetValue(home + '/MLHIM2')
+
+# end of class ConfigDialog
+
 class MainDialog(wx.Dialog):
     def __init__(self, *args, **kwds):
         # begin wxGlade: MainDialog.__init__