Search found 125 matches

by chris_bern
Sat Jun 05, 2010 3:41 pm
Forum: C++ Development
Topic: Embeed images into exe but free the memory afterwards
Replies: 4
Views: 892

No matter how you embed the image data in your executable, you'll never be able to free the memory. In your case with base64 encoding in a string literal, it would use even more memory. If I define the string literals on the heap as global, and later on I delete them, doesn't this frees the memory?...
by chris_bern
Sat Jun 05, 2010 10:14 am
Forum: C++ Development
Topic: wxDialog with NULL parent does not take focus
Replies: 5
Views: 1517

Re: wxDialog with NULL parent does not take focus

maxinuruguay wrote:However, although ShowModal makes the dialog pop up, the focus remains on the application the user was currently using before my program interrupted.
dialog->SetFocus right after dialog->ShowModal should be fine enough.
by chris_bern
Sat Jun 05, 2010 10:06 am
Forum: C++ Development
Topic: Embeed images into exe but free the memory afterwards
Replies: 4
Views: 892

Embeed images into exe but free the memory afterwards

The example at http://wiki.wxwidgets.org/Embedding_PNG_Images doesn't allow you to free the memory used by the char array that represent the image. I tried this code to achieve that: wxArrayString * Base64Images = new wxArrayString(); Base64Images->Add(wxT("base64 of the binary file goes here")); wx...
by chris_bern
Mon Mar 08, 2010 1:50 pm
Forum: C++ Development
Topic: wxFrame blocked by modal dialog called into another wxFrame
Replies: 8
Views: 1639

The major problem here is the handling of the return code. ShowModal() waits until the dialog is closed and returns a value, Show() does not. If the return code of the dialog is needed, this must be simulated by posting a message to the parent, for example in the dialog dtor. The main reason I need...
by chris_bern
Mon Mar 08, 2010 10:39 am
Forum: C++ Development
Topic: wxFrame blocked by modal dialog called into another wxFrame
Replies: 8
Views: 1639

So you have 2 frames, and and 3rd dialog that you want to only cover the frame that launched it? If so, try putting the dialog in a 3rd frame, and set wxFRAME_FLOAT_ON_PARENT If I understood you well you propose to create a hidden frame as a child of the second frame, and use the hidden frame as a ...
by chris_bern
Mon Mar 01, 2010 1:47 pm
Forum: C++ Development
Topic: wxFrame blocked by modal dialog called into another wxFrame
Replies: 8
Views: 1639

I use Show() for the frames, and ShowModal() for the dialog. I need the dialog to be modal and to block only the frame by which it is called.
by chris_bern
Mon Mar 01, 2010 1:24 pm
Forum: C++ Development
Topic: wxFrame blocked by modal dialog called into another wxFrame
Replies: 8
Views: 1639

wxFrame blocked by modal dialog called into another wxFrame

I have one main wxFrame and another frame created with null parent. When I call modal dialog into the second frame the main frame is blocked for user input as well. I don't know how to avoid the main frame being blocked in such case. Thanks in advance.
by chris_bern
Mon Mar 01, 2010 9:09 am
Forum: C++ Development
Topic: wxExecute on MS Vista
Replies: 4
Views: 1816

Re: wxExecute on MS Vista

Is it that the main application should also run with admin privileges in order to wxExecute another app that too requires admin privileges? Yes if you start it directly in wxExecute. To make UAC popup and ask for approval try this: wxExecute(wxT("cmd /C \"")+FullPathAndFileName+wxT("\""), .... To a...
by chris_bern
Sun Oct 18, 2009 5:18 pm
Forum: C++ Development
Topic: Error received while using wxListBox->clear API
Replies: 7
Views: 1117

Re: Error received while using wxListBox->clear API

Call ListControl->Clear(); only if the list is not empty.

Till you find the right cause.
by chris_bern
Sun Oct 18, 2009 4:04 pm
Forum: C++ Development
Topic: wxListBox blocked on SetSelection, or Clear
Replies: 1
Views: 462

Make sure you make GUI calls directly only from the MAIN THREAD. Extract from wxWidgets docs: wxWidgets Calls in Secondary Threads All threads other than the "main application thread" (the one running wxApp::OnInit() or the one your main function runs in, for example) are considered "secondary threa...
by chris_bern
Fri Oct 16, 2009 11:07 am
Forum: C++ Development
Topic: wxTaskBarIcon: Can't exit application if dialog is shown
Replies: 4
Views: 796

Or you have a better idea?
by chris_bern
Wed Oct 14, 2009 11:01 am
Forum: C++ Development
Topic: wxTaskBarIcon: Can't exit application if dialog is shown
Replies: 4
Views: 796

Thanks for the answer. I tried and it's not for modal.

As an alternative, I will hold a list of opened modal dialogs and destroy them manually on exit.
by chris_bern
Tue Oct 13, 2009 12:20 pm
Forum: C++ Development
Topic: wxTaskBarIcon: Can't exit application if dialog is shown
Replies: 4
Views: 796

wxTaskBarIcon: Can't exit application if dialog is shown

Hi,

When a modal dialog is shown in my application one cannot destroy the application using the taskbar menu command. To double check the issue I modified the wxTaskBarIcon Sample to show a wxMessageBox on the Dialog, the problem still occurs.

The source is attached.

Thanks,
Chris
by chris_bern
Tue Jun 30, 2009 2:12 am
Forum: C++ Development
Topic: Trouble animating bitmaps with a timer
Replies: 6
Views: 898

Just a note that wxAnimationCtrl does support transparent GIF animation under Windows as well.
by chris_bern
Tue Jun 30, 2009 1:05 am
Forum: C++ Development
Topic: Text to speech?
Replies: 1
Views: 475