Search found 78 matches

by shawnee
Wed Sep 26, 2018 1:12 am
Forum: C++ Development
Topic: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected
Replies: 9
Views: 1893

Re: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected

If I change wxEVT_LEFT_UP to wxEVT_LEFT_DOWN, then I could get left button single clicking mouse event.
But I got a new problem, no highlight on selected item is showing. If response wxEVT_LEFT_UP, the highlight is showing.
Anybody could help me out? Thanks!
by shawnee
Tue Sep 25, 2018 8:33 am
Forum: C++ Development
Topic: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected
Replies: 9
Views: 1893

Re: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected

I bind this event: this->mylist->Bind(wxEVT_LEFT_UP, &MyList::OnClickListItem, this, this->mylist->GetId()); void MyList::OnClickListItem(wxMouseEvent& event) { int eventx = this->mylist->ScreenToClient(wxGetMousePosition()).x; int eventy = this->mylist->ScreenToClient(wxGetMousePosition())....
by shawnee
Tue Sep 25, 2018 6:36 am
Forum: C++ Development
Topic: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected
Replies: 9
Views: 1893

wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected

Hi All,

I'm using single selection wxListCtrl. I found when I select a selected item again, it won't trigger wxEVT_LIST_ITEM_SELECTED event.
How can I get wxEVT_LIST_ITEM_SELECTED event from selected item? I really need this kind of behavior.
Thanks!
by shawnee
Wed Aug 22, 2018 1:53 am
Forum: Platform Related Issues
Topic: if call wx GUI from dll, the style of GUI would be not WIN10 native style
Replies: 9
Views: 2222

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

I'm using vs2015. Including path(c/c++ -> Gerneral -> Additional Include Directories ) about wxWidgets has been set. Are you sure this is the correct setting. These are for C++ compiler, not the resource one which are in Resources -> General -> Additional Include Directories. The setting is availab...
by shawnee
Tue Aug 21, 2018 12:30 pm
Forum: Platform Related Issues
Topic: if call wx GUI from dll, the style of GUI would be not WIN10 native style
Replies: 9
Views: 2222

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

I got this prompt: fatal error RC1015: cannot open include file 'wx/msw/rcdefs.h' Did you add the required path (WXWIN\include) to the include directories for resource compiler? What compiler/linker are you using? MSVC adds the manifest automatically by default... I'm using vs2015. Including path(c...
by shawnee
Tue Aug 21, 2018 9:02 am
Forum: Platform Related Issues
Topic: if call wx GUI from dll, the style of GUI would be not WIN10 native style
Replies: 9
Views: 2222

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

If load wx GUI not from dll project, just from main(.exe) project, the style is WIN10 style.
But I didn't add any rc or manifest to main project. I'm confused...
by shawnee
Tue Aug 21, 2018 8:56 am
Forum: Platform Related Issues
Topic: if call wx GUI from dll, the style of GUI would be not WIN10 native style
Replies: 9
Views: 2222

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

Thank you PB!
I got this prompt: fatal error RC1015: cannot open include file 'wx/msw/rcdefs.h'
by shawnee
Tue Aug 21, 2018 8:24 am
Forum: Platform Related Issues
Topic: if call wx GUI from dll, the style of GUI would be not WIN10 native style
Replies: 9
Views: 2222

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

Thanks PB!
I make a manifest copied from winxp.txt, and reside the folder where is as same as my application.
It seems not solve the problem.
by shawnee
Tue Aug 21, 2018 7:25 am
Forum: Platform Related Issues
Topic: if call wx GUI from dll, the style of GUI would be not WIN10 native style
Replies: 9
Views: 2222

if call wx GUI from dll, the style of GUI would be not WIN10 native style

I built two projects in Windows. One is the program entry project, the other is a dll project. In entry project, it's just WinMain entry. All of wxWidgets GUI issues(wxApp, wxFrame,etc.) will be done in dll project. I found, the appearance of widget, such as wxChoice, wxRadioButton and wxTextCtrl ar...
by shawnee
Tue Jun 26, 2018 1:57 am
Forum: C++ Development
Topic: wxBoxSizer border
Replies: 1
Views: 447

Re: wxBoxSizer border

Oh, I checked again. The outside extra one pixel gray border belongs to wxButton itself.
So, It seems no way to get rid of it? :(
by shawnee
Tue Jun 26, 2018 1:46 am
Forum: C++ Development
Topic: wxBoxSizer border
Replies: 1
Views: 447

wxBoxSizer border

Hi All, I'm running into a problem about wxBoxSizer border around wxButton. Here is my codes: wxPanel * regionPanel = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER); regionPanel->SetBackgroundColour(wxColour(234,163,65)); wxBoxSizer * hSizer = new wxBoxSizer(wxHORIZONTA...
by shawnee
Thu May 10, 2018 7:46 am
Forum: C++ Development
Topic: Get selected column in virtual wxListCtrl
Replies: 13
Views: 4667

Re: Re:

Does event.GetPoint().x really work? In my codes, it always 0. I checked the header file in v3.1, GetPoint() returns the value of m_pointDrag. It seems not mouse clicking position. Like i wrote: The docs say that GetPoint() is only valid for drag events, but i tested it on MSW and it also works her...
by shawnee
Wed May 09, 2018 3:12 pm
Forum: C++ Development
Topic: Get selected column in virtual wxListCtrl
Replies: 13
Views: 4667

Re:

You could try iterating over the column widths and compare it with the x-position of the mouse click: void myListCtrl::OnItemRightClick(wxListEvent& event) { int column; int x=0; for(column=0; column<GetColumnCount(); column++) { x+=GetColumnWidth(column); if(x>=event.GetPoint().x) break; } wxL...
by shawnee
Tue Jan 16, 2018 11:31 am
Forum: C++ Development
Topic: set user data for ribbonbuttonbar event
Replies: 3
Views: 1801

Re: set user data for ribbonbuttonbar event

The documentation for userData says: userData Optional data to be associated with the event table entry. wxWidgets will take ownership of this pointer, i.e. it will be destroyed when the event handler is disconnected or at the program termination. This pointer can be retrieved using wxEvent::GetEve...
by shawnee
Tue Jan 16, 2018 8:32 am
Forum: wxWidgets Development (Chinese)
Topic: Ribbon动态事件绑定的userdata传入问题(wx3.1)
Replies: 1
Views: 15189

Re: Ribbon动态事件绑定的userdata传入问题(wx3.1)

我从别的帖子找到了解决方法,https://forums.wxwidgets.org/viewtopic.php?f=1&t=39934&p=161254&hilit=userdata#p161249 定义一个通用类,专门存放宿主指针。 template<class T> class wxExUserData : public wxObject { public: T * Class() { return cls; } private: T * cls; public: wxExUserData(T * cl) : cls(cl) {} virtual ~wxExUse...