Search found 15 matches

by wonkey_monkey
Fri Aug 30, 2019 4:14 pm
Forum: C++ Development
Topic: Confusion over wxFocusEvent
Replies: 2
Views: 82

Re: Confusion over wxFocusEvent

Derp... I was calling event.Skip(), but I was also calling SetFocus() for some reason. Sorry! Now working as expected.
by wonkey_monkey
Thu Aug 29, 2019 10:28 pm
Forum: C++ Development
Topic: Confusion over wxFocusEvent
Replies: 2
Views: 82

Confusion over wxFocusEvent

I'm just looking into the events which can be handled when a window loses or gains focus. When my window gains focus, it receives an EVT_SET_FOCUS, and the value of event.GetWindow() is 0. When the window loses focus, it receives an EVT_KILL_FOCUS, and the value of event.GetWindow(). So far, so good...
by wonkey_monkey
Tue Aug 06, 2019 5:11 pm
Forum: C++ Development
Topic: How to have all RadioTools in a group deselected?
Replies: 2
Views: 110

Re: How to have all RadioTools in a group deselected?

I went with something else in the end. If I'm disabling all the tools, I toggle the first one on and set its active bitmap to be the disabled bitmap. Then when I re-enable, I reset the active bitmap. This makes all the tools look and act disabled. Seemed like less trouble than re-inventing radio too...
by wonkey_monkey
Sat Aug 03, 2019 8:05 pm
Forum: C++ Development
Topic: How to have all RadioTools in a group deselected?
Replies: 2
Views: 110

How to have all RadioTools in a group deselected?

I've got a Toolbar with a group of RadioTools. When the program first opens, I want them all to be disabled, but the first one always uses the non-disabled bitmap, because (it seems) one of the RadioTools in the group must be selected at all times, even if they are all disabled. Is there a way to ad...
by wonkey_monkey
Mon Jul 08, 2019 8:43 pm
Forum: C++ Development
Topic: Multi-column menu using menu.Break()? (MSW)
Replies: 1
Views: 74

Multi-column menu using menu.Break()? (MSW)

According to the docs: virtual void Break () Inserts a break in a menu, causing the next appended item to appear in a new column. but when I try this as follows: wxMenu menu(wxEmptyString); menu.Append(0, "Zoom"); menu.AppendSeparator(); menu.Append(1, "1/4×"); menu.Append(2, "1/2×"); menu.Append(3,...
by wonkey_monkey
Sat Jun 01, 2019 8:43 pm
Forum: C++ Development
Topic: Is it possible to reject drag/dropped files based on filetype?
Replies: 4
Views: 112

Re: Is it possible to reject drag/dropped files based on filetype?

Ah okay, so it sounds like something that isn't implemented and so can't be done purely in wxWidgets. I'll look into doing it natively.

Out of interest, was I going about the multiple inheritance thing the right way? I'm still not sure why OnDropFiles() and OnEnter() weren't being called.
by wonkey_monkey
Sat Jun 01, 2019 7:37 pm
Forum: C++ Development
Topic: Is it possible to reject drag/dropped files based on filetype?
Replies: 4
Views: 112

Is it possible to reject drag/dropped files based on filetype?

Years ago I remember finding out how to reject (by changing the cursor to a denial cursor) a drag/dropped file based on its filetype in a basic WINAPI program. Is it possible to do something similar in wxWidgets? I have a class derived from wxWindow. I can DragAcceptFiles() easily enough, but it doe...
by wonkey_monkey
Tue May 28, 2019 10:47 pm
Forum: Compiler / Linking / IDE Related
Topic: Can't use a PNG from Resources file (VS2017)
Replies: 7
Views: 281

Re: Can't use a PNG from Resources file (VS2017)

I'm definitely not clear on what causes the issue! Somewhere, I'm guessing, the name is being unexpectedly converted to the ordinal because of the macro #defined in resource.h - remove or rename the macro and the issue disappears. But it's all macros within macros within macros so who knows what's g...
by wonkey_monkey
Tue May 28, 2019 9:48 pm
Forum: C++ Development
Topic: I just can't understand sizers - trying to make panel fill horizontal space
Replies: 5
Views: 140

Re: I just can't understand sizers - trying to make panel fill horizontal space

Yes I did, thanks. I think I just hadn't made the conceptual connection that sizers could/should wxEXPAND as well.

I'm finding wxFormBuilder useful for generating C++ code which I can then pore over and understand, rather than just letting it do the work for me.
by wonkey_monkey
Tue May 28, 2019 9:01 pm
Forum: C++ Development
Topic: I just can't understand sizers - trying to make panel fill horizontal space
Replies: 5
Views: 140

Re: I just can't understand sizers - trying to make panel fill horizontal space

Ah, I just figured that out one minute after you posted, I swear! Not that I exactly get how it works, but it works.

I'll look into wxFormBuilder, too, although this is going to be a pretty simple program and I had enough problems just trying to use a PNG resource...

Thanks!
by wonkey_monkey
Tue May 28, 2019 7:55 pm
Forum: C++ Development
Topic: I just can't understand sizers - trying to make panel fill horizontal space
Replies: 5
Views: 140

I just can't understand sizers - trying to make panel fill horizontal space

I'm normally pretty good at being able to find answers via Google, but when it comes to understanding sizers I'm hitting a brick wall. I've read every tutorial and guide on sizers that I can find but I'm either overlooking something or there's something missing from them. What I've got so far is thi...
by wonkey_monkey
Mon May 27, 2019 5:03 pm
Forum: Compiler / Linking / IDE Related
Topic: Can't use a PNG from Resources file (VS2017)
Replies: 7
Views: 281

Re: Can't use a PNG from Resources file (VS2017)

I've gone with this as a Visual Studio compatible alternative: hResource = FindResource(nullptr, MAKEINTRESOURCE(IDB_PNG1), L"PNG"); size_t _size = SizeofResource(nullptr, hResource); hMemory = LoadResource(nullptr, hResource); LPVOID ptr = LockResource(hMemory); wxBitmap my_bitmap = wxBitmap::NewFr...
by wonkey_monkey
Sun May 26, 2019 11:16 pm
Forum: Compiler / Linking / IDE Related
Topic: Can't use a PNG from Resources file (VS2017)
Replies: 7
Views: 281

Re: Can't use a PNG from Resources file (VS2017)

Hmm, okay, that works (I thought just removing #include "resource.h" would work, but it seems those definitions are getting included regardless), and I think I sort of see why... ...but doesn't that now have to potential to screw up any other resources I try to create? And what if I want to be able ...
by wonkey_monkey
Sun May 26, 2019 8:26 pm
Forum: Compiler / Linking / IDE Related
Topic: Can't use a PNG from Resources file (VS2017)
Replies: 7
Views: 281

Can't use a PNG from Resources file (VS2017)

Hi, I've done a lot of Googling and seen a few people having this same problem, but I've been unable to find a solution that works. The problem is that I can't use a PNG file from my resource.rc file. I followed the instructions here: https://wiki.wxwidgets.org/Embedding_PNG_Images#Embedding_data_in...