Search found 178 matches

by RainRat
Tue May 22, 2012 8:55 pm
Forum: C++ Development
Topic: wxThreadEvent, QueueEvent, and GUI responsiveness...
Replies: 10
Views: 3208

Re: wxThreadEvent, QueueEvent, and GUI responsiveness...

Profiling to see where the bottleneck is would also be informative (unfortunately, on Windows it seems very hard to find a decent profiler that is not also expensive) CodeAnalyst is free from AMD and works with AMD chips. It seems a subset of the features will work on Intel chips also. Specifically...
by RainRat
Sat Mar 24, 2012 6:37 am
Forum: Component Writing
Topic: Text control with multiple selection
Replies: 6
Views: 6663

Re: Text control with multiple selection

It's not clear what you need. Do you want something like wxComboBox?
by RainRat
Mon Feb 27, 2012 12:47 am
Forum: C++ Development
Topic: getchar() wx style
Replies: 12
Views: 2016

Re: getchar() wx style

If I understand the problem correctly, then you can use Bind instead of the event table. The char event does not propagate upward to parent windows, but by using Bind() you can have a different class/method handle the key press. I think something like this: MyFrame::MyFrame(...) { m_text_ctrl->Bind(...
by RainRat
Fri Feb 17, 2012 6:36 pm
Forum: C++ Development
Topic: error: multiple definition of function
Replies: 4
Views: 10761

Re: error: multiple definition of function

softport wrote:PS Would you have a recommendation for a good beginner C++ book?
There is a free downloadable book here: http://mindview.net/Books/TICPP/ThinkingInCPP2e.html
by RainRat
Fri Feb 17, 2012 6:30 pm
Forum: C++ Development
Topic: Problems using rand() in wxThreads
Replies: 5
Views: 1673

Re: Problems using rand() in wxThreads

I use a mutex protected, great but slower RNG in my main thread to seed the faster RNG I use in threads. The overhead of the mutex and initial seeding of the thread RNG is relatively negligible, but this guarantees a good new seed for each new thread. This may be overkill or slightly tangent to your...
by RainRat
Fri Feb 10, 2012 7:29 pm
Forum: C++ Development
Topic: Problem resizing array
Replies: 2
Views: 716

Re: Problem resizing array

There are of course better ways to work with arrays in C++, namely using std::vector which will manage the memory for you. But to answer your question, you are deleting the memory that was allocated to hold both arrays, so "array" is pointing to a memory location that is deleted. I suspect that inte...
by RainRat
Fri Feb 10, 2012 7:20 pm
Forum: C++ Development
Topic: Multi-threading
Replies: 10
Views: 2580

Re: Multi-threading

You can't update any GUI elements directly from worker threads. You need to pass an event to the main thread and update from there. I see no point in actually updating the text controls every millisecond. Screen refresh rates are less than 100 times per second and no human would need to see updates ...
by RainRat
Fri Feb 10, 2012 7:04 pm
Forum: C++ Development
Topic: wxListCtrl - wxLC_VRULES
Replies: 3
Views: 859

Re: wxListCtrl - wxLC_VRULES

Bill87 wrote:1). Can these lines be made darker?
The color is hard coded, so you would need to change the OnPaint source code for each platform.
by RainRat
Fri Feb 10, 2012 9:00 am
Forum: C++ Development
Topic: wxRichToolTip bugs
Replies: 1
Views: 629

Re: wxRichToolTip bugs

Actually, I not sure if the second bug is a bug. I thought that the dismissing click should be sent to the panel with the id of the panel. If I only Bind to the id's 1 and 2, then this isn't a problem. But the dismissing click gets resent with a negative id, and not the wxFrame's id. I just assumed ...
by RainRat
Thu Feb 09, 2012 9:08 am
Forum: C++ Development
Topic: wxRichToolTip bugs
Replies: 1
Views: 629

wxRichToolTip bugs

I was trying out wxRichToolTip in 2.9.3 on MSW with VC++ 2010, but there seems to be 2 bugs, unless I am doing something wrong. First, if the timeout is set and the program is stopped in the debugger after the ShowFor() function call, then resumed after the timer is expired it crashes with "..\..\sr...
by RainRat
Wed Feb 01, 2012 6:37 pm
Forum: C++ Development
Topic: GetTextExtent using font only
Replies: 3
Views: 1896

Re: GetTextExtent using font only

I'll add that if the font is the font of any wxWindow object, then you can use wxWindow::GetTextExtent which "Gets the dimensions of the string as it would be drawn on the window with the currently selected font." So you don't need to create a wxDC in this case. We'd need to know where your font com...
by RainRat
Wed Feb 01, 2012 10:31 am
Forum: C++ Development
Topic: Capture and modify wxKeyEvent
Replies: 2
Views: 957

Re: Capture and modify wxKeyEvent

I was using event.Skip() and still had the problem, but... I think I solved it. I needed to check if the changes I want to make (e.g. capitalize a's) actually change the current string, then only update if it was changed. So when an item is selected from the list, there is no change...as long as onl...
by RainRat
Tue Jan 31, 2012 9:20 pm
Forum: C++ Development
Topic: Capture and modify wxKeyEvent
Replies: 2
Views: 957

Capture and modify wxKeyEvent

I'd like to capture some lowercase letter wxKeyEvents and capitalize them before they get to the control. i.e. 'a' --> 'A' Specifically, in a wxComboBox, I tired to handle wxEVT_COMMAND_TEXT_UPDATED and simply capitalize the letters and then put the new text back with ChangeValue(), but this seems t...
by RainRat
Fri Jan 27, 2012 8:23 am
Forum: C++ Development
Topic: Expected behaivor of wxComboBox
Replies: 4
Views: 1216

Re: Expected behaivor of wxComboBox

I think in most of the cases, automatically adding the entries would be unwanted. I agree...therefore that is not the default behavior. I just thought that it was common enough that there would be a member function at least to do it. e.g. AddTextToList(). But I guess I shouldn't be surprised since ...
by RainRat
Thu Jan 26, 2012 5:29 pm
Forum: C++ Development
Topic: Expected behaivor of wxComboBox
Replies: 4
Views: 1216

Re: Expected behaivor of wxComboBox

I'm not saying the proposed behavior is no good, but changing the default now is very unlikely to be accepted. Well, what is the default behavior? The program adds a set of options to the drop down list from which the user can select and edit, but these edits never get added? This guideline page: D...