Search found 52 matches
- Mon Sep 11, 2017 9:10 pm
- Forum: C++ Development
- Topic: wxString input
- Replies: 4
- Views: 1092
Re: wxString input
I'm guessing you're looking for someWxString.ToStdString()
- Wed Aug 16, 2017 7:11 pm
- Forum: C++ Development
- Topic: Dynamically adding wxAuiToolBarItem to wxAuiToolBar has minor graphical artifact
- Replies: 0
- Views: 6620
Dynamically adding wxAuiToolBarItem to wxAuiToolBar has minor graphical artifact
The goal is to populate the wxAuiToolBar with, essentially, image buttons that represent images to be analyzed or directories of images to be analyzed. It's going to act like a "Recent Documents..." control, only graphically. I've just noticed that when I add my new wxAuiToolBarItem to it,...
- Fri Aug 04, 2017 9:24 pm
- Forum: C++ Development
- Topic: Event Handling in submenu's of a wxMenu
- Replies: 8
- Views: 23974
Re: Event Handling in submenu's of a wxMenu
I haven't researched the sources, but i think menu events are usually sent directly to the wxFrame. The fact that you can catch some events in a class derived from wxMenuBar is just a lucky coincidence ;) I'm starting to feel like my attempt to encapsulate every wxMenu into their own class, that ge...
- Fri Aug 04, 2017 8:57 pm
- Forum: C++ Development
- Topic: Event Handling in submenu's of a wxMenu
- Replies: 8
- Views: 23974
Re: Event Handling in submenu's of a wxMenu
Yeh, I've been tweaking things since I posted the initial issue, so names have changed, but having the same issue. I use the same event handler now for both and use evt.GetID() to set the different behavior for both menuItems. But I still have the same issue of them working when Appended to (this), ...
- Fri Aug 04, 2017 8:47 pm
- Forum: C++ Development
- Topic: Event Handling in submenu's of a wxMenu
- Replies: 8
- Views: 23974
Re: Event Handling in submenu's of a wxMenu
Hi, Are you trying to create your own handler for the menu or you are using the standard one? Are you using event table or dynamic binding? Could you please copy'n'paste the event binding code (either how do you call Bind() or the event table macros)? Also I presume in the code you posted 'this' is...
- Fri Aug 04, 2017 8:24 pm
- Forum: C++ Development
- Topic: Event Handling in submenu's of a wxMenu
- Replies: 8
- Views: 23974
Re: Event Handling in submenu's of a wxMenu
In the 'Standard items demo' submenu, is it supposed to just print the ID when you click on a menuitem such as Add or are Dialog windows supposed to pop up as well? Because I am not seeing anything pop up from that particular menu item. Quit works, but Add or Print Preview have no dialogs popup. I g...
- Fri Aug 04, 2017 5:55 pm
- Forum: C++ Development
- Topic: Event Handling in submenu's of a wxMenu
- Replies: 8
- Views: 23974
Event Handling in submenu's of a wxMenu
I have two wxMenuItems that are submenus and when I set them up this way, the second event is not fired. wxMenu *menuBorders = new wxMenu; menuBorders->Append(ID_FSAVE, wxT("Save as Single &Image")); menuBorders->Append(ID_TSAVE, wxT("Save as &Multi-Page TIFF")); this->Ap...
- Tue Aug 01, 2017 8:03 pm
- Forum: C++ Development
- Topic: Does the event handler create new objects during Bind?
- Replies: 9
- Views: 2057
Re: Does the event handler create new objects during Bind?
Like I said above, not actually implementing it this way, I just thought it was interesting.doublemax wrote:I don't see how this is possible, but: Good luck with this
- Tue Aug 01, 2017 7:58 pm
- Forum: C++ Development
- Topic: Does the event handler create new objects during Bind?
- Replies: 9
- Views: 2057
Re: Does the event handler create new objects during Bind?
No, you're not accessing a random memory location, by setting that static pointer during AuiManager construction, that variable will remain in place for any following call to OpenFile. Basically you no longer need an instance of AuiManager, at least from the perspective of FileMenu. Like I said, it ...
- Tue Aug 01, 2017 6:45 pm
- Forum: C++ Development
- Topic: Does the event handler create new objects during Bind?
- Replies: 9
- Views: 2057
Re: Does the event handler create new objects during Bind?
BEGIN_EVENT_TABLE(FileMenu, wxMenu) EVT_MENU( ID_FOPEN, AuiManager::OnFileOpen This can't work. When using a static event table, the event handler has to be a method of the class that owns the event table, in this case "FileMenu". Actually, just screwing around I discovered you could do i...
- Mon Jul 31, 2017 9:43 pm
- Forum: C++ Development
- Topic: Does the event handler create new objects during Bind?
- Replies: 9
- Views: 2057
- Mon Jul 31, 2017 9:20 pm
- Forum: C++ Development
- Topic: Does the event handler create new objects during Bind?
- Replies: 9
- Views: 2057
Re: Does the event handler create new objects during Bind?
Well damn, it all actually worked somewhat so I just assumed I was missing one little thing. Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(AuiManager::OnFileOpen), this, ID_FOPEN); What does "this" point to? It must be a pointer to a AuiManager instance. Doesn't it technically ne...
- Mon Jul 31, 2017 7:20 pm
- Forum: C++ Development
- Topic: Does the event handler create new objects during Bind?
- Replies: 9
- Views: 2057
Does the event handler create new objects during Bind?
So I have all my menus broken up in my program, for now I want a custom control that inherits from wxAuiManager to accept events from them. I have tried binding the event these two ways on the menu end. BEGIN_EVENT_TABLE(FileMenu, wxMenu) EVT_MENU( ID_FOPEN, AuiManager::OnFileOpen .... or Bind(wxEVT...
- Fri Jul 28, 2017 5:35 pm
- Forum: C++ Development
- Topic: Passing data between controls
- Replies: 10
- Views: 2853
Re: Passing data between controls
There is a nice tutorial "Widgets communicate" at the end of page: http://zetcode.com/gui/wxwidgets/firstprograms/ I saw that awhile ago, I figured I would just end up having everything pointing to everything and I'd much rather not do that. I got this working though mostly. Bind(wxEVT_CO...
- Fri Jul 28, 2017 2:59 pm
- Forum: C++ Development
- Topic: Passing data between controls
- Replies: 10
- Views: 2853
Re: Passing data between controls
for linking events to other classes, I would prefer Bind() http://docs.wxwidgets.org/3.1/overview_events.html#overview_events_bind keep scrolling on that page to see how events propogate. Bind is just the most up to date to dynamically link right? Statically linking is still valid? I just kind of l...