[Commits] (jed) Made EditText blocks process enter events.

commits at osafoundation.org commits at osafoundation.org
Tue Jan 27 14:49:30 PST 2004


Commit by: jed
Modified files:
osaf/chandler/Chandler/parcels/OSAF/views/main/parcel.xml 1.4 1.5
osaf/chandler/Chandler/parcels/OSAF/views/demo/parcel.xml 1.3 1.4
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Events/parcel.xml 1.12 1.13
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/parcel.xml 1.35 1.36
osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py 1.45 1.46

Log message:
Made EditText blocks process enter events.
Started added new menu events for showing/hiding parts of the ui.
Cleaned up parcel.xml files.


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/views/main/parcel.xml.diff?r1=text&tr1=1.4&r2=text&tr2=1.5
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/views/demo/parcel.xml.diff?r1=text&tr1=1.3&r2=text&tr2=1.4
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Events/parcel.xml.diff?r1=text&tr1=1.12&r2=text&tr2=1.13
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/parcel.xml.diff?r1=text&tr1=1.35&r2=text&tr2=1.36
http://cvs.osafoundation.org/index.cgi/osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py.diff?r1=text&tr1=1.45&r2=text&tr2=1.46

Index: osaf/chandler/Chandler/parcels/OSAF/views/demo/parcel.xml
diff -u osaf/chandler/Chandler/parcels/OSAF/views/demo/parcel.xml:1.3 osaf/chandler/Chandler/parcels/OSAF/views/demo/parcel.xml:1.4
--- osaf/chandler/Chandler/parcels/OSAF/views/demo/parcel.xml:1.3	Mon Jan 26 13:19:54 2004
+++ osaf/chandler/Chandler/parcels/OSAF/views/demo/parcel.xml	Tue Jan 27 14:48:55 2004
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.3 $ -->
-<!-- $Date: 2004/01/26 21:19:54 $ -->
+<!-- $Revision: 1.4 $ -->
+<!-- $Date: 2004/01/27 22:48:55 $ -->
 <!-- Copyright (c) 2003 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -103,6 +103,17 @@
     <helpString></helpString>
   </MenuItem>
 
+  <MenuItem itemName="ControlsMenuItem">
+    <title>Controls Tab</title>
+    <operation>InsertBefore</operation>
+    <menuLocation>DemoMenu</menuLocation>
+    <itemLocation></itemLocation>
+    <menuItemKind>Radio</menuItemKind>
+    <accel></accel>
+    <event itemref="doc:ChooseControlsTab"/>
+    <helpString></helpString>
+  </MenuItem>
+
   <MenuItem itemName="DataMenuItem">
     <title>Data Tab</title>
     <operation>InsertBefore</operation>
@@ -141,25 +152,7 @@
     <!-- Attributes -->
 
 
-
-
-
-
-  
-
-  <MenuItem itemName="LeftMenuItem">
-    <title>Left</title>
-    <operation>InsertBefore</operation>
-    <menuLocation>EditMenu</menuLocation>
-    <itemLocation></itemLocation>
-    <menuItemKind>Normal</menuItemKind>
-    <accel></accel>
-    <event itemref="events:Left"/>
-    <helpString></helpString>
-  </MenuItem>
-  
   <EditText itemName="LeftText">
-    <childrenBlocks itemref="doc:LeftMenuItem"/>
     <open>True</open>
 
     <size>100,20</size>
@@ -173,26 +166,7 @@
     <readOnly>False</readOnly>
     <characterStyle itemref="doc:TextStyle"/>
   </EditText>
-  
-  <Menu itemName="RightMenu">
-    <title>Right Menu</title>
-    <operation>InsertBefore</operation>
-    <menuLocation>EditMenu</menuLocation>
-    <itemLocation>EditSeparator1</itemLocation>
-    <helpString></helpString>
-  </Menu>
-
-  <MenuItem itemName="RightMenuItem">
-    <title>Right</title>
-    <operation>InsertBefore</operation>
-    <menuLocation>RightMenu</menuLocation>
-    <itemLocation></itemLocation>
-    <menuItemKind>Normal</menuItemKind>
-    <accel></accel>
-    <event itemref="events:Right"/>
-    <helpString></helpString>
-  </MenuItem>
-  
+    
   <CharacterStyle itemName="OneStyle">
     <fontFamily>DefaultUIFont</fontFamily>
     <fontSize>12.0</fontSize>
@@ -279,9 +253,6 @@
   </BoxContainer>
   
   <EditText itemName="ButtonText">
-    <childrenBlocks itemref="doc:RightMenu"/>
-    <childrenBlocks itemref="doc:RightMenuItem"/>
-
     <open>True</open>
 
     <size>100,100</size>
