Search found 18 matches

by Knampf
Thu Feb 25, 2021 8:34 am
Forum: C++ Development
Topic: How do I save drawings in a wxDC temporarily?
Replies: 3
Views: 138

Re: How do I save drawings in a wxDC temporarily?

Thanks for the example, but the original version doesn't start after copy&pasting it and the edited version from the other person in the thread is broken. It starts, but the box selection functionality is very bugged. It was 3 - 4 years, but I think, it would be worth reworking. I'll still read over...
by Knampf
Thu Feb 25, 2021 5:49 am
Forum: C++ Development
Topic: How do I save drawings in a wxDC temporarily?
Replies: 3
Views: 138

How do I save drawings in a wxDC temporarily?

I’m trying to paint a dot into a wxDC where the cursor is and save the dots as long as the program goes, so you can draw with the mouse. After that, I’d like to draw the dots only when the left mouse button is down. For now, I have a form of PaintDC that creates the wished dot where the mouse is but...
by Knampf
Tue Feb 23, 2021 12:18 pm
Forum: General Development
Topic: What is wxwidgets intended to do?
Replies: 5
Views: 550

Re: What is wxwidgets intended to do?

Hello I did the basic C++ course of codecademy, read till chapter 6+ of Bjarne Stroustrup’s Principles and Practise Using C++ and watched a lot of videos. I’ve made a small card playing app for console for example. I know that wxwidgets is not designed to make video games. My end goal is not making ...
by Knampf
Tue Feb 23, 2021 7:48 am
Forum: General Development
Topic: What is wxwidgets intended to do?
Replies: 5
Views: 550

Re: What is wxwidgets intended to do?

I haven't been to college/university, but I have the so called "Fachabitur", which is 2 additional years to obligatory school. I did that in technical subjects. I can’t really say how much I know about programming, but I would say I’m a bit further than basics. I mostly understand basics and general...
by Knampf
Tue Feb 23, 2021 12:34 am
Forum: General Development
Topic: What is wxwidgets intended to do?
Replies: 5
Views: 550

What is wxwidgets intended to do?

I have a more abstract question. wxwidgets is obviously designed so you can make 2D-GUI applications, which overall have advantages over console applications. Is wxwidgets designed so you can make any 2D-GUI program you can think of or does it focus more on meaningful programs? In a previous post of...
by Knampf
Mon Feb 22, 2021 9:42 pm
Forum: C++ Development
Topic: Why doesn't my drag&drop work?
Replies: 1
Views: 103

Why doesn't my drag&drop work?

I got started with drag&drop with the help of wxwidgets guides and this is what I've made of it. It's supposed to display 2 buttons, one with "drag_text" as label the other with an empty label. You can drag&drop one label to the other one with overwriting where you drop and deleting the label of the...
by Knampf
Sat Feb 20, 2021 5:24 pm
Forum: C++ Development
Topic: How do you make a program recognize this image? (variables)
Replies: 9
Views: 245

Re: How do you make a program recognize this image? (variables)

I tried expanding the functionality of the program by adding buttons and having them change the image. I had some problems, for exmaple creating an image area. My furthest attempt in terms of least errors is this one: panels.h: #include "wx/wx.h" #include "wx/dc.h" #include "wx/dcbuffer.h" #include ...
by Knampf
Sat Feb 20, 2021 2:06 am
Forum: C++ Development
Topic: How do you make a program recognize this image? (variables)
Replies: 9
Views: 245

Re: How do you make a program recognize this image? (variables)

I think, I'll stick with the simpler version without wxGraphicsContext for now till I'm more familiar with panels and stuff. Is there a reason you used GetClientSize()? Using the size of the panel seems more general and apply more often: void img_panel::OnPaint(wxPaintEvent& evt) { wxAutoBufferedPai...
by Knampf
Fri Feb 19, 2021 10:20 pm
Forum: C++ Development
Topic: How do you make a program recognize this image? (variables)
Replies: 9
Views: 245

Re: How do you make a program recognize this image? (variables)

The code works with some refreshing issues and I googled the new terms like wxGraphicsContext. Seemingly irregular, it does trails, but it always has a complete image on top. SetBackgroundStyle is for avoiding flickering when repainting? The concept of wxGraphicsContext is very new to me. The class ...
by Knampf
Fri Feb 19, 2021 8:11 pm
Forum: C++ Development
Topic: How do you make a program recognize this image? (variables)
Replies: 9
Views: 245

Re: How do you make a program recognize this image? (variables)

Yes, that was the issue. I solved it the same way in my other app but forgot because working with wxPanels is so different and new to me... I missed the scaling part of my image scaling app. Here's are the new versions of panels.h and panels.cpp + the current problems. cApp.h and cApp.cpp haven't ch...
by Knampf
Fri Feb 19, 2021 6:09 pm
Forum: C++ Development
Topic: How do you make a program recognize this image? (variables)
Replies: 9
Views: 245

How do you make a program recognize this image? (variables)

I tried different ways to show this image in a very simple program. I used the image successfully in another program before, so the image itself should be ok. The folder which contains the image is included over properties in Additional Include Directories. I just share the code + questions after th...
by Knampf
Wed Feb 17, 2021 5:38 pm
Forum: C++ Development
Topic: How do I start a paint event?
Replies: 5
Views: 266

Re: How do I start a paint event?

This question is a bit late but it just popped up today. In your shared link https://wiki.wxwidgets.org/Drawing_on_a_panel_with_a_DC, a wxFrame is created on initialisation of the app + an instance of the user defined class BasicDrawPane, which is a subclass of wxPanel. The panel is put inside the f...
by Knampf
Tue Feb 16, 2021 9:12 pm
Forum: C++ Development
Topic: Why can a function in wxPanel access this?
Replies: 5
Views: 196

Re: Why can a function in wxPanel access this?

How would you make the code more general? Is there a way to access any frame the panel is in without being dependet of the subclass, in this case Communicate? How would you handle the problem that the called frame has to have m_rp in it?
by Knampf
Tue Feb 16, 2021 4:54 pm
Forum: C++ Development
Topic: Why can a function in wxPanel access this?
Replies: 5
Views: 196

Re: Why can a function in wxPanel access this?

Question 1 means: Why do you have to write "Communicate *comm = (Communicate *) m_parent->GetParent();"? Why can't you just leave that out and do "comm->m_rp->m_text->SetLabel(wxString::Format(wxT("%d"), count));" immediately, because the frame "comm" was created when starting the app? At the point ...
by Knampf
Tue Feb 16, 2021 4:15 pm
Forum: C++ Development
Topic: Why can a function in wxPanel access this?
Replies: 5
Views: 196

Why can a function in wxPanel access this?

Hello I'm doing this tutorial https://zetcode.com/gui/wxwidgets/firstprograms/ and I'm at the "Widgets communicate" part, the 3rd part of 3. A function there goes like this: void LeftPanel::OnPlus(wxCommandEvent & WXUNUSED(event)) { count++; Communicate *comm = (Communicate *) m_parent->GetParent();...