Search found 41 matches

by 00061205
Fri Aug 01, 2008 4:32 am
Forum: wxWidgets Development (Chinese)
Topic: 如何更改wxStaticText 和wxTextCtrl的字体和颜色?
Replies: 4
Views: 5074

创建一个wxTextAttr类的对象,在里面设定字体和颜色wxTextAttr::SetTextColour
();wxTextAttr::SetFont()。然后用wxTextCtrl::SetStyle()设定。

其实用smith或wxformbuilder的话都是可以设定的。字体是font,字体颜色是foreground。
by 00061205
Fri Aug 01, 2008 4:22 am
Forum: wxWidgets Development (Chinese)
Topic: 应用程序句柄
Replies: 1
Views: 2747

wxApp::GetInstance()
wxThread::GetCurrentId()
by 00061205
Wed Jul 30, 2008 11:34 am
Forum: C++ Development
Topic: wxTextCtrl::SetSelection(0, 1) didn't work
Replies: 1
Views: 1046

I figured it out. The wxTE_NOHIDESEL style must be set in MSW to show the selection when it doesn't have focus.
by 00061205
Wed Jul 30, 2008 11:31 am
Forum: wxWidgets Development (Chinese)
Topic: 关于wxTextCtrl::SetSelection()的问题。
Replies: 2
Views: 2830

liuqi5521 wrote:TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, wxT("TextCtrl1"), wxPoint(30,470), wxSize(461,21), wxTE_NOHIDESEL, wxDefaultValidator, wxT("TextCtrl1"));
太感谢了,困扰我好久。
by 00061205
Wed Jul 30, 2008 6:30 am
Forum: C++ Development
Topic: wxTextCtrl::SetSelection(0, 1) didn't work
Replies: 1
Views: 1046

wxTextCtrl::SetSelection(0, 1) didn't work

Why SetSelection(0,1) didn't work in my app? ctrlaFrame::ctrlaFrame(wxWindow* parent,wxWindowID id) { ...... TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, _("Text"), wxDefaultPosition, wxSize(268,260), wxTE_MULTILINE, wxDefaultValidator, _T("ID_TEXTCTRL1")); ...... TextCtrl1->Se...
by 00061205
Mon Jul 28, 2008 3:17 am
Forum: wxWidgets Development (Chinese)
Topic: 请问哪里可以下载cross-Platform GUI Programming的...
Replies: 1
Views: 2076

wxWidgets里的sample和这本书中的源代码大同小异,可以参考。
by 00061205
Sun Jul 27, 2008 4:43 am
Forum: wxWidgets Development (Chinese)
Topic: 关于wxTextCtrl::SetSelection()的问题。
Replies: 2
Views: 2830

关于wxTextCtrl::SetSelection()的问题。

为什么这函数SetSelection(0,1)在我的程序里没效果? ctrlaFrame::ctrlaFrame(wxWindow* parent,wxWindowID id) { ...... TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, _("Text"), wxDefaultPosition, wxSize(268,260), wxTE_MULTILINE, wxDefaultValidator, _T("ID_TEXTCTRL1")); ...... TextCtrl1->SetValue(L&qu...
by 00061205
Sun Jul 27, 2008 2:59 am
Forum: C++ Development
Topic: How to let the wxTextCtrl can select all by "ctrl+a&quo
Replies: 4
Views: 2747

I solved this problem by connect the keyevent to wxTextCtrl control. Step 1 TextCtrl1->Connect(ID_TEXTCTRL1,wxEVT_CHAR,(wxObjectEventFunction)&ctrlaFrame::OnChar,NULL,this); Step 2 void ctrlaFrame::OnChar(wxKeyEvent& event) { //The keycode of "ctrl+a" is 1 if(event.GetKeyCode()==1)...
by 00061205
Fri Jul 25, 2008 1:29 pm
Forum: C++ Development
Topic: Question about using wxSocketBase::Peek()
Replies: 5
Views: 2369

Thanks a lot, FireMail. :D
by 00061205
Fri Jul 25, 2008 7:15 am
Forum: C++ Development
Topic: How to know wether there are more data in socket to be read?
Replies: 2
Views: 1116

mc2r wrote:Not sure if this helps but wxSocketBase::IsData() might be what you are looking for. I don't use wx for networking stuff, so i've not tried it.

-Max
Thanks, Max. I tried wxSocketBase::IsData(). It didn't work as I want. :lol:
by 00061205
Fri Jul 25, 2008 3:03 am
Forum: C++ Development
Topic: How to know wether there are more data in socket to be read?
Replies: 2
Views: 1116

How to know wether there are more data in socket to be read?

void netdbgFrame::OnSocketEvent(wxSocketEvent& event) { wxString s = _(""); char cBuf [257]; wxString wxstrBuf=wxT(""); wxSocketBase *sock = event.GetSocket(); strtemp=""; memset( cBuf, 0, 257 ); switch (event.GetSocketEvent()) { case wxSOCKET_INPUT : sock->Read(cB...
by 00061205
Fri Jul 25, 2008 2:52 am
Forum: C++ Development
Topic: wxYield called recursively
Replies: 6
Views: 2618

ok found the solution with wxBook :) Will split up my application into several threads now. If you need more information why this happened, write me a msg and i will tell ya :) I got the same problem when i use wxSocketClient. How did you solve this problem? here http://forums.wxwidgets.org/viewtop...
by 00061205
Fri Jul 25, 2008 1:25 am
Forum: C++ Development
Topic: Question about using wxSocketBase::Peek()
Replies: 5
Views: 2369

mc2r wrote:FireMail had a similiar error with wxSocketClient and wxSocketServer in this thread. FireMail mentions you can message him and he will provide more details.

-Max
wow, :shock:
by 00061205
Fri Jul 25, 2008 1:21 am
Forum: C++ Development
Topic: How to let the wxTextCtrl can select all by "ctrl+a&quo
Replies: 4
Views: 2747

SteveDowd wrote:Check out wxKeyEvent:

http://docs.wxwidgets.org/stable/wx_wxk ... wxkeyevent

then handle the event by checking to see if event.CmdDown + "a" keyCode was pressed, then call wxTextCtrl::SetSelection(0, LastCharPos);
Thanks, I'll try.
by 00061205
Thu Jul 24, 2008 1:54 pm
Forum: C++ Development
Topic: How to let the wxTextCtrl can select all by "ctrl+a&quo
Replies: 4
Views: 2747

How to let the wxTextCtrl can select all by "ctrl+a&quo

How let wxTextCtrl can select all by "ctrl+a"