@@ -538,7 +509,7 @@
   <TabbedContainer itemName="Tabs">
     <childrenBlocks itemref="doc:ButtonsTab"/>
     <childrenBlocks itemref="doc:ControlsTab"/>
-    <childrenBlocks itemref="doc:DataTab"/>
+    <!-- childrenBlocks itemref="doc:DataTab"/ -->
     <!-- childrenBlocks itemref="doc:EmbeddedTab"/ -->
 
     <tabPosEnum>Top</tabPosEnum>
@@ -559,15 +530,15 @@
     <contentSpec itemref="doc:myQuery"/>
     <childrenBlocks itemref="doc:DemoMenu"/>
     <childrenBlocks itemref="doc:ButtonsMenuItem"/>
-    <!-- childrenBlocks itemref="doc:ControlsMenuItem"/ -->
-    <childrenBlocks itemref="doc:DataMenuItem"/>
-    <childrenBlocks itemref="doc:EmbeddedMenuItem"/>
-    <childrenBlocks itemref="doc:DemoSeparatorItem"/>
+    <childrenBlocks itemref="doc:ControlsMenuItem"/>
+    <!-- childrenBlocks itemref="doc:DataMenuItem"/ -->
+    <!-- childrenBlocks itemref="doc:EmbeddedMenuItem"/ -->
+    <!-- childrenBlocks itemref="doc:DemoSeparatorItem"/ -->
     <!-- childrenBlocks itemref="doc:SwitchViewItem"/ -->
     
     <blockEvents itemref="doc:ChooseButtonsTab"/>
     <blockEvents itemref="doc:ChooseControlsTab"/>
-    <blockEvents itemref="doc:ChooseDataTab"/>
+    <!-- blockEvents itemref="doc:ChooseDataTab"/ -->
     <!-- blockEvents itemref="doc:SwitchEmbeddedChild"/ -->
     <!-- blockEvents itemref="doc:ChooseEmbeddedTab"/ -->
 

Index: osaf/chandler/Chandler/parcels/OSAF/views/main/parcel.xml
diff -u osaf/chandler/Chandler/parcels/OSAF/views/main/parcel.xml:1.4 osaf/chandler/Chandler/parcels/OSAF/views/main/parcel.xml:1.5
--- osaf/chandler/Chandler/parcels/OSAF/views/main/parcel.xml:1.4	Thu Jan 22 14:12:07 2004
+++ osaf/chandler/Chandler/parcels/OSAF/views/main/parcel.xml	Tue Jan 27 14:48:55 2004
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.4 $ -->
-<!-- $Date: 2004/01/22 22:12:07 $ -->
+<!-- $Revision: 1.5 $ -->
+<!-- $Date: 2004/01/27 22:48:55 $ -->
 <!-- Copyright (c) 2003 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -40,15 +40,6 @@
   <!--
     Events
   -->
-  <BlockEvent itemName="ShowRepositoryViewer">
-    <dispatchEnum>SendToBlock</dispatchEnum>
-    <dispatchToBlock itemref="doc:ParcelViewer"/>
-  </BlockEvent>
-
-  <BlockEvent itemName="ShowDemo">
-    <dispatchEnum>SendToBlock</dispatchEnum>
-    <dispatchToBlock itemref="doc:ParcelViewer"/>
-  </BlockEvent>
 
   <!--
     Menus
@@ -69,6 +60,14 @@
     <helpString></helpString>
   </Menu>
     
+  <Menu itemName="ViewMenu">
+    <title>View</title>
+    <operation>InsertBefore</operation>
+    <menuLocation></menuLocation>
+    <itemLocation></itemLocation>
+    <helpString></helpString>
+  </Menu>
+
   <!--
     Menu Items
   -->
@@ -170,6 +169,39 @@
     <helpString></helpString>
   </MenuItem>
 
+  <MenuItem itemName="ViewSidebarItem">
+    <title>View Sidebar</title>
+    <operation>InsertBefore</operation>
+    <menuLocation>ViewMenu</menuLocation>
+    <itemLocation></itemLocation>
+    <menuItemKind>Normal</menuItemKind>
+    <accel></accel>
+    <event itemref="events:ViewSidebar"/>
+    <helpString></helpString>
+  </MenuItem>
+
+  <MenuItem itemName="ViewNavigationBarItem">
+    <title>View Navigation Bar</title>
+    <operation>InsertBefore</operation>
+    <menuLocation>ViewMenu</menuLocation>
+    <itemLocation></itemLocation>
+    <menuItemKind>Normal</menuItemKind>
+    <accel></accel>
+    <event itemref="events:ViewNavigationBar"/>
+    <helpString></helpString>
+  </MenuItem>
+
+  <MenuItem itemName="ViewStatusBarItem">
+    <title>View Status Bar</title>
+    <operation>InsertBefore</operation>
+    <menuLocation>ViewMenu</menuLocation>
+    <itemLocation></itemLocation>
+    <menuItemKind>Normal</menuItemKind>
+    <accel></accel>
+    <event itemref="events:ViewStatusBar"/>
+    <helpString></helpString>
+  </MenuItem>
+
   <!--
     Toolbars
   -->
