Search found 17 matches

by Martin Silenus
Sun Apr 18, 2021 4:15 pm
Forum: C++ Development
Topic: Is there automatic dynamic Unbinding upon windows deletion?
Replies: 2
Views: 523

Re: Is there automatic dynamic Unbinding upon windows deletion?

Yes, it does work, I get the behaviour I want. Except I wasn't sure whether I was collecting some "free floating bindings" somewhere that in the long run would add up, perhaps slowing down my app or create a memory leak. I didn't find anything in the documentation about that, if a wx-destr...
by Martin Silenus
Sun Apr 18, 2021 11:41 am
Forum: C++ Development
Topic: Is there automatic dynamic Unbinding upon windows deletion?
Replies: 2
Views: 523

Is there automatic dynamic Unbinding upon windows deletion?

In my application, I can create new modules during runtime. A module is an internal application data class, nothing to do with wxWidgets. Each time a new module is created, a wxToggleButton appears on a panel, added to a sizer on that panel. Because I don't know how many buttons will be present duri...
by Martin Silenus
Mon Dec 07, 2020 10:17 pm
Forum: C++ Development
Topic: Default hotkeys for wxTextCtrl
Replies: 1
Views: 199

Default hotkeys for wxTextCtrl

wxTextCtrl comes with built-in hotkeys, such as Ctrl+x, Ctrl+c and Ctrl+v for cut, copy and paste resp. There are others too, such as Ctrl+a for select all. I would like to implement additional hotkeys without interfering with the existing ones. Is there somewhere an exhaustive list of all the alrea...
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: 731

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: 731

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: 558

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: 1188

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 "unu...
by Martin Silenus
Sat Feb 08, 2020 11:26 am
Forum: C++ Development
Topic: Maximum and minimum values for wxDateTime
Replies: 5
Views: 797

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...
by Martin Silenus
Sat Feb 01, 2020 2:51 pm
Forum: C++ Development
Topic: Maximum and minimum values for wxDateTime
Replies: 5
Views: 797

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: 347

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: 1688

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: 1688

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(&q...
by Martin Silenus
Mon Nov 25, 2019 11:19 pm
Forum: C++ Development
Topic: Decaration of widgets inside functions
Replies: 12
Views: 1688

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 hea...
by Martin Silenus
Mon Nov 25, 2019 10:11 pm
Forum: C++ Development
Topic: Decaration of widgets inside functions
Replies: 12
Views: 1688

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...
by Martin Silenus
Sun Nov 24, 2019 12:21 pm
Forum: C++ Development
Topic: Decaration of widgets inside functions
Replies: 12
Views: 1688

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...