def __init__(self, parent, arr, title):
        wxFrame.__init__(self, parent, -1, title)
        global grid
        grid = HugeTableGrid(self, arr)

        grid.EnableDragRowSize(0)
        grid.SetDefaultCellAlignment(wx.ALIGN_RIGHT, wx.ALIGN_CENTER)
        grid.SetFont(wx.SWISS_FONT)
        grid.AutoSizeColumns()
Exemple #2
0
def setup_grid(grid, title):
    """
    This function only works with type wx.grid.Grid
    The it will create a grid that is like the one found in LinkCtrl/View.
    :param grid:
    :return:
    """

    grid.CreateGrid(6, 2)
    grid.EnableEditing(False)
    grid.EnableGridLines(True)
    grid.SetGridLineColour(wx.Colour(0, 0, 0))
    grid.EnableDragGridSize(False)

    # Columns
    grid.EnableDragColMove(False)
    grid.EnableDragColSize(True)
    grid.SetColLabelSize(0)
    grid.SetColLabelAlignment(wx.ALIGN_CENTER, wx.ALIGN_CENTER)
    grid.SetColSize(0, 110)

    # Rows
    grid.EnableDragRowSize(True)
    grid.SetRowLabelSize(0)
    grid.SetRowLabelAlignment(wx.ALIGN_CENTER, wx.ALIGN_CENTER)

    # Defaults
    grid.SetDefaultCellBackgroundColour(wx.Colour(255, 255, 255))  # white
    grid.SetDefaultCellAlignment(wx.ALIGN_LEFT, wx.ALIGN_TOP)

    # Set Cell Values
    grid.SetCellValue(0, 0, " %s" % title)
    grid.SetCellValue(1, 0, " Variable Name")
    grid.SetCellValue(2, 0, " Geometry Type")
    grid.SetCellValue(3, 0, " Geometry Count")
    grid.SetCellValue(4, 0, " Coordinate System")
    grid.SetCellValue(5, 0, " Spatial Extent")

    # set the default background color
    grid.SetDefaultCellBackgroundColour('WHITE')

    # change color and size of header
    grid.SetCellSize(0, 0, 1, 2)  # span cols 0 and 1
    grid.SetCellBackgroundColour(0, 0, wx.Colour(195, 195, 195))  # Grey

    # set the table column size
    grid.SetColSize(0, 133)
    grid.SetColSize(1, 155)

    # change color of properties
    for i in range(1, grid.GetNumberRows()):
        grid.SetCellBackgroundColour(i, 0, wx.Colour(250, 250,
                                                     250))  # light Grey

    grid.SetGridLineColour(wx.Colour(195, 195, 195))
Exemple #3
0
    def draw_table(self, i, x, y):
        results = self.type_result[i]
        # size = self.ssize[i]
        size_of_par = self.size_of_par[i]

        grid = self.tables[i]
        grid.SetMaxSize(wx.Size(320, 360))
        grid.SetMinSize(wx.Size(320, 360))
        names = self.names[i]

        grid.CreateGrid(28, 13)
        grid.EnableEditing(True)
        grid.EnableGridLines(True)
        grid.EnableDragGridSize(False)
        grid.SetMargins(0, 0)

        # Columns
        grid.EnableDragColMove(False)
        grid.EnableDragColSize(True)
        grid.SetColLabelSize(30)
        grid.SetColLabelAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
        i = 0
        for namei in names:
            grid.SetColLabelValue(i, namei)
            i += 1

        # 设置内容
        # Rows
        grid.EnableDragRowSize(True)
        grid.SetRowLabelSize(80)
        grid.SetRowLabelAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)

        # Label Appearance

        # Cell Defaults
        grid.SetDefaultCellAlignment(wx.ALIGN_LEFT, wx.ALIGN_TOP)
        """"设置内容"""
        j = 0
        for result in results:
            i = 0
            for row in result:
                # 截段输出 numpy 抽样结果过长
                grid.SetCellValue(i, j, str(("%.3f" % row)))
                i = i + 1
            j += 1

        self.gbSizer_show.Add(grid, wx.GBPosition(x, y), wx.GBSpan(1, 3),
                              wx.ALL, 5)
        return y + size_of_par
