Changeset 3035
- Timestamp:
- 04/05/2007 02:24:43 PM (2 years ago)
- Files:
-
- trunk/dabo/lib/datanav/Form.py (modified) (4 diffs)
- trunk/dabo/lib/datanav/PageFrame.py (modified) (2 diffs)
- trunk/dabo/lib/datanav2/PageFrame.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/lib/datanav/Form.py
r2905 r3035 142 142 # It's already been set up 143 143 return 144 tb.MaxWidth = 16 145 tb.MaxHeight = 16 146 144 145 if self.Application.Platform == "Mac": 146 # Toolbar looks better with larger icons on Mac. In fact, I believe HIG 147 # recommends 32x32 for Mac Toolbars. 148 iconSize = (32, 32) 149 else: 150 iconSize = (22, 22) 151 tb.SetToolBitmapSize(iconSize) ## need to abstract in dToolBar! 152 iconPath = "themes/tango/%sx%s" % iconSize 153 147 154 if self.FormType != 'Edit': 148 self.appendToolBarButton("First", " leftArrows", OnHit=self.onFirst,149 tip=_("First"), help=_("Go to the first record"))150 self.appendToolBarButton("Prior", " leftArrow", OnHit=self.onPrior,151 tip=_("Prior"), help=_("Go to the prior record"))152 self.appendToolBarButton("Requery", " requery", OnHit=self.onRequery,153 tip=_("Requery"), help=_("Requery dataset"))154 self.appendToolBarButton("Next", " rightArrow", OnHit=self.onNext,155 tip=_("Next"), help=_("Go to the next record"))156 self.appendToolBarButton("Last", " rightArrows", OnHit=self.onLast,157 tip=_("Last"), help=_("Go to the last record"))155 self.appendToolBarButton("First", "%s/actions/go-first.png" % iconPath, 156 OnHit=self.onFirst, tip=_("First"), help=_("Go to the first record")) 157 self.appendToolBarButton("Prior", "%s/actions/go-previous.png" % iconPath, 158 OnHit=self.onPrior, tip=_("Prior"), help=_("Go to the prior record")) 159 self.appendToolBarButton("Requery", "%s/actions/view-refresh.png" % iconPath, 160 OnHit=self.onRequery, tip=_("Requery"), help=_("Requery dataset")) 161 self.appendToolBarButton("Next", "%s/actions/go-next.png" % iconPath, 162 OnHit=self.onNext, tip=_("Next"), help=_("Go to the next record")) 163 self.appendToolBarButton("Last", "%s/actions/go-last.png" % iconPath, 164 OnHit=self.onLast, tip=_("Last"), help=_("Go to the last record")) 158 165 tb.appendSeparator() 159 166 160 167 if self.FormType == 'Normal': 161 self.appendToolBarButton("New", " blank", OnHit=self.onNew,162 tip=_("New"), help=_("Add a new record"))163 self.appendToolBarButton("Delete", " delete", OnHit=self.onDelete,164 tip=_("Delete"), help=_("Delete this record"))168 self.appendToolBarButton("New", "%s/actions/document-new.png" % iconPath, 169 OnHit=self.onNew, tip=_("New"), help=_("Add a new record")) 170 self.appendToolBarButton("Delete", "%s/actions/edit-delete.png" % iconPath, 171 OnHit=self.onDelete, tip=_("Delete"), help=_("Delete this record")) 165 172 tb.appendSeparator() 166 173 167 174 if self.FormType != 'PickList': 168 self.appendToolBarButton("Save", " save", OnHit=self.onSave,169 tip=_("Save"), help=_("Save changes"))170 self.appendToolBarButton("Cancel", " revert", OnHit=self.onCancel,171 tip=_("Cancel"), help=_("Cancel changes"))175 self.appendToolBarButton("Save", "%s/actions/document-save.png" % iconPath, 176 OnHit=self.onSave, tip=_("Save"), help=_("Save changes")) 177 self.appendToolBarButton("Cancel", "%s/actions/edit-undo.png" % iconPath, 178 OnHit=self.onCancel, tip=_("Cancel"), help=_("Cancel changes")) 172 179 tb.appendSeparator() 173 180 174 if self.FormType != "Edit":175 self.appendToolBarButton("SQL", "zoomNormal", OnHit=self.onShowSQL,176 tip=_("Show SQL"), help=_("Show the last executed SQL statement"))177 178 181 if self.FormType == "Normal": 179 self.appendToolBarButton(_("Quick Report"), " print",182 self.appendToolBarButton(_("Quick Report"), "%s/actions/document-print-preview.png" % iconPath, 180 183 OnHit=self.onQuickReport, tip=_("Quick Report"), 181 184 help=_("Run a Quick Report on the current dataset")) … … 183 186 184 187 def getMenu(self): 188 iconPath = "themes/tango/16x16" 185 189 menu = super(Form, self).getMenu() 186 190 menu.Caption = _("&Actions") 187 191 188 192 menu.append(_("Set Selection &Criteria")+"\tAlt+1", 189 OnHit=self.onSetSelectionCriteria, bmp=" checkMark",193 OnHit=self.onSetSelectionCriteria, bmp="%s/actions/system-search.png" % iconPath, 190 194 help=_("Set the selection criteria for the recordset.")) 191 195 192 196 menu.append(_("&Browse Records")+"\tAlt+2", 193 OnHit=self.onBrowseRecords, bmp=" browse",197 OnHit=self.onBrowseRecords, bmp="%s/actions/format-justify-fill.png" % iconPath, 194 198 help=_("Browse the records in the current recordset.")) 195 199 … … 211 215 help = "" 212 216 213 menu.append(title, OnHit=onHit, bmp="edit", help=help, Tag=tag) 217 menu.append(title, OnHit=onHit, bmp="%s/apps/accessories-text-editor.png" % iconPath, 218 help=help, Tag=tag) 214 219 menu.appendSeparator() 215 220 216 221 if self.FormType != "Edit": 217 menu.append(_("&Requery")+"\tCtrl+R", OnHit=self.onRequery, bmp="requery", 222 menu.append(_("&Requery")+"\tCtrl+R", OnHit=self.onRequery, 223 bmp="%s/actions/view-refresh.png" % iconPath, 218 224 help=_("Get a new recordset from the backend."), menutype="check") 219 225 220 226 if self.FormType != "PickList": 221 menu.append(_("&Save Changes")+"\tCtrl+S", OnHit=self.onSave, bmp="save", 227 menu.append(_("&Save Changes")+"\tCtrl+S", OnHit=self.onSave, 228 bmp="%s/actions/document-save.png" % iconPath, 222 229 help=_("Save any changes made to the records.")) 223 menu.append(_("&Cancel Changes"), OnHit=self.onCancel, bmp="revert", 230 menu.append(_("&Cancel Changes"), OnHit=self.onCancel, 231 bmp="%s/actions/edit-undo.png" % iconPath, 224 232 help=_("Cancel any changes made to the records.")) 225 233 menu.appendSeparator() … … 233 241 234 242 menu.append(_("Select &First Record")+"\t%s+UP" % altKey, 235 OnHit=self.onFirst, bmp=" leftArrows",243 OnHit=self.onFirst, bmp="%s/actions/go-first.png" % iconPath, 236 244 help=_("Go to the first record in the set.")) 237 245 menu.append(_("Select &Prior Record")+"\t%s+LEFT" % altKey, 238 OnHit=self.onPrior, bmp="leftArrow",246 OnHit=self.onPrior, bmp="%s/actions/go-previous.png" % iconPath, 239 247 help=_("Go to the prior record in the set.")) 240 248 menu.append(_("Select Ne&xt Record")+"\t%s+RIGHT" % altKey, 241 OnHit=self.onNext, bmp=" rightArrow",249 OnHit=self.onNext, bmp="%s/actions/go-next.png" % iconPath, 242 250 help=_("Go to the next record in the set.")) 243 251 menu.append(_("Select &Last Record")+"\t%s+DOWN" % altKey, 244 OnHit=self.onLast, bmp=" rightArrows",252 OnHit=self.onLast, bmp="%s/actions/go-last.png" % iconPath, 245 253 help=_("Go to the last record in the set.")) 246 254 menu.appendSeparator() 247 255 248 256 if self.FormType == "Normal": 249 menu.append(_("&New Record")+"\tCtrl+N", OnHit=self.onNew, bmp="blank", 257 menu.append(_("&New Record")+"\tCtrl+N", OnHit=self.onNew, 258 bmp="%s/actions/document-new.png" % iconPath, 250 259 help=_("Add a new record to the dataset.")) 251 menu.append(_("&Delete Current Record"), OnHit=self.onDelete, bmp="delete", 260 menu.append(_("&Delete Current Record"), OnHit=self.onDelete, 261 bmp="%s/actions/edit-delete" % iconPath, 252 262 help=_("Delete the current record from the dataset.")) 253 263 menu.appendSeparator() 254 264 255 265 if self.FormType != "Edit": 256 menu.append(_("Show S&QL"), OnHit=self.onShowSQL , bmp="zoomNormal")266 menu.append(_("Show S&QL"), OnHit=self.onShowSQL) 257 267 258 268 if self.FormType == "Normal": 259 menu.append(_("Quick &Report"), OnHit=self.onQuickReport, bmp="print", 269 menu.append(_("Quick &Report"), OnHit=self.onQuickReport, 270 bmp="%s/actions/document-print-preview.png" % iconPath, 260 271 DynamicEnabled=self.enableQuickReport) 261 272 trunk/dabo/lib/datanav/PageFrame.py
r2543 r3035 15 15 self._pageStyleClass.__init__(self, parent, Name=Name, *args, **kwargs) 16 16 # Add the images for the various pages. 17 self.addImage("checkMark")18 self.addImage(" browse")19 self.addImage(" edit")20 self.addImage(" childview")17 iconPath = "themes/tango/16x16" 18 self.addImage("%s/actions/system-search.png" % iconPath, key="select") 19 self.addImage("%s/actions/format-justify-fill.png" % iconPath, key="browse") 20 self.addImage("%s/apps/accessories-text-editor.png" % iconPath, key="edit") 21 21 22 22 … … 57 57 for child in bizobj.getChildren(): 58 58 self.appendPage(self.ChildPageClass(self, child.DataSource), 59 child.Caption , imgKey="childview")59 child.Caption) 60 60 61 61 62 62 def addSelectPage(self, title=_("Select")): 63 self.appendPage(self.Form.SelectPageClass, caption=title, imgKey=" checkMark")63 self.appendPage(self.Form.SelectPageClass, caption=title, imgKey="select") 64 64 65 65 def addBrowsePage(self, title=_("Browse")): trunk/dabo/lib/datanav2/PageFrame.py
r3032 r3035 13 13 self.addImage("%s/actions/format-justify-fill.png" % iconPath, key="browse") 14 14 self.addImage("%s/apps/accessories-text-editor.png" % iconPath, key="edit") 15 self.addImage("childview")16 15 17 16 self.dsEditPages = {}
