Changeset d361b462 in sasview


Ignore:
Timestamp:
Feb 18, 2010 4:43:50 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
bdd162f
Parents:
25f766a
Message:

forbid the user to close all the tab for the fit panel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/fitpanel.py

    rffa69b6 rd361b462  
    138138    def __init__(self, parent, *args, **kwargs): 
    139139        wx.aui.AuiNotebook.__init__(self,parent,-1, 
    140                     style= wx.aui.AUI_NB_WINDOWLIST_BUTTON|wx.aui.AUI_NB_DEFAULT_STYLE|wx.CLIP_CHILDREN  ) 
     140                    style= wx.aui.AUI_NB_WINDOWLIST_BUTTON| 
     141                    wx.aui.AUI_NB_DEFAULT_STYLE| 
     142                    wx.CLIP_CHILDREN) 
    141143     
    142144        self.manager=None 
     
    188190             close page and remove all references to the closed page 
    189191        """ 
     192        nbr_page = self.GetPageCount() 
     193        if nbr_page == 1: 
     194            event.Veto() 
     195            return  
    190196        selected_page = self.GetPage(self.GetSelection()) 
     197        #remove default page  
     198        if selected_page == self.default_page: 
     199            self.default_page = None 
     200            return  
    191201        #remove hint page 
    192202        if selected_page == self.hint_page: 
Note: See TracChangeset for help on using the changeset viewer.