@@ -226,6 +258,12 @@
   </ToolbarItem>
 
   <!--
+    Status Bar
+  -->
+  <StatusBar itemName="StatusBar">
+  </StatusBar>
+
+  <!--
     Layout blocks
   -->
   <EmbeddedContainer itemName="ParcelViewer">
@@ -286,9 +324,10 @@
     <childrenBlocks itemref="doc:PasteItem"/>
     <childrenBlocks itemref="doc:EditSeparator2"/>
     <childrenBlocks itemref="doc:PreferencesItem"/>
-    
-    <blockEvents itemref="doc:ShowDemo"/>    
-    <blockEvents itemref="doc:ShowRepositoryViewer"/>
+    <childrenBlocks itemref="doc:ViewMenu"/>
+    <childrenBlocks itemref="doc:ViewSidebarItem"/>
+    <childrenBlocks itemref="doc:ViewNavigationBarItem"/>
+    <childrenBlocks itemref="doc:ViewStatusBarItem"/>
     
     <!-- Toolbar -->
     <childrenBlocks itemref="doc:Toolbar"/>
@@ -297,6 +336,9 @@
     <childrenBlocks itemref="doc:ReloadButton"/>
     <childrenBlocks itemref="doc:Spacer"/>
     <childrenBlocks itemref="doc:URLBox"/>
+    
+    <!-- Status Bar -->
+    <childrenBlocks itemref="doc:StatusBar"/>
     
     <!-- Layout children -->
     <childrenBlocks itemref="doc:MainSplitter"/>

Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Events/parcel.xml
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Events/parcel.xml:1.12 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Events/parcel.xml:1.13
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Events/parcel.xml:1.12	Thu Jan 22 14:43:50 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/Events/parcel.xml	Tue Jan 27 14:48:56 2004
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.12 $ -->
-<!-- $Date: 2004/01/22 22:43:50 $ -->
+<!-- $Revision: 1.13 $ -->
+<!-- $Date: 2004/01/27 22:48:56 $ -->
 <!-- Copyright (c) 2003 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -23,9 +23,11 @@
     <blockEvents itemref="events:Copy"/>
     <blockEvents itemref="events:Paste"/>
     <blockEvents itemref="events:Preferences"/>
-    <blockEvents itemref="events:Right"/>
-    <blockEvents itemref="events:Left"/>
+    <blockEvents itemref="events:ViewSidebar"/>
+    <blockEvents itemref="events:ViewNavigationBar"/>
+    <blockEvents itemref="events:ViewStatusBar"/>    
     <blockEvents itemref="events:SelectionChanged"/>
+    <blockEvents itemref="events:EnterPressed"/>    
     <blockEvents itemref="events:GoToURI"/>
   </EventData>
 
@@ -64,19 +66,29 @@
     <methodName>OnPreferencesEvent</methodName>
   </BlockEvent>
 
-  <BlockEvent itemName="Right">
+  <BlockEvent itemName="ViewSidebar">
     <dispatchEnum>BubbleUp</dispatchEnum>
-    <methodName>OnRightEvent</methodName>
+    <methodName>OnViewSidebarEvent</methodName>
   </BlockEvent>
 
-  <BlockEvent itemName="Left">
+  <BlockEvent itemName="ViewNavigationBar">
     <dispatchEnum>BubbleUp</dispatchEnum>
-    <methodName>OnLeftEvent</methodName>
+    <methodName>OnViewNavigationBarEvent</methodName>
+  </BlockEvent>
+
+  <BlockEvent itemName="ViewStatusBar">
+    <dispatchEnum>BubbleUp</dispatchEnum>
+    <methodName>OnViewStatusBarEvent</methodName>
   </BlockEvent>
 
   <BlockEvent itemName="SelectionChanged">
     <dispatchEnum>Broadcast</dispatchEnum>
     <methodName>OnSelectionChangedEvent</methodName>
+  </BlockEvent>
+
+  <BlockEvent itemName="EnterPressed">
+    <dispatchEnum>Broadcast</dispatchEnum>
+    <methodName>OnEnterPressedEvent</methodName>
   </BlockEvent>
 
   <BlockEvent itemName="GoToURI">

Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/parcel.xml
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/parcel.xml:1.35 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/parcel.xml:1.36
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/parcel.xml:1.35	Mon Jan 26 11:37:48 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/parcel.xml	Tue Jan 27 14:48:59 2004
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.35 $ -->
-<!-- $Date: 2004/01/26 19:37:48 $ -->
+<!-- $Revision: 1.36 $ -->
+<!-- $Date: 2004/01/27 22:48:59 $ -->
 <!-- Copyright (c) 2003 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -265,15 +265,20 @@
     <methodName>OnPreferencesEvent</methodName>
   </docSchema:BlockEvent>
 
