def MakeActions(self) : act = actions.Actions(self) act.AddAction(self.ID_IMPORT, u"导入", glob.getBitmap('import'), self.OnCmdImport ) act.AddAction(self.ID_EXPORT, u"导出", glob.getBitmap('export'), self.OnCmdExport ) act.AddAction(self.ID_ADD_ITEM, u"添加", glob.getBitmap('add'), self.OnCmdAddItem ) act.AddAction(self.ID_DEL_ITEM, u"删除", glob.getBitmap('remove'), self.OnCmdDelItem ) act.AddAction(self.ID_SAVE, u"保存", glob.getBitmap('save'), self.OnCmdSave ) return act
def MakeActions(self): act = actions.Actions(self) act.AddAction(self.ID_ADD, u"添加联系人", glob.getBitmap('add'), self.OnCmdAddRoster) act.AddAction(self.ID_GROUPCHAT, u"群聊", glob.getBitmap('groupchat'), None) act.AddAction( self.ID_SEND_FILE, u"发送文件", glob.getBitmap('filetransfer'), self.OnCmdSendFile, ) act.AddAction(self.ID_PERSONAL_INFO, u"个人信息", glob.getBitmap('self'), self.OnCmdPersonalInfo) act.AddCheckAction(self.ID_CHECK_OFFLINE, u"显示离线联系人", glob.getBitmap('offline'), self.OnCmdHideOffline, checked=True) #act.AddAction( ,) #act.AddAction( ,) #act.AddAction( ,) return act
def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize): wx.Panel.__init__(self, parent, -1, pos, size) sizer = wx.BoxSizer(wx.HORIZONTAL) #bmp = wx.ArtProvider.GetBitmap(wx.ART_CROSS_MARK, wx.ART_FRAME_ICON, (12,12)) bmp = glob.getBitmap('cancel') closebtn = wx.BitmapButton(self, -1, bmp, (12, 12), (bmp.GetWidth(), bmp.GetHeight())) self.Bind(wx.EVT_BUTTON, self.OnCloseBtnClick, closebtn) sizer.AddStretchSpacer() sizer.Add(closebtn, 0, wx.ALIGN_RIGHT | wx.ALL, 0) self.SetSizer(sizer) self.lastSize = size self.moving = False self.Bind(wx.EVT_LEFT_DOWN, self.OnMouseLeftDown) self.Bind(wx.EVT_MOTION, self.OnMouseMotion) self.Bind(wx.EVT_LEFT_UP, self.OnMouseLeftUp) self.Bind(wx.EVT_SIZE, self.OnSize)
def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize) : wx.Panel.__init__(self, parent, -1, pos, size) sizer = wx.BoxSizer(wx.VERTICAL) self._actions = self.MakeActions() self._toolBar = self.MakeToolBar() sizer.Add(self._toolBar, 0, wx.ALIGN_TOP|wx.ALL, 2) self._iconIndex = {} self._treeIcon = wx.ImageList(16, 16) iconlist = ['groupopen', 'groupclose', 'online', 'offline', 'chat', 'dnd', 'away', 'xa', 'ask', 'noauth' ] for item in iconlist : self._iconIndex[item] = self._treeIcon.Add(glob.getBitmap(item)) self._rosterCtrl = RosterTreeCtrl(self, -1, self._treeIcon, self._iconIndex) sizer.Add(self._rosterCtrl, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 1) #self.Bind(wx.EVT_COMMAND_TREE_BEGIN_DRAG, , self._rosterCtrl) #self.Bind(wx.EVT_COMMAND_TREE_END_DRAG, , self._rosterCtrl) self._btnChangeStatus = wx.Button(self, -1, u'') self._btnChangeStatus.Enable(False) self.Bind(wx.EVT_BUTTON, self.OnBtnChangeStatus, self._btnChangeStatus) sizer.Add(self._btnChangeStatus, 0, wx.ALIGN_BOTTOM | wx.ALL |wx.EXPAND, 1) self.SetSizer(sizer) #sizer.Fit(self) #self.Bind(imclient.EVT_IM_PRESENCE_UPDATE, self.OnPresenceUpdate) #self.Bind(imclient.EVT_IM_ROSTER_UPDATE, self.OnRosterUpdate) self.Bind(wx.EVT_TOOL, self.OnCmdAddRoster, id = self.ID_ADD) self.Bind(wx.EVT_TOOL, self.OnCmdHideOffline, id = self.ID_CHECK_OFFLINE) ''' self.Bind(wx.EVT_MENU, self.OnChat, id = self.ID_CHAT) self.Bind(wx.EVT_MENU, self.OnSendFile, id = self.ID_SEND_FILE) self.Bind(wx.EVT_MENU, self.OnRemove, id = self.ID_REMOVE) self.Bind(wx.EVT_MENU, self.OnMove, id = self.ID_MOVE) self.Bind(wx.EVT_MENU, self.OnCopy, id = self.ID_COPY) self.Bind(wx.EVT_MENU, self.OnRename, id = self.ID_RENAME) self.Bind(wx.EVT_MENU, self.OnDetail, id = self.ID_DETAIL) ''' self.Bind(wx.EVT_MENU, self.OnChangingMyStatus, id = self.ID_ONLINE) self.Bind(wx.EVT_MENU, self.OnChangingMyStatus, id = self.ID_FREE) self.Bind(wx.EVT_MENU, self.OnChangingMyStatus, id = self.ID_DND) self.Bind(wx.EVT_MENU, self.OnChangingMyStatus, id = self.ID_AWAY) self.Bind(wx.EVT_MENU, self.OnChangingMyStatus, id = self.ID_HIDE) self._presences = PresenceStatus(self, self._iconIndex) self._vcards = {}
def MakeActions(self) : act = actions.Actions(self) act.AddAction(self.ID_SAVE, u"保存", glob.getBitmap('save'), self.OnCmdSave ) return act
def MakeActions(self): act = actions.Actions(self) act.AddAction(self.ID_IMPORT, u"导入", glob.getBitmap('import'), self.OnCmdImport) act.AddAction(self.ID_EXPORT, u"导出", glob.getBitmap('export'), self.OnCmdExport) act.AddAction(self.ID_ADD_ITEM, u"添加", glob.getBitmap('add'), self.OnCmdAddItem) act.AddAction(self.ID_DEL_ITEM, u"删除", glob.getBitmap('remove'), self.OnCmdDelItem) act.AddAction(self.ID_SAVE, u"保存", glob.getBitmap('save'), self.OnCmdSave) return act
def MakeActions(self) : act = actions.Actions(self) act.AddAction(self.ID_ADD, u"添加联系人", glob.getBitmap('add'), self.OnCmdAddRoster ) act.AddAction(self.ID_GROUPCHAT, u"群聊", glob.getBitmap('groupchat'), None ) act.AddAction(self.ID_SEND_FILE, u"发送文件", glob.getBitmap('filetransfer'), self.OnCmdSendFile, ) act.AddAction(self.ID_PERSONAL_INFO, u"个人信息", glob.getBitmap('self'), self.OnCmdPersonalInfo ) act.AddCheckAction(self.ID_CHECK_OFFLINE, u"显示离线联系人", glob.getBitmap('offline'), self.OnCmdHideOffline, checked = True ) #act.AddAction( ,) #act.AddAction( ,) #act.AddAction( ,) return act
def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize) : wx.Panel.__init__(self, parent, -1, pos, size) sizer = wx.BoxSizer(wx.HORIZONTAL) #bmp = wx.ArtProvider.GetBitmap(wx.ART_CROSS_MARK, wx.ART_FRAME_ICON, (12,12)) bmp = glob.getBitmap('cancel') closebtn = wx.BitmapButton(self, -1, bmp, (12, 12), (bmp.GetWidth(), bmp.GetHeight())) self.Bind(wx.EVT_BUTTON, self.OnCloseBtnClick, closebtn) sizer.AddStretchSpacer() sizer.Add(closebtn, 0, wx.ALIGN_RIGHT|wx.ALL, 0) self.SetSizer(sizer) self.lastSize = size self.moving = False self.Bind(wx.EVT_LEFT_DOWN, self.OnMouseLeftDown) self.Bind(wx.EVT_MOTION, self.OnMouseMotion) self.Bind(wx.EVT_LEFT_UP, self.OnMouseLeftUp) self.Bind(wx.EVT_SIZE, self.OnSize)
def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize): wx.Panel.__init__(self, parent, -1, pos, size) sizer = wx.BoxSizer(wx.VERTICAL) self._actions = self.MakeActions() self._toolBar = self.MakeToolBar() sizer.Add(self._toolBar, 0, wx.ALIGN_TOP | wx.ALL, 2) self._iconIndex = {} self._treeIcon = wx.ImageList(16, 16) iconlist = [ 'groupopen', 'groupclose', 'online', 'offline', 'chat', 'dnd', 'away', 'xa', 'ask', 'noauth' ] for item in iconlist: self._iconIndex[item] = self._treeIcon.Add(glob.getBitmap(item)) self._rosterCtrl = RosterTreeCtrl(self, -1, self._treeIcon, self._iconIndex) sizer.Add(self._rosterCtrl, 1, wx.ALIGN_CENTER_VERTICAL | wx.ALL | wx.EXPAND, 1) #self.Bind(wx.EVT_COMMAND_TREE_BEGIN_DRAG, , self._rosterCtrl) #self.Bind(wx.EVT_COMMAND_TREE_END_DRAG, , self._rosterCtrl) self._btnChangeStatus = wx.Button(self, -1, u'') self._btnChangeStatus.Enable(False) self.Bind(wx.EVT_BUTTON, self.OnBtnChangeStatus, self._btnChangeStatus) sizer.Add(self._btnChangeStatus, 0, wx.ALIGN_BOTTOM | wx.ALL | wx.EXPAND, 1) self.SetSizer(sizer) #sizer.Fit(self) #self.Bind(imclient.EVT_IM_PRESENCE_UPDATE, self.OnPresenceUpdate) #self.Bind(imclient.EVT_IM_ROSTER_UPDATE, self.OnRosterUpdate) self.Bind(wx.EVT_TOOL, self.OnCmdAddRoster, id=self.ID_ADD) self.Bind(wx.EVT_TOOL, self.OnCmdHideOffline, id=self.ID_CHECK_OFFLINE) ''' self.Bind(wx.EVT_MENU, self.OnChat, id = self.ID_CHAT) self.Bind(wx.EVT_MENU, self.OnSendFile, id = self.ID_SEND_FILE) self.Bind(wx.EVT_MENU, self.OnRemove, id = self.ID_REMOVE) self.Bind(wx.EVT_MENU, self.OnMove, id = self.ID_MOVE) self.Bind(wx.EVT_MENU, self.OnCopy, id = self.ID_COPY) self.Bind(wx.EVT_MENU, self.OnRename, id = self.ID_RENAME) self.Bind(wx.EVT_MENU, self.OnDetail, id = self.ID_DETAIL) ''' self.Bind(wx.EVT_MENU, self.OnChangingMyStatus, id=self.ID_ONLINE) self.Bind(wx.EVT_MENU, self.OnChangingMyStatus, id=self.ID_FREE) self.Bind(wx.EVT_MENU, self.OnChangingMyStatus, id=self.ID_DND) self.Bind(wx.EVT_MENU, self.OnChangingMyStatus, id=self.ID_AWAY) self.Bind(wx.EVT_MENU, self.OnChangingMyStatus, id=self.ID_HIDE) self._presences = PresenceStatus(self, self._iconIndex) self._vcards = {}
def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize): wx.Panel.__init__(self, parent, id, pos, size) self._mgr = wx.aui.AuiManager() self._mgr.SetManagedWindow(self) bmps = ChessBmps() tb = wx.ToolBar( self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_NOICONS | wx.TB_TEXT | wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_VERTICAL) tb.SetToolBitmapSize(wx.Size(32, 32)) tb.AddLabelTool(-1, u"协商", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"开始", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"求和", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"认输", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"重新开始", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"红黑交换", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"翻转棋盘", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"保存记录", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"打谱", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"退出游戏", glob.getBitmap('quit')) tb.Realize() self._mgr.AddPane( tb, wx.aui.AuiPaneInfo().Name("toolbar").Caption( "Toolbar").ToolbarPane().Top().DockFixed(True).TopDockable( True).BottomDockable(False)) ''' sizer = wx.BoxSizer(wx.HORIZONTAL) btnsizer = wx.BoxSizer(wx.VERTICAL) btnsizer.AddStretchSpacer() btnsizer.Add(wx.Button(self, -1, u"协商"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.Button(self, -1, u"开始"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.Button(self, -1, u"求和"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.Button(self, -1, u"认输"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.Button(self, -1, u"保存记录"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.Button(self, -1, u"重新开始"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.Button(self, -1, u"退出游戏"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.StaticText(self, -1, u"走棋记录:"), 0, wx.ALIGN_TOP|wx.ALL, 5) self.MoveLogList = wx.ListCtrl(self, -1, size = (-1, 300)) btnsizer.Add(self.MoveLogList, 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.AddStretchSpacer() sizer.Add(btnsizer, 0, wx.ALIGN_LEFT|wx.ALL, 5) psizer = wx.BoxSizer(wx.VERTICAL) self.upInfo = wx.StaticText(self, -1, u"黑方:") psizer.Add(self.upInfo, 0, wx.ALIGN_CENTRE|wx.ALL, 5) #boardbmp = bmps.GetBoardBmp() #self.boardBmp = wx.StaticBitmap(self, -1, boardbmp, (0, 0), (boardbmp.GetWidth(), boardbmp.GetHeight())) self.boardBmp = CChessBoardPanel(self, bmps) psizer.Add(self.boardBmp, 1, wx.ALIGN_CENTRE|wx.ALL, 5) self.downInfo = wx.StaticText(self, -1, u"红方:") psizer.Add(self.downInfo, 0, wx.ALIGN_CENTRE|wx.ALL, 5) sizer.Add(psizer, 1, wx.ALIGN_LEFT|wx.ALL, 5) rsizer = wx.BoxSizer(wx.VERTICAL) rsizer.Add(wx.StaticText(self, -1, u"消息:"), 0, wx.ALIGN_TOP|wx.ALL, 2) self.MessageList = wx.ListCtrl(self, -1, size = (-1, 400)) rsizer.Add(self.MessageList, 1, wx.ALIGN_TOP|wx.ALL|wx.EXPAND, 2) rsizer.Add(wx.StaticText(self, -1, u"人员:"), 0, wx.ALIGN_TOP|wx.ALL, 2) self.MemberList = wx.ListCtrl(self, -1, size = (-1, 400)) rsizer.Add(self.MemberList, 1, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 2) rsizer.Add(wx.StaticText(self, -1, u"输入消息:"), 0, wx.ALIGN_TOP|wx.ALL, 2) self.inputText = wx.TextCtrl(self, -1, '') rsizer.Add(self.inputText, 0, wx.ALIGN_BOTTOM|wx.ALL|wx.EXPAND, 2) sizer.Add(rsizer, 0, wx.ALIGN_LEFT|wx.ALL|wx.EXPAND, 1) self.SetSizer(sizer) ''' self.MemberList = wx.ListCtrl(self, -1, size=(100, 400)) self._mgr.AddPane( self.MemberList, wx.aui.AuiPaneInfo().BestSize((100, -1)).Name('member').Caption( u'人员列表').Right().CloseButton(False).Position(1)) self.MessageList = wx.ListCtrl(self, -1, size=(100, 400)) self._mgr.AddPane( self.MessageList, wx.aui.AuiPaneInfo().Name('message').Caption( u'消息').Right().CloseButton(False).Position(2)) self.inputText = wx.TextCtrl(self, -1, '') self._mgr.AddPane( self.inputText, wx.aui.AuiPaneInfo().BestSize((-1, 30)).Name('input').Caption( u'发送消息').Right().CloseButton(False).Position(3)) boardbmp = bmps.GetBoardBmp() self.boardBmp = CChessBoardPanel(self, bmps) self._mgr.AddPane(self.boardBmp, wx.aui.AuiPaneInfo().Name('board').CenterPane()) self._mgr.Update()
def MakeActions(self): act = actions.Actions(self) act.AddAction(self.ID_SAVE, u"保存", glob.getBitmap('save'), self.OnCmdSave) return act
def __init__(self, parent, id = -1, pos = wx.DefaultPosition, size = wx.DefaultSize) : wx.Panel.__init__(self, parent, id, pos, size) self._mgr = wx.aui.AuiManager() self._mgr.SetManagedWindow(self) bmps = ChessBmps() tb = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_NOICONS | wx.TB_TEXT | wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_VERTICAL) tb.SetToolBitmapSize(wx.Size(32,32)) tb.AddLabelTool(-1, u"协商", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"开始", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"求和", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"认输", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"重新开始", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"红黑交换", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"翻转棋盘", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"保存记录", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"打谱", glob.getBitmap('quit')) tb.AddLabelTool(-1, u"退出游戏", glob.getBitmap('quit')) tb.Realize() self._mgr.AddPane(tb, wx.aui.AuiPaneInfo(). Name("toolbar").Caption("Toolbar").ToolbarPane().Top().DockFixed(True). TopDockable(True).BottomDockable(False)) ''' sizer = wx.BoxSizer(wx.HORIZONTAL) btnsizer = wx.BoxSizer(wx.VERTICAL) btnsizer.AddStretchSpacer() btnsizer.Add(wx.Button(self, -1, u"协商"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.Button(self, -1, u"开始"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.Button(self, -1, u"求和"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.Button(self, -1, u"认输"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.Button(self, -1, u"保存记录"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.Button(self, -1, u"重新开始"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.Button(self, -1, u"退出游戏"), 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.Add(wx.StaticText(self, -1, u"走棋记录:"), 0, wx.ALIGN_TOP|wx.ALL, 5) self.MoveLogList = wx.ListCtrl(self, -1, size = (-1, 300)) btnsizer.Add(self.MoveLogList, 0, wx.ALIGN_CENTER|wx.ALL, 5) btnsizer.AddStretchSpacer() sizer.Add(btnsizer, 0, wx.ALIGN_LEFT|wx.ALL, 5) psizer = wx.BoxSizer(wx.VERTICAL) self.upInfo = wx.StaticText(self, -1, u"黑方:") psizer.Add(self.upInfo, 0, wx.ALIGN_CENTRE|wx.ALL, 5) #boardbmp = bmps.GetBoardBmp() #self.boardBmp = wx.StaticBitmap(self, -1, boardbmp, (0, 0), (boardbmp.GetWidth(), boardbmp.GetHeight())) self.boardBmp = CChessBoardPanel(self, bmps) psizer.Add(self.boardBmp, 1, wx.ALIGN_CENTRE|wx.ALL, 5) self.downInfo = wx.StaticText(self, -1, u"红方:") psizer.Add(self.downInfo, 0, wx.ALIGN_CENTRE|wx.ALL, 5) sizer.Add(psizer, 1, wx.ALIGN_LEFT|wx.ALL, 5) rsizer = wx.BoxSizer(wx.VERTICAL) rsizer.Add(wx.StaticText(self, -1, u"消息:"), 0, wx.ALIGN_TOP|wx.ALL, 2) self.MessageList = wx.ListCtrl(self, -1, size = (-1, 400)) rsizer.Add(self.MessageList, 1, wx.ALIGN_TOP|wx.ALL|wx.EXPAND, 2) rsizer.Add(wx.StaticText(self, -1, u"人员:"), 0, wx.ALIGN_TOP|wx.ALL, 2) self.MemberList = wx.ListCtrl(self, -1, size = (-1, 400)) rsizer.Add(self.MemberList, 1, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 2) rsizer.Add(wx.StaticText(self, -1, u"输入消息:"), 0, wx.ALIGN_TOP|wx.ALL, 2) self.inputText = wx.TextCtrl(self, -1, '') rsizer.Add(self.inputText, 0, wx.ALIGN_BOTTOM|wx.ALL|wx.EXPAND, 2) sizer.Add(rsizer, 0, wx.ALIGN_LEFT|wx.ALL|wx.EXPAND, 1) self.SetSizer(sizer) ''' self.MemberList = wx.ListCtrl(self, -1, size = (100, 400)) self._mgr.AddPane(self.MemberList, wx.aui.AuiPaneInfo().BestSize((100,-1)). Name('member').Caption(u'人员列表').Right().CloseButton(False).Position(1)) self.MessageList = wx.ListCtrl(self, -1, size = (100, 400)) self._mgr.AddPane(self.MessageList, wx.aui.AuiPaneInfo(). Name('message').Caption(u'消息').Right().CloseButton(False).Position(2)) self.inputText = wx.TextCtrl(self, -1, '') self._mgr.AddPane(self.inputText, wx.aui.AuiPaneInfo().BestSize((-1,30)). Name('input').Caption(u'发送消息').Right().CloseButton(False).Position(3)) boardbmp = bmps.GetBoardBmp() self.boardBmp = CChessBoardPanel(self, bmps) self._mgr.AddPane(self.boardBmp, wx.aui.AuiPaneInfo().Name('board').CenterPane()) self._mgr.Update()