Search found 2952 matches

by PB
Sun Apr 18, 2021 3:17 pm
Forum: C++ Development
Topic: wxAuiNotebook::OnLeftUp not working
Replies: 13
Views: 63

Re: wxAuiNotebook::OnLeftUp not working

I think the SSCCE below does what you asked, i.e., adding a page after clicking the tab of the first wxAuiNotebook page. The code expects there is at least one more page after the "Add Page"; however, that would be easy to change (i.e., bind the mouse up from the page itself, e.g., a wxPanel), so I ...
by PB
Sun Apr 18, 2021 2:43 pm
Forum: C++ Development
Topic: wxAuiNotebook::OnLeftUp not working
Replies: 13
Views: 63

Re: wxAuiNotebook::OnLeftUp not working

With wxAuiNotebook one has to bind EVT_AUINOTEBOOK_TAB_* events. However, there is no events for the left mouse button, only for the middle and right one. I guess the left mouse click on the tab is transformed to the appropriate EVT_AUINOTEBOOK_PAGE_* event. Using wxNootebook gives me mouse left bu...
by PB
Sun Apr 18, 2021 2:33 pm
Forum: C++ Development
Topic: wxAuiNotebook::OnLeftUp not working
Replies: 13
Views: 63

Re: wxAuiNotebook::OnLeftUp not working

As I always, I would start with reducing the code to make sure the window hierarchy actually has any effect on the issue.

Often, one figures out what is wrong by themselves when doing so.
by PB
Sun Apr 18, 2021 2:23 pm
Forum: C++ Development
Topic: wxAuiNotebook::OnLeftUp not working
Replies: 13
Views: 63

Re: wxAuiNotebook::OnLeftUp not working

I have just tried replacing wxNotebook with wxAuiNotebook and then I do not get the mouse events. With wxAuiNotebook one has to bind EVT_AUINOTEBOOK_TAB_* events. However, there is no events for the left mouse button, only for the middle and right one. I guess the left mouse click on the tab is tran...
by PB
Sun Apr 18, 2021 2:06 pm
Forum: C++ Development
Topic: wxAuiNotebook::OnLeftUp not working
Replies: 13
Views: 63

Re: wxAuiNotebook::OnLeftUp not working

I cannot reproduce the issue (wxWidgets 3.1.5, Windows 10) with this SSCCE, which should pretty much mimic your code: #include <wx/wx.h> #include <wx/aui/aui.h> #include <wx/notebook.h> class MyFrame: public wxFrame { public: MyFrame() : wxFrame (nullptr, wxID_ANY, "Test") { wxPanel* panel = new wxP...
by PB
Sat Apr 17, 2021 8:13 am
Forum: Platform Related Issues
Topic: Getting windows mousepointer icon = black square
Replies: 23
Views: 350

Re: Getting windows mousepointer icon = black square

The issue just has been fixed in wxWidgets master: https://github.com/wxWidgets/wxWidgets/commit/b889f6897ba8429c02e598ee9d5a366347fef477 current-cursor.gif #include <wx/wx.h> #include <wx/msw/wrapwin.h> bool GetFromCurrentCursor(wxIcon& icon, wxBitmap& bitmap) { CURSORINFO ci{0}; wxIcon tmpIcon; wx...
by PB
Fri Apr 16, 2021 5:39 pm
Forum: Platform Related Issues
Topic: Getting windows mousepointer icon = black square
Replies: 23
Views: 350

Re: Getting windows mousepointer icon = black square

Attempting to fix wxWidgets code, I have realized that perhaps monochrome icons cannot be properly stored in a wxBitmap/wxImage. wxBitmap stores pixels to be drawn and optionally a transparent mask to indicate which pixels to not draw. Similarly with alpha for wxBitmap/wxImage. However, a monochrome...
by PB
Fri Apr 16, 2021 3:49 pm
Forum: Platform Related Issues
Topic: Getting windows mousepointer icon = black square
Replies: 23
Views: 350

