Search found 15922 matches

by doublemax
Tue May 18, 2021 9:40 am
Forum: C++ Development
Topic: wxFrame starts with extremely small size.
Replies: 4
Views: 56

Re: wxFrame starts with extremely small size.

Do you have a SetSizerAndFit() call or something similar later in the code?
by doublemax
Mon May 17, 2021 5:33 am
Forum: C++ Development
Topic: wxThread and wxQueueEvent
Replies: 11
Views: 311

Re: wxThread and wxQueueEvent

The assert just comes from a bad printf, in your case, this line:

Code: Select all

wxLogMessage("%%%%% MYFRAME: deleting thread %%%%%");
Apart from that, i'm not sure if executing the code in the dtor of the frame is not too late. Try moving it to a close event handler like in the sample.
by doublemax
Sun May 16, 2021 10:55 pm
Forum: C++ Development
Topic: Clearing prop grid help string
Replies: 2
Views: 91

Re: Clearing prop grid help string

I've never used wxPropGrid, but looking through the methods, how about wxPropertyGridManager::SetDescription()?
https://docs.wxwidgets.org/trunk/classw ... f90e5b673c
by doublemax
Sat May 15, 2021 9:00 pm
Forum: C++ Development
Topic: Sockets FAQ/Tutorial
Replies: 31
Views: 61004

Re: Sockets FAQ/Tutorial

This post is pinned, but appears to be from over 15 years ago. Is the information still relevant? Honestly, i don't know. I'd use the "sockets" sample that comes with wxWidgets as reference. I'm confused by events in wxwigets. There are event tables, functions like Connect and also Bind. I understa...
by doublemax
Fri May 14, 2021 11:30 pm
Forum: C++ Development
Topic: wxThread and wxQueueEvent
Replies: 11
Views: 311

Re: wxThread and wxQueueEvent

dualband wrote:
Fri May 14, 2021 11:21 pm
Do I need to register a new ID to access trac.wxwidgets.org?
Yes, that site is completely separate from this one.
by doublemax
Fri May 14, 2021 7:44 pm
Forum: C++ Development
Topic: Tooltips for wxListCtrl column headers
Replies: 9
Views: 169

Re: Tooltips for wxListCtrl column headers

Depending on what you need to display, and how important the column tooltips are for you, wxGrid might be another option. It can be configured to use a non-native header, so i'm pretty sure you can receive EVT_MOTION events from it.
by doublemax
Fri May 14, 2021 2:16 pm
Forum: Compiler / Linking / IDE Related
Topic: Main font in chm help is too small on 4K monitor 200% scaled
Replies: 9
Views: 217

Re: Main font in chm help is too small on 4K monitor 200% scaled

The main issue seems to be that the font sizes are given in pixels (px). In order to be resolution independent they should be defined in point (pt) (1 pt = 1/72th inch)
by doublemax
Thu May 13, 2021 11:38 pm
Forum: C++ Development
Topic: wxThread and wxQueueEvent
Replies: 11
Views: 311

Re: wxThread and wxQueueEvent

Unfortunately the sample code in the documentation is bad, it doesn't even compile with the latest wxWidgets version. Like New Pagodi said: Remove the entries in the static event table, instead add these two lines at the end of the myFrame ctor: Bind(wxEVT_COMMAND_MYTHREAD_UPDATE, &myFrame::OnThread...
by doublemax
Thu May 13, 2021 5:36 pm
Forum: C++ Development
Topic: Proper way to queue a wxMenuEvent for next idle cycle?
Replies: 2
Views: 100

Re: Proper way to queue a wxMenuEvent for next idle cycle?

wxMenuEvent *ev = new wxMenuEvent (wxID_ANY, wxID_NEW); QueueEvent (ev); That go that route, that hackish and horrible. Try using CallAfter(): (in the ctor of your mainframe, assuming you have a method to create a new document) CallAfter( [this] { // this will be executed at the end of the next eve...
by doublemax
Thu May 13, 2021 5:26 pm
Forum: C++ Development
Topic: wxSocketClient silently stops receiving messages
Replies: 5
Views: 85

Re: wxSocketClient silently stops receiving messages

What happens inside "OnMessage(message);" ? Can it take longer than 30ms to process the data? IOW, is it possible that the event queue gets saturated when new events come in every 30ms? Apart from that, i'm out of ideas. I'd probably try to move the code to a secondary thread and use sockets in bloc...
by doublemax
Thu May 13, 2021 4:51 pm
Forum: C++ Development
Topic: wxSocketClient silently stops receiving messages
Replies: 5
Views: 85

Re: wxSocketClient silently stops receiving messages

sockBase->SetNotify(wxSOCKET_LOST_FLAG); sockBase->SetFlags(wxSOCKET_WAITALL); [...] //Enable input events again. sockBase->SetNotify(wxSOCKET_LOST_FLAG | wxSOCKET_INPUT_FLAG); I've never worked with sockets, so i don't know if this is a common thing when handling socket events, but this look suspi...
by doublemax
Thu May 13, 2021 2:50 pm
Forum: Platform Related Issues
Topic: Memory leak - macOSX - leaks command line tool
Replies: 10
Views: 275

Re: Memory leak - macOSX - leaks command line tool

Please try to create the dialog on the stack (that's what you're supposed to do, although what you did should work, too), and check if it makes any difference. If you still get a leak, please run and build the unmodified "dialogs" sample (or any sample that uses a wxFileDialog) and check if it leaks...
by doublemax
Thu May 13, 2021 2:39 pm
Forum: C++ Development
Topic: How to get the initial size of a wxTextCtrl later after its creation?
Replies: 13
Views: 280

Re: How to get the initial size of a wxTextCtrl later after its creation?

The code you posted works fine for me. However, if you work with dynamic fontsizes, instead of using hard-coded sizes, why don't you leave it to the control? How about this: void MyFrame::OnToggleBigSize(wxCommandEvent&) { wxFont font = m_txtCtrl->GetFont(); if( m_bigSizeCheck->GetValue() ) font.Set...
by doublemax
Thu May 13, 2021 11:31 am
Forum: Compiler / Linking / IDE Related
Topic: need help!!! can not use some basic socket code!!
Replies: 4
Views: 163

Re: need help!!! can not use some basic socket code!!

czczzzz wrote:
Thu May 13, 2021 10:48 am
But I can not include winsock2.h! it will give me a lot of error.
I assume you mean compiler errors? If yes, which ones?

Try including <wx/msw/wrapwin.h> either instead of winsock2.h or before it.

Also experiment with include order, e.g. first all wx classes, then others. Or vice versa.
by doublemax
Thu May 13, 2021 7:38 am
Forum: C++ Development
Topic: Assigning keyboard shortcuts to controls.
Replies: 34
Views: 1530

Re: Assigning keyboard shortcuts to controls.

I can't make any promises, this is still very hackish after all, but i think it should work.