Search found 22 matches
- Sat Sep 30, 2023 9:54 pm
- Forum: Compiler / Linking / IDE Related
- Topic: Getting macro redefinitions when adding "#include "MyApp.h"" to a new .cpp file (Visual Studio)
- Replies: 3
- Views: 2689
Re: Getting macro redefinitions when adding "#include "MyApp.h"" to a new .cpp file (Visual Studio)
If that doesn't work, try including them exclusively before or after wx headers. I think that may have fixed it, thanks! I just need to make it conditional as there are two projects in this solution, one of which doesn't use wxWidgets. dib_section.h already had #include <wx/wx.h> in it, but it was ...
- Sat Sep 30, 2023 9:47 pm
- Forum: Compiler / Linking / IDE Related
- Topic: Getting macro redefinitions when adding "#include "MyApp.h"" to a new .cpp file (Visual Studio)
- Replies: 3
- Views: 2689
Re: Getting macro redefinitions when adding "#include "MyApp.h"" to a new .cpp file (Visual Studio)
If I omit windows.h, I get a bunch of errors from gdiplus.h, mostly missing type specifiers and undeclared identifers: 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\GdiplusEnums.h(33,31): error C4430: missing type ... 2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\u...
- Sat Sep 30, 2023 6:48 pm
- Forum: Compiler / Linking / IDE Related
- Topic: Getting macro redefinitions when adding "#include "MyApp.h"" to a new .cpp file (Visual Studio)
- Replies: 3
- Views: 2689
Getting macro redefinitions when adding "#include "MyApp.h"" to a new .cpp file (Visual Studio)
I'm writing what is, for me, a rather sprawling program with about 30 .h and 30 .cpp files. A lot of the .cpp files include the app's header file (MyApp.h) so that they can, for various reasons, use wxGetApp(). I've decided to abstract away some of the logic in one of my window classes by creating a...
- Sun Sep 10, 2023 12:48 pm
- Forum: C++ Development
- Topic: Looking for help to understand this Refresh/Update issue with wxIdleEvent on Windows
- Replies: 0
- Views: 86715
Looking for help to understand this Refresh/Update issue with wxIdleEvent on Windows
Hi, I've got an issue with some code that performs very basic animation with wxIdleEvent. It's possible that it isn't anything to do with wxWidgets, but I figured someone here was likely to have some insight. The program uses a continuous loop of wxIdleEvents. Each time through the loop it calls DWM...
- Tue Jan 25, 2022 11:11 pm
- Forum: C++ Development
- Topic: How can I paint to existing RGB32 data with a wxMemoryDC
- Replies: 7
- Views: 1708
Re: How can I paint to existing RGB32 data with a wxMemoryDC
I feel like we're talking at cross-purposes here. Your link seems to show data being copied from a blob to a bitmap. That doesn't suit my needs. Is there some combination of wxImage, wxBitmap, and/or wxMemoryDC that will allow me to draw directly to my pre-existing malloc'd block of data using wxDC ...
- Tue Jan 25, 2022 10:21 pm
- Forum: C++ Development
- Topic: How can I paint to existing RGB32 data with a wxMemoryDC
- Replies: 7
- Views: 1708
Re: How can I paint to existing RGB32 data with a wxMemoryDC
Sorry, I find your reply a bit confusing, so maybe I was not clear. Suppose I've done this: void* pixel_data = malloc(640*480*4); // block of memory for 640x480 RGBA data I can modify those pixels easily enough myself directly, but at some point I want to use (for example) wxDC's DrawText on it. Wha...
- Tue Jan 25, 2022 7:55 pm
- Forum: C++ Development
- Topic: How can I paint to existing RGB32 data with a wxMemoryDC
- Replies: 7
- Views: 1708
How can I paint to existing RGB32 data with a wxMemoryDC
I have an array of raw RGB32 (RBGA) data that I would like to paint to. I've googled and tried various combinations of wxImage, wxBitmap, and wxMemoryDC but so far nothing seems to work. I can create a wxImage pointing to the bytes, but if I use SetRGB it's clear that it's treating it as 24-bit RGB,...
- Fri Aug 30, 2019 4:14 pm
- Forum: C++ Development
- Topic: Confusion over wxFocusEvent
- Replies: 2
- Views: 1042
Re: Confusion over wxFocusEvent
Derp... I was calling event.Skip(), but I was also calling SetFocus() for some reason. Sorry! Now working as expected.
- Thu Aug 29, 2019 10:28 pm
- Forum: C++ Development
- Topic: Confusion over wxFocusEvent
- Replies: 2
- Views: 1042
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...
- Tue Aug 06, 2019 5:11 pm
- Forum: C++ Development
- Topic: How to have all RadioTools in a group deselected?
- Replies: 2
- Views: 1170
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...
- Sat Aug 03, 2019 8:05 pm
- Forum: C++ Development
- Topic: How to have all RadioTools in a group deselected?
- Replies: 2
- Views: 1170
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...
- Mon Jul 08, 2019 8:43 pm
- Forum: C++ Development
- Topic: Multi-column menu using menu.Break()? (MSW)
- Replies: 1
- Views: 739
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, &qu...
- Sat Jun 01, 2019 11:05 pm
- Forum: C++ Development
- Topic: Is it possible to reject drag/dropped files based on filetype?
- Replies: 4
- Views: 1514
Re: Is it possible to reject drag/dropped files based on filetype?
Yes, that was it, thanks.
- 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: 1514
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.
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.
- 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: 1514
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...