|
From: <zou...@us...> - 2008-01-29 01:47:46
|
Revision: 979
http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=979&view=rev
Author: zouzou123gen
Date: 2008-01-28 17:47:38 -0800 (Mon, 28 Jan 2008)
Log Message:
-----------
Allow spaces in the description field
Modified Paths:
--------------
dcplusplus/trunk/changelog.txt
dcplusplus/trunk/win32/GeneralPage.cpp
dcplusplus/trunk/win32/GeneralPage.h
Modified: dcplusplus/trunk/changelog.txt
===================================================================
--- dcplusplus/trunk/changelog.txt 2008-01-25 21:08:22 UTC (rev 978)
+++ dcplusplus/trunk/changelog.txt 2008-01-29 01:47:38 UTC (rev 979)
@@ -15,6 +15,7 @@
* Fixed search spy crash
* Upgraded to bzip 1.0.4 (thanks pothead)
* Tab tooltips (thanks poy)
+* Allow spaces in the description field (poy)
-- 0.704 2007-12-14 --
* Hub lists added to utilize Coral's distributed network (ullner)
Modified: dcplusplus/trunk/win32/GeneralPage.cpp
===================================================================
--- dcplusplus/trunk/win32/GeneralPage.cpp 2008-01-25 21:08:22 UTC (rev 978)
+++ dcplusplus/trunk/win32/GeneralPage.cpp 2008-01-29 01:47:38 UTC (rev 979)
@@ -42,7 +42,7 @@
{ 0, 0, PropPage::T_END }
};
-GeneralPage::GeneralPage(SmartWin::Widget* parent) : PropPage(parent) {
+GeneralPage::GeneralPage(SmartWin::Widget* parent) : PropPage(parent), nick(0) {
createDialog(IDD_GENERALPAGE);
PropPage::translate(handle(), texts);
@@ -60,14 +60,11 @@
connections->setSelectedIndex(selected);
- WidgetTextBoxPtr textBox;
-#define TEXTBOX_ATTACH(id) \
- textBox = attachTextBox(id); \
- textBox->setTextLimit(35); \
- textBox->onTextChanged(std::tr1::bind(&GeneralPage::handleTextChanged, this, textBox))
- TEXTBOX_ATTACH(IDC_NICK);
- TEXTBOX_ATTACH(IDC_DESCRIPTION);
-#undef TEXTBOX_ATTACH
+ nick = attachTextBox(IDC_NICK);
+ nick->setTextLimit(35);
+ nick->onTextChanged(std::tr1::bind(&GeneralPage::handleNickTextChanged, this));
+
+ attachTextBox(IDC_DESCRIPTION)->setTextLimit(35);
}
GeneralPage::~GeneralPage() {
@@ -77,8 +74,8 @@
PropPage::write(handle(), items);
}
-void GeneralPage::handleTextChanged(WidgetTextBoxPtr textBox) {
- tstring text = textBox->getText();
+void GeneralPage::handleNickTextChanged() {
+ tstring text = nick->getText();
bool update = false;
// Strip ' '
@@ -90,8 +87,8 @@
if(update) {
// Something changed; update window text without changing cursor pos
- long caretPos = textBox->getCaretPos() - 1;
- textBox->setText(text);
- textBox->setSelection(caretPos, caretPos);
+ long caretPos = nick->getCaretPos() - 1;
+ nick->setText(text);
+ nick->setSelection(caretPos, caretPos);
}
}
Modified: dcplusplus/trunk/win32/GeneralPage.h
===================================================================
--- dcplusplus/trunk/win32/GeneralPage.h 2008-01-25 21:08:22 UTC (rev 978)
+++ dcplusplus/trunk/win32/GeneralPage.h 2008-01-29 01:47:38 UTC (rev 979)
@@ -34,7 +34,9 @@
static Item items[];
static TextItem texts[];
- void handleTextChanged(WidgetTextBoxPtr textBox);
+ WidgetTextBoxPtr nick;
+
+ void handleNickTextChanged();
};
#endif // !defined(DCPLUSPLUS_WIN32_GENERAL_PAGE_H)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|