Search found 41 matches

by ArKay
Sat Apr 05, 2008 3:58 pm
Forum: C++ Development
Topic: wxWidgets/C++ Tabbed Text Editor
Replies: 26
Views: 4130

I think that those .xpm files are wrong though. Take a look at samples/sample.xpm (open with a text editor) to see what they must be like.

You should also move the xpm #includes to the CWebGUI.cpp to avoid multiple declarations should you include CWebGUI.h in other sources.
by ArKay
Sat Apr 05, 2008 3:40 pm
Forum: C++ Development
Topic: wxWidgets/C++ Tabbed Text Editor
Replies: 26
Views: 4130

How are your xpm bitmaps declared in the header files? Looks like you are using "string" when it should be something like "static const char *const xxx_xpm[]". Do your xpm headers actually contain xpm character arrays?
by ArKay
Sat Apr 05, 2008 3:35 pm
Forum: C++ Development
Topic: wxXmlDocument.Save() parameter truncation
Replies: 11
Views: 1995

Should you ever need UTF-16 (just in case), build and use the wxXml2 library (syntax is similar to that of wxXml)... http://wxcode.sourceforge.net/components/wxxml2/ Pass 0 flags when saving the file (document.Save(file, encoding, 0)). Otherwise the EOLs will be converted to native (flags default to...
by ArKay
Sat Apr 05, 2008 3:15 pm
Forum: C++ Development
Topic: wxAuiNotebook events
Replies: 1
Views: 606

Try using EVT_AUINOTEBOOK_PAGE_CLOSE() instead of wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE().
by ArKay
Fri Apr 04, 2008 8:22 pm
Forum: C++ Development
Topic: wxXmlDocument.Save() parameter truncation
Replies: 11
Views: 1995

Then they are not generating UTF-16 to begin with. Some people are really careless with document encoding information :D I'm wondering how they can parse their own documents. They probably don't even use an XML toolkit for generation and parsing. You don't have to use a temp file. You could do it in...
by ArKay
Thu Apr 03, 2008 6:43 am
Forum: C++ Development
Topic: How do I hide a column in a wxListCtrl?
Replies: 6
Views: 1093

Removing and adding columns on the fly works pretty well, too. Something like this (I have a virtual wxListrCtrl in report mode). void ServiceListCtrl::RebuildColumns() { int nColumns = GetConfiguredColumnCount(); int nCurrentColumns = GetColumnCount(); if (nCurrentColumns > nColumns) { while (nCurr...
by ArKay
Thu Apr 03, 2008 12:20 am
Forum: C++ Development
Topic: How do I save the contents of a wxListBox to a text file?
Replies: 9
Views: 1425

So far I've always used wxTextOutputStream for saving so I didn't know that Create() could fail either until I checked. :) I can't imagine writing code like this :lol: wxTextFile file("C:\\blech.txt"); if ((file.Exists() ? file.Open() : file.Create())) ... file.Write(); file.Close(); }
by ArKay
Wed Apr 02, 2008 11:49 pm
Forum: C++ Development
Topic: wxXmlDocument.Save() parameter truncation
Replies: 11
Views: 1995

Actually wxXml2 does it _nearly_ right. The only thing wrong with it is that it doesn't encode EOL characters in UTF-16. It writes... 0D 0A instead of... 0D 00 0A 00 The rest of the file is correct (tried it with a hex editor, after insertion of the missing 0s the file can be opened). No idea whethe...
by ArKay
Wed Apr 02, 2008 11:33 pm
Forum: C++ Development
Topic: wxXmlDocument.Save() parameter truncation
Replies: 11
Views: 1995

I think that in UTF-16 EVERY character needs to be written as 16bit (I might be wrong), contrary to UTF-8 where only non-ASCII characters are escaped. That's wrong. In UTF16 each character is minimally 16 bits long, but there are some that need more. I know. Just wanted to illustrate that what wx i...
by ArKay
Wed Apr 02, 2008 11:05 pm
Forum: C++ Development
Topic: How do I save the contents of a wxListBox to a text file?
Replies: 9
Views: 1425

Well, the API is kind of weird :D wxTextFile::Open bool Open(wxMBConv& conv = wxConvUTF8) const bool Open(const wxString& strFile, wxMBConv& conv = wxConvUTF8) const Open() opens the file with the given name or the name which was given in the constructor and also loads file in memory on success. It ...
by ArKay
Wed Apr 02, 2008 9:51 pm
Forum: C++ Development
Topic: How do I save the contents of a wxListBox to a text file?
Replies: 9
Views: 1425

file.Create(const wxString& strFile) should be used for creation instead of Open().
by ArKay
Wed Apr 02, 2008 9:39 pm
Forum: C++ Development
Topic: Visual 2005/2008 - problem with wxTextCtrl
Replies: 3
Views: 1897

Bizarre. I don't have such problems with VS 2008 Professional.

I would build the samples/widgets wx demo to see if you run into the same problem there.
by ArKay
Wed Apr 02, 2008 9:32 pm
Forum: C++ Development
Topic: wxXmlDocument.Save() parameter truncation
Replies: 11
Views: 1995

I haven't come across UTF-16 encoded XML myself yet, it's probably not too common and UTF-8 works just fine.

Do those files really have to be encoded in UTF-16?
by ArKay
Wed Apr 02, 2008 11:38 am
Forum: C++ Development
Topic: Initializing wxCharBuff in call to wxFileConfig
Replies: 8
Views: 1517

The problem could be somewhere else entirely, maybe code which gets executed before messes up memory so that the realloc() here finally crashes.

I would check other places as well :)
by ArKay
Wed Apr 02, 2008 9:59 am
Forum: C++ Development
Topic: wxXmlDocument.Save() parameter truncation
Replies: 11
Views: 1995

convFile isn't NULL, but it's not used everywhere. I think that in UTF-16 EVERY character needs to be written as 16bit (I might be wrong), contrary to UTF-8 where only non-ASCII characters are escaped. OutputNode() only converts comments and parameters (OutputString() called with 4 parameters), the ...