Search found 107 matches
- Wed Apr 13, 2022 7:22 am
- Forum: C++ Development
- Topic: Fill listCtrl with data from another thread
- Replies: 5
- Views: 486
Re: Fill listCtrl with data from another thread
You probably also need a way to shut down the worker thread from the GUI thread, e.g. when the user closes the window/application. Good point, will find how to handle window/application close event. On more little question: can I start my worker thread from MyApp::OnInit() function after creating o...
- Wed Apr 13, 2022 7:08 am
- Forum: C++ Development
- Topic: Fill listCtrl with data from another thread
- Replies: 5
- Views: 486
Re: Fill listCtrl with data from another thread
Thanks, will try it. Currently I'm using std::thread. As I understand I just need to pass wxEvtHandler of my MainWindow class to the thread and call wxQueueEvent when user connected/disconnected, right?
- Wed Apr 13, 2022 6:43 am
- Forum: C++ Development
- Topic: Fill listCtrl with data from another thread
- Replies: 5
- Views: 486
Fill listCtrl with data from another thread
Hello, The idea is following: I've got 2 threads, one is for UI and the second one is server which is listening for incoming connections. Once new client connected I add client's data (name and ip) to global std::vector<client>. Now I need to tell wxListCtrl to fill it's data from the vector. The sa...
- Thu Mar 26, 2020 3:45 pm
- Forum: C++ Development
- Topic: Scroll doesn't work after focusing custom control
- Replies: 15
- Views: 2711
Re: Scroll doesn't work after focusing custom control
Thanks, it helps.
Will now implement logic to determine if mouse inside the wxDVC
Will now implement logic to determine if mouse inside the wxDVC
- Thu Mar 26, 2020 12:10 pm
- Forum: C++ Development
- Topic: Scroll doesn't work after focusing custom control
- Replies: 15
- Views: 2711
Re: Scroll doesn't work after focusing custom control
Tried to pass mouswheel event to parent control, but didn't help. But may be I'm doing something wrong. wxListViewShares::wxListViewShares(wxWindow* parent, const share_list_t& shares, const std::shared_ptr<ApplicationHelper>& appHelper, const SharesSerializer::used_shares_t& usedShares)...
- Wed Mar 25, 2020 6:50 pm
- Forum: C++ Development
- Topic: Scroll doesn't work after focusing custom control
- Replies: 15
- Views: 2711
Re: Scroll doesn't work after focusing custom control
Tried unbind OnMouseMove handler in the dialog - didn't help.
Will check it tomorrow
I expect the same...seems like wxDataViewListCtrl works in incorrect way.As a user, I expect mouse wheel events going to the focused control supporting scrolling (listctrl, textctrl...), not its top-level parent.
Will check it tomorrow
- Wed Mar 25, 2020 4:56 pm
- Forum: C++ Development
- Topic: Scroll doesn't work after focusing custom control
- Replies: 15
- Views: 2711
Re: Scroll doesn't work after focusing custom control
By "stop working" I mean that it doesn't respond on mouse wheel action.
I attached parent dialog's files. But actually I don't think the problem somewhere there, because if I focus wxTextCtrl on the same dialog, then everything works ok
I attached parent dialog's files. But actually I don't think the problem somewhere there, because if I focus wxTextCtrl on the same dialog, then everything works ok
- Wed Mar 25, 2020 4:19 pm
- Forum: C++ Development
- Topic: Scroll doesn't work after focusing custom control
- Replies: 15
- Views: 2711
Re: Scroll doesn't work after focusing custom control
PB, nice point about exiting MouseMove handler without skipping the event sometimes. But It is not the reason of the issue, because I tried to comment OnMouseMove binding and it didn't help.
Regarding SelectionChange event, yes, parent control handles this event too.
Regarding SelectionChange event, yes, parent control handles this event too.
- Wed Mar 25, 2020 3:11 pm
- Forum: C++ Development
- Topic: Scroll doesn't work after focusing custom control
- Replies: 15
- Views: 2711
Re: Scroll doesn't work after focusing custom control
wxWidgets 3.1.3, OS - windows, but I believe that on Linux will be the same behavior. I don't think that the problem is in scroll actually, because my custom control just doesn't loose the focus after I clicking outside the control. I also tried handle wxEVT_LEAVE_WINDOW by setting focus on parent w...
- Wed Mar 25, 2020 7:18 am
- Forum: C++ Development
- Topic: Scroll doesn't work after focusing custom control
- Replies: 15
- Views: 2711
Scroll doesn't work after focusing custom control
I've got scrollbars on my dialog. And there is custom control inside. When I focus (click inside) custom control, then scroll (inside the dialog) stops working. To make it work again I have to focus some native control (wxTextCtrl). Here is code of my custom control: class wxListViewShares : public ...
- Fri Mar 06, 2020 1:25 pm
- Forum: C++ Development
- Topic: Resize window in runtime
- Replies: 5
- Views: 948
Re: Resize window in runtime
Problem was here:
So I calculated the size before creating contenPanel and use correct size in it's constructor.
Thanks for helping.
Code: Select all
auto contentPanel = new wxCustomPanel(m_frameContent, FromDIP(wxSize(GetSize().GetWidth(), GetSize().GetHeight())));
Thanks for helping.
- Fri Mar 06, 2020 10:21 am
- Forum: C++ Development
- Topic: Resize window in runtime
- Replies: 5
- Views: 948
Re: Resize window in runtime
Commented all Fit() calls, but it didn't help
- Fri Mar 06, 2020 9:51 am
- Forum: C++ Development
- Topic: Resize window in runtime
- Replies: 5
- Views: 948
Resize window in runtime
I need to set window width depending on text's width. I tried SetClientSize and SetSize methods, but window still has the same size: MainWindow::MainWindow(wxWindow* parent, const std::shared_ptr<SharingManager>& sharingManager, const std::shared_ptr<UiAgentMasterBridge>& agentBridge) : wxCu...
- Tue Dec 03, 2019 1:00 pm
- Forum: C++ Development
- Topic: wxScrolledWindow size changes after wxDialog::Fit() call
- Replies: 0
- Views: 14048
wxScrolledWindow size changes after wxDialog::Fit() call
Greetings, I have dialog class (derived from wxDialog) with fixed min size. The dialog class has wxCustomPanel* member (derived from wxPanel) also some collapsible panels are present on dialog. wxCustomPanel* member is used as a template type for wxScrolled<>: wxCustomPanel* wxRTSharesManagerDialog:...
- Fri Nov 29, 2019 10:00 am
- Forum: C++ Development
- Topic: Allow user to resize wxDialog without border
- Replies: 5
- Views: 1123
Re: Allow user to resize wxDialog without border
Tried to implement this solution: void wxRTSharesManagerDialog::OnLeftDown(wxMouseEvent& event) { CaptureMouse(); } void wxRTSharesManagerDialog::OnLeftUp(wxMouseEvent& event) { if (HasCapture()) { ReleaseMouse(); } } void wxRTSharesManagerDialog::OnMouseMove(wxMouseEvent& event) { wxPoi...