Search found 103 matches

by liuqi5521
Wed Jul 30, 2008 10:00 am
Forum: wxWidgets Development (Chinese)
Topic: 关于wxTextCtrl::SetSelection()的问题。
Replies: 2
Views: 1743

Code: Select all

TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, wxT("TextCtrl1"), wxPoint(30,470), wxSize(461,21), wxTE_NOHIDESEL, wxDefaultValidator, wxT("TextCtrl1"));
by liuqi5521
Wed Jul 30, 2008 1:10 am
Forum: wxWidgets Development (Chinese)
Topic: 说说wxString的Printf和Format的区别?
Replies: 2
Views: 1961

Format是静态函数,不需要类实例来调。

strTable=wxString::Format(_T("%s%02d%s"), m_strTable.c_str(), i, m_strType.c_str());
by liuqi5521
Sat Jul 26, 2008 1:37 pm
Forum: wxWidgets Development (Chinese)
Topic: wxListCtrl遍历得到行、列数据的效率
Replies: 6
Views: 2748

仅仅获取项目的文字的话,直接用GetItemText方法就可以了吧
by liuqi5521
Tue Jul 15, 2008 11:53 pm
Forum: wxWidgets Development (Chinese)
Topic: 如何保证wxTextCtrl只输入数字
Replies: 4
Views: 2515

首先,响应 wxEVT_COMMAND_TEXT_UPDATED 事件,该事件在文本框内容改变后发生。 然后编写事件处理函数如下: /* * WxEdit2Updated */ void test1Dlg::WxEdit2Updated(wxCommandEvent& event) { // insert your code here //MessageBox(0,"a","a",MB_OK); static wxString oldstr=""; double d; if (NULL == WxEdit2)return; if (WxEdit2->GetValue().ToDouble(&d...
by liuqi5521
Tue Jul 15, 2008 12:06 pm
Forum: wxWidgets Development (Chinese)
Topic: 如何保证wxTextCtrl只输入数字
Replies: 4
Views: 2515

可以在Change事件里面判断并纠正。
by liuqi5521
Wed Jul 09, 2008 11:19 am
Forum: wxDev-C++
Topic: raise an event when click an item of wxListCtrl?
Replies: 6
Views: 1385

thanks.
I'm look for Single click event, because I use Items as Buttons.:-)
by liuqi5521
Wed Jul 09, 2008 3:34 am
Forum: wxDev-C++
Topic: raise an event when click an item of wxListCtrl?
Replies: 6
Views: 1385

wxEVT_COMMAND_LIST_ITEM_ACTIVATED links Double click event
by liuqi5521
Wed Jul 09, 2008 12:02 am
Forum: wxDev-C++
Topic: raise an event when click an item of wxListCtrl?
Replies: 6
Views: 1385

thanks

I have another question:
I'm looking for something such as "wxEVT_COMMAND_LIST_ITEM_CLICK", but there is no such thing in wxwidgets,why?

PS: I can find wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK
by liuqi5521
Tue Jul 08, 2008 1:46 am
Forum: wxDev-C++
Topic: raise an event when click an item of wxListCtrl?
Replies: 6
Views: 1385

raise an event when click an item of wxListCtrl?

how can I connect an event when click an item of wxListCtrl,and retrieve index of the item clicked in the event function?
by liuqi5521
Sun Jul 06, 2008 9:27 am
Forum: wxWidgets Development (Chinese)
Topic: [翻译进行中]wxWidgets C++ Users Forum FAQ
Replies: 12
Views: 25686

哦,我在翻译 “十三 wxUniversal是什么?”的时候,
一直把单词 port 理解成是端口、接口的意思,所以怎么也理解不了整句话,版主把 port 翻译为移植就通顺了。已经把这句正确的翻译改到帖子里面了。
by liuqi5521
Mon Jun 30, 2008 11:58 pm
Forum: wxWidgets Development (Chinese)
Topic: 谁能访问到sourceforge?
Replies: 15
Views: 10216

我也是上不去,没有办法。
by liuqi5521
Thu Jun 26, 2008 2:27 pm
Forum: wxWidgets Development (Chinese)
Topic: 怎样重设菜单文字?
Replies: 1
Views: 1427

怎样重设菜单文字?

像普通的控件,比如 Button、Edit,只要调用SetLabel()或者SetValue()就可以用代码重设控件的显示文字。今天我在一个框架里面放了一个wxMenuBar,并且设置了一些菜单项,但我发现用代码调用SetLabel去设置菜单项的文字是没有效的,这是为什么呢? //代码如下,其中 ////GUI Items Creation Start ////GUI Items Creation End之间的代码是由wxDev-C++自动生成的,而后的代码是我自己加的。 void SafeBoxGUI2Frm::CreateGUIControls() { //Do not add custo...
by liuqi5521
Wed Jun 25, 2008 1:21 pm
Forum: wxWidgets Development (Chinese)
Topic: wxString有没有直接提供分割字符串的方法?
Replies: 5
Views: 3247

谢谢!
根据你提供的方法,我查了一下文档,又稍微改变了一下用法。

wxArrayString as = ::wxStringTokenize(s,"|");

这也算是一种思路吧。
by liuqi5521
Wed Jun 25, 2008 1:22 am
Forum: wxWidgets Development (Chinese)
Topic: 怎么实现位图按钮上文字滚动?
Replies: 9
Views: 3499

1.先用 wxBitmap 载入图片
2、创建一个 wxMemoryDC, SelectObject()选入刚才的位图。
3、用DrawText方法绘制文字,有一定偏移。
4、把位图对象赋值给按钮控件

要想滚动显示文字,在Timer里面不停的做上面的工作,每次改变偏移量。
by liuqi5521
Wed Jun 25, 2008 1:17 am
Forum: wxWidgets Development (Chinese)
Topic: wxString有没有直接提供分割字符串的方法?
Replies: 5
Views: 3247

我看了一下,wxString的下面四个成员可以帮到我。

wxString AfterFirst(wxChar ch) const
wxString AfterLast(wxChar ch) const
wxString BeforeFirst(wxChar ch) const
wxString BeforeLast(wxChar ch) const

最起码第 1、2 、倒数第1,倒数第2个子串可以很方便的得到。
至于中间的,我要自己想办法得到了。