Search found 14 matches

by Martin Silenus
Sun Apr 05, 2020 2:03 pm
Forum: C++ Development
Topic: String formatting in hex incorrect for characters between 0x80 and 0xA0
Replies: 2
Views: 85

Re: String formatting in hex incorrect for characters between 0x80 and 0xA0

Yes, it was only until I started writing my own conversion function that I started noticing the sensitivity to the format of the char. By default, a 'char' is a 'signed char' and thus has only 7 bits of data plus a sign bit. This screws up the conversion of course (although I'm not sure why 0xA0 and...
by Martin Silenus
Sun Apr 05, 2020 12:11 pm
Forum: C++ Development
Topic: String formatting in hex incorrect for characters between 0x80 and 0xA0
Replies: 2
Views: 85

String formatting in hex incorrect for characters between 0x80 and 0xA0

I have this curious problem when trying to display something in hex code. First I make a string with 256 characters, in which each character has another number (it's just a loop of increasing numbers) wxString NumTestString; char TempChar = 0x00; for (int Counter = 0; Counter < 256; Counter++) { Num...
by Martin Silenus
Sat Feb 22, 2020 3:01 pm
Forum: C++ Development
Topic: One object in two classes
Replies: 2
Views: 145

Re: One object in two classes

That could work but you can only access a member of an actual object, not of the class. So somewhere in your code, you'll probably create an instance of MyFrame, let's call it MyFrameObject, e.g. : // in a header file called MyApp.h for the sake of this explanation MyFrame *MyFrameObject; // then in...
by Martin Silenus
Sun Feb 09, 2020 12:16 pm
Forum: C++ Development
Topic: wxTimePickerCtrl Format
Replies: 6
Views: 249

Re: wxTimePickerCtrl Format

I have been struggling with wxDatePickerCtrl and wxTimePickerCtrl a bit myself too. Both have a data exchange format using wxDateTime, however - in case of wxDatePickerCtrl, the time part is "ignored" - in case of wxTimePickerCtrl, the date part is "ignored" however the "unused" parts are still ther...
by Martin Silenus
Sat Feb 08, 2020 11:26 am
Forum: C++ Development
Topic: Maximum and minimum values for wxDateTime
Replies: 5
Views: 180

Re: Maximum and minimum values for wxDateTime

Thanks guys, but it seems there's no answer to my original question "is there a pre-defined constant for the minimum and maximum allowed wxDateTime" Therefore I defined some myself, in accordance with the minimum and maximum expected in my application. #define IMR_MAX_DATETIME wxDateTime(1, wxDateTi...
by Martin Silenus
Sat Feb 01, 2020 2:51 pm
Forum: C++ Development
Topic: Maximum and minimum values for wxDateTime
Replies: 5
Views: 180

Maximum and minimum values for wxDateTime

If I want to determine the minimum and maximum of a collection of numbers, typically I do something like the following : int Min = INT_MAX; // INT_MAX is defined in limits.h as 2147483647 int Max = INT_MIN; // INT_MIN is defined in limits.h as (-INT_MAX-1) //in a loop, fetching NewNumber each time ....
by Martin Silenus
Thu Dec 12, 2019 10:35 pm
Forum: C++ Development
Topic: wxTextCtrl not catching menu events when in richtext mode
Replies: 1
Views: 90

wxTextCtrl not catching menu events when in richtext mode

Here's an observation I didn't find anywhere on the net, and which took me quite some time and frustration to find out. In my application, I want to log data from a serial port. wxTextCtrl looked like a good idea to me because the logging happens in textual format anyway, I can use it also for other...
by Martin Silenus
Tue Nov 26, 2019 10:04 pm
Forum: C++ Development
Topic: Decaration of widgets inside functions
Replies: 12
Views: 490

Re: Decaration of widgets inside functions

Ah, I see, that was the missing piece of the puzzle, all clear now.
Thanks for the clarifications.
by Martin Silenus
Tue Nov 26, 2019 5:08 pm
Forum: C++ Development
Topic: Decaration of widgets inside functions
Replies: 12
Views: 490

Re: Decaration of widgets inside functions

I am familiar with parenting and using the this-parameter in this context, although I have to admit I didn't consider it yet in this discussion. Refering again to the first example (BlankwxSmithFrame), that can indeed explain the status bar. StatusBar1 = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("I...
by Martin Silenus
Mon Nov 25, 2019 11:19 pm
Forum: C++ Development
Topic: Decaration of widgets inside functions
Replies: 12
Views: 490

Re: Decaration of widgets inside functions

But in wxWidgets it often happens that another object takes ownership of that pointer and the memory will be deleted internally. Aha, that's what I started to suspect indeed, there's some underlying code/mechanism copying pointers or as you say "taking ownership". Ok, I won't break my head over the...
by Martin Silenus
Mon Nov 25, 2019 10:11 pm
Forum: C++ Development
Topic: Decaration of widgets inside functions
Replies: 12
Views: 490

Re: Decaration of widgets inside functions

Ah yes, but my problem is this (refering to the first example with "wxSmith" now) : The pointer, e.g. wxMenu* Menu1 is declared only in the constructor, which as far as I know behaves as any other function. Next, some memory is allocated with the new-operator. This will indeed allocate the necessary...
by Martin Silenus
Sun Nov 24, 2019 12:21 pm
Forum: C++ Development
Topic: Decaration of widgets inside functions
Replies: 12
Views: 490

Re: Decaration of widgets inside functions

Ah yes, good spot, it's the opposite of course, new-operations are on the heap indeed. Here's two different examples of (an extract of) auto-generated code by the Code::Blocks wizard of a blank project (just used the wizard, no other code added by me) First one is when choosing the option to use wxS...
by Martin Silenus
Sat Nov 23, 2019 4:17 pm
Forum: C++ Development
Topic: Decaration of widgets inside functions
Replies: 12
Views: 490

Decaration of widgets inside functions

I'm new to wxWidgets, trying to learn as much as possible from manuals, books and internet forums, however I do have an observation I couldn't find an explanation for yet. Working with wxWidgets 3.0.4 in Code::Blocks 16.01 under MSW, using the wxSmith GUI designer. Playing around with various widget...
by Martin Silenus
Sat Nov 09, 2019 12:06 pm
Forum: C++ Development
Topic: wxThread exit vs destructor
Replies: 1
Views: 187

wxThread exit vs destructor

Quick question on wxThreads :

It is said that detached threads destroy themselves upon completion. Threads also have a destructor. So does it make a difference if I put my clean-up code at the end of the Entry() function or in the destructor?