Exemple #4
0
    def init_grid(self, grid):
        # Grid
        grid.CreateGrid(7, 2)
        grid.EnableEditing(False)
        grid.EnableGridLines(True)
        grid.SetGridLineColour(wx.Colour(0, 0, 0))
        grid.EnableDragGridSize(False)
        grid.SetMargins(0, 0)

        # Columns
        grid.EnableDragColMove(False)
        grid.EnableDragColSize(True)
        grid.SetColLabelSize(0)
        grid.SetColLabelAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)

        # Rows
        grid.EnableDragRowSize(True)
        grid.SetRowLabelSize(0)
        grid.SetRowLabelAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)

        # Label Appearance

        # Cell Defaults
        grid.SetDefaultCellBackgroundColour(wx.Colour(255, 255, 255))
        grid.SetDefaultCellAlignment(wx.ALIGN_LEFT, wx.ALIGN_TOP)

        # Set Cell Values
        grid.SetCellValue(0, 0, " Variable")
        grid.SetCellValue(1, 0, " Name")
        grid.SetCellValue(2, 0, " Description")
        grid.SetCellValue(3, 0, " Unit")
        grid.SetCellValue(4, 0, " Name")
        grid.SetCellValue(5, 0, " Type")
        grid.SetCellValue(6, 0, " Abbreviation")

        grid.SetCellBackgroundColour(0, 0, wx.Colour(195, 195, 195))
        grid.SetCellBackgroundColour(0, 1, wx.Colour(195, 195, 195))
        grid.SetCellBackgroundColour(3, 0, wx.Colour(195, 195, 195))
        grid.SetCellBackgroundColour(3, 1, wx.Colour(195, 195, 195))
        grid.SetGridLineColour(wx.Colour(195, 195, 195))
        self.resize_grid_to_fill_white_space(grid)
def gridview(array, title="2d viewer", originLeftBottom=1):
    try:
        from scipy.sparse import spmatrix
        if not isinstance(array, spmatrix):
            array = N.asanyarray(array)
    except:
        array = N.asanyarray(array)

    if array.ndim == 1:
        array = array.view()
        array.shape = (-1, len(array))
    if len(array.shape) != 2:
        raise ValueError, "array must be of dimension 2"

    ###########size = (400,400)
    frame = wx.Frame(None, -1, title)
    #    grid = wx.Window(frame, -1)
    global grid
    grid = HugeTableGrid(frame, array, originLeftBottom)

    grid.EnableDragRowSize(0)
    grid.SetDefaultCellAlignment(wx.ALIGN_RIGHT, wx.ALIGN_CENTER)
    grid.SetFont(wx.SWISS_FONT)
    #grid.AutoSizeColumns()

    grid.SetDefaultColSize(40, True)
    grid.SetRowLabelSize(30)

    p1 = wx.Panel(frame, -1)
    p1_sizer = wx.BoxSizer(wx.HORIZONTAL)

    nz = 1
    if nz == 1:
        label = wx.StaticText(p1, -1, "---------->")
        #label.SetHelpText("This is the help text for the label")
        p1_sizer.Add(label, 0, wx.GROW | wx.ALL, 2)
        #z0 = 0
        #self.z = z0  ## CHECK worker thread

    else:
        #self.lastZ = -1 # remember - for checking if update needed
        #z0 = 0
        #self.z = z0
        #slider = wx.Slider(panel1, 1001, z0, 0, self.nz-1,
        #                   wx.DefaultPosition, wx.DefaultSize,
        #                   #wx.SL_VERTICAL
        #                   wx.SL_HORIZONTAL
        #                   | wx.SL_AUTOTICKS | wx.SL_LABELS )
        #slider.SetTickFreq(5, 1)
        #box.Add(slider, 1, wx.EXPAND)
        #box.Add(slider, 0, wx.GROW|wx.ALL, 2)
        #box.Add(slider, 1, wx.EXPAND)
        #wx.EVT_SLIDER(frame, slider.GetId(), self.OnSlider)
        #self.slider = slider
        pass

    label2 = wx.StaticText(p1, -1, "<- move mouse over image ->")
    #label2.SetHelpText("This is the help text for the label")

    #p1_sizer.Add(label2, 0, wx.GROW|wx.ALL, 2)
    p1.SetAutoLayout(True)
    p1.SetSizer(p1_sizer)

    sizer = wx.BoxSizer(wx.VERTICAL)
    sizer.Add(label2, 0, wx.GROW | wx.ALL, 2)
    sizer.Add(p1, 0, wx.GROW | wx.ALL, 2)
    sizer.Add(grid, 1, wx.EXPAND | wx.ALL, 5)

    frame.SetSizer(sizer)
    # sizer.SetSizeHints(frame)
    #2.4auto  frame.SetAutoLayout(1)
    sizer.Fit(frame)

    frame.Show(1)
    frame.Layout()  # hack for Linux-GTK
