Search found 29 matches

by refaelsh
Sat Feb 16, 2019 7:16 pm
Forum: C++ Development
Topic: wxrichtextctrl and disappearing cursor
Replies: 8
Views: 847

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

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

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&quo...
by refaelsh
Thu Feb 07, 2019 6:39 pm
Forum: C++ Development
Topic: High DPI and version 3.1.2
Replies: 2
Views: 1018

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 ...
by refaelsh
Thu Feb 07, 2019 2:40 pm
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 2719

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

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", wxDataV...
by refaelsh
Thu Feb 07, 2019 8:30 am
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 2719

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

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& titl...
by refaelsh
Thu Feb 07, 2019 8:22 am
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 2719

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 ...
by refaelsh
Thu Feb 07, 2019 7:45 am
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 2719

Re: wxDataViewListCtrl and wxVariant

Based on the callstack, i would suspect an error in MyCustomRenderer. I guess it's called before the control is filled with data and your code doesn't handle the situation properly. But it's only a guess. I don't know why it happened after the switch to 3.1.2. Your answer got me thinking. Since I d...
by refaelsh
Wed Feb 06, 2019 8:37 pm
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 2719

Re: wxDataViewListCtrl and wxVariant

ONEEYEMAN wrote:Hi,
So this "Raw pointer to an instance of MyClass" is a good pointer and not NULL?

Thank you.
Correct.
by refaelsh
Wed Feb 06, 2019 8:05 pm
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 2719

Re: wxDataViewListCtrl and wxVariant

Hi, Where the data is coming from? External device? Internet? File? Its kinda hard to explain, but a good approximation would be "Internal" and/or "File". I execute some shell command and parse the output to get the data. Right after you populated the data, is it good? Yes, it d...
by refaelsh
Wed Feb 06, 2019 7:05 pm
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 2719

Re: wxDataViewListCtrl and wxVariant

ONEEYEMAN wrote:Hi,
Looking at the SO question: are you populating the data in a thread? Maybe its just a timing issue?

Thank you.
No, I am not populating it in a thread. I am populating it in the wxApp::OnInit method.
by refaelsh
Tue Feb 05, 2019 8:23 pm
Forum: C++ Development
Topic: wxDataViewListCtrl and wxVariant
Replies: 17
Views: 2719

wxDataViewListCtrl and wxVariant

I have a simple setup, a wxDataViewListCtrl, the first column uses wxDataViewCustomRenderer and the second column is just text. class MyCustomRenderer : public wxDataViewCustomRenderer I add a line to the wxDataViewListCtrl like this: wxVector<wxVariant> item; item.push_back(wxVariant(/*a raw pointe...