Search found 2362 matches

by PB
Thu May 14, 2020 10:42 am
Forum: C++ Development
Topic: Access deniedwhen trying to write wxString into file.
Replies: 2
Views: 75

Re: Access deniedwhen trying to write wxString into file.

You cannot write to a file you Open()ed in the default read mode, you probably want to use write_append or similar instead. See wxFile documentation for more information https://docs.wxwidgets.org/trunk/classwx_file.html You may also want to consider whether wxFile is the best class for writing text...
by PB
Thu May 14, 2020 5:28 am
Forum: C++ Development
Topic: Casting a Pointer to the Frame
Replies: 1
Views: 67

Re: Casting a Pointer to the Frame

You should use C++'s dynamic_cast to cast a pointer to the base class to the derived class. E.g., if you have a pointer to a wxWindow (such as returned from GetParent()) where you know it is an instance of TIA_DesignerFrame (which is also derived from wxWindow, with few other classes in between), yo...
by PB
Wed May 13, 2020 7:12 am
Forum: C++ Development
Topic: Can't make wxTextCtrl fit more than 10 digits.
Replies: 4
Views: 106

Re: Can't make wxTextCtrl fit more than 10 digits.

Trying to have boxes fit fourteen digit initializers. Only 12 digits fit. using sizers. ... The textCtrl's are intended for input and output og IPv4 ip addresses. I thought IPv4 has 12 (4 groups of 3) digits? Anyway, if you want to size the text control to fit around the IP address, did you try set...
by PB
Wed May 13, 2020 5:31 am
Forum: C++ Development
Topic: wxListCtrl virtual style
Replies: 1
Views: 48

Re: wxListCtrl virtual style

Hi In wxListCtrl virtual style, I uses wxLogError in OnGetItemText. and the application is crashed. Could you explain why this happens? You must be doing something wrong. Hard to say what as you did not post any code. It may be possible that the logging system gets overloaded if one calls wxLogErro...
by PB
Mon May 11, 2020 4:26 pm
Forum: General Development
Topic: map.find() not working
Replies: 12
Views: 612

Re: map.find() not working

If the code is not a throwaway, I think the correct way would be to abstract and encapsulate the courses data in a class. It takes more code but is IMO more maintainable, e.g. // stores courses as id and name of the course class Courses { public: bool Load(); bool IsLoaded() const; bool HasCourseWit...
by PB
Mon May 11, 2020 8:37 am
Forum: General Development
Topic: map.find() not working
Replies: 12
Views: 612

Re: map.find() not working

Yes... You are absolutely correct. However, my intention was to create a map of all the courses once (most suitably as a variable) and have my event handlers check that map whenever the credit load of a course had to evaluated.This is what I tried (in the constructor): using namespace std; std::map...
by PB
Mon May 11, 2020 7:12 am
Forum: General Development
Topic: map.find() not working
Replies: 12
Views: 612

Re: map.find() not working

alvindera97 wrote:
Mon May 11, 2020 6:49 am
The other options for declaring maps were too complex for my current understanding of C++.
I do not think it is that complex. ;)

Code: Select all

// declaration of a new type called Courses
typedef std::map<wxString, int> Courses;

// declaration of variable of type Courses
Courses myCourses;
by PB
Mon May 11, 2020 7:07 am
Forum: Compiler / Linking / IDE Related
Topic: Undefined reference to wxHtmlWindowMouseHelper
Replies: 11
Views: 191

Re: Undefined reference to wxHtmlWindowMouseHelper

here's my build log -------------- Build: Release in Acorn (compiler: GNU GCC Compiler)--------------- C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: C:\wxWidgets-3.1.3\lib\gcc_lib/libwxmsw31u_html.a(htmllib_htmlwin.o): bad reloc address 0x30c i...
by PB
Sun May 10, 2020 6:43 pm
Forum: Compiler / Linking / IDE Related
Topic: Undefined reference to wxHtmlWindowMouseHelper
Replies: 11
Views: 191

Re: Undefined reference to wxHtmlWindowMouseHelper

Sorry for the stupid question, but: Did you add (and in the correct order) the wxHTML library, i.e. libwxmsw31u_html.a for the Release and libwxmsw31ud_html.a for the Debug build configurations in Code::Blocks' Project Build Options in Linker Settings / Link Libraries?
by PB
Fri May 08, 2020 6:03 pm
Forum: Platform Related Issues
Topic: Question about Windows Font scaling
Replies: 6
Views: 243

Re: Question about Windows Font scaling

art-ganseforth wrote:
Fri May 08, 2020 5:17 pm
Probably i have a solution:
Setting DPI awareness is normally not done in code but in the application manifest.

wxWidgets now have, unfortunately not perfect, per monitor DPI awareness support.
by PB
Wed May 06, 2020 3:25 pm
Forum: C++ Development
Topic: Doubt, Confused with Hello World
Replies: 11
Views: 214

Re: Doubt, Confused with Hello World

That's a good attitude!

I do understand (and remember), that one wants to write the code doing things ASAP and not read something. However, having a good idea about what I am doing can save so much time, effort, and spare from frustration in the future.
by PB
Wed May 06, 2020 12:26 pm
Forum: C++ Development
Topic: How can i display numbers in wxWidgets?
Replies: 5
Views: 145

Re: How can i display numbers in wxWidgets?

I do not think that reusing button variable matters here.

But I do not see the timer event being Bind()ed anywhere, i.e., something like

Code: Select all

timer.Bind(wxEVT_TIMER, &cMain::OnUpdateDisplayedTime, this);
by PB
Wed May 06, 2020 9:23 am
Forum: C++ Development
Topic: Doubt, Confused with Hello World
Replies: 11
Views: 214

Re: Doubt, Confused with Hello World

I still think that doing that is a bad idea, regardless of the assumed source code size.

There is a good reason that people who know what they are doing do not write their programs like that.
by PB
Wed May 06, 2020 9:09 am
Forum: C++ Development
Topic: How can i display numbers in wxWidgets?
Replies: 5
Views: 145

Re: How can i display numbers in wxWidgets?

The simplest would probably be to use a wxStaticText, e.g.:. stopwatch.png #include <wx/wx.h> #include <wx/datetime.h> class MyDialog : public wxDialog { public: MyDialog() : wxDialog(nullptr, wxID_ANY, "Test") { wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); wxButton* button = nullptr; wxFont ...
by PB
Wed May 06, 2020 6:20 am
Forum: General Development
Topic: map.find() not working
Replies: 12
Views: 612

Re: map.find() not working

I wouldn't want my users to have to scroll through 20+ options to get to where they want to. BTW, I assume that you are aware that wxTextCtrl has AutoComplete() method which could assist users in typing their option? Of course, if the options are short and they differ only at their ends (ABCDE1, AB...