251 AppendMenu(parent, help='', id=wx.ID_OPEN, |
251 AppendMenu(parent, help='', id=wx.ID_OPEN, |
252 kind=wx.ITEM_NORMAL, text=_(u'Open') + '\tCTRL+O') |
252 kind=wx.ITEM_NORMAL, text=_(u'Open') + '\tCTRL+O') |
253 parent.Append(ID_FILEMENURECENTPROJECTS, _("&Recent Projects"), self.RecentProjectsMenu) |
253 parent.Append(ID_FILEMENURECENTPROJECTS, _("&Recent Projects"), self.RecentProjectsMenu) |
254 parent.AppendSeparator() |
254 parent.AppendSeparator() |
255 parent.Append(wx.ID_ANY, _("&Tutorials and Examples"), self.TutorialsProjectsMenu) |
255 parent.Append(wx.ID_ANY, _("&Tutorials and Examples"), self.TutorialsProjectsMenu) |
|
256 |
|
257 exemples_dir = Bpath("exemples") |
|
258 project_list = sorted(os.listdir(exemples_dir)) |
|
259 |
|
260 for idx, dirname in enumerate(project_list): |
|
261 text = u'&%d: %s' % (idx + 1, dirname) |
|
262 |
|
263 item = self.TutorialsProjectsMenu.Append(wx.ID_ANY, text, '') |
|
264 |
|
265 projectpath = os.path.join(exemples_dir, dirname) |
|
266 |
|
267 def OpenExemple(event): |
|
268 if self.CTR is not None and not self.CheckSaveBeforeClosing(): |
|
269 return |
|
270 |
|
271 self.OpenProject(projectpath) |
|
272 if not self.CTR.CheckProjectPathPerm(): |
|
273 self.ResetView() |
|
274 |
|
275 self.Bind(wx.EVT_MENU, OpenExemple, item) |
|
276 parent.AppendSeparator() |
|
277 parent.AppendMenu(wx.ID_ANY, _("&Tutorials and Examples"), self.TutorialsProjectsMenu) |
256 |
278 |
257 exemples_dir = Bpath("exemples") |
279 exemples_dir = Bpath("exemples") |
258 project_list = sorted(os.listdir(exemples_dir)) |
280 project_list = sorted(os.listdir(exemples_dir)) |
259 |
281 |
260 for idx, dirname in enumerate(project_list): |
282 for idx, dirname in enumerate(project_list): |