Search found 26 matches

by S.Volkenandt
Thu Nov 27, 2008 7:12 am
Forum: C++ Development
Topic: Use of DECLARE_APP Macro
Replies: 13
Views: 2420

Blinkinhek wrote:error: no matching function for call to `MyApp::MyApp()'
note: candidates are: MyApp::MyApp(const MyApp&)
I guess anywhere within that <stuff>, <other methods> and <other stuff> is a constructor (with more than 0 arguments) that prevents the default constructor from being autogenerated.
by S.Volkenandt
Tue Jul 22, 2008 2:33 pm
Forum: C++ Development
Topic: Where to intercept Alt-Keypress to simulate mnemonics
Replies: 1
Views: 497

Where to intercept Alt-Keypress to simulate mnemonics

Hello, I have to extend a Notebook control (at present eranif's new Notebook control) to support mnemonics on tabs. But I am currently unable to intercept the corresponding keypresses to react to. So far I've tried wxEVT_CHAR event handlers in the topmost widget (the notebook page) and all panels an...
by S.Volkenandt
Thu Apr 24, 2008 9:19 am
Forum: C++ Development
Topic: wxString ToDouble precision
Replies: 5
Views: 778

You mean you didn't experience this problem on windows? Naturally it depends on the precision of the datatype itself. But mathematically, floating point numbers are stored in terms of Mantisse * 2 ^ Exponent (IEEE754) where both Mantisse and Exponent are integers of a limited width. So, to store 1.1...
by S.Volkenandt
Thu Apr 24, 2008 7:52 am
Forum: C++ Development
Topic: wxString ToDouble precision
Replies: 5
Views: 778

Actually this seems to be a plain c++ float/double precision issue: Actually, it's the C(++) floating point precision issue. Floating point numbers just are not precise. If you can't store 1.1 in a double, then a double simply can't represent 1.1 exactly. You will have to live with that or use a fi...
by S.Volkenandt
Wed Apr 16, 2008 7:49 am
Forum: C++ Development
Topic: How to delete std::vector<wxString*> ?
Replies: 7
Views: 1384

I suppose you double-delete those pointers, or the pointers stored in the vector are not allocated via new wxString.
by S.Volkenandt
Fri Mar 14, 2008 10:40 am
Forum: The Code Dump
Topic: More flexible event callbacks
Replies: 9
Views: 3767

Flexible Event Callbacks revised

As I stated, I have evaluated the mechanism and I wanted to reduce the dependencies between wxEvtHandler and the actual handler functions even more. For example, if you handle wxEVT_COMMAND_MENU_SELECTED, there's really no need to specify that the argument is of type wxCommandEvent& in the Connect-c...
by S.Volkenandt
Thu Mar 13, 2008 12:18 pm
Forum: The Code Dump
Topic: More flexible event callbacks
Replies: 9
Views: 3767

Additionally, the syntax is more natural modern C++, i.e. &Class::Method instead of wxSomeEventHandler(Class::Method). Nice approach, I have been close to trying something similar myself. I will try this out and possibly post some more remarks later. EDIT: I would plead for a more modern event syste...
by S.Volkenandt
Mon Dec 18, 2006 2:17 pm
Forum: C++ Development
Topic: Wierd bug with event tables on wxFrame derived classes
Replies: 4
Views: 860

You had to make the OnExit method static because you are actually calling it when declaring the event table (notice the empty parens!). Since you are calling it without an object, it must be static for that piece of code to work. However, I guess you wanted EVT_MENU(EVENTID_MAINFRAME_EXIT,GhostFrame...
by S.Volkenandt
Mon Dec 18, 2006 10:30 am
Forum: C++ Development
Topic: wxDateTime::Parseformat return less one month
Replies: 3
Views: 895

The GetMonth method of wxDateTime returns a member of the Month enum, in which "Jan" has value 0.
by S.Volkenandt
Mon Dec 18, 2006 8:21 am
Forum: C++ Development
Topic: about wxString and char[100]
Replies: 1
Views: 494

Probably your wxWidgets is compiled in Unicode mode. Then, wxString doesn't manage character arrays, but wide character arrays. You cannot pass narrow character arrays directly. Furthermore, the wxT macro is useful only for string literals. Two ways to make this work: // using wide characters direct...
by S.Volkenandt
Fri Dec 15, 2006 5:55 pm
Forum: C++ Development
Topic: Dialogs in 2.8
Replies: 5
Views: 1242

Since I started with wxWidgets only after 2.7, I can't say how it was before, however, when I connect an event handler to wxID_OK and call event.Skip() after doint my own stuff, I don't need to do anything to close the dialog myself. Maybe this helps... void MyDialog::OnOk( wxCommandEvent& event ) {...
by S.Volkenandt
Sun Dec 10, 2006 10:51 pm
Forum: C++ Development
Topic: wxArray size_t or int, which one is it?
Replies: 7
Views: 1149

... and besides, wx will use exclusively STL in the future in which there are no such "problems", wouldn't it ? Agreed, as long as dereferencing iterators of wxArray doesn't evaluate to void* (at least I've experienced that with 2.7, but I will verify it before filing any reports). Are there any of...
by S.Volkenandt
Fri Dec 08, 2006 8:42 am
Forum: C++ Development
Topic: Access controls in child wxPanel
Replies: 3
Views: 795

You should use a C++ style cast: wxTextCtrl* myTC = static_cast< wxTextCtrl* >(FindWindowById(ID_MySQLADDRESS)); // if you are _absolutely_ sure that FindWindowById(ID_MySQLADDRESS) will return a wxTextCtrl* if (myTC == 0) { /* nope, this control was not found */ } // or wxTextCtrl* myTC = dynamic_c...
by S.Volkenandt
Thu Dec 07, 2006 8:41 pm
Forum: C++ Development
Topic: wxArray size_t or int, which one is it?
Replies: 7
Views: 1149

Since I'm interested, too, this still doesn't work out for item no. 3000000 for example. A solution could be defining the not_found-id as (size_t)-1 (or more conformant std::numeric_limits<size_t>::max()-1), which is the largest possible size_t. This would only render one possible index useless, not...
by S.Volkenandt
Wed Dec 06, 2006 8:54 am
Forum: C++ Development
Topic: [wxString] problem when initializing
Replies: 4
Views: 1342

This will again only work if the character type is only one byte wide. In general, you're safest when you mark all literal strings with wxT(), since this works fine in both Unicode and ANSI modes. More precisely: A narrow character string in C++ is represented by the text within quotation marks. A w...