Search found 47 matches

by vanarieleyen
Mon Dec 16, 2019 3:07 am
Forum: C++ Development
Topic: wxImage and grayscale BMP files
Replies: 9
Views: 425

Re: wxImage and grayscale BMP files

I use the folowing code to load the bmp file: image.LoadFile(filePath, wxBITMAP_TYPE_BMP); This works fine, when the bmp file is 24 bit (3x8 bit channels) I can read the rgb values, but when the bmp file is in grayscale format it fails. I use the following to retrieve the pixel values: image.GetRed(...
by vanarieleyen
Sun Dec 15, 2019 11:27 pm
Forum: C++ Development
Topic: wxImage and grayscale BMP files
Replies: 9
Views: 425

wxImage and grayscale BMP files

I have a problem with BMP files that are in grayscale format. Where are the pixels in grayscale stored? When I try to access them using for instance getRed() I don't receive the expected result. When however the BMP file is in 24 bit RGB format and the content is grayscale (each channel has the same...
by vanarieleyen
Fri Nov 01, 2019 8:58 am
Forum: C++ Development
Topic: is semi transparency possible?
Replies: 2
Views: 328

Re: is semi transparency possible?

Ok, I will try that.
Thank you doublemax :D
by vanarieleyen
Fri Nov 01, 2019 8:33 am
Forum: C++ Development
Topic: is semi transparency possible?
Replies: 2
Views: 328

is semi transparency possible?

I am looking for a way to create semi transparent layers. To explain is simple: Suppose I have one widget that has a yellow color and a second widget with a blue color, and position these in a way that they overlap (like 2 colored glass plates) The result should be a green color. I know I can do thi...
by vanarieleyen
Fri Nov 01, 2019 8:25 am
Forum: C++ Development
Topic: wxBoxSizer not refreshing
Replies: 13
Views: 729

Re: wxBoxSizer not refreshing

Excuse me for my late response (I had a computer problem and needed to reinstall my OS) The wxBoxSizer is used on a wxFrame. There are bitmap-buttons placed using this sizer and these appear correctly in the frame. On a certain moment these buttons are removed from the sizer using boxsizer->Clear(fa...
by vanarieleyen
Wed Oct 30, 2019 3:04 am
Forum: C++ Development
Topic: wxBoxSizer not refreshing
Replies: 13
Views: 729

Re: wxBoxSizer not refreshing

Yes, you're right - I misunderstood this. But that leads me to another question. I have placed the sizers directly on the wxFrame without a panel. The sizer is only responsible for the positioning of the widgets, so the widgets are placed directly on the wxFrame. How can I clean the contents of the ...
by vanarieleyen
Tue Oct 29, 2019 9:11 am
Forum: C++ Development
Topic: wxBoxSizer not refreshing
Replies: 13
Views: 729

Re: wxBoxSizer not refreshing

I now hide the buttons as you suggested and that works.

However, I think this is a flaw in the design and should be mentioned in the docs. But Ok, I can live with it, it only needs a little changes to my code.
by vanarieleyen
Tue Oct 29, 2019 8:51 am
Forum: C++ Development
Topic: wxBoxSizer not refreshing
Replies: 13
Views: 729

Re: wxBoxSizer not refreshing

The docs mention: Detaches all children from the sizer. If delete_windows is true then child windows will also be deleted. Actually I don't want the child windows (the buttons) to be deleted I only want them to be removed from the sizer, so I assumed that 'delete_windows = false) would do that. The ...
by vanarieleyen
Tue Oct 29, 2019 8:34 am
Forum: C++ Development
Topic: wxBoxSizer not refreshing
Replies: 13
Views: 729

Re: wxBoxSizer not refreshing

Does that mean that the buttons are also deleted and need to be created again?

I thought that clear(false) only removed the appearance of the childs but apparantly not.
by vanarieleyen
Tue Oct 29, 2019 5:28 am
Forum: C++ Development
Topic: wxBoxSizer not refreshing
Replies: 13
Views: 729

wxBoxSizer not refreshing

I am most likely doing something wrong but I can't figure out what :? I have a wxBoxSizer that I dynamically fill with some buttons. The buttons are displayed without any problem. Next I perform some action in the program (fired by a click event) that is supposed to remove these buttons and place di...
by vanarieleyen
Sat Oct 26, 2019 7:47 am
Forum: C++ Development
Topic: Howto bind within a derived class?
Replies: 12
Views: 682

Re: Howto bind within a derived class?

Ahhhh, stupid ME!!

Yes, it works :D

Thank you doublemax
by vanarieleyen
Sat Oct 26, 2019 7:32 am
Forum: C++ Development
Topic: Howto bind within a derived class?
Replies: 12
Views: 682

Re: Howto bind within a derived class?

I have modified the code: class ButtonGroup : public wxBoxSizer, public wxBitmapButton { public: ButtonGroup( wxWindow *parent, int orientation = wxHORIZONTAL ): wxBoxSizer(orientation){ this->parent = parent; }; // append a button, on success return true bool Append(const wxBitmap &bitmap) { if (in...
by vanarieleyen
Sat Oct 26, 2019 7:08 am
Forum: C++ Development
Topic: Howto bind within a derived class?
Replies: 12
Views: 682

Re: Howto bind within a derived class?

When a button of the button group is clicked it should show its state (only one button of a button group can be active, the other buttons should not be active) To do this I want to call a local (within the class) function that modifies the bitmap of the clicked button and resets the bitmaps of the o...
by vanarieleyen
Sat Oct 26, 2019 6:44 am
Forum: C++ Development
Topic: Howto bind within a derived class?
Replies: 12
Views: 682

Howto bind within a derived class?

Hello, I am busy making a custom button group class which is derived from wxBoxSizer. The class seems OK, I can add buttons to it and it is correctly displayed. However, I would like to perform additional actions when a button is pressed. This event should be handled by a function within the class a...
by vanarieleyen
Wed Sep 18, 2019 8:58 am
Forum: C++ Development
Topic: wxRearrangeCtrl: Howto catch button event
Replies: 4
Views: 242

Re: wxRearrangeCtrl: Howto catch button event

No I didn't miss your reply but was busy implementing it because it looks much cleaner as what I came up with.
Thank you :D