Search found 392 matches

by New Pagodi
Wed Jun 23, 2021 8:10 am
Forum: C++ Development
Topic: How to capture wxSizeEvent caused by double-clicking on window titlebar?
Replies: 6
Views: 1053

Re: How to capture wxSizeEvent caused by double-clicking on window titlebar?

wxMaximizeEvent can only capture the maximize message, it can't capture the size changing by double-clicking on window titlebar. I just wrote a simple test (on windows), and I get the event in all of these cases 1) clicking the maximize button 2) double clicking the titlebar 3) selecting "maximize"...
by New Pagodi
Mon Jun 07, 2021 7:44 pm
Forum: C++ Development
Topic: How to TAB traversal on custom wxWindow controls
Replies: 6
Views: 1022

Re: How to TAB traversal on custom wxWindow controls

Create a borderless text control and put in in another window and draw a rounded border on that second window.
by New Pagodi
Tue Jun 01, 2021 12:35 am
Forum: Compiler / Linking / IDE Related
Topic: Undefined Reference to GetThemeBackgroundContentRect
Replies: 1
Views: 1266

Re: Undefined Reference to GetThemeBackgroundContentRect

You need to add uxtheme.lib to the link libraries. I thought codeblocks added this to the wizard, but maybe that hasn't been done yet. Usually with errors like this you can google the function name to find the missing library. In this case, googling will bring up this page and at the bottom you can ...
by New Pagodi
Sun May 30, 2021 7:51 pm
Forum: Platform Related Issues
Topic: Support to Dark Mode on Windows 10.
Replies: 12
Views: 4065

Re: Support to Dark Mode on Windows 10.

On windows, you can override OnMeasureItem and OnDrawItem for menus to draw them as you want if you want to draw them with a dark theme. I didn't know that, thank you for the tip! Although I suspect that, to keep the codebase more consistent, using the wxFlatMenu might be a better option (but may l...
by New Pagodi
Wed May 26, 2021 2:50 pm
Forum: Platform Related Issues
Topic: Support to Dark Mode on Windows 10.
Replies: 12
Views: 4065

Re: Support to Dark Mode on Windows 10.

Oh, by the way, I plan to switch to using eranif's wxFlatMenu in the future. Maybe his Notebook implementation as well (although that doesn't support wxAui, so I may just have to create a new wxAuiTabArt class for when I need the wxAui interface). On windows, you can override OnMeasureItem and OnDr...
by New Pagodi
Mon May 17, 2021 6:55 pm
Forum: Compiler / Linking / IDE Related
Topic: Cant compile 3.1.5 with webview2
Replies: 6
Views: 2185

Re: Cant compile 3.1.5 with webview2

I think the new webview backend only builds with visual c.
by New Pagodi
Mon May 17, 2021 3:11 am
Forum: C++ Development
Topic: wxThread and wxQueueEvent
Replies: 11
Views: 1523

Re: wxThread and wxQueueEvent

I guess that's OK. Personally, I would use a semaphore or a condition variable to signal to the thread that it should end instead of calling Destroy. But that's mostly a matter of preference. I think calling Destroy and checking for it with TestDestroy should be reserved for exceptional circumstance...
by New Pagodi
Thu May 13, 2021 10:47 pm
Forum: C++ Development
Topic: wxThread and wxQueueEvent
Replies: 11
Views: 1523

Re: wxThread and wxQueueEvent

I don't think the EVT_THREAD macro works with custom thread events. I think the event table macro needs to be something like this: wx__DECLARE_EVT1(wxEVT_COMMAND_MYTHREAD_COMPLETED, wxID_ANY, wxThreadEventHandler(myFrame::OnThreadCompletion)) But I would recommend using Bind instead of event tables.
by New Pagodi
Thu May 13, 2021 1:08 pm
Forum: Compiler / Linking / IDE Related
Topic: need help!!! can not use some basic socket code!!
Replies: 4
Views: 2771

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

As PB said, until very recently, wxWidgets used winsock1 by default to ensure applications would work even with really old systems. It's a well known issue that if you try to use include both winsocke2.h (as you are with you're application) and winsock.h (which wxWidgets will) you need to include wi...
by New Pagodi
Sun Apr 18, 2021 6:13 am
Forum: Component Writing
Topic: Creating a custom LED indicator
Replies: 10
Views: 5919

Re: Creating a custom LED indicator

I could draw the Led, but i get those white areas... is there any way to make the component background transparent? I think calling Clear for the paint dc should fill the background in appropriately. Like so: void Led::OnPaint(wxPaintEvent& event) { wxPaintDC dc(this); dc.Clear(); ....
by New Pagodi
Fri Mar 19, 2021 8:36 pm
Forum: Platform Related Issues
Topic: MSWMessageHandler example
Replies: 6
Views: 3081

Re: MSWMessageHandler example

If you want to handle messages on windows, you should derive a class from whatever wwWidgets object you are using and override MSWOnNotify or MSWHandleMessage.
by New Pagodi
Thu Feb 25, 2021 6:33 am
Forum: C++ Development
Topic: How do I save drawings in a wxDC temporarily?
Replies: 3
Views: 304

Re: How do I save drawings in a wxDC temporarily?

I gave an example of a small drawing program in the code dump forum.
by New Pagodi
Wed Feb 24, 2021 10:54 am
Forum: C++ Development
Topic: How to implement zoom in/out of a map on wxWidgets
Replies: 1
Views: 277

Re: How to implement zoom in/out of a map on wxWidgets

I posted an example of how to do this here.
by New Pagodi
Sun Feb 14, 2021 3:59 am
Forum: C++ Development
Topic: How to delete items from wxTreeCtrl?
Replies: 15
Views: 899

Re: How to delete items from wxTreeCtrl?

This code that you provided, will it work with wxDataViewTreeCtrl as well? Of course need to change few things, but overall? Also I'm wondering if there is a way to store the containers and child of treectrl and keep track of them, to restore them back to application, when user closes and re opens ...