Search found 91 matches

by Peri
Mon Jan 02, 2012 4:06 am
Forum: C++ Development
Topic: have context menu, need control id
Replies: 3
Views: 1541

have context menu, need control id

I have several controls, all which can pop up a context menu. I have the event table setup to produce wxCommandEvent objects via the EVT_MENU macro. In the EVT_MENU handler, how can I tell which control initiated the event? I see it's possible to get the id of the menu item, but I see nothing to get...
by Peri
Thu Dec 22, 2011 11:22 pm
Forum: C++ Development
Topic: need EVT_KILL_FOCUS for wxRichTextCtrl
Replies: 2
Views: 961

Re: need EVT_KILL_FOCUS for wxRichTextCtrl

Ah, yes. I was making the mistake of trying to handle the event in the parent. I moved the handler to a subclass of wxRichTextCtrl and it's working great!

Thanks.
by Peri
Thu Dec 22, 2011 7:27 pm
Forum: C++ Development
Topic: need EVT_KILL_FOCUS for wxRichTextCtrl
Replies: 2
Views: 961

need EVT_KILL_FOCUS for wxRichTextCtrl

Is there a way to be notified when a wxRichTextCtrl loses focus?

Nothing is documented for this, and looking through the code I didn't see any mechanism for notification. (Not sure why this was omitted.) I tried putting an EVT_KILL_FOCUS handler in just be sure. No luck.

Thanks.
by Peri
Wed Dec 21, 2011 12:00 am
Forum: C++ Development
Topic: close wxFrame without closing all frames
Replies: 5
Views: 1822

Re: close wxFrame without closing all frames

You are so right, Auria. I wrote a two frame app and I can close either window independently, and the app terminates only after the second one closes. Perfect.

Now comes the fun part :)
by Peri
Tue Dec 20, 2011 10:17 pm
Forum: C++ Development
Topic: close wxFrame without closing all frames
Replies: 5
Views: 1822

Re: close wxFrame without closing all frames

I haven't tried a small test app yet. Give me some time and I'll let you know.
by Peri
Tue Dec 20, 2011 9:38 pm
Forum: C++ Development
Topic: close wxFrame without closing all frames
Replies: 5
Views: 1822

Re: close wxFrame without closing all frames

I forgot to mention that I am creating the frames with NULL for the parent - if I didn't then the original parent will always be behind the new ones. I'll add that this wx behavior makes some sense: most apps have just one frame and the app needs to know when to shut down - the implementation assume...
by Peri
Tue Dec 20, 2011 8:09 pm
Forum: C++ Development
Topic: close wxFrame without closing all frames
Replies: 5
Views: 1822

close wxFrame without closing all frames

My app creates a number of wxFrame windows - essentially like an SDI app. The problem occurs when the user closes one of the window - all windows end up getting destroyed. I want only the subject window to close. More specifically, in the EVT_CLOSE handler for the wxFrame, I'm calling Destroy. This ...
by Peri
Tue Dec 20, 2011 1:10 am
Forum: Component Writing
Topic: how do I get native settings to use in a custom control?
Replies: 3
Views: 10526

Re: how do I get native settings to use in a custom control?

This is great info. Thanks! Don't know how I missed it.
by Peri
Mon Dec 19, 2011 11:23 pm
Forum: Component Writing
Topic: how do I get native settings to use in a custom control?
Replies: 3
Views: 10526

how do I get native settings to use in a custom control?

Does wxWidgets provide any api for getting native settings? I've looked but haven't found anything. I'm making a custom control - more or less - and would like it to have a native look and feel. That is, it should use background and foreground colors typical for other controls, simlilarly for fonts,...
by Peri
Sat Dec 17, 2011 7:15 am
Forum: C++ Development
Topic: Disabling scroll bars in wxRichTextCtrl?
Replies: 2
Views: 1871

Re: Disabling scroll bars in wxRichTextCtrl?

I see this is an old thread, but hopefully still relevant. Similar to rgruian, I was looking into disabling scrollbars and also having the control size itself vertically to exactly fit its contents. The first part turns out to be really easy - just override SetupScrollbars like this: void SetupScrol...
by Peri
Thu Dec 15, 2011 3:18 pm
Forum: C++ Development
Topic: why isn't wxMutex blocking?
Replies: 3
Views: 1361

Re: why isn't wxMutex blocking?

Thanks to both of you! I had originally thought that OnSize and the other GUI callbacks were single threaded but it was appearing that, maybe, they were not. Anyway, with your affirmation, I quickly went back looking for the culprit. Found it: a calls to wxSize size = GetBestVirtualSize(); SetVirtua...
by Peri
Thu Dec 15, 2011 5:03 am
Forum: C++ Development
Topic: why isn't wxMutex blocking?
Replies: 3
Views: 1361

why isn't wxMutex blocking?

This ought to be simple... I have an OnSize function for a wxScrolledWindow. Sometimes it takes a long time to executes and I discovered it was being reentered before finishing. So, I tried adding a wxMutex in it, as follows. But, it's not blocking on the Lock. class Pane : wxScrolledWindow { ... vo...
by Peri
Wed Dec 14, 2011 8:09 pm
Forum: C++ Development
Topic: Design Guidelines
Replies: 3
Views: 1445

Re: Design Guidelines

First, I like the idea from the UI point of view - less user interruption by annoying OK, Cancel buttons. I'm doing the same thing, more or less, so will be interested to see what defficienies you run into. Your case is a little different than mine in that I think you are saving a group of fields wh...
by Peri
Tue Dec 13, 2011 9:50 pm
Forum: C++ Development
Topic: wxDialog popup causing parent wxScrolledWindow to scroll
Replies: 6
Views: 1665

Re: wxDialog popup causing parent wxScrolledWindow to scroll

I guess I'm missing your point. Certainly, within a window, if you tab from control to control, the window should scroll to keep the focus in view. However, I can't imagine why a popup dialog should cause the underlying window to scroll without some app-level code to do so. Try my code and you'll se...
by Peri
Tue Dec 13, 2011 2:44 pm
Forum: C++ Development
Topic: wxDialog popup causing parent wxScrolledWindow to scroll
Replies: 6
Views: 1665

Re: wxDialog popup causing parent wxScrolledWindow to scroll

Just tried you suggestion - overriding wxChildFocusEvent. It works! So, thanks for coming up with this workaround.

It still seems like a bug in wxDialog, though. What do you think?