Search found 361 matches

by New Pagodi
Sun Aug 02, 2020 12:37 pm
Forum: Platform Related Issues
Topic: [wxMSW] How can I create a wxBrush from an existing HBRUSH?
Replies: 2
Views: 277

Re: [wxMSW] How can I create a wxBrush from an existing HBRUSH?

There doesn't seem to be a MSW only InitFromHBRUSH method like there is with some of the other GDI objects. But what you can do is call GetObject to get a LOGBRUSH. Then use the information in that structure to create a wxBrush.
by New Pagodi
Tue Jul 07, 2020 8:42 pm
Forum: Platform Related Issues
Topic: macOS on ARM CPU
Replies: 4
Views: 540

Re: macOS on ARM CPU

Here's a discussion of ARM support for macOS from the wxDev group.

Basically the plan is to build universal binaries containing both ARM and x86-64 code similar to how the situation was handled during the transition from powerpc to x86.
by New Pagodi
Sun Jun 07, 2020 4:19 am
Forum: C++ Development
Topic: Memory Management of a panel using unique_ptr
Replies: 2
Views: 269

Re: Memory Management of a panel using unique_ptr

Just use raw pointers. The panel is owned by the frame and so it will be deleted when the frame is destroyed. So there is no possibility of leaking the panel object.
by New Pagodi
Fri Jun 05, 2020 4:41 pm
Forum: C++ Development
Topic: Can't set wxChoice background color
Replies: 2
Views: 306

Re: Can't set wxChoice background color

Setting colors for native controls is usually not a good idea. It may not work or may not work as intended. Even if it works on one port, it may not work on other ports. As the documentation states : Notice that as with SetForegroundColour(), setting the background colour of a native control may not...
by New Pagodi
Thu May 21, 2020 7:39 pm
Forum: Platform Related Issues
Topic: wxSplitterWindow broken on Windows?
Replies: 2
Views: 332

Re: wxSplitterWindow broken on Windows?

Code: Select all

SetSizerAndFit ( sizer );
This tells all windows to resize to the minimum size. Just use SetSizer instead.
by New Pagodi
Tue May 19, 2020 5:49 pm
Forum: C++ Development
Topic: Real-time Graphical Output on a wxPanel from within a wxThread
Replies: 2
Views: 253

Re: Real-time Graphical Output on a wxPanel from within a wxThread

As the documentation states : When writing a multi-threaded application, it is strongly recommended that no secondary threads call GUI functions. What you can do is throw an event from your secondary thread and then in the handler for that event call Update/Refresh on the panel. The page for wxThrea...
by New Pagodi
Sun Apr 26, 2020 6:56 pm
Forum: C++ Development
Topic: How to do a basic GUI with two panels
Replies: 10
Views: 697

Re: How to do a basic GUI with two panels

Nick wrote:
Sun Apr 26, 2020 6:20 pm
Good morning, what IDE, Designer or program are you using in these images?
Those images are from wxFormBuilder.
by New Pagodi
Sun Apr 26, 2020 5:08 am
Forum: Platform Related Issues
Topic: wxStyledTextCtrl TAB key ignored on Linux
Replies: 4
Views: 430

Re: wxStyledTextCtrl TAB key ignored on Linux

I'm not sure what, but there is some setting that makes the tab key not work on linux. You can see it in the stc sample: the tab key does not work in the main frame but it does work with the mini editor frame. Also the tab key works if you create a plain stc without any configuration at all. I would...
by New Pagodi
Fri Apr 24, 2020 8:32 pm
Forum: Compiler / Linking / IDE Related
Topic: window id required even with wx built with --disable-gui
Replies: 5
Views: 524

Re: window id required even with wx built with --disable-gui

This was discussed in the comments here and should have been fixed by this PR.

If there is still and issue, you should probably mention it in the comments for the second PR or open and issue on trac.
by New Pagodi
Tue Apr 21, 2020 2:53 am
Forum: C++ Development
Topic: Add zooming and panning to wxDC
Replies: 2
Views: 263

Re: Add zooming and panning to wxDC

I wrote about this here.
by New Pagodi
Mon Apr 20, 2020 9:21 pm
Forum: C++ Development
Topic: Problem with custom lexer for wxStyledTextCtrl and unicode characters
Replies: 4
Views: 338

Re: Problem with custom lexer for wxStyledTextCtrl and unicode characters

Matching positions for is not easy. An example of how to do this is given by the SurfaceImpl::MeasureWidths method defined in src/stc/PlatWX.cpp from the wxWidgets source. I assume you have a function for styling line in wxString form. ie you already have this function void StylewxString(const wxStr...
by New Pagodi
Mon Apr 20, 2020 7:55 pm
Forum: C++ Development
Topic: looking for wxTextInputStream replacement for binary files
Replies: 2
Views: 264

Re: looking for wxTextInputStream replacement for binary files

You should be able to use wxMemoryOutputStream. I haven't tested this, but this should work: if (wxFileName::FileExists(source_file)) { wxFileInputStream input(source_file); wxMemoryOutputStream memOut(NULL); input.Read(memOut); wxStreamBuffer* buffer = memOut.GetOutputStreamBuffer(); const auto fil...
by New Pagodi
Mon Apr 20, 2020 7:14 pm
Forum: C++ Development
Topic: Problem with custom lexer for wxStyledTextCtrl and unicode characters
Replies: 4
Views: 338

Re: Problem with custom lexer for wxStyledTextCtrl and unicode characters

There are a number of "raw" methods supplied with wxStyledTextCtrl that allow you to get information from the control without converting from/to wxString. I think in particular GetLineRaw would be helpful here.
by New Pagodi
Sat Apr 18, 2020 7:33 pm
Forum: C++ Development
Topic: How to do a basic GUI with two panels
Replies: 10
Views: 697

Re: How to do a basic GUI with two panels

The proportion option is under "sizer item" near the bottom of the grid:
stretch.png
stretch.png (12.12 KiB) Viewed 662 times

Note that the setting will be ignored unless "stretch" is selected for the item on the toolbar:
prop.png
prop.png (9.96 KiB) Viewed 662 times
by New Pagodi
Sat Apr 18, 2020 3:26 am
Forum: C++ Development
Topic: [SOLVED] Copy wxTreeCrtl from one tree to another
Replies: 12
Views: 797

Re: Copy wxTreeCrtl from one tree to another

If I'm understanding correctly, you read from the database to some sort tree structure and then copy that structure to a tree control. If that's right, maybe you could use wxDataViewCtrl with a model designed to implement the virtual methods based on that tree structure you've built from the databa...