Search found 111 matches

by maxbld
Fri Feb 14, 2014 11:59 am
Forum: C++ Development
Topic: Dynamic array are performance killers??
Replies: 4
Views: 1621

Re: Dynamic array are performance killers??

maxbld wrote:I'll update if the idea works.
Yes worked and performance improved significantly...
by maxbld
Tue Jan 28, 2014 3:15 pm
Forum: C++ Development
Topic: cast to (const char*) not working in release??
Replies: 3
Views: 1122

Re: cast to (const char*) not working in release??

My gosh!! Turns out I overlooked that the DLL VS project bearing the code was configured to use the Multi-threaded DEBUG DLL /MDd runtime library instead than Multi-threaded DLL /MD one. It's one day and a half I struggle on this, and I just didn't see it, I was searching for DLL versions, optimizat...
by maxbld
Tue Jan 28, 2014 2:01 pm
Forum: C++ Development
Topic: cast to (const char*) not working in release??
Replies: 3
Views: 1122

Re: cast to (const char*) not working in release??

What happens if you return std::string( pData.mb_str(wxConvUTF8) ) instead? BTW: In wx 2.9/3.0, you can also use wxString::ToUTF8() which is a little less to type. Same. But now I've got a clearer picture: wxString::mb_str returns a const wxScopedCharBuffer which, when it's destroyed, does a wxScop...
by maxbld
Tue Jan 28, 2014 9:55 am
Forum: C++ Development
Topic: cast to (const char*) not working in release??
Replies: 3
Views: 1122

cast to (const char*) not working in release??

Dear all, I've a quite strange issue: std::string Tools::ConvertToDbStr(const wxString& pData, dba::ConvSpec::charset pCharset) throw (dba::ConversionException) { wxFontEncoding enc = ToWxFontEnconding(pCharset); if (enc == wxFONTENCODING_UTF8) return (const char*)pData.mb_str(wxConvUTF8); <== ASSER...
by maxbld
Sat Jan 04, 2014 10:14 pm
Forum: C++ Development
Topic: Dynamic array are performance killers??
Replies: 4
Views: 1621

Re: Dynamic array are performance killers??

Thanks a lot for the interesting answers! :-) Re-thinking my code I figured out the worst problem I have is that I'm forced to search m_mapArray by column name because the database recordset and the wxGrid columns doesn't have a one to one relationship (in general the recordset is bigger than the wx...
by maxbld
Sat Jan 04, 2014 6:18 pm
Forum: C++ Development
Topic: Dynamic array are performance killers??
Replies: 4
Views: 1621

Dynamic array are performance killers??

Dear all, In my app I'm using intesively the wxGrid object. I take the data to show from the database and I basically map each recordset field on a wxGrid column. Actually the fields must be treated differently, i.e. some are comboboxes, some are read only and so on. To keep trace of the fields attr...
by maxbld
Thu Jan 02, 2014 12:37 pm
Forum: C++ Development
Topic: screen coords when scrolling horizontally
Replies: 1
Views: 1155

screen coords when scrolling horizontally

Dear all, I'm handling the event wxEVT_LEFT_DOWN in a window I obtained from wxGrid::GetGridWindow() and I want to see if the carpet pointer was contained in a given wxRect. The code below works until when the grid hasn't been scrolled horizontally (for vertical scrolling works well), after that, ev...
by maxbld
Tue Dec 03, 2013 4:51 pm
Forum: C++ Development
Topic: Date format in wxLocale
Replies: 8
Views: 1974

Re: Date format in wxLocale

Dear all, I've been misled by the internat sample: There wxLocale::Init is used, which in my project didn't work well (I got asserts in intl.cpp ln 1445 of method wxLocale::GetInfo) I don't know what was I doing wrong, but for the moment I don't care much, since I've no internationalization nor dict...
by maxbld
Tue Dec 03, 2013 3:18 pm
Forum: C++ Development
Topic: Date format in wxLocale
Replies: 8
Views: 1974

Re: Date format in wxLocale

all my app has the locale I initialize in wxApp::OnInit() and I pass to wxLocale wxFrame::m_locale of my app. I'm not quite sure what you mean here. what I mean is if I put a piece of code like wxString str; str.Printf(wxT("current date: %s"), wxDateTime::Now().Format("%A %d %B %Y")); wxMessageBox(...
by maxbld
Mon Dec 02, 2013 11:40 pm
Forum: C++ Development
Topic: Date format in wxLocale
Replies: 8
Views: 1974

Re: Date format in wxLocale

Well, here is happening something I don't understand: all my app has the locale I initialize in wxApp::OnInit() and I pass to wxLocale wxFrame::m_locale of my app. But the wxGrid, which I create in the constructor of wxFrame has a different wxLocale. Actually the wxGrid is child of a wxAuiNotebook o...
by maxbld
Mon Dec 02, 2013 7:23 pm
Forum: C++ Development
Topic: Date format in wxLocale
Replies: 8
Views: 1974

Re: Date format in wxLocale

You answered your own question already. In order to preserve the set locale, its instance can not go out of scope. If your locale is supposed to be application-wide, set it e.g. in the OnInit() method of your wxApp instance. You can take a look at the code in the internat sample (located in %WXWIN%...
by maxbld
Mon Dec 02, 2013 4:50 pm
Forum: C++ Development
Topic: Date format in wxLocale
Replies: 8
Views: 1974

Date format in wxLocale

Dear all, when I call wxDateTime.Format I always get back a date written in English, even though my win OS is set to another language. If I set say wxLocale locale(wxLANGUAGE_ITALIAN); then the date is formatted in Italian, but ONLY locally in the wxLocale locale object scope. How can I make the set...
by maxbld
Mon Nov 11, 2013 11:23 pm
Forum: C++ Development
Topic: Text background
Replies: 7
Views: 1456

Re: Text background

I'd try to create a wxPanel and put both controls onto the panel, probably in a horizontal boxsizer. I tried the wxPanel approach, which indeed seemed to me smart, but had exact same result: again that white hole in the button square. What is interesting is that I can change the color of the hole b...
by maxbld
Sun Nov 10, 2013 11:22 am
Forum: C++ Development
Topic: Text background
Replies: 7
Views: 1456

Re: Text background

I need some context, i have no idea what you're doing. Any maybe some screenshots? I've derived from wxGridCellRenderer and wxGridCellEditor to have buttons in the cells, as in the attached screenshot. But as you may see when the cell is open for editing in the wxGridCellEditor, the three dots I pa...
by maxbld
Sat Nov 09, 2013 6:03 pm
Forum: C++ Development
Topic: Text background
Replies: 7
Views: 1456

Re: Text background

[quote="doublemax"] dc.SetBackgroundMode( wxTRANSPARENT ) OK, and this solves for the renderer. But then again I have same issue in the editor: there in the Create method i put the following: m_pButton = new wxButton(parent, id, m_strLabel); SetControl(m_pButton); Where m_strLabel is the same label ...