Search found 2569 matches

by PB
Thu Jan 27, 2011 11:31 am
Forum: C++ Development
Topic: wxlistbox Arrays with CASE and SWITCH not working
Replies: 22
Views: 6351

Have you checked out the Controls sample and wxListBox documentation as I advised you earlier? It would really save you a lot of time. You should do something like this for starters, a real application should have much more, e.g. enable/disable a button if there's an item selected or not, doubleclic...
by PB
Wed Jan 26, 2011 8:33 pm
Forum: C++ Development
Topic: wxlistbox Arrays with CASE and SWITCH not working
Replies: 22
Views: 6351

you have to declare your m_pListBox in the wxFrameListBox and create it in its constructor like this: class ListBoxFrame : public wxFrame { ... private: wxListBox* m_pListBox; ... } ListBoxFrame::ListBoxFrame(...) { ... m_pListBox = new wxListBox(this, ... } The enum was meant to be for numeric case...
by PB
Wed Jan 26, 2011 10:30 am
Forum: C++ Development
Topic: Combobox - can you get the selected string from the event?
Replies: 2
Views: 741

Event.GetString() doesn't work for you? It should be as simple as that, at least according to MyPanel::OnCombo() in the Controls example.
Even if this for some reason doesn't work, you should be able to get the combobox using the event id or object without the need of declaring a class member for it.
by PB
Wed Jan 26, 2011 9:16 am
Forum: C++ Development
Topic: MDI menu doesn't get updated
Replies: 6
Views: 1701

The problem is the MDI Example doesn't modify the menu bar via EVT_UPDATE_UI. Actually, the MDI sample (which uses different menubars for the parent and child frames) does disable/enable a menu item - "Child/Copy text from Clipboard". BEGIN_EVENT_TABLE(MyChild, wxMDIChildFrame) ... EVT_UPDATE_UI(wx...
by PB
Wed Jan 26, 2011 6:53 am
Forum: C++ Development
Topic: string & stringstream issue/Q
Replies: 11
Views: 2097

I also don't think you're doing it the best way, anyway: did you check out wxMemory[Input/Output]Stream? http://docs.wxwidgets.org/trunk/classwx_memory_input_stream.html http://docs.wxwidgets.org/trunk/classwx_memory_output_stream.html This also might be useful: http://docs.wxwidgets.org/trunk/class...
by PB
Wed Jan 26, 2011 6:31 am
Forum: C++ Development
Topic: wxlistbox Arrays with CASE and SWITCH not working
Replies: 22
Views: 6351

I did google it. I am just becoming more clear at what I am seeing here now. Thank you for that info it's almost good. I have one more error to fix in my code and I am stumped on why I am getting the error. The error tells me that c1 and c2 and c3 and c4 were not declared in this scope. Here is my ...
by PB
Tue Jan 25, 2011 7:48 pm
Forum: C++ Development
Topic: wxlistbox Arrays with CASE and SWITCH not working
Replies: 22
Views: 6351

Just few remarks. 1. Is your code valid C++, i.e. does it even compile? I didn't know one can use string literals as switch labels. :S Also the code using IsSelected looks odd, IsSelected is a method returning a bool, not a "property". 2. Generally speaking, you are supposed to create any controls o...
by PB
Tue Jan 25, 2011 7:21 pm
Forum: C++ Development
Topic: MDI menu doesn't get updated
Replies: 6
Views: 1701

I can only recommend you look into MDI sample and check wxWidgets docs. The way it is done looks natural and makes sense to me. To have different menubar when there were no children is how it used to be done even in the most mainstream applications like MS Word back when MDI was all the rage. If you...
by PB
Tue Jan 25, 2011 12:47 pm
Forum: C++ Development
Topic: whate wxListCtrl's virtual list mean? how to insert Item?
Replies: 2
Views: 2035

A special case of report view quite different from the other modes of the list control is a virtual control in which the items data (including text, images and attributes) is managed by the main program and is requested by the control itself only when needed which allows to have controls with milli...
by PB
Mon Jan 24, 2011 11:13 am
Forum: C++ Development
Topic: MDI menu doesn't get updated
Replies: 6
Views: 1701

IIRC from my MDI experience (I used DocView MDI though) the toolbar is owned by wxMDIParentFrame (of course MDI children can have their own toolbars, but this is very unusual, these would be placed in the MDI child window itself and not below the menu bar). With menubars, the situation is a bit more...
by PB
Fri Jan 14, 2011 6:57 am
Forum: C++ Development
Topic: How to get Microsofts Win32API-handle of the Main-Window?
Replies: 2
Views: 723

Generally speaking you can get application's "main window" from wxWindow* wxApp::GetTopWindow() You can get window handle for any window using WXWidget wxWindow::GetHandle() (on Windows returns HWND) BUT: when using wxWidgets you should rarely have a need for doing this. You should program into wxWi...
by PB
Wed Jan 05, 2011 7:21 pm
Forum: C++ Development
Topic: Problem with wxFileSystemWatcher: Does not recognize modif.
Replies: 14
Views: 2985

doublemax wrote:BTW: I just checked the sources, overriding the methods can't work, they're not even members of the base class. The documentation is wrong there.;)
I've also noticed that, together with some other issues with this class, so I'm going to create a ticket.
by PB
Wed Jan 05, 2011 6:19 pm
Forum: C++ Development
Topic: Problem with wxFileSystemWatcher: Does not recognize modif.
Replies: 14
Views: 2985

Try replacing FileWatcher->Bind(wxEVT_FSWATCHER, &ImportDlg::OnFileSystemEvent, this); with Bind(wxEVT_FSWATCHER, &ImportDlg::OnFileSystemEvent, this); assuming the code is run within your ImportDlg constructor, I'm somewhat confused because you've also mentioned a panel (as in wxPanel?). I have to ...
by PB
Wed Jan 05, 2011 5:14 pm
Forum: C++ Development
Topic: Problem with wxFileSystemWatcher: Does not recognize modif.
Replies: 14
Views: 2985

I have also never used this class, Nevertheless, I don't think overriding these functions in the Owner is going to work as your panel is not derived from wxFileSystemWatcher. I think you should begin with what FSWatcher sample does: 1. create an instance of wxFileSystemWatcher in your Panel 2. set i...
by PB
Tue Jan 04, 2011 6:38 am
Forum: C++ Development
Topic: wxAUI: pane titles not translated if perspective loaded
Replies: 4
Views: 1912

However, wxAui uses the caption as part of the way it 'registers' and identifies each dockable pane. So I found that, once the caption was changed, wxAui would lose track of the pane if it were moved or floated: it looked at the caption and decided it wasn't the one it was expecting. I don't have m...