Search found 380 matches

by New Pagodi
Mon Apr 20, 2020 7:55 pm
Forum: C++ Development
Topic: looking for wxTextInputStream replacement for binary files
Replies: 2
Views: 332

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

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

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 798 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 798 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: 953

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

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

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

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

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

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

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

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

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

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...
by New Pagodi
Sun Jan 26, 2020 7:58 pm
Forum: Compiler / Linking / IDE Related
Topic: fatal error: wx/setup.h: No such file or directory
Replies: 5
Views: 950

Re: fatal error: wx/setup.h: No such file or directory

You need to match the wizard's options to the settings you specified when building the library. Since you said you used the build command mingw32-make.exe -f makefile.gcc USE_XRC=1 SHARED=1 BUILD=release UNICODE=1 make sure "Use wxWidgets dll" and "Enable Unicode" are checked and the option about a ...
by New Pagodi
Sun Jan 26, 2020 7:03 pm
Forum: Compiler / Linking / IDE Related
Topic: fatal error: wx/setup.h: No such file or directory
Replies: 5
Views: 950

Re: fatal error: wx/setup.h: No such file or directory

If you're using codeblocks, just use the wizard to create a new wxwidgets project. The wizard will configure all of the include/lib folders for you. You don't need to make any changes to your system's environment variables to use it.