Re: Getting windows mousepointer icon = black square

I check his return value against sizeof(BITMAP): whatever result (0 or not) not equal to the size of that BITMAP means a failure. Seems to me more strict than just checking for 0. Sorry for having missing that check, I did not look past the end of the function closing parentheses. Anyway, the docs ...
by PB
Fri Apr 16, 2021 3:35 pm
Forum: Platform Related Issues
Topic: Getting windows mousepointer icon = black square
Replies: 23
Views: 350

Re: Getting windows mousepointer icon = black square

Parduz wrote:
Fri Apr 16, 2021 3:27 pm
This is a try to get the color one (i modified your sample):
WHY it does'nt work?
I think there is a bug, you are always missing "!" when checking the result of ::GetObject(), this function returns zero on failure, non-zero otherwise. I did not read the rest of the code.
by PB
Fri Apr 16, 2021 3:22 pm
Forum: Platform Related Issues
Topic: Getting windows mousepointer icon = black square
Replies: 23
Views: 350

Re: Getting windows mousepointer icon = black square

Parduz wrote:
Fri Apr 16, 2021 3:20 pm
I'd like to do it so much, but until i can't get anything even from the "normal" hbmColor i'm stuck.
As shown in my code from my previous post, hbmColor is not used for monochrome cursors, so...
by PB
Fri Apr 16, 2021 3:18 pm
Forum: Platform Related Issues
Topic: Getting windows mousepointer icon = black square
Replies: 23
Views: 350

Re: Getting windows mousepointer icon = black square

Parduz wrote:
Fri Apr 16, 2021 3:16 pm
Anyway, i still wonder WHY we should use the wxIcon, and then the wxBitmap, while the IconInfo.hbmColor and hbmMask already are the HBITMAP we need.
You cans use them but for monochrome cursors, you need to do what wxWidgets attempts to do, i.e., properly blend the two parts of the mask...
by PB
Fri Apr 16, 2021 3:13 pm
Forum: Platform Related Issues
Topic: Getting windows mousepointer icon = black square
Replies: 23
Views: 350

Re: Getting windows mousepointer icon = black square

In the end, I decided to file a ticket, considering this a bug: https://trac.wxwidgets.org/ticket/19146
by PB
Thu Apr 15, 2021 3:58 pm
Forum: Platform Related Issues
Topic: Getting windows mousepointer icon = black square
Replies: 23
Views: 350

Re: Getting windows mousepointer icon = black square

I would ask in the wx-users mailing first, to see what can be done and if it is indeed a bug. I think i'll try to sort out the monochrome icons on my own. I am going to ask there, wxWidgets has code to convert monochrome icons to a wxBitmap: https://github.com/wxWidgets/wxWidgets/blob/master/src/ms...
by PB
Wed Apr 14, 2021 4:01 pm
Forum: Platform Related Issues
Topic: Getting windows mousepointer icon = black square
Replies: 23
Views: 350

Re: Getting windows mousepointer icon = black square

I have updated the code to include some more information #include <wx/wx.h> #include <wx/msw/wrapwin.h> bool CreatewxBitmapFromCurrentCursor(wxBitmap& bitmap) { CURSORINFO ci{0}; ICONINFO ii{0}; ci.cbSize = sizeof(ci); if ( !::GetCursorInfo(&ci) || (ci.flags & CURSOR_SHOWING) == 0 ) { wxLogError("Co...
by PB
Wed Apr 14, 2021 9:55 am
Forum: Compiler / Linking / IDE Related
Topic: Debug wxWidgets classes
Replies: 3
Views: 89

Re: Debug wxWidgets classes

This may not be really related, but FWIW, wxWidgets ships with GDB pretty printer for some of its classes, including wxArrayString (I have never used it):
https://github.com/wxWidgets/wxWidgets/ ... b/print.py

The CodeLite question would probably be better asked on their forum.