Search found 352 matches

by New Pagodi
Tue Apr 21, 2020 2:53 am
Forum: C++ Development
Topic: Add zooming and panning to wxDC
Replies: 2
Views: 207

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

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

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

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

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 474 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 474 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: 566

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...
by New Pagodi
Sat Apr 18, 2020 1:12 am
Forum: C++ Development
Topic: [SOLVED] Copy wxTreeCrtl from one tree to another
Replies: 12
Views: 566

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 database.
by New Pagodi
Wed Apr 15, 2020 3:32 pm
Forum: C++ Development
Topic: wxStyledTextCtrl how to multyple UNDO?
Replies: 5
Views: 297

Re: wxStyledTextCtrl how to multyple UNDO?

For the most part, the undo actions are managed by the Scintilla library, and there isn't much api available for customizing the behavior. If you want to make sure each character has its own undo action, you can try handling the wxEVT_STC_MODIFIED event, and calling BeginUndoAction before the charac...
by New Pagodi
Tue Apr 14, 2020 6:04 pm
Forum: C++ Development
Topic: wxAuiManager: setting pane sizes
Replies: 7
Views: 432

Re: wxAuiManager: setting pane sizes

The dock_proportion property seems to work, but there doesn't seem to be a setter for it. So you have to create a separate wxAuiPaneInfo object, then set the property on it, and finally use the pane info to add the window. Like so: wxAuiPaneInfo pi = wxAuiPaneInfo().Caption("Layers").Right().Resizab...
by New Pagodi
Fri Apr 10, 2020 6:15 pm
Forum: Platform Related Issues
Topic: How do I show a text cursor on wxTextCtrl with inverted colors?
Replies: 14
Views: 770

Re: How do I show a text cursor on wxTextCtrl with inverted colors?

wxStyledTextCtrl supports setting caret colors. It's a little more complicated than wxTextCtrl though.
by New Pagodi
Tue Mar 24, 2020 3:17 am
Forum: C++ Development
Topic: Difficulty with Bind and Events
Replies: 2
Views: 230

Re: Difficulty with Bind and Events

You usually call Bind on the object generating the event you want to handle. Since the frame is the object generating the size event, you should call

Code: Select all

FrmMain->Bind(wxEVT_SIZE, &MyProgram::OnSize, this);
by New Pagodi
Thu Feb 20, 2020 8:58 pm
Forum: Compiler / Linking / IDE Related
Topic: Adding my own C++ headers from other project
Replies: 3
Views: 370

Re: Adding my own C++ headers from other project

I'm not sure what your asking, but here's an very simple example of how you can use the same code file in 2 projects with codeblocks. I created a console application and a wxWidgets application in the same folder. Then I used the new file wizard to create a c++ header and a c++ file named class.h an...
by New Pagodi
Wed Feb 12, 2020 6:14 am
Forum: C++ Development
Topic: Intercept wxLogError calls
Replies: 7
Views: 462

Re: Intercept wxLogError calls

It sounds like you should be using libtiff directly instead of wxWidgets wrapper for it.
by New Pagodi
Sat Feb 01, 2020 7:07 pm
Forum: General Development
Topic: Inquire, to make my library support MacOS
Replies: 4
Views: 499

Re: Inquire, to make my library support MacOS

The development tools supplied by apple use the clang compiler. It is capable of compiling c,c++, objective c, and maybe others as well. You only need to use objective c if you want to work directly with the system libraries. As far as gui programming does, on macOS, wxWidgets is basically a c++ wra...
by New Pagodi
Thu Jan 30, 2020 7:39 pm
Forum: C++ Development
Topic: calculate screen pos -> pos on rotated wxBitmap
Replies: 2
Views: 234

Re: calculate screen pos -> pos on rotated wxBitmap

To rotate an image by angle α about a point P(x0,y0), you translate by (-x0,-y0) perform the rotation translate back by (x0,y0) So if you have an image that has already been rotated about a point and you want to get the original point, you just undo those operations: translate by (-x0,-y0) [this und...