mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-08-27 18:29:23 +00:00
Show total characters used in the title bar for tweets and messages
This commit is contained in:
@@ -39,11 +39,12 @@ class textLimited(wx.Dialog):
|
||||
wx.Dialog.__init__(self, parent)
|
||||
self.twitter = parent.twitter
|
||||
self.parent = parent
|
||||
self.SetTitle(_(u"New tweet"))
|
||||
self.title = title
|
||||
self.SetTitle(_(u"%s - %s of 140 characters") % (self.title, str(len(text))))
|
||||
self.panel = wx.Panel(self)
|
||||
|
||||
def createTextArea(self, message, text):
|
||||
self.label = wx.StaticText(self.panel, -1, str(len(text)))
|
||||
self.label = wx.StaticText(self.panel, -1, message)
|
||||
self.text = wx.TextCtrl(self.panel, -1, text)
|
||||
font = self.text.GetFont()
|
||||
dc = wx.WindowDC(self.text)
|
||||
@@ -139,7 +140,7 @@ class textLimited(wx.Dialog):
|
||||
self.text.SetFocus()
|
||||
|
||||
def onTimer(self, ev):
|
||||
self.label.SetLabel(str(len(self.text.GetValue())))
|
||||
self.SetTitle(_(u"%s - %s of 140 characters") % (self.title, str(len(self.text.GetValue()))))
|
||||
if len(self.text.GetValue()) > 1:
|
||||
self.shortenButton.Enable()
|
||||
self.unshortenButton.Enable()
|
||||
|
48
src/gui/dialogs/trending.py
Normal file
48
src/gui/dialogs/trending.py
Normal file
@@ -0,0 +1,48 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
############################################################
|
||||
# Copyright (c) 2014 Manuel Eduardo Cortéz Vallejo <manuel@manuelcortez.net>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
############################################################
|
||||
import wx
|
||||
|
||||
class trendingTopicsDialog(wx.Dialog):
|
||||
def __init__(self):
|
||||
super(searchDialog, self).__init__(None, -1)
|
||||
panel = wx.Panel(self)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
self.SetTitle(_(u"Search on Twitter"))
|
||||
label = wx.StaticText(panel, -1, _(u"Search"))
|
||||
self.term = wx.TextCtrl(panel, -1,)
|
||||
dc = wx.WindowDC(self.term)
|
||||
dc.SetFont(self.term.GetFont())
|
||||
self.term.SetSize(dc.GetTextExtent("0"*40))
|
||||
sizer.Add(label, 0, wx.ALL, 5)
|
||||
sizer.Add(self.term, 0, wx.ALL, 5)
|
||||
self.tweets = wx.RadioButton(panel, -1, _(u"Tweets"), style=wx.RB_GROUP)
|
||||
self.users = wx.RadioButton(panel, -1, _(u"Users"))
|
||||
radioSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
radioSizer.Add(self.tweets, 0, wx.ALL, 5)
|
||||
radioSizer.Add(self.users, 0, wx.ALL, 5)
|
||||
sizer.Add(radioSizer, 0, wx.ALL, 5)
|
||||
ok = wx.Button(panel, wx.ID_OK, _(u"OK"))
|
||||
ok.SetDefault()
|
||||
cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Close"))
|
||||
btnsizer = wx.BoxSizer()
|
||||
btnsizer.Add(ok, 0, wx.ALL, 5)
|
||||
btnsizer.Add(cancel, 0, wx.ALL, 5)
|
||||
sizer.Add(btnsizer, 0, wx.ALL, 5)
|
||||
panel.SetSizer(sizer)
|
||||
self.SetClientSize(sizer.CalcMin())
|
Reference in New Issue
Block a user