Exemple #6
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, -1)

        self.hand_type = {0:'No Pair', 1:'One Pair', 2:'Two Pair', 3:'Three of a Kind', 4:'Straight', 5:'Flush', 6:'Full House', 7:'Four of a Kind', 8:'Straight Flush', 9:'Five of a Kind'}

        # Initialize the hand so that it's easier to implement active min hand calc
        #self.card_array = [12,11,51,50,10,9,8,7]
        self.card_array = [53] * 9

        self.right_clicked_card = -1
        self.right_click_selection = -1
        self.last_flop_array = [53] * 9
        self.last_turn_array = [53] * 9
        self.last_showdown_array = [53] * 9
        self.flop_turn_results = ()
        self.flop_river_results = ()
        self.flop_better_hands = []
        self.turn_river_results = ()
        self.turn_better_hands = []
        self.showdown_results = ()
        self.showdown_better_hands = []

        self.better = ()

        self.minipanel_is_open = 0
        self.minipanel = -1

        grid = wx.grid.Grid(self, -1, size = wx.Size(500, 347), style = wx.SIMPLE_BORDER)
        grid.CreateGrid(9, 5)
        grid.SetColLabelValue(0, "Hand")
        grid.SetColLabelValue(1, "Count")
        grid.SetColLabelValue(2, "Odds 1:x")
        grid.SetColLabelValue(3, "Probability")
        grid.SetColLabelValue(4, "# Better")
        grid.SetColSize(0, 160)
        grid.SetColSize(1, COL_SIZE)
        grid.SetColSize(2, COL_SIZE)
        grid.SetColSize(3, COL_SIZE)
        grid.SetColSize(4, COL_SIZE)
        grid.SetRowSize(0, ROW_SIZE)
        grid.SetRowSize(1, ROW_SIZE)
        grid.SetRowSize(2, ROW_SIZE)
        grid.SetRowSize(3, ROW_SIZE)
        grid.SetRowSize(4, ROW_SIZE)
        grid.SetRowSize(5, ROW_SIZE)
        grid.SetRowSize(6, ROW_SIZE)
        grid.SetRowSize(7, ROW_SIZE)
        grid.SetRowSize(8, ROW_SIZE)
        grid.SetColLabelSize(30)
        grid.SetRowLabelSize(0)
        grid.EnableEditing(False)
        grid.EnableDragColSize(False)
        grid.EnableDragRowSize(False)
        grid.EnableDragGridSize(False)
        grid.SetDefaultCellAlignment(wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
        font = wx.Font(12, family = wx.ROMAN, style = wx.NORMAL, weight = wx.BOLD)
        grid.SetDefaultCellFont(font)
        # This is the magical line that turns off the scrollbars
        # Thank you: http://lists.wxwidgets.org/archive/wxPython-users/msg10178.html
        grid.SetMargins(-100,-100)

        self.grid = grid

        font = wx.Font(14, family = wx.MODERN, style = wx.NORMAL, weight = wx.BOLD)

        #self.title = wx.StaticText(self, -1, "", size=(250,25), style = wx.ST_NO_AUTORESIZE | wx.ALIGN_CENTRE | wx.SIMPLE_BORDER, name = "Title")
        self.title = wx.StaticText(self, -1, "", size=(250,25), style = wx.ST_NO_AUTORESIZE | wx.ALIGN_CENTRE, name = "Title")
        # font styles:
        # family = wx.DEFAULT, wx.DECORATIVE, wx.ROMAN, wx.SCRIPT, wx.SWISS, wx.MODERN
        # style = wx.NORMAL, wx.SLANT, wx.ITALIC
        # weight = wx.NORMAL, wx.LIGHT, wx.BOLD
        self.title.SetFont(font)

        title_sizer = wx.BoxSizer ( wx.HORIZONTAL )
        
        title_sizer.Add((30,30), 0, wx.ALIGN_CENTRE_VERTICAL)
        title_sizer.Add(self.title, 0, wx.ALIGN_CENTRE_VERTICAL)
        title_sizer.Add((30,30), 0, wx.ALIGN_CENTRE_VERTICAL)

        font = wx.Font(13, family = wx.MODERN, style = wx.NORMAL, weight = wx.BOLD)

        # call min_hand_eval here
        #current_h = self.MinHandEval()
        current_h = ""

        #self.hand_display = wx.StaticText(self, -1, current_h, size=(200,25), style = wx.ST_NO_AUTORESIZE | wx.ALIGN_CENTRE | wx.SIMPLE_BORDER)
        self.hand_display = wx.StaticText(self, -1, current_h, size=(200,25), style = wx.ST_NO_AUTORESIZE | wx.ALIGN_CENTRE)
        self.hand_display.SetFont(font)

        # hutchison index
        #h_index = hutchison(self.card_array[:4])
        h_index = ""
        #self.hutch_display = wx.StaticText(self, -1, h_index, size=(200,25), style = wx.ST_NO_AUTORESIZE | wx.ALIGN_CENTRE | wx.SIMPLE_BORDER)
        self.hutch_display = wx.StaticText(self, -1, h_index, size=(200,25), style = wx.ST_NO_AUTORESIZE | wx.ALIGN_CENTRE)
        self.hutch_display.SetFont(font)

        hand_disp_sizer = wx.BoxSizer( wx.HORIZONTAL )

        hand_disp_sizer.Add(self.hutch_display, 0 , wx.ALIGN_CENTER_VERTICAL)
        hand_disp_sizer.Add((30,50), 0, wx.ALIGN_CENTRE_VERTICAL)
        hand_disp_sizer.Add(self.hand_display, 0, wx.ALIGN_CENTRE_VERTICAL)
        #hand_disp_sizer.Add((30,50), 0, wx.ALIGN_CENTRE_VERTICAL)

        self.button1 = wx.Button(self, ID_BUTTON1, "Turn", size=(70,30))
        self.button2 = wx.Button(self, ID_BUTTON2, "River", size=(70,30))
        self.button3 = wx.Button(self, ID_BUTTON3, "River+", size=(70,30))
        self.button6 = wx.Button(self, ID_BUTTON6, "Showdown", size=(70,30))
        self.button4 = wx.Button(self, ID_BUTTON4, "Reset", size=(70,30))
        self.button5 = wx.Button(self, ID_BUTTON5, "Panel", size=(70,30))

        self.button1.Disable()
        self.button2.Disable()
        self.button3.Disable()
        self.button4.Disable()
        self.button6.Disable()

        button_sizer = wx.BoxSizer( wx.HORIZONTAL )

        LARGE_BUTTON_SPACE = (20, 40)
        MEDIUM_BUTTON_SPACE = (12, 40)
        SMALL_BUTTON_SPACE = (2, 40)

        button_sizer.Add(self.button5, 0, wx.ALIGN_CENTRE_VERTICAL)
        button_sizer.Add(LARGE_BUTTON_SPACE, 0, wx.ALIGN_CENTRE_VERTICAL)
        button_sizer.Add(self.button1, 0, wx.ALIGN_CENTRE_VERTICAL)
        button_sizer.Add(SMALL_BUTTON_SPACE, 0, wx.ALIGN_CENTRE_VERTICAL)
        button_sizer.Add(self.button2, 0, wx.ALIGN_CENTRE_VERTICAL)
        button_sizer.Add(MEDIUM_BUTTON_SPACE, 0, wx.ALIGN_CENTRE_VERTICAL)
        button_sizer.Add(self.button3, 0, wx.ALIGN_CENTRE_VERTICAL)
        button_sizer.Add(MEDIUM_BUTTON_SPACE, 0, wx.ALIGN_CENTRE_VERTICAL)
        button_sizer.Add(self.button6, 0, wx.ALIGN_CENTRE_VERTICAL)
        button_sizer.Add(LARGE_BUTTON_SPACE, 0, wx.ALIGN_CENTRE_VERTICAL)
        button_sizer.Add(self.button4, 0, wx.ALIGN_CENTRE_VERTICAL)

        # Initialize the cards
        self.card1 = wx.StaticBitmap(self, ID_CARD_1, catalog[index[self.card_array[0]]].getBitmap(), name = "Card1")
        self.card2 = wx.StaticBitmap(self, ID_CARD_2, catalog[index[self.card_array[1]]].getBitmap(), name = "Card2")
        self.card3 = wx.StaticBitmap(self, ID_CARD_3, catalog[index[self.card_array[2]]].getBitmap(), name = "Card3")
        self.card4 = wx.StaticBitmap(self, ID_CARD_4, catalog[index[self.card_array[3]]].getBitmap(), name = "Card4")
        self.card5 = wx.StaticBitmap(self, ID_CARD_5, catalog[index[self.card_array[4]]].getBitmap(), name = "Card5")
        self.card6 = wx.StaticBitmap(self, ID_CARD_6, catalog[index[self.card_array[5]]].getBitmap(), name = "Card6")
        self.card7 = wx.StaticBitmap(self, ID_CARD_7, catalog[index[self.card_array[6]]].getBitmap(), name = "Card7")
        self.card8 = wx.StaticBitmap(self, ID_CARD_8, catalog[index[self.card_array[7]]].getBitmap(), name = "Card8")
        self.card9 = wx.StaticBitmap(self, ID_CARD_9, catalog[index[self.card_array[8]]].getBitmap(), name = "Card9")

        self.cards = (self.card1, self.card2, self.card3, self.card4, self.card5, self.card6, self.card7, self.card8, self.card9)

        card_sizer1 = wx.BoxSizer( wx.HORIZONTAL )
        card_sizer2 = wx.BoxSizer( wx.HORIZONTAL )

        LITTLE_SPACER = (5,5)
        BIG_SPACER = (25,5)
        HOLE_SPACER = (5,125)

        card_sizer2.Add(self.card1, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer2.Add(HOLE_SPACER, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer2.Add(self.card2, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer2.Add(HOLE_SPACER, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer2.Add(self.card3, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer2.Add(HOLE_SPACER, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer2.Add(self.card4, 0, wx.ALIGN_CENTRE_VERTICAL)

        card_sizer1.Add(self.card5, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer1.Add(LITTLE_SPACER, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer1.Add(self.card6, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer1.Add(LITTLE_SPACER, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer1.Add(self.card7, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer1.Add(BIG_SPACER, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer1.Add(self.card8, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer1.Add(BIG_SPACER, 0, wx.ALIGN_CENTRE_VERTICAL)
        card_sizer1.Add(self.card9, 0, wx.ALIGN_CENTRE_VERTICAL)

        self.sizer = wx.BoxSizer( wx.VERTICAL )

        self.sizer.Add(title_sizer, 0, wx.ALIGN_CENTRE_HORIZONTAL)
        self.sizer.Add(grid, 0, wx.ALIGN_CENTRE_HORIZONTAL)
        self.sizer.Add(hand_disp_sizer, 0, wx.ALIGN_CENTRE_HORIZONTAL)
        self.sizer.Add(card_sizer1, 0, wx.ALIGN_CENTRE_HORIZONTAL)
        self.sizer.Add(card_sizer2, 0, wx.ALIGN_CENTRE_HORIZONTAL)

        self.sizer.Add(button_sizer, 0, wx.ALIGN_CENTRE_HORIZONTAL)
        
        self.SetSizer(self.sizer)
        self.SetAutoLayout(1)

        self.Bind(wx.grid.EVT_GRID_CELL_RIGHT_CLICK, self.OnCellRightClick, self.grid)
        self.Bind(wx.EVT_BUTTON, self.OnButton5, self.button5)
        self.Bind(wx.EVT_BUTTON, self.OnButton1, self.button1)
        self.Bind(wx.EVT_BUTTON, self.OnButton2, self.button2)
        self.Bind(wx.EVT_BUTTON, self.OnButton3, self.button3)
        self.Bind(wx.EVT_BUTTON, self.OnButton6, self.button6)
        self.Bind(wx.EVT_BUTTON, self.OnButton4, self.button4)
        self.card1.Bind(wx.EVT_LEFT_UP, self.LeftClick)
        self.card2.Bind(wx.EVT_LEFT_UP, self.LeftClick)
        self.card3.Bind(wx.EVT_LEFT_UP, self.LeftClick)
        self.card4.Bind(wx.EVT_LEFT_UP, self.LeftClick)
        self.card5.Bind(wx.EVT_LEFT_UP, self.LeftClick)
        self.card6.Bind(wx.EVT_LEFT_UP, self.LeftClick)
        self.card7.Bind(wx.EVT_LEFT_UP, self.LeftClick)
        self.card8.Bind(wx.EVT_LEFT_UP, self.LeftClick)
        self.card9.Bind(wx.EVT_LEFT_UP, self.LeftClick)
        self.card1.Bind(wx.EVT_RIGHT_UP, self.RightClick)
        self.card2.Bind(wx.EVT_RIGHT_UP, self.RightClick)
        self.card3.Bind(wx.EVT_RIGHT_UP, self.RightClick)
        self.card4.Bind(wx.EVT_RIGHT_UP, self.RightClick)
        self.card5.Bind(wx.EVT_RIGHT_UP, self.RightClick)
        self.card6.Bind(wx.EVT_RIGHT_UP, self.RightClick)
        self.card7.Bind(wx.EVT_RIGHT_UP, self.RightClick)
        self.card8.Bind(wx.EVT_RIGHT_UP, self.RightClick)
        self.card9.Bind(wx.EVT_RIGHT_UP, self.RightClick)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_2)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_3)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_4)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_5)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_6)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_7)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_8)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_9)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_T)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_J)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_Q)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_K)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_A)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_S)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_H)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_D)
        self.Bind(wx.EVT_MENU, self.OnMenuSelection, id=ID_MENU_C)