def main(): from tests.testapp import testapp from tests.mock.mockbuddy import MockBuddy from path import path a = testapp('../../..') from gui.imwin.messagearea import MessageArea from gui.imwin.styles import get_theme from common.logger import history_from_files from gui import skin f = wx.Frame(None, title = 'Conversation Preview') msgarea = MessageArea(f) buddy = MockBuddy('digsby01') theme = get_theme('GoneDark', 'Steel') msgarea.init_content(theme, buddy.alias, buddy, show_history = False) msgs = history_from_files([skin.resourcedir() / 'Example Conversation.html']) msgarea.replay_messages(msgs, buddy) f.Show() a.MainLoop()
def build_example_message_area(parent, theme): buddy = MockBuddy('Friend') msgarea = MessageArea(parent) msgarea.SetMinSize((-1, 150)) msgarea.init_content(theme, buddy.alias, buddy, show_history = False) # load an example conversation from the resource directory. bytes = (skin.resourcedir() / EXAMPLE_CONVO_FILENAME).bytes() bytes = Template(bytes).safe_substitute({'Me': profile.username}) msgs = parent._examplehistory = list(common.logger.parse_html(bytes)) log.info(' %d messages', len(msgs)) msgarea.replay_messages(msgs, buddy, context = False) return msgarea
def build_example_message_area(parent, theme): buddy = MockBuddy('Friend') msgarea = MessageArea(parent) msgarea.SetMinSize((-1, 150)) msgarea.init_content(theme, buddy.alias, buddy, show_history=False) # load an example conversation from the resource directory. bytes = (skin.resourcedir() / EXAMPLE_CONVO_FILENAME).bytes() bytes = Template(bytes).safe_substitute({'Me': profile.username}) msgs = parent._examplehistory = list(common.logger.parse_html(bytes)) log.info(' %d messages', len(msgs)) msgarea.replay_messages(msgs, buddy, context=False) return msgarea
class AnnounceWindow(wx.Frame): def __init__(self, parent = None): wx.Frame.__init__(self, parent, -1, _('Digsby Announcement'), size = (400, 330)) self.SetFrameIcon(skinget('AppDefaults.TaskbarIcon')) self.message_area = MessageArea(self, header_enabled = False, prevent_align_to_bottom=True) self.inited = False self.CenterOnScreen() def message(self, messageobj): if not self.inited: self.inited = True theme, variant = pref('appearance.conversations.theme'), pref('appearance.conversations.variant') buddy = messageobj.buddy # initialize the message area, not showing history self.message_area.init_content(get_theme_safe(theme, variant), buddy.name, buddy, show_history = False) #prevent_align_to_bottom=True) # disable until all skins look correct with this option self.message_area.format_message(messageobj.type, messageobj)