Search found 20 matches

by weworld
Wed Dec 30, 2009 3:47 pm
Forum: C++ Development
Topic: How to add a new item to a .ini file use wxFileConfig class?
Replies: 3
Views: 778

Great! I will try these code. THANKS A LOT!
by weworld
Tue Dec 29, 2009 1:52 pm
Forum: C++ Development
Topic: How to add a new item to a .ini file use wxFileConfig class?
Replies: 3
Views: 778

I guess wxFileConfig need an instance and hold it while the application runs. The instance should write all options in it and save options to an ini file, it will save all content when it destroyed, right?
by weworld
Tue Dec 29, 2009 1:32 pm
Forum: C++ Development
Topic: How to add a new item to a .ini file use wxFileConfig class?
Replies: 3
Views: 778

How to add a new item to a .ini file use wxFileConfig class?

I want to add a new option to a ini file which have exist options before. I use code below but cann't work, it always overwrite the exist content in the ini file. The commit code cann't work too. wxString iniFile = wxGetApp().GetIniFileWithFullPath(); //wxFileInputStream fis(iniFile); wxFileOutputSt...
by weworld
Tue Dec 29, 2009 12:07 pm
Forum: wxWidgets Development (Chinese)
Topic: wxFileConfig 怎样读取ini并添加新的选项呢?
Replies: 0
Views: 1683

wxFileConfig 怎样读取ini并添加新的选项呢?

想读取已有的ini文件wxT("contacts.ini")并添加一个选项,可是之前的选项总是被覆盖了。请问有什么办法保留之前的选项吗? //注释的代码不起作用。 wxString iniFile = wxGetApp().GetIniFileWithFullPath(); //wxFileInputStream fis(iniFile); wxFileOutputStream fos(iniFile); wxFileConfig conf; //wxFileConfig conf(fis); //conf.Save(fos); conf.SetPath(wxT("/Client")); co...
by weworld
Sat Sep 26, 2009 11:14 am
Forum: C++ Development
Topic: Dialog reuse bug? or Never reuse a dialog newed in heap?
Replies: 7
Views: 1208

Who is the parent of "panel" ? dlg on stack. Define "randomly" for your case. after dlg gone out of it's scope. but not know when. You can anytime use a debugger to see where it crashes, many times also why it crashes. And if you can say with words what you are trying to achieve I'm sure it will he...
by weworld
Sat Sep 26, 2009 10:17 am
Forum: C++ Development
Topic: Dialog reuse bug? or Never reuse a dialog newed in heap?
Replies: 7
Views: 1208

It is strange that the child windows of dialog(a) will be released randomly after dialog(a) gone out of scope. So crash will be happened occasionally.
so my question is when will the child window be released if the parent dialog gone out of scope in a stack.
by weworld
Sat Sep 26, 2009 10:01 am
Forum: C++ Development
Topic: Dialog reuse bug? or Never reuse a dialog newed in heap?
Replies: 7
Views: 1208

dialog(a) was created on stack like this: void MembersPanel::OnCreateMemberButtonClick(wxCommandEvent& event) { wxDialog dlg(this->GetParent(), wxID_ANY, _("add person"), wxDefaultPosition, wxDefaultSize); MemberEditPanel* panel = new MemberEditPanel(m_memberManager, &dlg, &dlg, true); wxBoxSizer* s...
by weworld
Sat Sep 26, 2009 9:52 am
Forum: C++ Development
Topic: Dialog reuse bug? or Never reuse a dialog newed in heap?
Replies: 7
Views: 1208

the oldFocus window was defined in wxDialg::Create(), to remember old focus window when wxDialog was created. m_oldFocus = FindFocus(); I create a Dialog(a) to input a record, and on Dialog(a), it create another Dialog(b) to capture a photo(wxImage). if dialog(a) was released, the old focus window(r...
by weworld
Sat Sep 26, 2009 4:22 am
Forum: C++ Development
Topic: Dialog reuse bug? or Never reuse a dialog newed in heap?
Replies: 7
Views: 1208

Dialog reuse bug? or Never reuse a dialog newed in heap?

Can i use a dialog newed in heap, ShowModal(), and reuse it later? I found the dialog use a FindFocus() to find old focus window, but if the old focus window is delete, then i reuse the dialog, program will be crashed, in dialog ShowModal(). // We have to remember the HWND because we need to check /...
by weworld
Sun Aug 30, 2009 9:44 am
Forum: C++ Development
Topic: How to set POS58 paper size?
Replies: 0
Views: 900

How to set POS58 paper size?

Hello,
I want to print to a POS58 device, and i use the print code in wxWidgets. Now i can only print one A4 page even if the program have more data to print. I have set printData with

Code: Select all

g_pos58PrintData->SetPaperId(wxPAPER_A4)
How to set POS58 paper size(specially height)? Thanks.
by weworld
Thu Aug 27, 2009 6:49 am
Forum: wxWidgets Development (Chinese)
Topic: 求助wxWidgets自带打印的例子的问题
Replies: 1
Views: 1321

prompt 为fasle时 ,要把页面范围设置好。
调用一下printDialogData.SetAllPages(true)试试
by weworld
Mon Aug 24, 2009 6:15 am
Forum: C++ Development
Topic: Quickly show a panel in dialog without thinkin about sizers?
Replies: 2
Views: 497

Re: Quickly show a panel in dialog without thinkin about siz

I have many panels derived from wxPanel, and want to show one panel in a dialog. for example: show a MyPanel in a dialog. How can i do that without doing these: wxDialog dlg(...), new MyPanel(&dlg) new Sizer(...) sizer->Add(panel,...) dlg.SetSizer ... dlg.ShowModel() I need a common function to enc...
by weworld
Mon Aug 24, 2009 3:22 am
Forum: wxCode
Topic: databaselayer - mysqlGetResultBool error
Replies: 0
Views: 782

databaselayer - mysqlGetResultBool error

It seems that GetResultBool need to cast the binding buffuer to a char*, becasue buffer_type is MYSQL_TINY_TYPE if MYSQL set a BOOL field. Existing code in Databaselayer MysqlPreparedStatementResultSet::GetResultBool: if ((*(pResultBinding->is_null) == false)) bValue = (*((int*)(pResultBinding->buff...
by weworld
Mon May 18, 2009 9:15 am
Forum: C++ Development
Topic: Quickly show a panel in dialog without thinkin about sizers?
Replies: 2
Views: 497

Quickly show a panel in dialog without thinkin about sizers?

I have many panels derived from wxPanel, and want to show one panel in a dialog. for example: show a MyPanel in a dialog. How can i do that without doing these: wxDialog dlg(...), new MyPanel(&dlg) new Sizer(...) sizer->Add(panel,...) dlg.SetSizer ... dlg.ShowModel() I need a common function to enca...
by weworld
Sat May 16, 2009 5:51 am
Forum: C++ Development
Topic: How to cancel a wxMessageBox with a Esc key?
Replies: 1
Views: 505

How to cancel a wxMessageBox with a Esc key?

Hi,
I use "wxICON_INFORMATION | wxYES_NO" style, and I have this problem, and i need Help! :-)
Thank you!