-  <docSchema:BlockEvent itemName="Right">
+  <BlockEvent itemName="ViewSidebar">
     <dispatchEnum>BubbleUp</dispatchEnum>
-    <methodName>OnRightEvent</methodName>
-  </docSchema:BlockEvent>
+    <methodName>OnViewSidebarEvent</methodName>
+  </BlockEvent>
 
-  <docSchema:BlockEvent itemName="Left">
+  <BlockEvent itemName="ViewNavigationBar">
     <dispatchEnum>BubbleUp</dispatchEnum>
-    <methodName>OnLeftEvent</methodName>
-  </docSchema:BlockEvent>
+    <methodName>OnViewNavigationBarEvent</methodName>
+  </BlockEvent>
+
+  <BlockEvent itemName="ViewStatusBar">
+    <dispatchEnum>BubbleUp</dispatchEnum>
+    <methodName>OnViewStatusBarEvent</methodName>
+  </BlockEvent>
 
   <docSchema:BlockEvent itemName="SelectionChanged">
     <dispatchEnum>Broadcast</dispatchEnum>
@@ -722,6 +727,14 @@
     <attributes itemref="docSchema:textAlignmentEnum"/>
     <attributes itemref="docSchema:StaticText/title"/>
     <attributes itemref="docSchema:characterStyle"/>
+  </Kind>
+
+  <!--
+    StatusBar
+  -->
+  <Kind itemName="StatusBar">
+    <classes key="python">OSAF.framework.blocks.ContainerBlocks.StatusBar</classes>
+    <superKinds itemref="docSchema:RectangularChild"/>
   </Kind>
 
   <!--

Index: osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py
diff -u osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py:1.45 osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py:1.46
--- osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py:1.45	Mon Jan 26 17:31:28 2004
+++ osaf/chandler/Chandler/parcels/OSAF/framework/blocks/ContainerBlocks.py	Tue Jan 27 14:48:59 2004
@@ -256,10 +256,23 @@
                               self.Calculate_wxFlag(), self.Calculate_wxBorder())
         return comboBox, None, None
 
-    
+
+class wxEditText(wxTextCtrl):
+    def __init__(self, *arguments, **keywords):
+        wxTextCtrl.__init__ (self, *arguments, **keywords)
+        EVT_TEXT_ENTER(self, self.GetId(), self.OnEnterPressed)
+
+    def OnEnterPressed(self, event):
+        arguments = {'text':self.GetValue(), 'type':'Normal'}
+        event = Globals.repository.find('//parcels/OSAF/framework/blocks/Events/EnterPressed')
+        notification = Notification(event, None, None)
+        notification.SetData(arguments)
+        Globals.notificationManager.PostNotification (notification)
+
+            
 class EditText(RectangularChild):
     def renderOneBlock(self, parent, parentWindow):
-        style = 0
+        style = wxTE_PROCESS_ENTER
         if self.textAlignmentEnum == "Left":
             style |= wxTE_LEFT
         elif self.textAlignmentEnum == "Center":
@@ -276,12 +289,12 @@
         if self.readOnly:
             style |= wxTE_READONLY
 
-        editText = wxTextCtrl (parentWindow,
+        editText = wxEditText (parentWindow,
                                -1,
                                "",
                                wxDefaultPosition,
                                (self.minimumSize.width, self.minimumSize.height),
-                               style, name=self._name)
+                               style=style, name=self._name)
 
         editText.SetFont(Font (self.characterStyle))
         self.getParentBlock(parentWindow).addToContainer(parent,
@@ -291,7 +304,7 @@
                                                          self.Calculate_wxBorder())
         return editText, None, None
 
-
+    
 class HTML(RectangularChild):
     def renderOneBlock (self, parent, parentWindow):
         htmlWindow = wxHtmlWindow(parentWindow,
@@ -433,7 +446,14 @@
                                                          self.Calculate_wxBorder())
         return staticText, None, None
 
-
+class StatusBar(RectangularChild):
+    def renderOneBlock (self, parent, parentWindow):
+        frame = Globals.wxApplication.mainFrame
+        assert (frame.GetStatusBar () == None)
+        frame.CreateStatusBar ()
+        
+        return None, None, None
+    
 class TabbedContainer(RectangularChild):
     def renderOneBlock (self, parent, parentWindow):
         id = 0
@@ -742,5 +762,3 @@
         notification = Notification(event, None, None)
         notification.SetData(arguments)
         Globals.notificationManager.PostNotification (notification)
-
-        



More information about the Commits mailing list