Search found 15833 matches

by doublemax
Mon Apr 19, 2021 8:03 pm
Forum: C++ Development
Topic: size of elements
Replies: 1
Views: 27

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: 42

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: 194

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: 134

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: 194

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: 194

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: 134

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;
by doublemax
Thu Apr 15, 2021 9:38 pm
Forum: Compiler / Linking / IDE Related
Topic: Some samples won't compile
Replies: 3
Views: 77

Re: Some samples won't compile

How exactly did you try to build the samples? They all should build fine from the command line using the provided make files.

If you try to build them in CodeLite, you'll probably have to add the missing libraries to the linker options yourself.
by doublemax
Thu Apr 15, 2021 4:19 pm
Forum: Platform Related Issues
Topic: GTK3 / wxStaticText size
Replies: 21
Views: 958

Re: GTK3 / wxStaticText size

I usually don't work under Linux, but i have a faint memory that window creation under GTK is somehow delayed compared to window creation under Windows. I assume the Layout is calculated before the wxStaticText is aware of its new font size. I thought there was an open ticket about this on http://tr...
by doublemax
Thu Apr 15, 2021 2:57 pm
Forum: Platform Related Issues
Topic: GTK3 / wxStaticText size
Replies: 21
Views: 958

Re: GTK3 / wxStaticText size

The code is a little bit verbose because it comes from wxFormBuilder...
It's horrible indeed. Please remove *all* Fit() and Layout() calls. What happens on the "broken" page when you resize the frame manually?
by doublemax
Thu Apr 15, 2021 2:53 pm
Forum: Platform Related Issues
Topic: Getting windows mousepointer icon = black square
Replies: 25
Views: 402

Re: Getting windows mousepointer icon = black square

Off-topic:
i'm still waiting for a reply about the questions i wrote here about the wxStopWatch class members.
I think Vadim gave you a pretty clear answer. And in case you don't know him, he's the main wxWidgets maintainer. His word has weight.
by doublemax
Thu Apr 15, 2021 2:50 pm
Forum: Platform Related Issues
Topic: GTK3 / wxStaticText size
Replies: 21
Views: 958

Re: GTK3 / wxStaticText size

How is that a "small" test case? Small maybe, but not minimal. Is the wxSimpleBook relevant for the problem? Probably not. What about the buttons? I would suspect that a single wxPanel with 3 wxStaticTexts should be sufficient to show the issue.
by doublemax
Thu Apr 15, 2021 10:24 am
Forum: C++ Development
Topic: central alignement within panel
Replies: 2
Views: 53

Re: central alignement within panel

I don't quite understand the question. Can you show a screenshot?
by doublemax
Wed Apr 14, 2021 11:57 pm
Forum: C++ Development
Topic: Is there a way to make the radio button as button style?
Replies: 1
Views: 63

Re: Is there a way to make the radio button as button style?

You can't change the style of the radio buttons. However, they should look exactly like any other native radio button under Windows. If you get an interface that looks like Windows 95, then your executable is missing the manifest file.