Search found 20 matches

by refaelsh
Thu Feb 28, 2019 12:38 pm
Forum: C++ Development
Topic: wxDataViewListCtrl and wxEVT_DATAVIEW_ITEM_ACTIVATED
Replies: 4
Views: 136

Re: wxDataViewListCtrl and wxEVT_DATAVIEW_ITEM_ACTIVATED

Thank you. That helped solve my problem.
by refaelsh
Thu Feb 28, 2019 7:12 am
Forum: C++ Development
Topic: wxDataViewListCtrl and wxEVT_DATAVIEW_ITEM_ACTIVATED
Replies: 4
Views: 136

Re: wxDataViewListCtrl and wxEVT_DATAVIEW_ITEM_ACTIVATED

wxEVT_DATAVIEW_ITEM_ACTIVATED is an event that is generated for the whole item (row), not a particular column. So GetValue() doesn't make sense here. Oh! I understand now. Thank you. But GetItem() should give you the item. Eh... Could you please give an example of what should I do with GetItem()? I...
by refaelsh
Wed Feb 27, 2019 7:57 pm
Forum: C++ Development
Topic: wxDataViewListCtrl and wxEVT_DATAVIEW_ITEM_ACTIVATED
Replies: 4
Views: 136

wxDataViewListCtrl and wxEVT_DATAVIEW_ITEM_ACTIVATED

I have a wxDataViewListCtrl. I use a custom wxDataViewCustomRenderer like this: ColoredTextCustomRenderer::ColoredTextCustomRenderer() : wxDataViewCustomRenderer("void*", wxDATAVIEW_CELL_INERT, wxALIGN_CENTER) Please notice that the first parameter to wxDataViewCustomRenderer's constructor is void*....
by refaelsh
Sun Feb 17, 2019 8:37 pm
Forum: C++ Development
Topic: wxrichtextctrl and disappearing cursor
Replies: 8
Views: 178

Re: wxrichtextctrl and disappearing cursor

doublemax, can you please explain to me why your solution works?
by refaelsh
Sun Feb 17, 2019 8:36 pm
Forum: C++ Development
Topic: wxrichtextctrl and disappearing cursor
Replies: 8
Views: 178

Re: wxrichtextctrl and disappearing cursor

Does the control properly get focus if you do it manually (click into the window)? If yes, try calling SetFocus at a later time using wxEvtHandler::CallAfter(): https://docs.wxwidgets.org/trunk/classwx_evt_handler.html#a910416e4d0b1f38cec02213b8a0c6a12 That solved the issue. Thanks a a lot everyone...
by refaelsh
Sun Feb 17, 2019 8:35 pm
Forum: C++ Development
Topic: wxrichtextctrl and disappearing cursor
Replies: 8
Views: 178

Re: wxrichtextctrl and disappearing cursor

ONEEYEMAN wrote:Hi,
Also check if richtext sample works for you, i.e. the control can get focus and you can type in it after pressing the ALT+TAB.

Thank you.
The wxRichTextCtrl sample works perfectly, including ALT+TAB.
by refaelsh
Sat Feb 16, 2019 7:16 pm
Forum: C++ Development
Topic: wxrichtextctrl and disappearing cursor
Replies: 8
Views: 178

Re: wxrichtextctrl and disappearing cursor

1. I use version 3.1.2. 2. Windows 10. 3. I've build static libs using the default options (I've changed nothing). 4. wxRichTextCtrl. 5. Here is some code: view_model->tree.subscribe([=](std::shared_ptr<std::vector<std::shared_ptr<Line>>> t) { // Do stuff here that updates the wxDataViewListCtrl wit...
by refaelsh
Fri Feb 15, 2019 1:28 pm
Forum: C++ Development
Topic: wxrichtextctrl and disappearing cursor
Replies: 8
Views: 178

wxrichtextctrl and disappearing cursor

In my GUI I have a wxSplitterWindow. The wxSplitterWindow contains 2 wxPanels: one has wxDataViewListCtrl and the other has wxRichTextCtrl. I am programmatically updating the wxDataViewListCtrl with different data depending on some data base. I want the focus to be on the wxRichTextCtrl after every ...
by refaelsh
Thu Feb 07, 2019 7:27 pm
Forum: C++ Development
Topic: High DPI and version 3.1.2
Replies: 2
Views: 167

Re: High DPI and version 3.1.2

1) Using ClearType and HighDPI are two totally unrelated topics Understood. 2) wxFontInfo::AntiAliased() is currently not implemented on any platform and does nothing (as stated in its documentation) Understood. 3) You should mark your exe as "dpi aware", but not "per monitor dpi", as the latter is...
by refaelsh
Thu Feb 07, 2019 6:39 pm
Forum: C++ Development
Topic: High DPI and version 3.1.2
Replies: 2
Views: 167

High DPI and version 3.1.2

Hello. I want to use the `Consolas` font in my app, but in Clear Type. I tried doing it like this: const wxFont font(wxFontInfo(13).AntiAliased(false).FaceName("Consolas")); frame->m_richText->SetFont(font); But it came out all `smudged`, I don't really know how to describe it, so here is a picture:...
by refaelsh
Thu Feb 07, 2019 2:40 pm
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 454

Re: wxDataViewListCtrl and wxVariant

I don't have a working sample that uses a wxObject type (do you actually need this?). But here's one that uses void* as data, maybe this helps: #include <wx/wxprec.h> #include <wx/dataview.h> #include <wx/wx.h> class MyCustomRenderer : public wxDataViewCustomRenderer { public: MyCustomRenderer(cons...
by refaelsh
Thu Feb 07, 2019 9:07 am
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 454

Re: wxDataViewListCtrl and wxVariant

When does it crash? Directly at the start? I tested with this code and it worked fine: #include <wx/wxprec.h> #include <wx/dataview.h> #include <wx/wx.h> class MyCustomRenderer : public wxDataViewCustomRenderer { public: MyCustomRenderer(const wxString &varianttype = "string", wxDataViewCellMode mo...
by refaelsh
Thu Feb 07, 2019 8:30 am
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 454

Re: wxDataViewListCtrl and wxVariant

doublemax wrote:Set a breakpoint in MyCustomRenderer::SetValue(), single step through the code and see what happens.
I tried it, `value.IsNull()` is always true.
by refaelsh
Thu Feb 07, 2019 8:29 am
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 454

Re: wxDataViewListCtrl and wxVariant

Here is an mcve ( https://stackoverflow.com/help/mcve ): #include <wx/wxprec.h> #include <wx/dataview.h> #include "MyCustomRenderer.h" #include <wx/wx.h> class MyApp : public wxApp { public: virtual bool OnInit(); }; class MyFrame : public wxFrame { public: MyFrame(const wxString& title, const wxPoi...
by refaelsh
Thu Feb 07, 2019 8:22 am
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 454

Re: wxDataViewListCtrl and wxVariant

FWIW, the change was made here https://github.com/wxWidgets/wxWidgets/commit/615b49692c578db752a871244e836ea6607c4e54#diff-1219c3206e9311a24908e242eed7bcf2 I wonder if it makes an actual difference here, since wxDataViewCustomRenderer::GetDefaultType() still returns "string". I agree, it does seems...