[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue-designer/src/schema/DiaEditor VisualEditor.py
From: |
Jan Ischebeck |
Subject: |
gnue-designer/src/schema/DiaEditor VisualEditor.py |
Date: |
Tue, 11 Nov 2003 08:55:49 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue-designer
Branch:
Changes by: Jan Ischebeck <address@hidden> 03/11/11 08:55:49
Modified files:
src/schema/DiaEditor: VisualEditor.py
Log message:
adapt visual editor to "new" schema naming
add "Add Field (Number)" menu entry
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-designer/src/schema/DiaEditor/VisualEditor.py.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
Patches:
Index: gnue-designer/src/schema/DiaEditor/VisualEditor.py
diff -c gnue-designer/src/schema/DiaEditor/VisualEditor.py:1.11
gnue-designer/src/schema/DiaEditor/VisualEditor.py:1.12
*** gnue-designer/src/schema/DiaEditor/VisualEditor.py:1.11 Wed Jun 11
13:48:33 2003
--- gnue-designer/src/schema/DiaEditor/VisualEditor.py Tue Nov 11 08:55:49 2003
***************
*** 327,340 ****
object=self.getObjectAt(x,y)
menu = wxMenu()
! popup_NEWTABLE =1
! popup_NEWFIELD =2
! popup_NEWINDEX =3
! popup_NEWUINDEX=4
! popup_EDIT =5
! popup_RENAME =6
! popup_DUPPL =7
! popup_DEL =8
# TODO: Use a generalized popup menu like in the forms designer
# instead of this one. the popup menu in the treeview and
--- 327,341 ----
object=self.getObjectAt(x,y)
menu = wxMenu()
! popup_NEWTABLE =1
! popup_NEWSTRFIELD =2
! popup_NEWNUMFIELD =3
! popup_NEWINDEX =4
! popup_NEWUINDEX =5
! popup_EDIT =6
! popup_RENAME =7
! popup_DUPPL =8
! popup_DEL =9
# TODO: Use a generalized popup menu like in the forms designer
# instead of this one. the popup menu in the treeview and
***************
*** 346,353 ****
self.dispatchEvent('ObjectSelected', object=object, originator=__name__)
if object._type=='VisualTable' or object._type=="GSTable":
! menu.Append(popup_NEWFIELD, "Add Field")
! EVT_MENU(self,popup_NEWFIELD,self.onAddField)
elif object._type=="GSField":
menu.Append(popup_NEWINDEX, "Add Index")
--- 347,356 ----
self.dispatchEvent('ObjectSelected', object=object, originator=__name__)
if object._type=='VisualTable' or object._type=="GSTable":
! menu.Append(popup_NEWSTRFIELD, "Add Field (String)")
! EVT_MENU(self,popup_NEWSTRFIELD,self.onAddStringField)
! menu.Append(popup_NEWNUMFIELD, "Add Field (Number)")
! EVT_MENU(self,popup_NEWNUMFIELD,self.onAddNumberField)
elif object._type=="GSField":
menu.Append(popup_NEWINDEX, "Add Index")
***************
*** 394,400 ****
dialog.Destroy()
! def onAddField(self,event):
dialog = wxTextEntryDialog(self.diagram,'Name of the new field:')
if dialog.ShowModal() == wxID_OK:
--- 397,409 ----
dialog.Destroy()
! def onAddNumberField(self,event):
! self.onAddField(event,'number')
!
! def onAddStringField(self,event):
! self.onAddField(event,'string')
!
! def onAddField(self,event,type='string'):
dialog = wxTextEntryDialog(self.diagram,'Name of the new field:')
if dialog.ShowModal() == wxID_OK:
***************
*** 404,413 ****
fields=self.instance.incubator.createObject(
self.rootObject,'fields', tbl)
self.instance.incubator.createObject(self.rootObject, 'field',
! fields,{"name":dialog.GetValue(),
! "type":"varchar",
! "size":20})
dialog.Destroy()
--- 413,426 ----
fields=self.instance.incubator.createObject(
self.rootObject,'fields', tbl)
+ params = {"name":dialog.GetValue()}
+ if type=='string':
+ params.update({"type":"string","size":20})
+ else:
+ params.update({"type":type,"size":4})
+
self.instance.incubator.createObject(self.rootObject, 'field',
! fields,params)
dialog.Destroy()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue-designer/src/schema/DiaEditor VisualEditor.py,
Jan Ischebeck <=