Search found 361 matches

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

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

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

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

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

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

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

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

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

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

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.
by New Pagodi
Mon Jan 20, 2020 12:09 am
Forum: C++ Development
Topic: WarpPointer question
Replies: 8
Views: 863

Re: WarpPointer question

I agree that it is not good practice to move the mouse pointer programmatically... However, I want the behavior of using the wheel to zoom (in/out) with the position of the cursor determining which part of the image/diagram should be shown in the center of the window. So if I want the see the upper...
by New Pagodi
Wed Jan 15, 2020 10:57 pm
Forum: C++ Development
Topic: How to use wxDCOverlay?
Replies: 7
Views: 605

Re: How to use wxDCOverlay?

If you want to draw with transparency with wxGraphicsContext while caching the result in a bitmap, I would try adding a function like this: void CAnalysisPanel::BuildPlot(int width, int height) { wxImage img(width,height); // Create an alpha channel and set all pixels transparent. img.InitAlpha(); m...
by New Pagodi
Wed Jan 15, 2020 11:06 am
Forum: C++ Development
Topic: How to use wxDCOverlay?
Replies: 7
Views: 605

Re: How to use wxDCOverlay?

New Pagodi: yes, this seems the classical approach and I probably stay with it, it also allows me to cache separate bitmap for more plots and then just compose them when needed. Although the usage seems much more complicated, e.g. how to plot the lines into the transparent wxMemoryDC so I can compo...
by New Pagodi
Tue Jan 14, 2020 2:21 pm
Forum: C++ Development
Topic: How to use wxDCOverlay?
Replies: 7
Views: 605

Re: How to use wxDCOverlay?

I think a better approach would be to cache the plots into a bitmap. The paint handler would first draw the bitmap and then draw any extra lines over the bitmap. To generate the cached bitmap of the plot, you can use wxMemoryDC.