Search found 15 matches

by chess360
Tue Jul 14, 2009 12:22 am
Forum: wxWidgets Development (Chinese)
Topic: 移植執行檔時還需要哪些檔?
Replies: 7
Views: 2842

假定使用Microsoft Visual C++ Express 2008。 如果编译wxWidgets的时候,参数设定 SHARED = 0 RUNTIME_LIBS = dynamic 则除了生成的exe文件,还要为客户机器安装 The Microsoft Visual C++ 2008 Redistributable Package (x86) http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en 。优点:Windows up...
by chess360
Fri Oct 24, 2008 12:17 am
Forum: C++ Development
Topic: Setting the depth of a window
Replies: 3
Views: 1018

You may set window style to wxSTAY_ON_TOP in a top level window's constructor. But it works for Microsoft Windows only. Here's the constructor from the Shaped sample. // frame constructor ShapedFrame::ShapedFrame() : wxFrame((wxFrame *)NULL, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(100, 10...
by chess360
Sun Oct 12, 2008 5:37 am
Forum: wxWidgets Development (Chinese)
Topic: 读写INI文件怎么指定INI文件的位置在自己程序
Replies: 5
Views: 3272

据Cross-Platform GUI Programming with wxWidgets第20章∶wxWidgets 没有找程序安装路径的函数,因为有的平台(如Linux)没有绝对可靠的方法。 如果是Mac或Windows,可以在App::OnInit()里用wxGetCwd()找到安装目录。 先定义wxFindAppPath函数: // Find the absolute path the application has been run from. wxString wxFindAppPath(const wxString& argv0, const wxString& cwd, co...
by chess360
Sun Oct 12, 2008 4:15 am
Forum: wxWidgets Development (Chinese)
Topic: 请教动态事件与静态事件的效率?
Replies: 3
Views: 2588

可以参看event.h和event.cpp。 Event Table 用array,用for-loop找对应的function: for (size_t n = 0; n < count; n++) { if ( wxEvtHandler:: ProcessEventIfMatches(*eventEntryTable[n], self, event) ) { return true; } } Connect 则用wxList,也是一个个找对应的function: node = node->GetNext(); if ((event.GetEventType() == entry->m_eve...
by chess360
Sat Oct 11, 2008 1:27 am
Forum: C++ Development
Topic: Problem with portability
Replies: 8
Views: 1076

Under debug version, you may not be able to distribute only the executable. It is not supposed to. For release version, if you are using Visual C++ 2008 Express, you may check Project->Your project Properties->Configuration Properties->C/C++->Code Generation->Runtime Library You should be able to se...
by chess360
Thu Oct 09, 2008 11:07 am
Forum: C++ Development
Topic: Problem with portability
Replies: 8
Views: 1076

The pre-compiled libs come with wxPack do not have RUNTIME_LIBS=STATIC setting. So you cannot distribute *only* the executable. To the RUNTIME_LIBS=STATIC thing you need to compile wxWidgets yourself.
by chess360
Sun Oct 05, 2008 3:18 am
Forum: wxWidgets Development (Chinese)
Topic: 如何输出调试信息?
Replies: 1
Views: 1931

應該就是wxLogDebug。

wxLogDebug要在debugger下運行才行,也許是Code::Block不支持。

官方文件另介紹DebugView (http://www.sysinternals.com) (已經給微軟收購了,現網址:http://technet.microsoft.com/en-us/sysi ... fault.aspx)

附上用Visual C++ 2008 express 的例子供參考。
by chess360
Fri Oct 03, 2008 12:28 pm
Forum: Compiler / Linking / IDE Related
Topic: VC++ 2008 Express Applications don't run in others PC's
Replies: 2
Views: 887

You need to pass RUNTIME_LIB=static when compiling wxWidgets, for example: BUILD=release UNICODE=1 MONOLITHIC=0 RUNTIME_LIBS=static SHARED=0 Then you should be able to distribute only the executable file. I successfully did that with the Widgets and Minimal samples that come with wxWidgets. Please r...
by chess360
Fri Oct 03, 2008 12:07 pm
Forum: wxWidgets Development (Chinese)
Topic: wxFormBuilder--wxID_ANY
Replies: 3
Views: 3120

父控件可以透过ID呼叫子控件方法、修改属性,例如: wxRichTextCtrl *ctrl = (wxRichTextCtrl*) FindWindowbyID(ID_RICHTEXT_CTRL); ctrl->GetStyle(ctrl->GetInsertionPoint(), attr) 如果打算用呼叫ID的方法,就要为控件编独立ID。 如果不会呼叫的控件,例如wxSizer,wxStaticBitmap,wxStaticText之类,可以用wxID_ANY,不用为ID号伤神。 如果把子控件编为class member,又或者打算用其他FindWindow函数/方法(有FindWind...
by chess360
Fri Oct 03, 2008 11:38 am
Forum: C++ Development
Topic: wxDC.DrawRectangle not functioning
Replies: 6
Views: 1605

Auria you are right! I did mis-calculate w and h. Now I have the effect I want. Thanks you.

Thanks also for doublemax' help. Had the rectangle not drawn on and off I might be able to figure out the problem eariler.

The mistake is very stupid. Thank you Auria and doublemax.
by chess360
Thu Oct 02, 2008 11:50 pm
Forum: C++ Development
Topic: wxDC.DrawRectangle not functioning
Replies: 6
Views: 1605

Thanks again doublemax. What I really concern is the rectangles not drawing. I think it is more "fundamental". If I cannot solve the problem I may not go very far with wxWidgets. Getting rid of flickering is not that hard. I've done it before with MFC. I think I can do it again with wxWidgets. - is ...
by chess360
Thu Oct 02, 2008 4:12 pm
Forum: wxWidgets Development (Chinese)
Topic: 一个弱弱的问题--CodeBlock,wxFormBuilder
Replies: 4
Views: 2827

CB的向导会生成一个xxxxxx.fbp的文件,那是wxFormBuilder的项目文件。楼主可以试试双击那个文件,或用wxFormBuilder打开修改界面,回到CB应可成功。
by chess360
Thu Oct 02, 2008 3:49 pm
Forum: C++ Development
Topic: wxSplitterWindow
Replies: 3
Views: 738

Hi! There is a "splitter" sample comes with wxWidgets. It's under <your wxWidgets folder>/samples/splitter.

It's easier to use a visual designer (DialogBlocks, wxFormBuilder, etc) to create the UI.
by chess360
Thu Oct 02, 2008 3:36 pm
Forum: C++ Development
Topic: wxDC.DrawRectangle not functioning
Replies: 6
Views: 1605

Thanks doublemax! You are right. What I really want is animation, sort of sliding a card over a table or moving a piece over a chess board. I have tried Refresh() and painted in OnPaint handler. The flickering was serious. So I also tried RefreshRect(essentialArea). But only some wxRects got repaint...
by chess360
Thu Oct 02, 2008 1:42 pm
Forum: C++ Development
Topic: wxDC.DrawRectangle not functioning
Replies: 6
Views: 1605

wxDC.DrawRectangle not functioning

Hi! I tried to display a Bitmap surrounded by a rectangle on different locations on the client window, a bitmap each second. So I implement the drawing in OnTimer handler. My problem is: the bitmap shows perfectly every time (exactly what I want) but the reactangle shows up only occassionaly, as if ...