Search found 17 matches

by Fenhasan
Mon Apr 19, 2021 4:07 am
Forum: Component Writing
Topic: Creating a custom LED indicator
Replies: 10
Views: 7681

Re: Creating a custom LED indicator

As usual, thanks doublemax for providing the solution! The Led looks like this now :D : Test02.jpg Color can be changed on the fly. Thank you very much doublemax, I'm really grateful! Best regards, Fenhasan PD: This is the working code, in case anyone would like to use it. led_widget.h #include <wx/...
by Fenhasan
Sun Apr 18, 2021 8:43 pm
Forum: Component Writing
Topic: Creating a custom LED indicator
Replies: 10
Views: 7681

Re: Creating a custom LED indicator

doublemax: How do you set the wxTRANSPARENT_WINDOW flag? I tried adding this in the ctor: Led::Led(wxWindow *parent, wxWindowID id, wxPoint Position, int Size, char color) : wxWindow(parent, id, Position, wxSize(Size,Size),'R') { m_parent = parent; Connect(wxEVT_PAINT, wxPaintEventHandler(Led::OnPai...
by Fenhasan
Sun Apr 18, 2021 2:18 am
Forum: Component Writing
Topic: Creating a custom LED indicator
Replies: 10
Views: 7681

Re: Creating a custom LED indicator

So I made a few changes, and i got this result: Test01.jpg I could draw the Led, but i get those white areas... is there any way to make the component background transparent? The code now is: led_widget.h #include <wx/wx.h> #include <wx/graphics.h> class Led : public wxWindow { public: Led(wxWindow ...
by Fenhasan
Sat Apr 17, 2021 5:38 pm
Forum: Component Writing
Topic: Creating a custom LED indicator
Replies: 10
Views: 7681

Re: Creating a custom LED indicator

Thanks for your suggestions, doublemax, I'll give them a try and report the results.

Best regards,
Fenhasan
by Fenhasan
Sat Apr 17, 2021 2:12 pm
Forum: Component Writing
Topic: Creating a custom LED indicator
Replies: 10
Views: 7681

Re: Creating a custom LED indicator

Sorry for triple posting, but when i tried to post all 4 files in one post, the system flagged it as spam... Anyway, here is a picture of the test program running, showing the blank square at the top, where another LED should appear: Test.jpg My idea is to make a LED with some gradient fill, which i...
by Fenhasan
Sat Apr 17, 2021 2:06 pm
Forum: Component Writing
Topic: Creating a custom LED indicator
Replies: 10
Views: 7681

Re: Creating a custom LED indicator

TestDCMain.h #ifndef TESTDCMAIN_H #define TESTDCMAIN_H //(*Headers(TestDCFrame) #include <wx/button.h> #include <wx/frame.h> #include <wx/menu.h> #include <wx/radiobox.h> #include <wx/slider.h> #include <wx/stattext.h> #include <wx/statusbr.h> //*) #include <wx/wx.h> //#include <wx/graphics.h> #incl...
by Fenhasan
Sat Apr 17, 2021 2:03 pm
Forum: Component Writing
Topic: Creating a custom LED indicator
Replies: 10
Views: 7681

Creating a custom LED indicator

Hi guys: I want to make a LED indicator, but I've had no luck in making it modular. Let me explain: I managed to draw the LED, but when i tried to make it a module, to make it portable, it only shows a white square, and nothing else. My test code is the following: led_widget.h #include <wx/wx.h> #in...
by Fenhasan
Wed Mar 17, 2021 5:56 pm
Forum: C++ Development
Topic: Read argc and argv in GUI app
Replies: 7
Views: 625

Re: Read argc and argv in GUI app

Thank you doublemax, that's exactly what I needed! You rock!
by Fenhasan
Wed Mar 17, 2021 5:03 pm
Forum: C++ Development
Topic: Read argc and argv in GUI app
Replies: 7
Views: 625

Re: Read argc and argv in GUI app

These are my code files; i tried several times to pass the argv[1] string to the main app, without luck...
by Fenhasan
Wed Mar 17, 2021 5:02 pm
Forum: C++ Development
Topic: Read argc and argv in GUI app
Replies: 7
Views: 625

Re: Read argc and argv in GUI app

/*************************************************************** * Name: TestColorsApp.h * Purpose: Defines Application Class * Author: () * Created: 2021-03-03 * Copyright: () * License: **************************************************************/ #ifndef TESTCOLORSAPP_H #define TESTCOLORSAPP_H...
by Fenhasan
Wed Mar 17, 2021 5:02 pm
Forum: C++ Development
Topic: Read argc and argv in GUI app
Replies: 7
Views: 625

Re: Read argc and argv in GUI app

/*************************************************************** * Name: TestColorsApp.cpp * Purpose: Code for Application Class * Author: () * Created: 2021-03-03 * Copyright: () * License: **************************************************************/ #include "TestColorsApp.h" //(*App...
by Fenhasan
Wed Mar 17, 2021 5:01 pm
Forum: C++ Development
Topic: Read argc and argv in GUI app
Replies: 7
Views: 625

Re: Read argc and argv in GUI app

/*************************************************************** * Name: TestColorsMain.h * Purpose: Defines Application Frame * Author: () * Created: 2021-03-03 * Copyright: () * License: **************************************************************/ #ifndef TESTCOLORSMAIN_H #define TESTCOLORSMAI...
by Fenhasan
Wed Mar 17, 2021 5:00 pm
Forum: C++ Development
Topic: Read argc and argv in GUI app
Replies: 7
Views: 625

Re: Read argc and argv in GUI app

/*************************************************************** * Name: TestColorsMain.cpp * Purpose: Code for Application Frame * Author: () * Created: 2021-03-03 * Copyright: () * License: **************************************************************/ #include "TestColorsMain.h" #incl...
by Fenhasan
Wed Mar 17, 2021 4:59 pm
Forum: C++ Development
Topic: Read argc and argv in GUI app
Replies: 7
Views: 625

Read argc and argv in GUI app

Hello: I wrote a small test program lo learn wxWidgets basics; it works just fine... then i decided to learn how to read a command line parameter, even is the program is GUI based, and i haven't had luck with it. I have 4 files: TestColorsMain.cpp, TestColorsMain.h, TestColorsApp.cpp and TestColorsA...