What's the best way to implement such a layout

42 views
Skip to first unread message

Igor Korot

unread,
Sep 23, 2012, 12:31:23 AM9/23/12
to wx-u...@googlegroups.com
Hi, ALL,
I apologize for the attachment, but it's small and I think it's worth
1000 words.

What would be the best way to implement such a layout?
It is possible that the list will grow and there will be a possibility to
scrolling?
Is wxListView support this? Or it's a task for wxDataViewCtrl?

Thank you.
picture.png

John Roberts

unread,
Sep 23, 2012, 1:22:16 AM9/23/12
to wx-u...@googlegroups.com
I don't think wxListView will get the look you want and I don't know
about wxDataViewCtrl.

If you want it to look exactly as per attachment then a matrix of
textboxes in one of the gridsizers will work.

John

Igor Korot

unread,
Sep 23, 2012, 2:38:27 AM9/23/12
to wx-u...@googlegroups.com
John,
And if I need scrolling? Put the sizer on panel in a scrollview?

Thank you.

>
> John
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to wx-users+u...@googlegroups.com
> or visit http://groups.google.com/group/wx-users

Eran Ifrah

unread,
Sep 23, 2012, 2:40:47 AM9/23/12
to wx-u...@googlegroups.com
Go for wxDataViewCtrl (more specifically, wxDataViewListCtrl)

Using many text boxes will be slow eventually (depends on the number of controls you need to allocate)

--
Eran Ifrah
Author of codelite, a cross platform open source C/C++ IDE: http://www.codelite.org

Igor Korot

unread,
Sep 23, 2012, 3:22:37 AM9/23/12
to wx-u...@googlegroups.com
Eran,

On Sat, Sep 22, 2012 at 11:40 PM, Eran Ifrah <eran....@gmail.com> wrote:
> Go for wxDataViewCtrl (more specifically, wxDataViewListCtrl)
>
> Using many text boxes will be slow eventually (depends on the number of
> controls you need to allocate)

Is there a way to turn off line selection?
I ran the sample and when I clicked on the row it became selected.
What I need is when I click on the row it won't get selected, but the focus
will be given to the text control.

Or maybe that's how it will work?

Sorry don't have experience with this control...

Thank you.

Eran Ifrah

unread,
Sep 23, 2012, 3:31:19 AM9/23/12
to wx-u...@googlegroups.com
On Sun, Sep 23, 2012 at 10:22 AM, Igor Korot <ikor...@gmail.com> wrote:
Eran,

On Sat, Sep 22, 2012 at 11:40 PM, Eran Ifrah <eran....@gmail.com> wrote:
> Go for wxDataViewCtrl (more specifically, wxDataViewListCtrl)
>
> Using many text boxes will be slow eventually (depends on the number of
> controls you need to allocate)

Is there a way to turn off line selection?
I ran the sample and when I clicked on the row it became selected.
What I need is when I click on the row it won't get selected, but the focus
will be given to the text control.


You could try this:
Capture the EVT_DATAVIEW_SELECTION_CHANGED
and in the event handler call to:
wxDataViewListCtrl::EditItem( item , col )
I believe that this will set the focus to the proper cell (haven't tried that)

Marc DISPA

unread,
Sep 23, 2012, 5:48:38 AM9/23/12
to wx-u...@googlegroups.com, Igor Korot
Hi, Everybody !

I would rather use wxGrid. More flexible and fully customizable.

Gadget/Steve

unread,
Sep 23, 2012, 6:00:01 AM9/23/12
to wx-u...@googlegroups.com
If there are likely to be a lot of controls I would consider a list
control in virtual mode.

Gadget/Steve

John Roberts

unread,
Sep 23, 2012, 6:57:27 AM9/23/12
to wx-u...@googlegroups.com
It would be easier if we knew how many items you expect to have in your
layout.
If it contains a similar number as your attachment illustrates then the
textbox idea is sufficient and the visual look will match your attachment.
If you expect hundreds then you are almost obliged to use a list control
and for easy editing the wxGrid might be the go. Your desired
presentation will suffer though.
John

Igor Korot

unread,
Sep 24, 2012, 12:14:19 AM9/24/12
to wx-u...@googlegroups.com
Guys,
What I'm doing here is designing a wxWizard. One page will look like this:

It will contains 1 edit box per line. The number of lines will vary from 1 to 30
depending on the input from the previous wizard page.

Which mean that making text controls is probably not a good idea as
then the program
will suffer from the performance point of view.
The list control should be fine however I don't know if it supports
the edit controls
and not just static text.
wxGrid might be a good choice but by default in order to bring the
editor up in the cell
I need to click the cell twice.

So I guess the closest is wxDataViewListCtrl. But the problem is the selection.

John Roberts

unread,
Sep 24, 2012, 1:59:09 AM9/24/12
to wx-u...@googlegroups.com
On 23/09/2012, at 2:38 PM, Igor Korot wrote:

John,

On Sat, Sep 22, 2012 at 10:22 PM, John Roberts <jo...@iinet.net.au> wrote:
On 23/09/2012 12:31 PM, Igor Korot wrote:

Hi, ALL,
I apologize for the attachment, but it's small and I think it's worth
1000 words.

What would be the best way to implement such a layout?
It is possible that the list will grow and there will be a possibility to
scrolling?
Is wxListView support this? Or it's a task for wxDataViewCtrl?

Thank you.


I don't think wxListView will get the look you want and I don't know about
wxDataViewCtrl.

If you want it to look exactly as per attachment then a matrix of textboxes
in one of the gridsizers will work.

And if I need scrolling? Put the sizer on panel in a scrollview?

Thank you.

You could use what I know as a 'detailblock'. Keep the number of onscreen rows static and add a wxScrollbar or some up/down buttons. You will have to populate the text boxes in response to user scroll and, if using a scroll bar, set the scrollbar dimensions in response to changes in data rows count.

John

Julian Smart

unread,
Sep 24, 2012, 2:28:10 AM9/24/12
to wx-u...@googlegroups.com
I can't find your original screenshot but it might be worth considering
wxPropertyGrid also (an add on in 2.8, built-in on 2.9). It will display
an arbitrary number of rows but only one text control will be used for
editing.

Regards,

Julian

Eric Jensen

unread,
Sep 24, 2012, 3:32:25 AM9/24/12
to Igor Korot
Hello Igor,

Monday, September 24, 2012, 6:14:19 AM, you wrote:

IK> What I'm doing here is designing a wxWizard. One page will look like this:

IK> It will contains 1 edit box per line. The number of lines will vary from 1 to 30
IK> depending on the input from the previous wizard page.

For a maximum of 30 lines, i'd definitely use standard controls in a
wxFlexGridSizer.

Eric


Reply all
Reply to author
Forward
0 new messages