Search found 306 matches

by Ronald
Thu Apr 07, 2022 9:29 am
Forum: Open Discussion
Topic: wxDataViewCtrl and wxDataViewModel coupling problem
Replies: 1
Views: 3773

wxDataViewCtrl and wxDataViewModel coupling problem

Now wxDataViewCtrl manages columns and wxDataViewModel manages rows.

In fact, data determines both columns and rows, and model knows data, so is it better for wxDataViewModel to manage both columns and rows.
by Ronald
Wed Apr 06, 2022 2:17 pm
Forum: C++ Development
Topic: Editable column with some cells uneditable in wxDataViewCtrl
Replies: 1
Views: 820

Editable column with some cells uneditable in wxDataViewCtrl

After add an editable column as below AppendTextColumn(wxT("Name"), 0, wxDATAVIEW_CELL_EDITABLE, wxCOL_WIDTH_DEFAULT); Some cells in the column are not editable, instead of ignore editing in wxDataViewModel::SetValue , anyway to prevent the text editor for uneditable cells? Tried to proces...
by Ronald
Tue Apr 05, 2022 5:02 pm
Forum: C++ Development
Topic: How to fit column width to content for wxDataViewCtrl?
Replies: 13
Views: 6850

Re: How to fit column width to content for wxDataViewCtrl?

ONEEYEMAN wrote: Tue Apr 05, 2022 4:38 pm Are you looking to make the control autosize after creation?
No, it is fine to be autosize when added.
My demand is meeted.
Better if it is consistent for different platforms.

Thanks all
by Ronald
Tue Apr 05, 2022 4:06 pm
Forum: C++ Development
Topic: How to fit column width to content for wxDataViewCtrl?
Replies: 13
Views: 6850

Re: How to fit column width to content for wxDataViewCtrl?

wxCOL_WIDTH_AUTOSIZE isn't used in the GTK version of the control. I guess the autosizing is a functionality of the underlying native control that is not exposed via the API. From the GTK source: void wxDataViewColumn::SetWidth( int width ) { // Notice that we don't have anything to do for wxCOL_WI...
by Ronald
Tue Apr 05, 2022 3:41 pm
Forum: C++ Development
Topic: How to fit column width to content for wxDataViewCtrl?
Replies: 13
Views: 6850

Re: How to fit column width to content for wxDataViewCtrl?

Do you have a screenshot? What is your GTK+ exact version? Quoting the source: // Notice that we don't have anything to do for wxCOL_WIDTH_DEFAULT and // wxCOL_WIDTH_AUTOSIZE as the native control tries to use the appropriate // width by default anyhow Are you using X11 or Wayland? Do you see the s...
by Ronald
Tue Apr 05, 2022 3:23 pm
Forum: C++ Development
Topic: How to fit column width to content for wxDataViewCtrl?
Replies: 13
Views: 6850

Re: How to fit column width to content for wxDataViewCtrl?

ONEEYEMAN wrote: Tue Apr 05, 2022 3:20 pm What platform?
GTK3
Linux
by Ronald
Tue Apr 05, 2022 1:28 pm
Forum: C++ Development
Topic: How to fit column width to content for wxDataViewCtrl?
Replies: 13
Views: 6850

Re: How to fit column width to content for wxDataViewCtrl?

PB wrote: Tue Apr 05, 2022 1:19 pm Calling

Code: Select all

wxDataViewColumn::SetWidth(wxCOL_WIDTH_AUTOSIZE)
for the given column did not work?
Just tested, it doesn't work.
by Ronald
Tue Apr 05, 2022 12:39 pm
Forum: C++ Development
Topic: How to fit column width to content for wxDataViewCtrl?
Replies: 13
Views: 6850

How to fit column width to content for wxDataViewCtrl?

Env wxWidgets: 3.1.6 or later Linux GTK3 3.24.33 X11 More Info After loading data to wxDataViewCtrl dynamically, how to fit column width to content for wxDataViewCtrl? i.e. When double clicking a seperator between two columns, the width of the column on the left side will fit to the content, how to...
by Ronald
Wed Oct 20, 2021 4:17 am
Forum: C++ Development
Topic: How to expand all root items in wxDataViewCtrl?
Replies: 11
Views: 5500

Re: How to expand all root items in wxDataViewCtrl?

Did you see the damage? I think wxDVTC supports it. If not - try wxDataViewTreeListCtrl. I've checked the doc, no functions for column manipulations, so I think it doesn't support multi columns. BTW, I could not post due to "The submitted form was invalid ..." yesterday, it occurs frequen...
by Ronald
Mon Oct 18, 2021 12:02 pm
Forum: C++ Development
Topic: How to make the last column of wxDataViewCtrl not to fill all the remaining spaces?
Replies: 2
Views: 2539

Re: How to make the last column of wxDataViewCtrl not to fill all the remaining spaces?

doublemax@work wrote: Mon Oct 18, 2021 11:49 am How about adding another, empty column? I can't think of any other way.
It's ok.

BTW, last column auto expanding is inspired by gtk3, I hope this solution for fixed width of the last column is by the design of gtk3, or else I think unctronollable width of a column is not a good desgin.
by Ronald
Mon Oct 18, 2021 11:09 am
Forum: C++ Development
Topic: How to make the last column of wxDataViewCtrl not to fill all the remaining spaces?
Replies: 2
Views: 2539

How to make the last column of wxDataViewCtrl not to fill all the remaining spaces?

OS: Windows
wx: 3.1.5

For the last column contains numbers for contents and right aligned,
if the width is too large, it doesn't look good.
by Ronald
Sun Oct 17, 2021 10:25 am
Forum: Open Discussion
Topic: Windows Forms VS. wxWidgets which one is better?
Replies: 5
Views: 12082

Re: Windows Forms VS. wxWidgets which one is better?

C# is much easier to learn and use. I think the difference is not that big. Except for the manual memory management and dealing with pointers in C++, they're pretty much the same. For grammar, no critical difference, but C# wins. For convenience of dependencies, C# wins C++ uses .h and .cpp, C# use...
by Ronald
Sun Oct 17, 2021 10:09 am
Forum: C++ Development
Topic: How to expand all root items in wxDataViewCtrl?
Replies: 11
Views: 5500

Re: How to expand all root items in wxDataViewCtrl?

ONEEYEMAN wrote: Sun Oct 17, 2021 1:39 am What is the reason you are NOT using wxDataViewTreeCtrl? Or even wxTreeCtrl?
Multi columns are need.
by Ronald
Sun Oct 17, 2021 2:38 am
Forum: Open Discussion
Topic: Windows Forms VS. wxWidgets which one is better?
Replies: 5
Views: 12082

Re: Windows Forms VS. wxWidgets which one is better?

dragonMan wrote: Sat Jun 19, 2021 4:43 pm 1. Which one is better for a real job?
It depends on which programming langugage you are going to use.
C# is more human friendly, relatively C++ is more machine friendly.
dragonMan wrote: Sat Jun 19, 2021 4:43 pm 2. Which one is easier to learn?
C# is much easier to learn and use.
by Ronald
Sat Oct 16, 2021 9:18 am
Forum: C++ Development
Topic: How to expand all root items in wxDataViewCtrl?
Replies: 11
Views: 5500

Re: How to expand all root items in wxDataViewCtrl?

You need to get the root item first. Which wxDataViewModel are you using? Or are you explicitly using wxDataViewTreeCtrl? model is derived from wxDataViewModel ctrl is derived from wxDataViewCtrl I hope an invalid wxDataViewItem is the final root, and in model it is, but for wxDataViewCtrl::Expand ...