Search found 15841 matches

by doublemax
Thu Apr 22, 2021 11:55 am
Forum: C++ Development
Topic: Best way to draw non-antialiased image with alpha support?
Replies: 2
Views: 9

Re: Best way to draw non-antialiased image with alpha support?

Create a wxBitmap with explicit depth of 32.
Use wxPixelData to manipulate the wxBitmap data. https://docs.wxwidgets.org/trunk/classw ... _data.html
Use a "normal" wxDC and SetUserScale() to scale the bitmap while drawing.
by doublemax
Thu Apr 22, 2021 11:54 am
Forum: C++ Development
Topic: Copying folders to the clipboard
Replies: 1
Views: 9

Re: Copying folders to the clipboard

Are you saying that you tried wxFileDataObject and it does not work with folders?
by doublemax
Thu Apr 22, 2021 10:10 am
Forum: C++ Development
Topic: wxScrolledWindow do not scroll to focused wxTextCtrl
Replies: 1
Views: 18

Re: wxScrolledWindow do not scroll to focused wxTextCtrl

Code: Select all

txt->GetRect().GetX()
Shouldn't that be GetY() here?
by doublemax
Wed Apr 21, 2021 4:21 pm
Forum: General Development
Topic: Run wx projects on embedded board
Replies: 4
Views: 52

Re: Run wx projects on embedded board

OK, how about other embedded systems? If it runs Linux with GTK or X11, there is a good chance, wxWidgets will build on it. There is also wxDFB (FB for framebuffer) which displays a Gui by writing directly into the framebuffer of the graphics card (without running GTK, X11 or similar), but i don't ...
by doublemax
Wed Apr 21, 2021 1:11 pm
Forum: General Development
Topic: Run wx projects on embedded board
Replies: 4
Views: 52

Re: Run wx projects on embedded board

If you're talking about a Raspi with GUI (GTK or X11), it definitely works.
by doublemax
Tue Apr 20, 2021 4:50 pm
Forum: General Development
Topic: How to contribute to the wxwidgets C++ Project?
Replies: 4
Views: 70

Re: How to contribute to the wxwidgets C++ Project?

Unfortunately all these sites have their own user management, the accounts are not shared among them.
by doublemax
Tue Apr 20, 2021 4:11 pm
Forum: General Development
Topic: How to contribute to the wxwidgets C++ Project?
Replies: 4
Views: 70

Re: How to contribute to the wxwidgets C++ Project?

In general it's to good starting point to check the list of open bugs and try to fix one. http://trac.wxwidgets.org/ You can also check recent Google Summer of Code projects and project ideas: https://www.wxwidgets.org/gsoc/projects/ Some of them might already be implemented by now. Before you start...
by doublemax
Tue Apr 20, 2021 1:56 pm
Forum: C++ Development
Topic: size of elements
Replies: 5
Views: 119

Re: size of elements

El_isra wrote:
Tue Apr 20, 2021 12:33 pm
sizers only work for element layout?
Yes.
El_isra wrote:
Tue Apr 20, 2021 12:33 pm
some users reported some buttons and text become bigger.
No, sizers don't do that.
by doublemax
Mon Apr 19, 2021 8:03 pm
Forum: C++ Development
Topic: size of elements
Replies: 5
Views: 119

Re: size of elements

I think this is a good introduction to understand the basic concept behind sizers:
http://neume.sourceforge.net/sizerdemo/
by doublemax
Mon Apr 19, 2021 6:11 pm
Forum: C++ Development
Topic: How to efficiently create wxBitmap from std::vector<std::vector<wxColour>>
Replies: 2
Views: 63

Re: How to efficiently create wxBitmap from std::vector<std::vector<wxColour>>

Use wxPixelData to write directly into the bitmap, without the vectors: https://docs.wxwidgets.org/trunk/classwx_pixel_data.html As you're just writing into memory, it's safe from multiple threads. But you must destroy the wxPixelData instance before you use the bitmap for any other operation, like ...
by doublemax
Sun Apr 18, 2021 8:57 pm
Forum: Component Writing
Topic: Creating a custom LED indicator
Replies: 10
Views: 235

Re: Creating a custom LED indicator

Pass as "style" to the wxWindow ctor.

Code: Select all

Led::Led(wxWindow *parent, wxWindowID id, wxPoint Position, int Size, char color)
    : wxWindow(parent, id, Position, wxSize(Size,Size), wxTRANSPARENT_WINDOW )
And must not have the "dc.Clear();" in the paint event handler.
by doublemax
Sun Apr 18, 2021 8:28 am
Forum: C++ Development
Topic: wxEVT_CHAR works, wxEVT_KEY_UP does not
Replies: 7
Views: 136

Re: wxEVT_CHAR works, wxEVT_KEY_UP does not

mael15 wrote:
Sun Apr 18, 2021 7:57 am
I am wondering why a "simple and clean" EVT_KEY_UP is not triggered while EVT_CHAR is. Any idea?
Not really. Got any sample code i can play around with? I'm lazy on a sunday ;)
by doublemax
Sun Apr 18, 2021 8:15 am
Forum: Component Writing
Topic: Creating a custom LED indicator
Replies: 10
Views: 235

Re: Creating a custom LED indicator

Add the wxTRANSPARENT_WINDOW style flag.
Call SetBackgroundStyle(wxBG_STYLE_PAINT); in the ctor, so that its background does not get cleared.

Memory leak: You need to call "delete gc;" at the end of the paint event handler.
by doublemax
Sat Apr 17, 2021 4:58 pm
Forum: Component Writing
Topic: Creating a custom LED indicator
Replies: 10
Views: 235

Re: Creating a custom LED indicator

int x0=100,y0=100,x1=0,y1=0,x2=0,y2=0,D1=40,D2=60; I suspect these hard-coded coordinates to be responsible. Inside a paint event handler for a specific window, the coordinates are relative to the window position, i.e. they always start at (0,0) in the upper left corner. I guess you're drawing outs...
by doublemax
Fri Apr 16, 2021 5:15 pm
Forum: C++ Development
Topic: wxEVT_CHAR works, wxEVT_KEY_UP does not
Replies: 7
Views: 136

Re: wxEVT_CHAR works, wxEVT_KEY_UP does not

Is this all about avoiding to delete multiple items because of the key-repeat of the delete key?

Under Windows you can get this information from wxKeyEvent::GetRawKeyFlags(). If bit 30 is set, the event is the result of an auto-repeat.

Code: Select all

bool isRepeat = (keyevent.GetRawKeyFlags() & 0x40000000) != 0;